Fix pocket computers swinging when rebooted

With the 1.21.1 update, computers IDs are stored in a NonNegativeId, so
we can't compare with reference equality.

There's an ErrorProne check for this, I wonder if we should enable it
again, or at least roll our own which is a little more permissive.
This commit is contained in:
Jonathan Coates committed 2026-11-20 12:27:12 +00:00
1 parent 2079db1c24
commit d81f7c8ce2
1 file changed
+1 -1
@@ -177,7 +177,7 @@ public class PocketComputerItem extends Item {
return slotChanged
|| oldStack.getItem() != newStack.getItem()
|| oldStack.getCount() != newStack.getCount()
|| oldStack.get(ModRegistry.DataComponents.COMPUTER_ID.get()) != newStack.get(ModRegistry.DataComponents.COMPUTER_ID.get());
|| !Objects.equals(oldStack.get(ModRegistry.DataComponents.COMPUTER_ID.get()), newStack.get(ModRegistry.DataComponents.COMPUTER_ID.get()));
}
@FabricOverride