diff options
-rw-r--r-- | Essentials/src/com/earth2me/essentials/User.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index d7e3686ea..ca586dc4f 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -708,13 +708,15 @@ public class User extends PlayerExtension implements Comparable<User> } @SuppressWarnings("unchecked") - public void setUnlimited(ItemStack stack, boolean b) { + public void setUnlimited(ItemStack stack, boolean state) { List<Integer> items = new ArrayList<Integer>(); if (data.containsKey("unlimited")) { items = (List<Integer>)data.get("unlimited"); } - items.remove(stack.getTypeId()); - if (b) { + if (items.contains(stack.getTypeId())) { + items.remove(Integer.valueOf(stack.getTypeId())); + } + if (state) { items.add(stack.getTypeId()); } data.put("unlimited", items); |