diff --git a/core/src/main/java/org/geysermc/geyser/inventory/GeyserItemStack.java b/core/src/main/java/org/geysermc/geyser/inventory/GeyserItemStack.java index 5e1fb8447..4c8277341 100644 --- a/core/src/main/java/org/geysermc/geyser/inventory/GeyserItemStack.java +++ b/core/src/main/java/org/geysermc/geyser/inventory/GeyserItemStack.java @@ -54,7 +54,6 @@ import java.util.HashMap; @Data public class GeyserItemStack { public static final GeyserItemStack EMPTY = new GeyserItemStack(Items.AIR_ID, 0, null); - public static final int UNSET_NET_ID = 1; private final int javaId; private int amount; @@ -158,13 +157,6 @@ public class GeyserItemStack { return def; } -// public boolean hasComponent(DataComponentType type) { -// if (components == null) { -// return false; -// } -// return components.getDataComponents().containsKey(type); -// } - public int getNetId() { return isEmpty() ? 0 : netId; } diff --git a/core/src/main/java/org/geysermc/geyser/inventory/click/ClickPlan.java b/core/src/main/java/org/geysermc/geyser/inventory/click/ClickPlan.java index 15c46aed0..d4344f6e8 100644 --- a/core/src/main/java/org/geysermc/geyser/inventory/click/ClickPlan.java +++ b/core/src/main/java/org/geysermc/geyser/inventory/click/ClickPlan.java @@ -183,8 +183,10 @@ public final class ClickPlan { inventory.setItem(simulatedSlot.getIntKey(), simulatedSlot.getValue(), session); } for (Int2ObjectMap.Entry changedSlot : changedItems.int2ObjectEntrySet()) { + ItemStack value = changedSlot.getValue(); + ItemStack toSend = InventoryUtils.isEmpty(value) ? new ItemStack(-1, 0, null) : value; session.sendDownstreamGamePacket( - new ServerboundSetCreativeModeSlotPacket((short) changedSlot.getIntKey(), changedSlot.getValue()) + new ServerboundSetCreativeModeSlotPacket((short) changedSlot.getIntKey(), toSend) ); } } diff --git a/core/src/main/java/org/geysermc/geyser/item/type/BundleItem.java b/core/src/main/java/org/geysermc/geyser/item/type/BundleItem.java deleted file mode 100644 index 9c06768b3..000000000 --- a/core/src/main/java/org/geysermc/geyser/item/type/BundleItem.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2024 GeyserMC. http://geysermc.org - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - * @author GeyserMC - * @link https://github.com/GeyserMC/Geyser - */ - -package org.geysermc.geyser.item.type; - -public class BundleItem extends Item { - public BundleItem(String javaIdentifier, Builder builder) { - super(javaIdentifier, builder); - } -} diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/BundleInventoryTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/BundleInventoryTranslator.java index 2d8e5770b..b281945aa 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/BundleInventoryTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/BundleInventoryTranslator.java @@ -195,7 +195,6 @@ public final class BundleInventoryTranslator { if (bundleSlotData.getStackNetworkId() != contents.get(0).getNetId()) { // We're pulling out the first item; if something mismatches, wuh oh. - System.out.println(bundleSlotData.getStackNetworkId() + " " + contents.get(0).getNetId()); return rejectRequest(request); } @@ -324,7 +323,7 @@ public final class BundleInventoryTranslator { } static boolean isBundle(GeyserSession session, GeyserItemStack stack) { - // Client as of 1.21.3 does use this, and + // Client as of 1.21.3 does use this return session.getTagCache().is(ItemTag.BUNDLES, stack); }