mirror of
https://github.com/PaperMC/Paper.git
synced 2025-05-19 05:30:23 -07:00
Co-authored-by: Bjarne Koll <git@lynxplay.dev> Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com> Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com> Co-authored-by: MiniDigger | Martin <admin@minidigger.dev> Co-authored-by: Nassim Jahnke <nassim@njahnke.dev> Co-authored-by: Noah van der Aa <ndvdaa@gmail.com> Co-authored-by: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> Co-authored-by: Shane Freeder <theboyetronic@gmail.com> Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com> Co-authored-by: Tamion <70228790+notTamion@users.noreply.github.com> Co-authored-by: Warrior <50800980+Warriorrrr@users.noreply.github.com>
34 lines
1.7 KiB
Diff
34 lines
1.7 KiB
Diff
--- a/net/minecraft/network/HashedStack.java
|
|
+++ b/net/minecraft/network/HashedStack.java
|
|
@@ -17,7 +_,7 @@
|
|
}
|
|
|
|
@Override
|
|
- public boolean matches(ItemStack stack, HashedPatchMap.HashGenerator hashGenerator) {
|
|
+ public boolean matches(ItemStack stack, HashedPatchMap.HashGenerator hashGenerator, final boolean simplifyMatching) { // Paper - add flag to simplify remote matching logic
|
|
return stack.isEmpty();
|
|
}
|
|
};
|
|
@@ -27,7 +_,7 @@
|
|
hashedStack -> hashedStack instanceof HashedStack.ActualItem actualItem ? Optional.of(actualItem) : Optional.empty()
|
|
);
|
|
|
|
- boolean matches(ItemStack stack, HashedPatchMap.HashGenerator hashGenerator);
|
|
+ boolean matches(ItemStack stack, HashedPatchMap.HashGenerator hashGenerator, final boolean simplifyMatching); // Paper - add flag to simplify remote matching logic
|
|
|
|
static HashedStack create(ItemStack stack, HashedPatchMap.HashGenerator hashGenerator) {
|
|
return (HashedStack)(stack.isEmpty()
|
|
@@ -47,10 +_,10 @@
|
|
);
|
|
|
|
@Override
|
|
- public boolean matches(ItemStack stack, HashedPatchMap.HashGenerator hashGenerator) {
|
|
+ public boolean matches(ItemStack stack, HashedPatchMap.HashGenerator hashGenerator, final boolean simplifyMatching) { // Paper - add flag to simplify remote matching logic
|
|
return this.count == stack.getCount()
|
|
&& this.item.equals(stack.getItemHolder())
|
|
- && this.components.matches(stack.getComponentsPatch(), hashGenerator);
|
|
+ && (simplifyMatching || this.components.matches(stack.getComponentsPatch(), hashGenerator)); // Paper - add flag to simplify remote matching logic
|
|
}
|
|
}
|
|
}
|