From 3d890d4a5cb32bb8314cb54be36523013144e56a Mon Sep 17 00:00:00 2001 From: Alemiz Date: Mon, 29 Jan 2024 15:04:45 +0100 Subject: [PATCH] Add MCBE 1.20.60 updater --- build.gradle.kts | 2 +- .../BlockStateUpdater_1_20_60.java | 35 +++++++++++++++++++ .../blockstateupdater/BlockStateUpdaters.java | 1 + 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 src/main/java/org/cloudburstmc/blockstateupdater/BlockStateUpdater_1_20_60.java diff --git a/build.gradle.kts b/build.gradle.kts index 3544119..7f25b26 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -4,7 +4,7 @@ plugins { id("signing") } -version = "1.20.50-SNAPSHOT" +version = "1.20.60-SNAPSHOT" group = "org.cloudburstmc" description = "Updates Minecraft: Bedrock Edition block states to the latest revision" diff --git a/src/main/java/org/cloudburstmc/blockstateupdater/BlockStateUpdater_1_20_60.java b/src/main/java/org/cloudburstmc/blockstateupdater/BlockStateUpdater_1_20_60.java new file mode 100644 index 0000000..9249d0b --- /dev/null +++ b/src/main/java/org/cloudburstmc/blockstateupdater/BlockStateUpdater_1_20_60.java @@ -0,0 +1,35 @@ +package org.cloudburstmc.blockstateupdater; + +import org.cloudburstmc.blockstateupdater.util.tagupdater.CompoundTagUpdaterContext; + +public class BlockStateUpdater_1_20_60 implements BlockStateUpdater { + + public static final BlockStateUpdater INSTANCE = new BlockStateUpdater_1_20_60(); + + @Override + public void registerUpdaters(CompoundTagUpdaterContext ctx) { + ctx.addUpdater(1, 20, 60) + .match("name", "minecraft:hard_stained_glass") + .visit("states") + .edit("color", helper -> { + String color = (String) helper.getTag(); + if (color.equals("silver")) { + color = "light_gray"; + } + helper.getRootTag().put("name", "minecraft:hard_" + color + "_stained_glass"); + }) + .remove("color"); + + ctx.addUpdater(1, 20, 60) + .match("name", "minecraft:hard_stained_glass_pane") + .visit("states") + .edit("color", helper -> { + String color = (String) helper.getTag(); + if (color.equals("silver")) { + color = "light_gray"; + } + helper.getRootTag().put("name", "minecraft:hard_" + color + "_stained_glass_pane"); + }) + .remove("color"); + } +} diff --git a/src/main/java/org/cloudburstmc/blockstateupdater/BlockStateUpdaters.java b/src/main/java/org/cloudburstmc/blockstateupdater/BlockStateUpdaters.java index b9feab2..1da0001 100644 --- a/src/main/java/org/cloudburstmc/blockstateupdater/BlockStateUpdaters.java +++ b/src/main/java/org/cloudburstmc/blockstateupdater/BlockStateUpdaters.java @@ -37,6 +37,7 @@ public class BlockStateUpdaters { updaters.add(BlockStateUpdater_1_20_30.INSTANCE); updaters.add(BlockStateUpdater_1_20_40.INSTANCE); updaters.add(BlockStateUpdater_1_20_50.INSTANCE); + updaters.add(BlockStateUpdater_1_20_60.INSTANCE); CompoundTagUpdaterContext context = new CompoundTagUpdaterContext(); updaters.forEach(updater -> updater.registerUpdaters(context));