Replace 0 count in item hovers

This commit is contained in:
Nassim Jahnke committed 2026-03-25 16:21:55 +01:00
1 parent fd13912295
commit 0519184da2
2 files changed
+5 -5

No files matched your search

@@ -47,7 +47,7 @@ public final class EntityDataTypes26_1 extends AbstractEntityDataTypes {
public final EntityDataType optionalBlockStateType = add(15, Types.VAR_INT);
public final EntityDataType particleType;
public final EntityDataType particlesType;
public final EntityDataType villagerDatatType = add(18, Types.VILLAGER_DATA);
public final EntityDataType villagerDataType = add(18, Types.VILLAGER_DATA);
public final EntityDataType optionalVarIntType = add(19, Types.OPTIONAL_VAR_INT);
public final EntityDataType poseType = add(20, Types.VAR_INT);
public final EntityDataType catVariantType = add(21, Types.VAR_INT);
@@ -32,10 +32,10 @@ public final class ComponentRewriter26_1 extends NBTComponentRewriter<Clientboun
@Override
protected void handleShowItem(final UserConnection connection, final CompoundTag itemTag, final CompoundTag componentsTag) {
super.handleShowItem(connection, itemTag, componentsTag);
if (componentsTag == null) {
return;
}
// Remove or update data from componentsTag
final int count = itemTag.getInt("count");
if (count == 0) {
itemTag.putInt("count", 1);
}
}
}