Generic cleanup of warnings, whitespace and style.

This commit is contained in:
Erik Broes
2011-12-25 16:02:30 +01:00
parent d9c22be882
commit dce83b6ce4
257 changed files with 1408 additions and 1152 deletions

View File

@@ -349,16 +349,16 @@ public class ItemStack implements ConfigurationSerializable {
}
public static ItemStack deserialize(Map<String, Object> args) {
Material type = Material.getMaterial((String)args.get("type"));
Material type = Material.getMaterial((String) args.get("type"));
short damage = 0;
int amount = 1;
if (args.containsKey("damage")) {
damage = (Short)args.get("damage");
damage = (Short) args.get("damage");
}
if (args.containsKey("amount")) {
amount = (Integer)args.get("amount");
amount = (Integer) args.get("amount");
}
ItemStack result = new ItemStack(type, amount, damage);
@@ -367,13 +367,14 @@ public class ItemStack implements ConfigurationSerializable {
Object raw = args.get("enchantments");
if (raw instanceof Map) {
Map<Object, Object> map = (Map<Object, Object>)raw;
@SuppressWarnings("unchecked")
Map<Object, Object> map = (Map<Object, Object>) raw;
for (Map.Entry<Object, Object> entry : map.entrySet()) {
Enchantment enchantment = Enchantment.getByName(entry.getKey().toString());
if ((enchantment != null) && (entry.getValue() instanceof Integer)) {
result.addEnchantment(enchantment, (Integer)entry.getValue());
result.addEnchantment(enchantment, (Integer) entry.getValue());
}
}
}