Skip to content

Commit

Permalink
Remove redundant helper method from datagen
Browse files Browse the repository at this point in the history
Vanilla has had an equivalent method for a few years now!
  • Loading branch information
SquidDev committed Jun 14, 2024
1 parent 1944995 commit 9fbb107
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ public static void addItemModels(ItemModelGenerators generators) {
}

private static void registerPocketComputer(ItemModelGenerators generators, ResourceLocation id, boolean off) {
createFlatItem(generators, addSuffix(id, "_blinking"),
createFlatItem(generators, id.withSuffix("_blinking"),
new ResourceLocation(ComputerCraftAPI.MOD_ID, "item/pocket_computer_blink"),
id,
new ResourceLocation(ComputerCraftAPI.MOD_ID, "item/pocket_computer_light")
);

createFlatItem(generators, addSuffix(id, "_on"),
createFlatItem(generators, id.withSuffix("_on"),
new ResourceLocation(ComputerCraftAPI.MOD_ID, "item/pocket_computer_on"),
id,
new ResourceLocation(ComputerCraftAPI.MOD_ID, "item/pocket_computer_light")
Expand Down Expand Up @@ -94,8 +94,4 @@ private static void createFlatItem(ItemModelGenerators generators, ResourceLocat
new ModelTemplate(Optional.of(new ResourceLocation("item/generated")), Optional.empty(), slots)
.create(model, mapping, generators.output);
}

private static ResourceLocation addSuffix(ResourceLocation location, String suffix) {
return new ResourceLocation(location.getNamespace(), location.getPath() + suffix);
}
}

0 comments on commit 9fbb107

Please sign in to comment.