From 365dd622bb08a65b6dcb1f5ce484d88f8287e38e Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+Camotoy@users.noreply.github.com> Date: Sun, 23 Apr 2023 14:09:51 -0400 Subject: [PATCH] Recipes are fixed in 1.19.80 --- .../CreativeItemRegistryPopulator.java | 18 +++++++++++------- .../java/JavaUpdateRecipesTranslator.java | 2 +- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/core/src/main/java/org/geysermc/geyser/registry/populator/CreativeItemRegistryPopulator.java b/core/src/main/java/org/geysermc/geyser/registry/populator/CreativeItemRegistryPopulator.java index 5ea76ae66..50398d863 100644 --- a/core/src/main/java/org/geysermc/geyser/registry/populator/CreativeItemRegistryPopulator.java +++ b/core/src/main/java/org/geysermc/geyser/registry/populator/CreativeItemRegistryPopulator.java @@ -81,6 +81,14 @@ public class CreativeItemRegistryPopulator { int damage = 0; int bedrockBlockRuntimeId = -1; NbtMap tag = null; + + String identifier = itemNode.get("id").textValue(); + for (BiPredicate predicate : JAVA_ONLY_ITEM_FILTER) { + if (predicate.test(identifier, damage)) { + return null; + } + } + JsonNode damageNode = itemNode.get("damage"); if (damageNode != null) { damage = damageNode.asInt(); @@ -94,6 +102,9 @@ public class CreativeItemRegistryPopulator { JsonNode blockRuntimeIdNode = itemNode.get("blockRuntimeId"); if (blockRuntimeIdNode != null) { bedrockBlockRuntimeId = blockRuntimeIdNode.asInt(); + if (bedrockBlockRuntimeId == 0 && !identifier.equals("minecraft:blue_candle")) { // FIXME + bedrockBlockRuntimeId = -1; + } } JsonNode nbtNode = itemNode.get("nbt_b64"); @@ -107,13 +118,6 @@ public class CreativeItemRegistryPopulator { } } - String identifier = itemNode.get("id").textValue(); - for (BiPredicate predicate : JAVA_ONLY_ITEM_FILTER) { - if (predicate.test(identifier, damage)) { - return null; - } - } - ItemDefinition definition = definitions.get(identifier); if (definition == null) { GeyserImpl.getInstance().getLogger().debug("Unknown item definition with identifier " + identifier + " when loading creative items!"); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaUpdateRecipesTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaUpdateRecipesTranslator.java index 9ac51c2dc..d58892ce5 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaUpdateRecipesTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaUpdateRecipesTranslator.java @@ -158,7 +158,7 @@ public class JavaUpdateRecipesTranslator extends PacketTranslator