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

fix: 修复网络包?

This commit is contained in:
jhqwqmc
2025-05-30 09:10:31 +08:00
parent b346b15fd6
commit 78a3772eb3

View File

@@ -2083,9 +2083,9 @@ public class PacketConsumers {
try {
FriendlyByteBuf buf = event.getBuffer();
ItemBuildContext context = ItemBuildContext.of((BukkitServerPlayer) user);
int slot = buf.readVarInt();
Object friendlyBuf = FastNMS.INSTANCE.constructor$FriendlyByteBuf(buf);
ItemStack itemStack = FastNMS.INSTANCE.method$FriendlyByteBuf$readItem(friendlyBuf);
int slot = buf.readVarInt();
BukkitItemManager.instance().s2c(itemStack, context).ifPresent((newItemStack) -> {
event.setChanged(true);
buf.clear();