|
72 | 72 | }
|
73 | 73 | }
|
74 | 74 | }
|
| 75 | +@@ -243,7 +_,7 @@ |
| 76 | + private void synchronizeSlotToRemote(int slotIndex, ItemStack stack, Supplier<ItemStack> supplier) { |
| 77 | + if (!this.suppressRemoteUpdates) { |
| 78 | + ItemStack itemStack = this.remoteSlots.get(slotIndex); |
| 79 | +- if (!ItemStack.matches(itemStack, stack)) { |
| 80 | ++ if (!this.matchesRemote(itemStack, stack)) { // Paper - add flag to simplify remote matching logic |
| 81 | + ItemStack itemStack1 = supplier.get(); |
| 82 | + this.remoteSlots.set(slotIndex, itemStack1); |
| 83 | + if (this.synchronizer != null) { |
| 84 | +@@ -267,7 +_,7 @@ |
| 85 | + |
| 86 | + private void synchronizeCarriedToRemote() { |
| 87 | + if (!this.suppressRemoteUpdates) { |
| 88 | +- if (!ItemStack.matches(this.getCarried(), this.remoteCarried)) { |
| 89 | ++ if (!this.matchesRemote(this.getCarried(), this.remoteCarried)) { // Paper - add flag to simplify remote matching logic |
| 90 | + this.remoteCarried = this.getCarried().copy(); |
| 91 | + if (this.synchronizer != null) { |
| 92 | + this.synchronizer.sendCarriedChange(this, this.remoteCarried); |
| 93 | +@@ -276,6 +_,16 @@ |
| 94 | + } |
| 95 | + } |
| 96 | + |
| 97 | ++ // Paper start - add flag to simplify remote matching logic |
| 98 | ++ private boolean matchesRemote(final ItemStack stack, final ItemStack other) { |
| 99 | ++ if (this.synchronizer != null && this.synchronizer.player() != null && this.synchronizer.player().getBukkitEntity().simplifyContainerDesyncCheck()) { |
| 100 | ++ // Only check the item type and count |
| 101 | ++ return stack == other || (stack.getCount() == other.getCount() && ItemStack.isSameItem(stack, other)); |
| 102 | ++ } |
| 103 | ++ return ItemStack.matches(stack, other); |
| 104 | ++ } |
| 105 | ++ // Paper end - add flag to simplify remote matching logic |
| 106 | ++ |
| 107 | + public void setRemoteSlot(int slot, ItemStack stack) { |
| 108 | + this.remoteSlots.set(slot, stack.copy()); |
| 109 | + } |
75 | 110 | @@ -343,6 +_,7 @@
|
76 | 111 | this.resetQuickCraft();
|
77 | 112 | }
|
|
0 commit comments