Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-25 15:50:10 +01:00
Don't cache Item
Dieser Commit ist enthalten in:
Ursprung
c7c5c79365
Commit
d76e70b1f7
@ -35,7 +35,7 @@ public class HandItemCache extends BukkitRunnable {
|
||||
}
|
||||
|
||||
public static Item convert(ItemStack itemInHand) {
|
||||
if (itemInHand == null) return Item.EMPTY;
|
||||
if (itemInHand == null) new Item((short) 0, (byte) 0, (short) 0, null);
|
||||
return new Item((short) itemInHand.getTypeId(), (byte) itemInHand.getAmount(), itemInHand.getDurability(), null);
|
||||
}
|
||||
}
|
||||
|
@ -11,7 +11,6 @@ import lombok.*;
|
||||
@ToString
|
||||
@EqualsAndHashCode
|
||||
public class Item {
|
||||
public static final Item EMPTY = new Item((short) 0, (byte) 0, (short) 0, null);
|
||||
@SerializedName(value = "identifier", alternate = "id")
|
||||
private int identifier;
|
||||
private byte amount;
|
||||
|
@ -51,7 +51,7 @@ public class HandItemCache implements Runnable {
|
||||
}
|
||||
|
||||
public static Item convert(ItemStack itemInHand) {
|
||||
if (itemInHand == null) return Item.EMPTY;
|
||||
if (itemInHand == null) return new Item((short) 0, (byte) 0, (short) 0, null);
|
||||
if (GET_DAMAGE == null) {
|
||||
try {
|
||||
GET_DAMAGE = itemInHand.getClass().getDeclaredField("field_77991_e");
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren