From 9fbb1070ef0ffc4af9ed53f51e781d5e950aacfb Mon Sep 17 00:00:00 2001 From: Jonathan Coates Date: Fri, 14 Jun 2024 22:12:16 +0100 Subject: [PATCH] Remove redundant helper method from datagen Vanilla has had an equivalent method for a few years now! --- .../java/dan200/computercraft/data/ItemModelProvider.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/projects/common/src/main/java/dan200/computercraft/data/ItemModelProvider.java b/projects/common/src/main/java/dan200/computercraft/data/ItemModelProvider.java index ac80bc9a5b..4d0e990c89 100644 --- a/projects/common/src/main/java/dan200/computercraft/data/ItemModelProvider.java +++ b/projects/common/src/main/java/dan200/computercraft/data/ItemModelProvider.java @@ -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") @@ -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); - } }