From a004fe9a3143df2d4b3d7ba9ba0c5f510fac0f9d Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+Camotoy@users.noreply.github.com> Date: Sat, 1 Apr 2023 01:32:06 -0400 Subject: [PATCH 1/3] Update Adapters to fix #3654 --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index dfa459f01..71b243430 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -22,7 +22,7 @@ jline = "3.21.0" terminalconsoleappender = "1.2.0" folia = "1.19.4-R0.1-SNAPSHOT" viaversion = "4.0.0" -adapters = "1.7-SNAPSHOT" +adapters = "1.8-SNAPSHOT" commodore = "2.2" bungeecord = "a7c6ede" velocity = "3.0.0" From 5871ca3f22a2a45f0be5247ffce563427818079a Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+Camotoy@users.noreply.github.com> Date: Sat, 1 Apr 2023 15:25:37 -0400 Subject: [PATCH 2/3] Fix up boat types after 1.19.4 Fixes #3649 --- .../java/org/geysermc/geyser/entity/type/BoatEntity.java | 6 +++++- .../bedrock/BedrockEntityPickRequestTranslator.java | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/BoatEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/BoatEntity.java index 9fd96f46b..07c7e7643 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/BoatEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/BoatEntity.java @@ -124,7 +124,11 @@ public class BoatEntity extends Entity { public void setVariant(IntEntityMetadata entityMetadata) { variant = entityMetadata.getPrimitiveValue(); - dirtyMetadata.put(EntityData.VARIANT, variant); + dirtyMetadata.put(EntityData.VARIANT, switch (variant) { + case 6, 7 -> variant - 1; // Dark oak and mangrove + case 5, 8 -> 0; // TODO temp until 1.20. Cherry and bamboo + default -> variant; + }); } public void setPaddlingLeft(BooleanEntityMetadata entityMetadata) { diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockEntityPickRequestTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockEntityPickRequestTranslator.java index 482d153bb..b20bc9ad9 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockEntityPickRequestTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockEntityPickRequestTranslator.java @@ -62,8 +62,10 @@ public class BedrockEntityPickRequestTranslator extends PacketTranslator "birch"; case 3 -> "jungle"; case 4 -> "acacia"; - case 5 -> "dark_oak"; - case 6 -> "mangrove"; + //case 5 -> "cherry"; TODO + case 6 -> "dark_oak"; + case 7 -> "mangrove"; + //case 8 -> "bamboo"; default -> "oak"; }; itemName = typeOfBoat + "_" + entity.getDefinition().entityType().name().toLowerCase(Locale.ROOT); From 0f99abc3a44a7beaef221f174456bbb7ef7c6227 Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+Camotoy@users.noreply.github.com> Date: Sun, 2 Apr 2023 16:42:44 -0400 Subject: [PATCH 3/3] Fix #3549 --- .../java/JavaUpdateRecipesTranslator.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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 e665d5424..2fe25bcb1 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 @@ -70,7 +70,7 @@ public class JavaUpdateRecipesTranslator extends PacketTranslator CARTOGRAPHY_RECIPES = Arrays.asList( + private static final List CARTOGRAPHY_RECIPES = List.of( CraftingData.fromMulti(UUID.fromString("8b36268c-1829-483c-a0f1-993b7156a8f2"), ++LAST_RECIPE_NET_ID), // Map extending CraftingData.fromMulti(UUID.fromString("442d85ed-8272-4543-a6f1-418f90ded05d"), ++LAST_RECIPE_NET_ID), // Map cloning CraftingData.fromMulti(UUID.fromString("98c84b38-1085-46bd-b1ce-dd38c159e6cc"), ++LAST_RECIPE_NET_ID), // Map upgrading @@ -99,6 +99,10 @@ public class JavaUpdateRecipesTranslator extends PacketTranslator, IntSet> squashedOptions = new HashMap<>(); for (int i = 0; i < ingredients.length; i++) { if (ingredients[i].getOptions().length == 0) { squashedOptions.computeIfAbsent(Collections.singleton(ItemDescriptorWithCount.EMPTY), k -> new IntOpenHashSet()).add(i); continue; } + empty = false; Ingredient ingredient = ingredients[i]; Map> groupedByIds = Arrays.stream(ingredient.getOptions()) .map(item -> ItemDescriptorWithCount.fromItem(ItemTranslator.translateToBedrock(session, item))) @@ -249,6 +258,11 @@ public class JavaUpdateRecipesTranslator extends PacketTranslator new IntOpenHashSet()).add(i); } + if (empty) { + // Crashes Bedrock 1.19.70 otherwise + // Fixes https://github.com/GeyserMC/Geyser/issues/3549 + return null; + } int totalCombinations = 1; for (Set optionSet : squashedOptions.keySet()) { totalCombinations *= optionSet.size();