Fixed bug where short messages aren't sent

This commit is contained in:
alisolarflare 2016-11-21 21:12:58 -05:00
parent 1adc2f1b4c
commit e5bb0e43dd
2 changed files with 133 additions and 142 deletions

View file

@ -98,6 +98,10 @@ public class DebugPotato {
int currentLineLength = 0;
int wordlength;
int maxLineLength = 40;
if (message.length() <= maxLineLength){
newMessage.add(message);
return newMessage;
}
for (String word : splitString) {
wordlength = word.length();
if (currentLineLength == 0 || (currentLineLength + wordlength) < maxLineLength) {
@ -114,7 +118,7 @@ public class DebugPotato {
public ItemStack toItemStack() {
ItemStack potato = new ItemStack(Material.BAKED_POTATO);
ItemMeta meta = potato.getItemMeta();
meta.setDisplayName(this.getType() == null ? "Spicy Debug Potato" : this.getType());
meta.setDisplayName(this.getType() == null ? "Null Flavoured Debug Potato" : this.getType());
if (this.getMessage() == null){
List<String> message = new ArrayList<String>();
message.add("nullMessage");

View file

@ -1,13 +0,0 @@
package buttondevteam.lib;
import org.bukkit.entity.Player;
/**@deprecated
* Fully Replaced by DebugPotato Class - Construct a DebugPotato*/
public class DebugPotatoAPI {
/**@deprecated Replaced by DebugPotato.send*/
public static void SendDebugPotato(DebugPotato dp, Player player) {
player.getInventory().addItem(dp.toItemStack());
return;
}
}