mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2026-11-24 08:07:15 +00:00
Don't swing pocket computers on changes
See #2528. We still swing on open/close, but reboots and equips/unequips don't cause a swing.
This commit is contained in:
1 file changed
+15
+15
@@ -4,6 +4,7 @@
|
||||
|
||||
package dan200.computercraft.shared.pocket.items;
|
||||
|
||||
import dan200.computercraft.annotations.FabricOverride;
|
||||
import dan200.computercraft.annotations.ForgeOverride;
|
||||
import dan200.computercraft.api.ComputerCraftAPI;
|
||||
import dan200.computercraft.api.pocket.IPocketUpgrade;
|
||||
@@ -229,6 +230,20 @@ public class PocketComputerItem extends Item implements IComputerItem, IColoured
|
||||
return ComputerCraftAPI.MOD_ID;
|
||||
}
|
||||
|
||||
@ForgeOverride
|
||||
public boolean shouldCauseReequipAnimation(ItemStack oldStack, ItemStack newStack, boolean slotChanged) {
|
||||
return slotChanged
|
||||
|| oldStack.getItem() != newStack.getItem()
|
||||
|| oldStack.getCount() != newStack.getCount()
|
||||
|| getComputerID(oldStack) != getComputerID(newStack);
|
||||
|
||||
}
|
||||
|
||||
@FabricOverride
|
||||
public boolean allowNbtUpdateAnimation(Player player, InteractionHand hand, ItemStack oldStack, ItemStack newStack) {
|
||||
return shouldCauseReequipAnimation(oldStack, newStack, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get (or create) the pocket brain and turn it on, ready for the player to interact with.
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user