From 93e99bc1efdd06d526fd47cc50ae4a5785c3d027 Mon Sep 17 00:00:00 2001
From: KennyTV <jahnke.nassim@gmail.com>
Date: Wed, 28 Apr 2021 17:56:29 +0200
Subject: [PATCH] 21w17a

---
 build.gradle.kts                              |   2 +-
 .../api/rewriters/EntityRewriterBase.java     |  23 +++
 .../packets/EntityPackets1_17.java            |  19 ++-
 .../data/mapping-1.16.2to1.17.json            | 144 ++++++------------
 gradle/libs.versions.toml                     |   2 +-
 5 files changed, 90 insertions(+), 100 deletions(-)

diff --git a/build.gradle.kts b/build.gradle.kts
index d91d6289..8aab044d 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -8,7 +8,7 @@ plugins {
 
 allprojects {
     group = "com.viaversion"
-    version = "4.0.0-21w16a"
+    version = "4.0.0-21w17a"
     description = "Allow older clients to join newer server versions."
 }
 
diff --git a/common/src/main/java/com/viaversion/viabackwards/api/rewriters/EntityRewriterBase.java b/common/src/main/java/com/viaversion/viabackwards/api/rewriters/EntityRewriterBase.java
index b7b3dbd8..34aa7e68 100644
--- a/common/src/main/java/com/viaversion/viabackwards/api/rewriters/EntityRewriterBase.java
+++ b/common/src/main/java/com/viaversion/viabackwards/api/rewriters/EntityRewriterBase.java
@@ -245,6 +245,11 @@ public abstract class EntityRewriterBase<T extends BackwardsProtocol> extends Re
         registerExtraTracker(packetType, entityType, Type.VAR_INT);
     }
 
+    /**
+     * Sub 1.17 method for entity remove packets.
+     *
+     * @param packetType remove entities packet type
+     */
     protected void registerEntityDestroy(ClientboundPacketType packetType) {
         getProtocol().registerClientbound(packetType, new PacketRemapper() {
             @Override
@@ -260,6 +265,24 @@ public abstract class EntityRewriterBase<T extends BackwardsProtocol> extends Re
         });
     }
 
+    /**
+     * 1.17+ method for entity remove packets.
+     *
+     * @param packetType remove entities packet type
+     */
+    protected void registerRemoveEntity(ClientboundPacketType packetType) {
+        protocol.registerClientbound(packetType, new PacketRemapper() {
+            @Override
+            public void registerMap() {
+                map(Type.VAR_INT); // 0 - Entity ids
+                handler(wrapper -> {
+                    int entity = wrapper.get(Type.VAR_INT, 0);
+                    getEntityTracker(wrapper.user()).removeEntity(entity);
+                });
+            }
+        });
+    }
+
     // ONLY TRACKS, DOESN'T REWRITE IDS
     protected PacketHandler getTrackerHandler(Type intType, int typeIndex) {
         return wrapper -> {
diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_16_4to1_17/packets/EntityPackets1_17.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_16_4to1_17/packets/EntityPackets1_17.java
index 0a8362ef..5a2028ab 100644
--- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_16_4to1_17/packets/EntityPackets1_17.java
+++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_16_4to1_17/packets/EntityPackets1_17.java
@@ -54,8 +54,22 @@ public class EntityPackets1_17 extends EntityRewriter<Protocol1_16_4To1_17> {
         registerExtraTracker(ClientboundPackets1_17.SPAWN_EXPERIENCE_ORB, Entity1_16_2Types.EXPERIENCE_ORB);
         registerExtraTracker(ClientboundPackets1_17.SPAWN_PAINTING, Entity1_16_2Types.PAINTING);
         registerExtraTracker(ClientboundPackets1_17.SPAWN_PLAYER, Entity1_16_2Types.PLAYER);
-        registerEntityDestroy(ClientboundPackets1_17.DESTROY_ENTITIES);
         registerMetadataRewriter(ClientboundPackets1_17.ENTITY_METADATA, Types1_17.METADATA_LIST, Types1_14.METADATA_LIST);
+
+        protocol.registerClientbound(ClientboundPackets1_17.REMOVE_ENTITY, ClientboundPackets1_16_2.DESTROY_ENTITIES, new PacketRemapper() {
+            @Override
+            public void registerMap() {
+                handler(wrapper -> {
+                    int entityId = wrapper.read(Type.VAR_INT);
+                    getEntityTracker(wrapper.user()).removeEntity(entityId);
+
+                    // Write into single value array
+                    int[] array = {entityId};
+                    wrapper.write(Type.VAR_INT_ARRAY_PRIMITIVE, array);
+                });
+            }
+        });
+
         protocol.registerClientbound(ClientboundPackets1_17.JOIN_GAME, new PacketRemapper() {
             @Override
             public void registerMap() {
@@ -97,6 +111,7 @@ public class EntityPackets1_17 extends EntityRewriter<Protocol1_16_4To1_17> {
                 });
             }
         });
+
         protocol.registerClientbound(ClientboundPackets1_17.RESPAWN, new PacketRemapper() {
             @Override
             public void registerMap() {
@@ -188,7 +203,7 @@ public class EntityPackets1_17 extends EntityRewriter<Protocol1_16_4To1_17> {
 
         registerMetaHandler().filter(Entity1_17Types.GLOW_SQUID, 16).removed();
 
-        registerMetaHandler().filter(Entity1_17Types.GOAT, 16).removed();
+        registerMetaHandler().filter(Entity1_17Types.GOAT, 17).removed();
 
         mapEntity(Entity1_17Types.AXOLOTL, Entity1_17Types.TROPICAL_FISH).jsonName("Axolotl");
         mapEntity(Entity1_17Types.GOAT, Entity1_17Types.SHEEP).jsonName("Goat");
diff --git a/common/src/main/resources/assets/viabackwards/data/mapping-1.16.2to1.17.json b/common/src/main/resources/assets/viabackwards/data/mapping-1.16.2to1.17.json
index 5a733fb0..8b18219a 100644
--- a/common/src/main/resources/assets/viabackwards/data/mapping-1.16.2to1.17.json
+++ b/common/src/main/resources/assets/viabackwards/data/mapping-1.16.2to1.17.json
@@ -437,102 +437,54 @@
     "minecraft:black_candle_cake[lit=false]": "minecraft:cake[bites=0]",
     "minecraft:amethyst_block": "minecraft:purpur_block",
     "minecraft:budding_amethyst": "minecraft:purpur_pillar[axis=y]",
-    "minecraft:amethyst_cluster[facing=north,lit=true,waterlogged=true]": "minecraft:bubble_coral_wall_fan[facing=north,waterlogged=true]",
-    "minecraft:amethyst_cluster[facing=north,lit=true,waterlogged=false]": "minecraft:bubble_coral_wall_fan[facing=north,waterlogged=false]",
-    "minecraft:amethyst_cluster[facing=north,lit=false,waterlogged=true]": "minecraft:bubble_coral_wall_fan[facing=north,waterlogged=true]",
-    "minecraft:amethyst_cluster[facing=north,lit=false,waterlogged=false]": "minecraft:bubble_coral_wall_fan[facing=north,waterlogged=false]",
-    "minecraft:amethyst_cluster[facing=east,lit=true,waterlogged=true]": "minecraft:bubble_coral_wall_fan[facing=east,waterlogged=true]",
-    "minecraft:amethyst_cluster[facing=east,lit=true,waterlogged=false]": "minecraft:bubble_coral_wall_fan[facing=east,waterlogged=false]",
-    "minecraft:amethyst_cluster[facing=east,lit=false,waterlogged=true]": "minecraft:bubble_coral_wall_fan[facing=east,waterlogged=true]",
-    "minecraft:amethyst_cluster[facing=east,lit=false,waterlogged=false]": "minecraft:bubble_coral_wall_fan[facing=east,waterlogged=false]",
-    "minecraft:amethyst_cluster[facing=south,lit=true,waterlogged=true]": "minecraft:bubble_coral_wall_fan[facing=south,waterlogged=true]",
-    "minecraft:amethyst_cluster[facing=south,lit=true,waterlogged=false]": "minecraft:bubble_coral_wall_fan[facing=south,waterlogged=false]",
-    "minecraft:amethyst_cluster[facing=south,lit=false,waterlogged=true]": "minecraft:bubble_coral_wall_fan[facing=south,waterlogged=true]",
-    "minecraft:amethyst_cluster[facing=south,lit=false,waterlogged=false]": "minecraft:bubble_coral_wall_fan[facing=south,waterlogged=false]",
-    "minecraft:amethyst_cluster[facing=west,lit=true,waterlogged=true]": "minecraft:bubble_coral_wall_fan[facing=west,waterlogged=true]",
-    "minecraft:amethyst_cluster[facing=west,lit=true,waterlogged=false]": "minecraft:bubble_coral_wall_fan[facing=west,waterlogged=false]",
-    "minecraft:amethyst_cluster[facing=west,lit=false,waterlogged=true]": "minecraft:bubble_coral_wall_fan[facing=west,waterlogged=true]",
-    "minecraft:amethyst_cluster[facing=west,lit=false,waterlogged=false]": "minecraft:bubble_coral_wall_fan[facing=west,waterlogged=false]",
-    "minecraft:amethyst_cluster[facing=up,lit=true,waterlogged=true]": "minecraft:bubble_coral_fan[waterlogged=true]",
-    "minecraft:amethyst_cluster[facing=up,lit=true,waterlogged=false]": "minecraft:bubble_coral_fan[waterlogged=false]",
-    "minecraft:amethyst_cluster[facing=up,lit=false,waterlogged=true]": "minecraft:bubble_coral_fan[waterlogged=true]",
-    "minecraft:amethyst_cluster[facing=up,lit=false,waterlogged=false]": "minecraft:bubble_coral_fan[waterlogged=false]",
-    "minecraft:amethyst_cluster[facing=down,lit=true,waterlogged=true]": "minecraft:weeping_vines[age=0]",
-    "minecraft:amethyst_cluster[facing=down,lit=true,waterlogged=false]": "minecraft:weeping_vines[age=0]",
-    "minecraft:amethyst_cluster[facing=down,lit=false,waterlogged=true]": "minecraft:weeping_vines[age=0]",
-    "minecraft:amethyst_cluster[facing=down,lit=false,waterlogged=false]": "minecraft:weeping_vines[age=0]",
-    "minecraft:large_amethyst_bud[facing=north,lit=true,waterlogged=true]": "minecraft:bubble_coral_wall_fan[facing=north,waterlogged=true]",
-    "minecraft:large_amethyst_bud[facing=north,lit=true,waterlogged=false]": "minecraft:bubble_coral_wall_fan[facing=north,waterlogged=false]",
-    "minecraft:large_amethyst_bud[facing=north,lit=false,waterlogged=true]": "minecraft:bubble_coral_wall_fan[facing=north,waterlogged=true]",
-    "minecraft:large_amethyst_bud[facing=north,lit=false,waterlogged=false]": "minecraft:bubble_coral_wall_fan[facing=north,waterlogged=false]",
-    "minecraft:large_amethyst_bud[facing=east,lit=true,waterlogged=true]": "minecraft:bubble_coral_wall_fan[facing=east,waterlogged=true]",
-    "minecraft:large_amethyst_bud[facing=east,lit=true,waterlogged=false]": "minecraft:bubble_coral_wall_fan[facing=east,waterlogged=false]",
-    "minecraft:large_amethyst_bud[facing=east,lit=false,waterlogged=true]": "minecraft:bubble_coral_wall_fan[facing=east,waterlogged=true]",
-    "minecraft:large_amethyst_bud[facing=east,lit=false,waterlogged=false]": "minecraft:bubble_coral_wall_fan[facing=east,waterlogged=false]",
-    "minecraft:large_amethyst_bud[facing=south,lit=true,waterlogged=true]": "minecraft:bubble_coral_wall_fan[facing=south,waterlogged=true]",
-    "minecraft:large_amethyst_bud[facing=south,lit=true,waterlogged=false]": "minecraft:bubble_coral_wall_fan[facing=south,waterlogged=false]",
-    "minecraft:large_amethyst_bud[facing=south,lit=false,waterlogged=true]": "minecraft:bubble_coral_wall_fan[facing=south,waterlogged=true]",
-    "minecraft:large_amethyst_bud[facing=south,lit=false,waterlogged=false]": "minecraft:bubble_coral_wall_fan[facing=south,waterlogged=false]",
-    "minecraft:large_amethyst_bud[facing=west,lit=true,waterlogged=true]": "minecraft:bubble_coral_wall_fan[facing=west,waterlogged=true]",
-    "minecraft:large_amethyst_bud[facing=west,lit=true,waterlogged=false]": "minecraft:bubble_coral_wall_fan[facing=west,waterlogged=false]",
-    "minecraft:large_amethyst_bud[facing=west,lit=false,waterlogged=true]": "minecraft:bubble_coral_wall_fan[facing=west,waterlogged=true]",
-    "minecraft:large_amethyst_bud[facing=west,lit=false,waterlogged=false]": "minecraft:bubble_coral_wall_fan[facing=west,waterlogged=false]",
-    "minecraft:large_amethyst_bud[facing=up,lit=true,waterlogged=true]": "minecraft:bubble_coral_fan[waterlogged=true]",
-    "minecraft:large_amethyst_bud[facing=up,lit=true,waterlogged=false]": "minecraft:bubble_coral_fan[waterlogged=false]",
-    "minecraft:large_amethyst_bud[facing=up,lit=false,waterlogged=true]": "minecraft:bubble_coral_fan[waterlogged=true]",
-    "minecraft:large_amethyst_bud[facing=up,lit=false,waterlogged=false]": "minecraft:bubble_coral_fan[waterlogged=false]",
-    "minecraft:large_amethyst_bud[facing=down,lit=true,waterlogged=true]": "minecraft:weeping_vines[age=0]",
-    "minecraft:large_amethyst_bud[facing=down,lit=true,waterlogged=false]": "minecraft:weeping_vines[age=0]",
-    "minecraft:large_amethyst_bud[facing=down,lit=false,waterlogged=true]": "minecraft:weeping_vines[age=0]",
-    "minecraft:large_amethyst_bud[facing=down,lit=false,waterlogged=false]": "minecraft:weeping_vines[age=0]",
-    "minecraft:medium_amethyst_bud[facing=north,lit=true,waterlogged=true]": "minecraft:bubble_coral_wall_fan[facing=north,waterlogged=true]",
-    "minecraft:medium_amethyst_bud[facing=north,lit=true,waterlogged=false]": "minecraft:bubble_coral_wall_fan[facing=north,waterlogged=false]",
-    "minecraft:medium_amethyst_bud[facing=north,lit=false,waterlogged=true]": "minecraft:bubble_coral_wall_fan[facing=north,waterlogged=true]",
-    "minecraft:medium_amethyst_bud[facing=north,lit=false,waterlogged=false]": "minecraft:bubble_coral_wall_fan[facing=north,waterlogged=false]",
-    "minecraft:medium_amethyst_bud[facing=east,lit=true,waterlogged=true]": "minecraft:bubble_coral_wall_fan[facing=east,waterlogged=true]",
-    "minecraft:medium_amethyst_bud[facing=east,lit=true,waterlogged=false]": "minecraft:bubble_coral_wall_fan[facing=east,waterlogged=false]",
-    "minecraft:medium_amethyst_bud[facing=east,lit=false,waterlogged=true]": "minecraft:bubble_coral_wall_fan[facing=east,waterlogged=true]",
-    "minecraft:medium_amethyst_bud[facing=east,lit=false,waterlogged=false]": "minecraft:bubble_coral_wall_fan[facing=east,waterlogged=false]",
-    "minecraft:medium_amethyst_bud[facing=south,lit=true,waterlogged=true]": "minecraft:bubble_coral_wall_fan[facing=south,waterlogged=true]",
-    "minecraft:medium_amethyst_bud[facing=south,lit=true,waterlogged=false]": "minecraft:bubble_coral_wall_fan[facing=south,waterlogged=false]",
-    "minecraft:medium_amethyst_bud[facing=south,lit=false,waterlogged=true]": "minecraft:bubble_coral_wall_fan[facing=south,waterlogged=true]",
-    "minecraft:medium_amethyst_bud[facing=south,lit=false,waterlogged=false]": "minecraft:bubble_coral_wall_fan[facing=south,waterlogged=false]",
-    "minecraft:medium_amethyst_bud[facing=west,lit=true,waterlogged=true]": "minecraft:bubble_coral_wall_fan[facing=west,waterlogged=true]",
-    "minecraft:medium_amethyst_bud[facing=west,lit=true,waterlogged=false]": "minecraft:bubble_coral_wall_fan[facing=west,waterlogged=false]",
-    "minecraft:medium_amethyst_bud[facing=west,lit=false,waterlogged=true]": "minecraft:bubble_coral_wall_fan[facing=west,waterlogged=true]",
-    "minecraft:medium_amethyst_bud[facing=west,lit=false,waterlogged=false]": "minecraft:bubble_coral_wall_fan[facing=west,waterlogged=false]",
-    "minecraft:medium_amethyst_bud[facing=up,lit=true,waterlogged=true]": "minecraft:bubble_coral_fan[waterlogged=true]",
-    "minecraft:medium_amethyst_bud[facing=up,lit=true,waterlogged=false]": "minecraft:bubble_coral_fan[waterlogged=false]",
-    "minecraft:medium_amethyst_bud[facing=up,lit=false,waterlogged=true]": "minecraft:bubble_coral_fan[waterlogged=true]",
-    "minecraft:medium_amethyst_bud[facing=up,lit=false,waterlogged=false]": "minecraft:bubble_coral_fan[waterlogged=false]",
-    "minecraft:medium_amethyst_bud[facing=down,lit=true,waterlogged=true]": "minecraft:weeping_vines[age=0]",
-    "minecraft:medium_amethyst_bud[facing=down,lit=true,waterlogged=false]": "minecraft:weeping_vines[age=0]",
-    "minecraft:medium_amethyst_bud[facing=down,lit=false,waterlogged=true]": "minecraft:weeping_vines[age=0]",
-    "minecraft:medium_amethyst_bud[facing=down,lit=false,waterlogged=false]": "minecraft:weeping_vines[age=0]",
-    "minecraft:small_amethyst_bud[facing=north,lit=true,waterlogged=true]": "minecraft:bubble_coral_wall_fan[facing=north,waterlogged=true]",
-    "minecraft:small_amethyst_bud[facing=north,lit=true,waterlogged=false]": "minecraft:bubble_coral_wall_fan[facing=north,waterlogged=false]",
-    "minecraft:small_amethyst_bud[facing=north,lit=false,waterlogged=true]": "minecraft:bubble_coral_wall_fan[facing=north,waterlogged=true]",
-    "minecraft:small_amethyst_bud[facing=north,lit=false,waterlogged=false]": "minecraft:bubble_coral_wall_fan[facing=north,waterlogged=false]",
-    "minecraft:small_amethyst_bud[facing=east,lit=true,waterlogged=true]": "minecraft:bubble_coral_wall_fan[facing=east,waterlogged=true]",
-    "minecraft:small_amethyst_bud[facing=east,lit=true,waterlogged=false]": "minecraft:bubble_coral_wall_fan[facing=east,waterlogged=false]",
-    "minecraft:small_amethyst_bud[facing=east,lit=false,waterlogged=true]": "minecraft:bubble_coral_wall_fan[facing=east,waterlogged=true]",
-    "minecraft:small_amethyst_bud[facing=east,lit=false,waterlogged=false]": "minecraft:bubble_coral_wall_fan[facing=east,waterlogged=false]",
-    "minecraft:small_amethyst_bud[facing=south,lit=true,waterlogged=true]": "minecraft:bubble_coral_wall_fan[facing=south,waterlogged=true]",
-    "minecraft:small_amethyst_bud[facing=south,lit=true,waterlogged=false]": "minecraft:bubble_coral_wall_fan[facing=south,waterlogged=false]",
-    "minecraft:small_amethyst_bud[facing=south,lit=false,waterlogged=true]": "minecraft:bubble_coral_wall_fan[facing=south,waterlogged=true]",
-    "minecraft:small_amethyst_bud[facing=south,lit=false,waterlogged=false]": "minecraft:bubble_coral_wall_fan[facing=south,waterlogged=false]",
-    "minecraft:small_amethyst_bud[facing=west,lit=true,waterlogged=true]": "minecraft:bubble_coral_wall_fan[facing=west,waterlogged=true]",
-    "minecraft:small_amethyst_bud[facing=west,lit=true,waterlogged=false]": "minecraft:bubble_coral_wall_fan[facing=west,waterlogged=false]",
-    "minecraft:small_amethyst_bud[facing=west,lit=false,waterlogged=true]": "minecraft:bubble_coral_wall_fan[facing=west,waterlogged=true]",
-    "minecraft:small_amethyst_bud[facing=west,lit=false,waterlogged=false]": "minecraft:bubble_coral_wall_fan[facing=west,waterlogged=false]",
-    "minecraft:small_amethyst_bud[facing=up,lit=true,waterlogged=true]": "minecraft:bubble_coral_fan[waterlogged=true]",
-    "minecraft:small_amethyst_bud[facing=up,lit=true,waterlogged=false]": "minecraft:bubble_coral_fan[waterlogged=false]",
-    "minecraft:small_amethyst_bud[facing=up,lit=false,waterlogged=true]": "minecraft:bubble_coral_fan[waterlogged=true]",
-    "minecraft:small_amethyst_bud[facing=up,lit=false,waterlogged=false]": "minecraft:bubble_coral_fan[waterlogged=false]",
-    "minecraft:small_amethyst_bud[facing=down,lit=true,waterlogged=true]": "minecraft:weeping_vines[age=0]",
-    "minecraft:small_amethyst_bud[facing=down,lit=true,waterlogged=false]": "minecraft:weeping_vines[age=0]",
-    "minecraft:small_amethyst_bud[facing=down,lit=false,waterlogged=true]": "minecraft:weeping_vines[age=0]",
-    "minecraft:small_amethyst_bud[facing=down,lit=false,waterlogged=false]": "minecraft:weeping_vines[age=0]",
+    "minecraft:amethyst_cluster[facing=north,waterlogged=true]": "minecraft:bubble_coral_wall_fan[facing=north,waterlogged=true]",
+    "minecraft:amethyst_cluster[facing=north,waterlogged=false]": "minecraft:bubble_coral_wall_fan[facing=north,waterlogged=false]",
+    "minecraft:amethyst_cluster[facing=east,waterlogged=true]": "minecraft:bubble_coral_wall_fan[facing=east,waterlogged=true]",
+    "minecraft:amethyst_cluster[facing=east,waterlogged=false]": "minecraft:bubble_coral_wall_fan[facing=east,waterlogged=false]",
+    "minecraft:amethyst_cluster[facing=south,waterlogged=true]": "minecraft:bubble_coral_wall_fan[facing=south,waterlogged=true]",
+    "minecraft:amethyst_cluster[facing=south,waterlogged=false]": "minecraft:bubble_coral_wall_fan[facing=south,waterlogged=false]",
+    "minecraft:amethyst_cluster[facing=west,waterlogged=true]": "minecraft:bubble_coral_wall_fan[facing=west,waterlogged=true]",
+    "minecraft:amethyst_cluster[facing=west,waterlogged=false]": "minecraft:bubble_coral_wall_fan[facing=west,waterlogged=false]",
+    "minecraft:amethyst_cluster[facing=up,waterlogged=true]": "minecraft:bubble_coral_fan[waterlogged=true]",
+    "minecraft:amethyst_cluster[facing=up,waterlogged=false]": "minecraft:bubble_coral_fan[waterlogged=false]",
+    "minecraft:amethyst_cluster[facing=down,waterlogged=true]": "minecraft:weeping_vines[age=0]",
+    "minecraft:amethyst_cluster[facing=down,waterlogged=false]": "minecraft:weeping_vines[age=0]",
+    "minecraft:large_amethyst_bud[facing=north,waterlogged=true]": "minecraft:bubble_coral_wall_fan[facing=north,waterlogged=true]",
+    "minecraft:large_amethyst_bud[facing=north,waterlogged=false]": "minecraft:bubble_coral_wall_fan[facing=north,waterlogged=false]",
+    "minecraft:large_amethyst_bud[facing=east,waterlogged=true]": "minecraft:bubble_coral_wall_fan[facing=east,waterlogged=true]",
+    "minecraft:large_amethyst_bud[facing=east,waterlogged=false]": "minecraft:bubble_coral_wall_fan[facing=east,waterlogged=false]",
+    "minecraft:large_amethyst_bud[facing=south,waterlogged=true]": "minecraft:bubble_coral_wall_fan[facing=south,waterlogged=true]",
+    "minecraft:large_amethyst_bud[facing=south,waterlogged=false]": "minecraft:bubble_coral_wall_fan[facing=south,waterlogged=false]",
+    "minecraft:large_amethyst_bud[facing=west,waterlogged=true]": "minecraft:bubble_coral_wall_fan[facing=west,waterlogged=true]",
+    "minecraft:large_amethyst_bud[facing=west,waterlogged=false]": "minecraft:bubble_coral_wall_fan[facing=west,waterlogged=false]",
+    "minecraft:large_amethyst_bud[facing=up,waterlogged=true]": "minecraft:bubble_coral_fan[waterlogged=true]",
+    "minecraft:large_amethyst_bud[facing=up,waterlogged=false]": "minecraft:bubble_coral_fan[waterlogged=false]",
+    "minecraft:large_amethyst_bud[facing=down,waterlogged=true]": "minecraft:weeping_vines[age=0]",
+    "minecraft:large_amethyst_bud[facing=down,waterlogged=false]": "minecraft:weeping_vines[age=0]",
+    "minecraft:medium_amethyst_bud[facing=north,waterlogged=true]": "minecraft:bubble_coral_wall_fan[facing=north,waterlogged=true]",
+    "minecraft:medium_amethyst_bud[facing=north,waterlogged=false]": "minecraft:bubble_coral_wall_fan[facing=north,waterlogged=false]",
+    "minecraft:medium_amethyst_bud[facing=east,waterlogged=true]": "minecraft:bubble_coral_wall_fan[facing=east,waterlogged=true]",
+    "minecraft:medium_amethyst_bud[facing=east,waterlogged=false]": "minecraft:bubble_coral_wall_fan[facing=east,waterlogged=false]",
+    "minecraft:medium_amethyst_bud[facing=south,waterlogged=true]": "minecraft:bubble_coral_wall_fan[facing=south,waterlogged=true]",
+    "minecraft:medium_amethyst_bud[facing=south,waterlogged=false]": "minecraft:bubble_coral_wall_fan[facing=south,waterlogged=false]",
+    "minecraft:medium_amethyst_bud[facing=west,waterlogged=true]": "minecraft:bubble_coral_wall_fan[facing=west,waterlogged=true]",
+    "minecraft:medium_amethyst_bud[facing=west,waterlogged=false]": "minecraft:bubble_coral_wall_fan[facing=west,waterlogged=false]",
+    "minecraft:medium_amethyst_bud[facing=up,waterlogged=true]": "minecraft:bubble_coral_fan[waterlogged=true]",
+    "minecraft:medium_amethyst_bud[facing=up,waterlogged=false]": "minecraft:bubble_coral_fan[waterlogged=false]",
+    "minecraft:medium_amethyst_bud[facing=down,waterlogged=true]": "minecraft:weeping_vines[age=0]",
+    "minecraft:medium_amethyst_bud[facing=down,waterlogged=false]": "minecraft:weeping_vines[age=0]",
+    "minecraft:small_amethyst_bud[facing=north,waterlogged=true]": "minecraft:bubble_coral_wall_fan[facing=north,waterlogged=true]",
+    "minecraft:small_amethyst_bud[facing=north,waterlogged=false]": "minecraft:bubble_coral_wall_fan[facing=north,waterlogged=false]",
+    "minecraft:small_amethyst_bud[facing=east,waterlogged=true]": "minecraft:bubble_coral_wall_fan[facing=east,waterlogged=true]",
+    "minecraft:small_amethyst_bud[facing=east,waterlogged=false]": "minecraft:bubble_coral_wall_fan[facing=east,waterlogged=false]",
+    "minecraft:small_amethyst_bud[facing=south,waterlogged=true]": "minecraft:bubble_coral_wall_fan[facing=south,waterlogged=true]",
+    "minecraft:small_amethyst_bud[facing=south,waterlogged=false]": "minecraft:bubble_coral_wall_fan[facing=south,waterlogged=false]",
+    "minecraft:small_amethyst_bud[facing=west,waterlogged=true]": "minecraft:bubble_coral_wall_fan[facing=west,waterlogged=true]",
+    "minecraft:small_amethyst_bud[facing=west,waterlogged=false]": "minecraft:bubble_coral_wall_fan[facing=west,waterlogged=false]",
+    "minecraft:small_amethyst_bud[facing=up,waterlogged=true]": "minecraft:bubble_coral_fan[waterlogged=true]",
+    "minecraft:small_amethyst_bud[facing=up,waterlogged=false]": "minecraft:bubble_coral_fan[waterlogged=false]",
+    "minecraft:small_amethyst_bud[facing=down,waterlogged=true]": "minecraft:weeping_vines[age=0]",
+    "minecraft:small_amethyst_bud[facing=down,waterlogged=false]": "minecraft:weeping_vines[age=0]",
     "minecraft:pointed_dripstone[thickness=tip_merge,vertical_direction=up,waterlogged=true]": "minecraft:end_rod[facing=up]",
     "minecraft:pointed_dripstone[thickness=tip_merge,vertical_direction=up,waterlogged=false]": "minecraft:end_rod[facing=up]",
     "minecraft:pointed_dripstone[thickness=tip_merge,vertical_direction=down,waterlogged=true]": "minecraft:end_rod[facing=down]",
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index c348e617..f1022566 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -3,7 +3,7 @@ metadata.format.version = "1.0"
 [versions]
 
 # ViaVersion
-viaver = "4.0.0-21w16a"
+viaver = "4.0.0-21w17a"
 
 # Common provided
 netty = "4.0.20.Final"