Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix dead coral updater #10

Merged
merged 1 commit into from
Sep 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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