Item damage is an Integer

This commit is contained in:
jglrxavpok 2020-07-06 23:34:22 +02:00
parent 7bb8ff9773
commit 84b06307c4
2 changed files with 6 additions and 6 deletions

View File

@ -23,7 +23,7 @@ public class ItemStack implements DataContainer {
private short materialId;
private byte amount;
private short damage;
private int damage;
private ColoredText displayName;
private boolean unbreakable;
@ -47,7 +47,7 @@ public class ItemStack implements DataContainer {
this.stackingRule = defaultStackingRule;
}
public ItemStack(short materialId, byte amount, short damage) {
public ItemStack(short materialId, byte amount, int damage) {
this.materialId = materialId;
this.amount = amount;
this.damage = damage;
@ -126,7 +126,7 @@ public class ItemStack implements DataContainer {
}
}
public short getDamage() {
public int getDamage() {
return damage;
}
@ -154,7 +154,7 @@ public class ItemStack implements DataContainer {
this.amount = amount;
}
public void setDamage(short damage) {
public void setDamage(int damage) {
this.damage = damage;
}

View File

@ -152,7 +152,7 @@ public class Utils {
NBT itemNBT = reader.readTag();
if(itemNBT instanceof NBTCompound) { // can also be a TAG_End if no data
NBTCompound nbt = (NBTCompound) itemNBT;
if(nbt.containsKey("Damage")) item.setDamage(nbt.getShort("Damage"));
if(nbt.containsKey("Damage")) item.setDamage(nbt.getInt("Damage"));
if(nbt.containsKey("Unbreakable")) item.setUnbreakable(nbt.getInt("Unbreakable") == 1);
if(nbt.containsKey("HideFlags")) item.setHideFlag(nbt.getInt("HideFlags"));
if(nbt.containsKey("Potion")) item.addPotionType(Registries.getPotionType(nbt.getString("Potion")));
@ -280,7 +280,7 @@ public class Utils {
// Start damage
{
itemNBT.setShort("Damage", itemStack.getDamage());
itemNBT.setInt("Damage", itemStack.getDamage());
}
// End damage