Skip to content

Commit

Permalink
Fix dead coral updater (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
PetteriM1 authored Sep 15, 2024
1 parent 18c65f9 commit 9a63bf9
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ public void registerUpdaters(CompoundTagUpdaterContext ctx) {
this.addCoralUpdater(ctx, "yellow", "minecraft:horn_coral");
this.addCoralUpdater(ctx, "purple", "minecraft:bubble_coral");

this.addDeadCoralUpdater(ctx, "red", "minecraft:dead_fire_coral");
this.addDeadCoralUpdater(ctx, "pink", "minecraft:dead_brain_coral");
this.addDeadCoralUpdater(ctx, "blue", "minecraft:dead_tube_coral");
this.addDeadCoralUpdater(ctx, "yellow", "minecraft:dead_horn_coral");
this.addDeadCoralUpdater(ctx, "purple", "minecraft:dead_bubble_coral");

ctx.addUpdater(1, 20, 0)
.match("name", "minecraft:calibrated_sculk_sensor")
.visit("states")
Expand Down Expand Up @@ -114,7 +120,6 @@ private void addCauldronUpdater(CompoundTagUpdaterContext ctx, String type) {
}

private void addCoralUpdater(CompoundTagUpdaterContext context, String type, String newIdentifier) {
// Two updates to match final version
context.addUpdater(1, 20, 0)
.match("name", "minecraft:coral")
.visit("states")
Expand All @@ -123,7 +128,9 @@ private void addCoralUpdater(CompoundTagUpdaterContext context, String type, Str
.edit("coral_color", helper -> helper.getRootTag().put("name", newIdentifier))
.remove("coral_color")
.remove("dead_bit");
}

private void addDeadCoralUpdater(CompoundTagUpdaterContext context, String type, String newIdentifier) {
context.addUpdater(1, 20, 0)
.match("name", "minecraft:coral")
.visit("states")
Expand Down

0 comments on commit 9a63bf9

Please sign in to comment.