Test if slot 50 used and under what conditions. (#1028)

This commit is contained in:
bundabrg 2020-07-31 04:11:35 +08:00 committed by GitHub
parent 11300254f0
commit 784cb73301
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,6 +31,7 @@ import com.nukkitx.protocol.bedrock.data.inventory.ContainerType;
import com.nukkitx.protocol.bedrock.data.inventory.InventoryActionData; import com.nukkitx.protocol.bedrock.data.inventory.InventoryActionData;
import com.nukkitx.protocol.bedrock.data.inventory.InventorySource; import com.nukkitx.protocol.bedrock.data.inventory.InventorySource;
import com.nukkitx.protocol.bedrock.packet.ContainerOpenPacket; import com.nukkitx.protocol.bedrock.packet.ContainerOpenPacket;
import org.geysermc.connector.GeyserConnector;
import org.geysermc.connector.inventory.Inventory; import org.geysermc.connector.inventory.Inventory;
import org.geysermc.connector.network.session.GeyserSession; import org.geysermc.connector.network.session.GeyserSession;
import org.geysermc.connector.network.translators.inventory.updater.CursorInventoryUpdater; import org.geysermc.connector.network.translators.inventory.updater.CursorInventoryUpdater;
@ -46,6 +47,11 @@ public class CraftingInventoryTranslator extends BlockInventoryTranslator {
@Override @Override
public int bedrockSlotToJava(InventoryActionData action) { public int bedrockSlotToJava(InventoryActionData action) {
if (action.getSlot() == 50) {
GeyserConnector.getInstance().getLogger().warning("Slot 50 found, please report: " + action);
return 0;
}
if (action.getSource().getContainerId() == ContainerId.UI) { if (action.getSource().getContainerId() == ContainerId.UI) {
int slotnum = action.getSlot(); int slotnum = action.getSlot();
if (slotnum >= 32 && 42 >= slotnum) { if (slotnum >= 32 && 42 >= slotnum) {