Remove simplify remote item matching stuff for now

Twas broken for some time and I haven't had time to address it, this may be revisited later in a different way
This commit is contained in:
Nassim Jahnke
2025-05-09 14:47:24 +02:00
parent d2ad2e668d
commit 358e72ec0d
7 changed files with 8 additions and 90 deletions

View File

@@ -1,15 +1,9 @@
--- a/net/minecraft/world/inventory/ContainerSynchronizer.java
+++ b/net/minecraft/world/inventory/ContainerSynchronizer.java
@@ -13,4 +_,12 @@
@@ -13,4 +_,6 @@
void sendDataChange(AbstractContainerMenu container, int id, int value);
RemoteSlot createSlot();
+
+ default void sendOffHandSlotChange() {} // Paper - Sync offhand slot in menus
+
+ // Paper start - add flag to simplify remote matching logic
+ default net.minecraft.server.level.@org.jspecify.annotations.Nullable ServerPlayer player() {
+ return null;
+ }
+ // Paper end - add flag to simplify remote matching logic
}

View File

@@ -1,27 +0,0 @@
--- a/net/minecraft/world/inventory/RemoteSlot.java
+++ b/net/minecraft/world/inventory/RemoteSlot.java
@@ -29,12 +_,14 @@
public static class Synchronized implements RemoteSlot {
private final HashedPatchMap.HashGenerator hasher;
+ private final boolean simplifyMatching; // Paper - add flag to simplify remote matching logic
@Nullable
private ItemStack remoteStack = null;
@Nullable
private HashedStack remoteHash = null;
- public Synchronized(HashedPatchMap.HashGenerator hasher) {
+ public Synchronized(HashedPatchMap.HashGenerator hasher, final boolean simplifyMatching) { // Paper - add flag to simplify remote matching logic
+ this.simplifyMatching = simplifyMatching; // Paper - add flag to simplify remote matching logic
this.hasher = hasher;
}
@@ -54,7 +_,7 @@
public boolean matches(ItemStack stack) {
if (this.remoteStack != null) {
return ItemStack.matches(this.remoteStack, stack);
- } else if (this.remoteHash != null && this.remoteHash.matches(stack, this.hasher)) {
+ } else if (this.remoteHash != null && this.remoteHash.matches(stack, this.hasher, this.simplifyMatching)) { // Paper - add flag to simplify remote matching logic
this.remoteStack = stack.copy();
return true;
} else {