GeyserItemStack: Remove item from equalsAndHashCode

This commit is contained in:
Camotoy 2023-04-26 19:02:49 -04:00
parent 545087fba4
commit 58b593ef99

View file

@ -28,6 +28,7 @@ package org.geysermc.geyser.inventory;
import com.github.steveice10.mc.protocol.data.game.entity.metadata.ItemStack;
import com.github.steveice10.opennbt.tag.builtin.CompoundTag;
import lombok.AccessLevel;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import org.cloudburstmc.protocol.bedrock.data.inventory.ItemData;
import lombok.Data;
@ -48,6 +49,10 @@ public class GeyserItemStack {
private CompoundTag nbt;
private int netId;
@Getter(AccessLevel.NONE)
@EqualsAndHashCode.Exclude
private Item item;
private GeyserItemStack(int javaId, int amount, CompoundTag nbt) {
this(javaId, amount, nbt, 1);
}
@ -109,9 +114,6 @@ public class GeyserItemStack {
return session.getItemMappings().getMapping(this.javaId);
}
@Getter(AccessLevel.NONE)
private Item item; //TODO
public Item asItem() {
if (item == null) {
return (item = Registries.JAVA_ITEMS.get().get(javaId));