From c38bf262985095509e71ac9330bcc82d3d119373 Mon Sep 17 00:00:00 2001 From: Eclipse Date: Fri, 6 Dec 2024 11:09:33 +0000 Subject: [PATCH] Add model check to custom item comparator --- .../geyser/registry/populator/ItemRegistryPopulator.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/geysermc/geyser/registry/populator/ItemRegistryPopulator.java b/core/src/main/java/org/geysermc/geyser/registry/populator/ItemRegistryPopulator.java index 6d04cb1b0..c3609cf59 100644 --- a/core/src/main/java/org/geysermc/geyser/registry/populator/ItemRegistryPopulator.java +++ b/core/src/main/java/org/geysermc/geyser/registry/populator/ItemRegistryPopulator.java @@ -718,6 +718,9 @@ public class ItemRegistryPopulator { * *

First by checking if they both have a similar range dispatch predicate, the one with the highest threshold going first, * and then by the amount of predicates, from most to least.

+ * + *

This comparator regards 2 custom item definitions as the same if their model differs, since it is only checking for predicates, and those + * don't matter if their models are different.

*/ private static class CustomItemDefinitionComparator implements Comparator> { @@ -725,7 +728,7 @@ public class ItemRegistryPopulator { public int compare(Pair firstPair, Pair secondPair) { CustomItemDefinition first = firstPair.first(); CustomItemDefinition second = secondPair.first(); - if (first.equals(second)) { + if (first.equals(second) || !first.model().equals(second.model())) { return 0; } for (CustomItemPredicate predicate : first.predicates()) {