Reduce calls to heavy nbt comparsion
Spigot patch: 0157-Use-FastMatches-for-ItemStack-Dirty-Check.patch
This commit is contained in:
@ -148,3 +148,16 @@
|
||||
this.stackTagCompound = p_77982_1_;
|
||||
}
|
||||
|
||||
@@ -768,4 +832,12 @@
|
||||
|
||||
return ichatcomponent;
|
||||
}
|
||||
+
|
||||
+ // Spigot start
|
||||
+ public static boolean fastMatches(ItemStack is1, ItemStack is2) {
|
||||
+ if (is1 == null && is2 == null) return true;
|
||||
+ if (is1 != null && is2 != null) return is1.stackSize == is1.stackSize && is1.field_151002_e == is2.field_151002_e && is1.itemDamage == is2.itemDamage;
|
||||
+ return false;
|
||||
+ }
|
||||
+ // Spigot end
|
||||
}
|
||||
|
Reference in New Issue
Block a user