Skip to content

Commit

Permalink
format(version-common): move #goatHorn up in LegacyVersionPatches
Browse files Browse the repository at this point in the history
  • Loading branch information
Siroshun09 committed Apr 23, 2024
1 parent ea23418 commit 4248ebb
Showing 1 changed file with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ public static boolean shouldPatchGoatHorn(@NotNull ItemVersion version) {
return original.equals("GOAT_HORN") ? "PONDER_GOAT_HORN" : original;
}

public static @NotNull ItemData goatHorn(@NotNull ItemData itemData) {
if (itemData.plainName().equals("GOAT_HORN")) {
var goatHorn = new ItemStack(Material.GOAT_HORN);
goatHorn.editMeta(MusicInstrumentMeta.class, meta -> meta.setInstrument(MusicInstrument.PONDER));

return new ItemData(itemData.internalId(), "PONDER_GOAT_HORN", goatHorn.serializeAsBytes());
} else {
return itemData;
}
}

public static boolean shouldPatchShortGrassName(@NotNull ItemVersion starting, @NotNull ItemVersion current) {
return starting.dataVersion().isBefore(MC_1_20_3) && current.dataVersion().isAfterOrSame(MC_1_20_3);
}
Expand Down Expand Up @@ -105,17 +116,6 @@ public static boolean shouldPatchTurtleScuteName(@NotNull ItemVersion starting,
return original.equals("SCUTE") ? "TURTLE_SCUTE" : original;
}

public static @NotNull ItemData goatHorn(@NotNull ItemData itemData) {
if (itemData.plainName().equals("GOAT_HORN")) {
var goatHorn = new ItemStack(Material.GOAT_HORN);
goatHorn.editMeta(MusicInstrumentMeta.class, meta -> meta.setInstrument(MusicInstrument.PONDER));

return new ItemData(itemData.internalId(), "PONDER_GOAT_HORN", goatHorn.serializeAsBytes());
} else {
return itemData;
}
}

private LegacyVersionPatches() {
throw new UnsupportedOperationException();
}
Expand Down

0 comments on commit 4248ebb

Please sign in to comment.