diff --git a/Essentials/src/com/earth2me/essentials/UserData.java b/Essentials/src/com/earth2me/essentials/UserData.java index e540bd998..ea3201f28 100644 --- a/Essentials/src/com/earth2me/essentials/UserData.java +++ b/Essentials/src/com/earth2me/essentials/UserData.java @@ -94,8 +94,9 @@ public abstract class UserData extends PlayerExtension implements IConf private Map _getHomes() { - if (config.isConfigurationSection("homes")) { - return config.getConfigurationSection("homes").getValues(false); + if (config.isConfigurationSection("homes")) + { + return config.getConfigurationSection("homes").getValues(false); } return new HashMap(); } @@ -228,22 +229,15 @@ public abstract class UserData extends PlayerExtension implements IConf config.setProperty("unlimited", unlimited); config.save(); } - private Map powertools; + private Map powertools; - @SuppressWarnings("unchecked") - private Map _getPowertools() + private Map _getPowertools() { - Object o = config.getProperty("powertools"); - - if (o instanceof Map) + if (config.isConfigurationSection("powertools")) { - return (Map)o; + return config.getConfigurationSection("powertools").getValues(false); } - else - { - return new HashMap(); - } - + return new HashMap(); } public void clearAllPowertools() @@ -255,23 +249,23 @@ public abstract class UserData extends PlayerExtension implements IConf public List getPowertool(ItemStack stack) { - return (List)powertools.get(stack.getTypeId()); + return (List)powertools.get("" + stack.getTypeId()); } - + public List getPowertool(int id) { - return (List)powertools.get(id); + return (List)powertools.get("" + id); } public void setPowertool(ItemStack stack, List commandList) { if (commandList == null || commandList.isEmpty()) { - powertools.remove(stack.getTypeId()); + powertools.remove("" + stack.getTypeId()); } else { - powertools.put(stack.getTypeId(), commandList); + powertools.put("" + stack.getTypeId(), commandList); } config.setProperty("powertools", powertools); config.save(); @@ -732,7 +726,6 @@ public abstract class UserData extends PlayerExtension implements IConf return ret; } private boolean newplayer; - private String geolocation; private String _getGeoLocation()