mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2025-12-19 15:09:15 +00:00
修复改包报错
This commit is contained in:
@@ -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());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user