1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-02-03 12:49:11 +00:00

Remove redundant helper method from datagen

Vanilla has had an equivalent method for a few years now!
This commit is contained in:
Jonathan Coates 2024-06-14 22:12:16 +01:00
parent 1944995c33
commit 9fbb1070ef
No known key found for this signature in database
GPG Key ID: B9E431FF07C98D06

View File

@ -36,13 +36,13 @@ public final class ItemModelProvider {
} }
private static void registerPocketComputer(ItemModelGenerators generators, ResourceLocation id, boolean off) { 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"), new ResourceLocation(ComputerCraftAPI.MOD_ID, "item/pocket_computer_blink"),
id, id,
new ResourceLocation(ComputerCraftAPI.MOD_ID, "item/pocket_computer_light") 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"), new ResourceLocation(ComputerCraftAPI.MOD_ID, "item/pocket_computer_on"),
id, id,
new ResourceLocation(ComputerCraftAPI.MOD_ID, "item/pocket_computer_light") new ResourceLocation(ComputerCraftAPI.MOD_ID, "item/pocket_computer_light")
@ -94,8 +94,4 @@ public final class ItemModelProvider {
new ModelTemplate(Optional.of(new ResourceLocation("item/generated")), Optional.empty(), slots) new ModelTemplate(Optional.of(new ResourceLocation("item/generated")), Optional.empty(), slots)
.create(model, mapping, generators.output); .create(model, mapping, generators.output);
} }
private static ResourceLocation addSuffix(ResourceLocation location, String suffix) {
return new ResourceLocation(location.getNamespace(), location.getPath() + suffix);
}
} }