Generic cleanup of warnings, whitespace and style.
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user