From 2ec0d8c5012d58096518521b46103492461a4b0d Mon Sep 17 00:00:00 2001 From: Konicai <71294714+Konicai@users.noreply.github.com> Date: Thu, 11 May 2023 21:27:46 -0400 Subject: [PATCH] Compiling against MCPL 1.20 At a minimum, smithing and signs are broken --- .../inventory/InventoryTranslator.java | 2 +- .../BedrockBlockEntityDataTranslator.java | 2 +- .../java/JavaUpdateRecipesTranslator.java | 19 +------------------ gradle/libs.versions.toml | 2 +- 4 files changed, 4 insertions(+), 21 deletions(-) diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/InventoryTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/InventoryTranslator.java index 4a43ea055..7a5a981c6 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/InventoryTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/InventoryTranslator.java @@ -92,7 +92,7 @@ public abstract class InventoryTranslator { put(ContainerType.LOOM, new LoomInventoryTranslator()); put(ContainerType.MERCHANT, new MerchantInventoryTranslator()); put(ContainerType.SHULKER_BOX, new ShulkerInventoryTranslator()); - put(ContainerType.LEGACY_SMITHING, new SmithingInventoryTranslator()); + put(ContainerType.SMITHING, new SmithingInventoryTranslator()); // todo: 1.20 smithing put(ContainerType.STONECUTTER, new StonecutterInventoryTranslator()); /* Lectern */ diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockBlockEntityDataTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockBlockEntityDataTranslator.java index 0e58917c7..60f14b230 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockBlockEntityDataTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockBlockEntityDataTranslator.java @@ -108,7 +108,7 @@ public class BedrockBlockEntityDataTranslator extends PacketTranslator { - // Required to translate these as of 1.18.10, or else they cannot be crafted - LegacyUpgradeRecipeData recipeData = (LegacyUpgradeRecipeData) recipe.getData(); - ItemData output = ItemTranslator.translateToBedrock(session, recipeData.getResult()); - for (ItemStack base : recipeData.getBase().getOptions()) { - ItemDescriptorWithCount bedrockBase = ItemDescriptorWithCount.fromItem(ItemTranslator.translateToBedrock(session, base)); - - for (ItemStack addition : recipeData.getAddition().getOptions()) { - ItemDescriptorWithCount bedrockAddition = ItemDescriptorWithCount.fromItem(ItemTranslator.translateToBedrock(session, addition)); - - // Note: vanilla inputs use aux value of Short.MAX_VALUE - craftingDataPacket.getCraftingData().add(SmithingTransformRecipeData.of(recipe.getIdentifier(), - ItemDescriptorWithCount.EMPTY, bedrockBase, bedrockAddition, output, "smithing_table", netId++)); - } - } - } + // todo: 1.20 smithing default -> { List craftingData = recipeTypes.get(recipe.getType()); if (craftingData != null) { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index d674c5c29..fd0528fed 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -13,7 +13,7 @@ protocol = "3.0.0.Beta1-20230507.200054-78" protocol-connection = "3.0.0.Beta1-20230507.200054-77" raknet = "1.0.0.CR1-20230430.211932-7" mcauthlib = "d9d773e" -mcprotocollib = "1.19.4-2-20230503.145414-3" +mcprotocollib = "1.20-1-SNAPSHOT" adventure = "4.14.0-20230424.215040-7" adventure-platform = "4.1.2" junit = "5.9.2"