Skip to content

Commit

Permalink
Merge pull request #258 from Sylfare/fix/item_frame_packet_error
Browse files Browse the repository at this point in the history
Fix: Player kick when removing an item from a item frame
  • Loading branch information
oddlama committed Jul 8, 2024
2 parents 85c7084 + f31cc1b commit a535cc8
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ public ContainerAdapter(PacketType type) {
public void onPacketSending(PacketEvent event) {
if (event.getPacket().getHandle() instanceof ClientboundSetEntityDataPacket edp) {
var newlist = edp.packedItems().stream().map(x -> {
if (x.value() instanceof net.minecraft.world.item.ItemStack itemStack) {
if (x.value() instanceof net.minecraft.world.item.ItemStack itemStack && !itemStack.isEmpty()) {

var bukkititem = CustomEnchantmentFixer.removeVaneEnchants(itemStack.asBukkitCopy());
var newitem = Nms.item_handle(bukkititem);
return new DataValue<net.minecraft.world.item.ItemStack>(x.id(),
Expand Down

0 comments on commit a535cc8

Please sign in to comment.