9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2025-12-19 15:09:15 +00:00

修复改包报错

This commit is contained in:
XiaoMoMi
2025-06-13 04:02:25 +08:00
parent fed23ef214
commit a41a38236b
2 changed files with 2 additions and 2 deletions

View File

@@ -64,7 +64,7 @@ public class LegacyNetworkItemHandler implements NetworkItemHandler<ItemStack> {
return new OtherItem(wrapped, false).process(); return new OtherItem(wrapped, false).process();
} else { } else {
BukkitCustomItem customItem = (BukkitCustomItem) optionalCustomItem.get(); BukkitCustomItem customItem = (BukkitCustomItem) optionalCustomItem.get();
boolean hasDifferentMaterial = FastNMS.INSTANCE.method$ItemStack$getItem(wrapped.getItem()) != customItem.clientItem(); boolean hasDifferentMaterial = FastNMS.INSTANCE.method$ItemStack$getItem(wrapped.getLiteralObject()) != customItem.clientItem();
if (hasDifferentMaterial) { if (hasDifferentMaterial) {
wrapped = wrapped.unsafeTransmuteCopy(customItem.clientItem(), wrapped.count()); wrapped = wrapped.unsafeTransmuteCopy(customItem.clientItem(), wrapped.count());
} }

View File

@@ -66,7 +66,7 @@ public final class ModernNetworkItemHandler implements NetworkItemHandler<ItemSt
return new OtherItem(wrapped, false).process(); return new OtherItem(wrapped, false).process();
} else { } else {
BukkitCustomItem customItem = (BukkitCustomItem) optionalCustomItem.get(); BukkitCustomItem customItem = (BukkitCustomItem) optionalCustomItem.get();
boolean hasDifferentMaterial = FastNMS.INSTANCE.method$ItemStack$getItem(wrapped.getItem()) != customItem.clientItem(); boolean hasDifferentMaterial = FastNMS.INSTANCE.method$ItemStack$getItem(wrapped.getLiteralObject()) != customItem.clientItem();
if (hasDifferentMaterial) { if (hasDifferentMaterial) {
wrapped = wrapped.unsafeTransmuteCopy(customItem.clientItem(), wrapped.count()); wrapped = wrapped.unsafeTransmuteCopy(customItem.clientItem(), wrapped.count());
} }