From d7b8f088990fcfdc9748eadbce47766b21fb6aaa Mon Sep 17 00:00:00 2001 From: DoctorMacc Date: Wed, 15 Apr 2020 15:24:57 -0400 Subject: [PATCH] Fix piston/sticky piston (among others) not being able to be retrieved in creative --- .../connector/network/translators/item/ItemTranslator.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/item/ItemTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/item/ItemTranslator.java index 8ca95159..0bcbf4b7 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/item/ItemTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/item/ItemTranslator.java @@ -118,6 +118,13 @@ public class ItemTranslator { return itemEntry; } } + // If item find was unsuccessful first time, we try again while ignoring damage + // Fixes piston, sticky pistons, dispensers and droppers turning into air from creative inventory + for (ItemEntry itemEntry : Toolbox.ITEM_ENTRIES.values()) { + if (itemEntry.getBedrockId() == data.getId()) { + return itemEntry; + } + } GeyserConnector.getInstance().getLogger().debug("Missing mapping for bedrock item " + data.getId() + ":" + data.getDamage()); return ItemEntry.AIR;