1
0
forked from xjboss/KCauldronX

Reduce calls to heavy nbt comparsion

Spigot patch: 0157-Use-FastMatches-for-ItemStack-Dirty-Check.patch
This commit is contained in:
Prototik
2015-05-14 22:21:55 +07:00
parent e6ac67c28c
commit f3a73d8d68
3 changed files with 47 additions and 6 deletions

View File

@ -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
}