From c9fcc43f8b8e80b70c627caeadf33b773e6a7856 Mon Sep 17 00:00:00 2001 From: UserNugget <47762903+UserNugget@users.noreply.github.com> Date: Sat, 14 Dec 2024 18:01:48 +0300 Subject: [PATCH] Minecraft 1.21.4 and Velocity b453+ support (#176) --- .../limboapi/api/chunk/BlockEntityVersion.java | 4 +++- .../limboapi/api/material/WorldVersion.java | 4 +++- plugin/build.gradle | 6 ++++-- plugin/mapping/fallbackdata.json | 13 +++++++++++++ .../main/java/net/elytrium/limboapi/LimboAPI.java | 2 +- 5 files changed, 24 insertions(+), 5 deletions(-) diff --git a/api/src/main/java/net/elytrium/limboapi/api/chunk/BlockEntityVersion.java b/api/src/main/java/net/elytrium/limboapi/api/chunk/BlockEntityVersion.java index efd474a8..aa40ea50 100644 --- a/api/src/main/java/net/elytrium/limboapi/api/chunk/BlockEntityVersion.java +++ b/api/src/main/java/net/elytrium/limboapi/api/chunk/BlockEntityVersion.java @@ -24,7 +24,8 @@ public enum BlockEntityVersion { MINECRAFT_1_20_3(EnumSet.of(ProtocolVersion.MINECRAFT_1_20_3)), MINECRAFT_1_20_5(EnumSet.of(ProtocolVersion.MINECRAFT_1_20_5)), MINECRAFT_1_21(EnumSet.of(ProtocolVersion.MINECRAFT_1_21)), - MINECRAFT_1_21_2(EnumSet.of(ProtocolVersion.MINECRAFT_1_21_2)); + MINECRAFT_1_21_2(EnumSet.of(ProtocolVersion.MINECRAFT_1_21_2)), + MINECRAFT_1_21_4(EnumSet.of(ProtocolVersion.MINECRAFT_1_21_4)); private static final EnumMap MC_VERSION_TO_ITEM_VERSIONS = new EnumMap<>(ProtocolVersion.class); @@ -66,6 +67,7 @@ public static BlockEntityVersion parse(String from) { case "1.20.5" -> MINECRAFT_1_20_5; case "1.21" -> MINECRAFT_1_21; case "1.21.2" -> MINECRAFT_1_21_2; + case "1.21.4" -> MINECRAFT_1_21_4; default -> LEGACY; }; } diff --git a/api/src/main/java/net/elytrium/limboapi/api/material/WorldVersion.java b/api/src/main/java/net/elytrium/limboapi/api/material/WorldVersion.java index 83e8d892..95cd8ddb 100644 --- a/api/src/main/java/net/elytrium/limboapi/api/material/WorldVersion.java +++ b/api/src/main/java/net/elytrium/limboapi/api/material/WorldVersion.java @@ -28,7 +28,8 @@ public enum WorldVersion { MINECRAFT_1_20(EnumSet.range(ProtocolVersion.MINECRAFT_1_20, ProtocolVersion.MINECRAFT_1_20_2)), MINECRAFT_1_20_3(ProtocolVersion.MINECRAFT_1_20_3), MINECRAFT_1_20_5(EnumSet.range(ProtocolVersion.MINECRAFT_1_20_5, ProtocolVersion.MINECRAFT_1_21)), - MINECRAFT_1_21_2(EnumSet.range(ProtocolVersion.MINECRAFT_1_21_2, ProtocolVersion.MAXIMUM_VERSION)); + MINECRAFT_1_21_2(EnumSet.range(ProtocolVersion.MINECRAFT_1_21_2, ProtocolVersion.MINECRAFT_1_21_2)), + MINECRAFT_1_21_4(EnumSet.range(ProtocolVersion.MINECRAFT_1_21_4, ProtocolVersion.MAXIMUM_VERSION)); private static final EnumMap MC_VERSION_TO_ITEM_VERSIONS = new EnumMap<>(ProtocolVersion.class); @@ -74,6 +75,7 @@ public static WorldVersion parse(String from) { case "1.20.3" -> MINECRAFT_1_20_3; case "1.20.5" -> MINECRAFT_1_20_5; case "1.21.2" -> MINECRAFT_1_21_2; + case "1.21.4" -> MINECRAFT_1_21_4; default -> LEGACY; }; } diff --git a/plugin/build.gradle b/plugin/build.gradle index 5bf07b13..aebc485a 100644 --- a/plugin/build.gradle +++ b/plugin/build.gradle @@ -129,7 +129,8 @@ enum MinecraftVersion { MINECRAFT_1_20_3(765), MINECRAFT_1_20_5(766), MINECRAFT_1_21(767), - MINECRAFT_1_21_2(768) + MINECRAFT_1_21_2(768), + MINECRAFT_1_21_4(769) public static final List WORLD_VERSIONS = List.of( MINECRAFT_1_13, @@ -145,7 +146,8 @@ enum MinecraftVersion { MINECRAFT_1_20, MINECRAFT_1_20_3, MINECRAFT_1_20_5, - MINECRAFT_1_21_2 + MINECRAFT_1_21_2, + MINECRAFT_1_21_4 ) public static final MinecraftVersion MINIMUM_VERSION = MINECRAFT_1_7_2 diff --git a/plugin/mapping/fallbackdata.json b/plugin/mapping/fallbackdata.json index b2177026..0d3d336b 100755 --- a/plugin/mapping/fallbackdata.json +++ b/plugin/mapping/fallbackdata.json @@ -1,4 +1,17 @@ { + "MINECRAFT_1_21_2": { + "minecraft:resin_clump": "minecraft:glow_lichen", + "minecraft:resin_block": "minecraft:cut_copper", + "minecraft:resin_bricks": "minecraft:bricks", + "minecraft:resin_brick_stairs": "minecraft:brick_stairs", + "minecraft:resin_brick_slab": "minecraft:brick_slab", + "minecraft:resin_brick_wall": "minecraft:brick_wall", + "minecraft:chiseled_resin_bricks": "minecraft:chiseled_copper", + "minecraft:open_eyeblossom": "minecraft:torchflower", + "minecraft:closed_eyeblossom": "minecraft:cornflower", + "minecraft:potted_open_eyeblossom": "minecraft:potted_torchflower", + "minecraft:potted_closed_eyeblossom": "minecraft:potted_cornflower" + }, "MINECRAFT_1_21": { "minecraft:pale_oak_wood": "minecraft:birch_wood", "minecraft:pale_oak_planks": "minecraft:birch_planks", diff --git a/plugin/src/main/java/net/elytrium/limboapi/LimboAPI.java b/plugin/src/main/java/net/elytrium/limboapi/LimboAPI.java index 2b0ac454..e2474554 100644 --- a/plugin/src/main/java/net/elytrium/limboapi/LimboAPI.java +++ b/plugin/src/main/java/net/elytrium/limboapi/LimboAPI.java @@ -128,7 +128,7 @@ @SuppressFBWarnings("MS_EXPOSE_REP") public class LimboAPI implements LimboFactory { - private static final int SUPPORTED_MAXIMUM_PROTOCOL_VERSION_NUMBER = 768; + private static final int SUPPORTED_MAXIMUM_PROTOCOL_VERSION_NUMBER = 769; @MonotonicNonNull private static Logger LOGGER;