mirror of
https://github.com/GeyserMC/Geyser.git
synced 2025-01-10 03:52:30 +01:00
Add model check to custom item comparator
This commit is contained in:
parent
0346a80e4b
commit
c38bf26298
1 changed files with 4 additions and 1 deletions
|
@ -718,6 +718,9 @@ public class ItemRegistryPopulator {
|
||||||
*
|
*
|
||||||
* <p>First by checking if they both have a similar range dispatch predicate, the one with the highest threshold going first,
|
* <p>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.</p>
|
* and then by the amount of predicates, from most to least.</p>
|
||||||
|
*
|
||||||
|
* <p>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.</p>
|
||||||
*/
|
*/
|
||||||
private static class CustomItemDefinitionComparator implements Comparator<Pair<CustomItemDefinition, ItemDefinition>> {
|
private static class CustomItemDefinitionComparator implements Comparator<Pair<CustomItemDefinition, ItemDefinition>> {
|
||||||
|
|
||||||
|
@ -725,7 +728,7 @@ public class ItemRegistryPopulator {
|
||||||
public int compare(Pair<CustomItemDefinition, ItemDefinition> firstPair, Pair<CustomItemDefinition, ItemDefinition> secondPair) {
|
public int compare(Pair<CustomItemDefinition, ItemDefinition> firstPair, Pair<CustomItemDefinition, ItemDefinition> secondPair) {
|
||||||
CustomItemDefinition first = firstPair.first();
|
CustomItemDefinition first = firstPair.first();
|
||||||
CustomItemDefinition second = secondPair.first();
|
CustomItemDefinition second = secondPair.first();
|
||||||
if (first.equals(second)) {
|
if (first.equals(second) || !first.model().equals(second.model())) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
for (CustomItemPredicate predicate : first.predicates()) {
|
for (CustomItemPredicate predicate : first.predicates()) {
|
||||||
|
|
Loading…
Reference in a new issue