[trunk] Unlimited: Fix for list

git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1125 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
snowleo 2011-04-04 17:58:02 +00:00
parent b19fa531cf
commit 72ea0a1220

View File

@ -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);
}