mirror of
https://github.com/Minestom/Minestom.git
synced 2025-03-02 11:21:15 +01:00
Item damage is an Integer
This commit is contained in:
parent
7bb8ff9773
commit
84b06307c4
@ -23,7 +23,7 @@ public class ItemStack implements DataContainer {
|
|||||||
private short materialId;
|
private short materialId;
|
||||||
|
|
||||||
private byte amount;
|
private byte amount;
|
||||||
private short damage;
|
private int damage;
|
||||||
|
|
||||||
private ColoredText displayName;
|
private ColoredText displayName;
|
||||||
private boolean unbreakable;
|
private boolean unbreakable;
|
||||||
@ -47,7 +47,7 @@ public class ItemStack implements DataContainer {
|
|||||||
this.stackingRule = defaultStackingRule;
|
this.stackingRule = defaultStackingRule;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack(short materialId, byte amount, short damage) {
|
public ItemStack(short materialId, byte amount, int damage) {
|
||||||
this.materialId = materialId;
|
this.materialId = materialId;
|
||||||
this.amount = amount;
|
this.amount = amount;
|
||||||
this.damage = damage;
|
this.damage = damage;
|
||||||
@ -126,7 +126,7 @@ public class ItemStack implements DataContainer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public short getDamage() {
|
public int getDamage() {
|
||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -154,7 +154,7 @@ public class ItemStack implements DataContainer {
|
|||||||
this.amount = amount;
|
this.amount = amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDamage(short damage) {
|
public void setDamage(int damage) {
|
||||||
this.damage = damage;
|
this.damage = damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -152,7 +152,7 @@ public class Utils {
|
|||||||
NBT itemNBT = reader.readTag();
|
NBT itemNBT = reader.readTag();
|
||||||
if(itemNBT instanceof NBTCompound) { // can also be a TAG_End if no data
|
if(itemNBT instanceof NBTCompound) { // can also be a TAG_End if no data
|
||||||
NBTCompound nbt = (NBTCompound) itemNBT;
|
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("Unbreakable")) item.setUnbreakable(nbt.getInt("Unbreakable") == 1);
|
||||||
if(nbt.containsKey("HideFlags")) item.setHideFlag(nbt.getInt("HideFlags"));
|
if(nbt.containsKey("HideFlags")) item.setHideFlag(nbt.getInt("HideFlags"));
|
||||||
if(nbt.containsKey("Potion")) item.addPotionType(Registries.getPotionType(nbt.getString("Potion")));
|
if(nbt.containsKey("Potion")) item.addPotionType(Registries.getPotionType(nbt.getString("Potion")));
|
||||||
@ -280,7 +280,7 @@ public class Utils {
|
|||||||
|
|
||||||
// Start damage
|
// Start damage
|
||||||
{
|
{
|
||||||
itemNBT.setShort("Damage", itemStack.getDamage());
|
itemNBT.setInt("Damage", itemStack.getDamage());
|
||||||
}
|
}
|
||||||
// End damage
|
// End damage
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user