This commit is contained in:
Camotoy 2024-11-11 14:36:49 -05:00
parent 12e93ba1d8
commit 415411e5fe
No known key found for this signature in database
GPG key ID: 7EEFB66FE798081F
4 changed files with 4 additions and 43 deletions

View file

@ -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;
}

View file

@ -183,8 +183,10 @@ public final class ClickPlan {
inventory.setItem(simulatedSlot.getIntKey(), simulatedSlot.getValue(), session);
}
for (Int2ObjectMap.Entry<ItemStack> 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)
);
}
}

View file

@ -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);
}
}

View file

@ -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);
}