summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsnowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb>2011-04-04 17:58:02 +0000
committersnowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb>2011-04-04 17:58:02 +0000
commit72ea0a12209b3d16dd9373d8164e770dd4a3ecb5 (patch)
treeeb4361bcdb2a37c3fd63f16c4616293f1084be6c
parentb19fa531cf4d88cd8a983df90d3d3380942e95f2 (diff)
downloadEssentials-72ea0a12209b3d16dd9373d8164e770dd4a3ecb5.tar
Essentials-72ea0a12209b3d16dd9373d8164e770dd4a3ecb5.tar.gz
Essentials-72ea0a12209b3d16dd9373d8164e770dd4a3ecb5.tar.lz
Essentials-72ea0a12209b3d16dd9373d8164e770dd4a3ecb5.tar.xz
Essentials-72ea0a12209b3d16dd9373d8164e770dd4a3ecb5.zip
[trunk] Unlimited: Fix for list
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1125 e251c2fe-e539-e718-e476-b85c1f46cddb
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandunlimited.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandunlimited.java b/Essentials/src/com/earth2me/essentials/commands/Commandunlimited.java
index 8026b9d60..1441590c9 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandunlimited.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandunlimited.java
@@ -4,6 +4,7 @@ import com.earth2me.essentials.Essentials;
import com.earth2me.essentials.InventoryWorkaround;
import com.earth2me.essentials.ItemDb;
import com.earth2me.essentials.User;
+import java.util.List;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.Server;
@@ -36,11 +37,15 @@ public class Commandunlimited extends EssentialsCommand
StringBuilder sb = new StringBuilder();
sb.append("Unlimited items: ");
boolean first = true;
- for (Integer integer : target.getUnlimited()) {
+ List<Integer> items = target.getUnlimited();
+ if (items.isEmpty()) {
+ sb.append("none");
+ }
+ for (Integer integer : items) {
if (!first) {
sb.append(", ");
- first = false;
}
+ first = false;
String matname = Material.getMaterial(integer).toString().toLowerCase().replace("_", "");
sb.append(matname);
}