mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-08 09:17:36 +01:00
Fixed casting in ItemStack.deserialize.
By: starrynte <starrynte@gmail.com>
This commit is contained in:
parent
e423860f9f
commit
1749f26e03
@ -356,18 +356,18 @@ public class ItemStack implements ConfigurationSerializable {
|
||||
|
||||
public static ItemStack deserialize(Map<String, Object> args) {
|
||||
Material type = Material.getMaterial((String) args.get("type"));
|
||||
int damage = 0;
|
||||
short damage = 0;
|
||||
int amount = 1;
|
||||
|
||||
if (args.containsKey("damage")) {
|
||||
damage = (Integer) args.get("damage");
|
||||
damage = (Short) args.get("damage");
|
||||
}
|
||||
|
||||
if (args.containsKey("amount")) {
|
||||
amount = (Integer) args.get("amount");
|
||||
}
|
||||
|
||||
ItemStack result = new ItemStack(type, amount, (short) damage);
|
||||
ItemStack result = new ItemStack(type, amount, damage);
|
||||
|
||||
if (args.containsKey("enchantments")) {
|
||||
Object raw = args.get("enchantments");
|
||||
|
Loading…
Reference in New Issue
Block a user