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 } @SuppressWarnings("unchecked") - public void setUnlimited(ItemStack stack, boolean b) { + public void setUnlimited(ItemStack stack, boolean state) { List items = new ArrayList(); if (data.containsKey("unlimited")) { items = (List)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);