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 a4e07f44f..e9cf95046 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 @@ -99,7 +99,7 @@ public class ItemTranslator { public BedrockItem getBedrockBlock(BlockState state) { BedrockItem bedrockItem = Remapper.BLOCK_REMAPPER.convertToBedrock(new ItemStack(state.getId())); if (bedrockItem == null) { - //GeyserLogger.DEFAULT.debug("Missing mapping for java item " + state.getId()); + // GeyserLogger.DEFAULT.debug("Missing mapping for java block " + state.getId()); return BedrockItem.AIR; } diff --git a/connector/src/main/java/org/geysermc/connector/utils/Toolbox.java b/connector/src/main/java/org/geysermc/connector/utils/Toolbox.java index 1447c5726..83c9d1a59 100644 --- a/connector/src/main/java/org/geysermc/connector/utils/Toolbox.java +++ b/connector/src/main/java/org/geysermc/connector/utils/Toolbox.java @@ -31,15 +31,13 @@ public class Toolbox { Map bedrockBlocks = new HashMap<>(); Map bedrockItems = new HashMap<>(); - for (Map e : entries) { - BedrockItem bedrockItem = new BedrockItem((String) e.get("name"), (int) e.get("id"), (int) e.get("data")); - bedrockBlocks.put(bedrockItem.getIdentifier(), bedrockItem); - bedrockItems.put(bedrockItem.getIdentifier() + ":" + bedrockItem.getData(), bedrockItem); - } - ByteBuf b = Unpooled.buffer(); VarInts.writeUnsignedInt(b, entries.size()); for (Map e : entries) { + BedrockItem bedrockItem = new BedrockItem((String) e.get("name"), (int) e.get("id"), (int) e.get("data")); + bedrockItems.put(bedrockItem.getIdentifier() + ":" + bedrockItem.getData(), bedrockItem); + bedrockBlocks.put(bedrockItem.getIdentifier() + ":" + bedrockItem.getData(), bedrockItem); + GlobalBlockPalette.registerMapping((int) e.get("id") << 4 | (int) e.get("data")); BedrockUtils.writeString(b, (String) e.get("name")); b.writeShortLE((int) e.get("data"));