From 140a4a2463acb786e5d201fd7130ad9c8d5b7805 Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Sat, 23 Oct 2021 03:20:55 +0200 Subject: [PATCH] Too hot a fix - Potential fix to outside-dev server startup - Removed unnecessary toolbox recipes - Fixed absolute coords in toolbox screen --- src/generated/resources/.cache/cache | 2 -- .../brown_toolbox_from_main_toolbox.json | 32 ------------------- .../brown_toolbox_from_main_toolbox.json | 18 ----------- .../java/com/simibubi/create/AllBlocks.java | 16 +++++----- .../curiosities/toolbox/ToolboxScreen.java | 5 +-- .../foundation/data/CreateRegistrate.java | 17 ++++++---- 6 files changed, 21 insertions(+), 69 deletions(-) delete mode 100644 src/generated/resources/data/create/advancements/recipes/create.base/crafting/curiosities/brown_toolbox_from_main_toolbox.json delete mode 100644 src/generated/resources/data/create/recipes/crafting/curiosities/brown_toolbox_from_main_toolbox.json diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index bb138dc30..3d05e536f 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -1884,7 +1884,6 @@ d06d9445256ae19d0a8a37e97983b168fd4d774e data/create/advancements/recipes/create acdf76187497b3101e9ec6101e2164e11277a68a data/create/advancements/recipes/create.base/crafting/curiosities/blue_toolbox_from_main_toolbox.json 3a8b083c1f4c67feade27a877e774f435b8e58da data/create/advancements/recipes/create.base/crafting/curiosities/blue_toolbox_from_other_toolbox.json bb138bedd2aec741fa54b6b52be384fdbd741249 data/create/advancements/recipes/create.base/crafting/curiosities/brown_toolbox.json -963555b6f24b35150769c3ff68a9a57c4968c9a6 data/create/advancements/recipes/create.base/crafting/curiosities/brown_toolbox_from_main_toolbox.json 502e8ea5b0f9cc0ca90a1018d907ffe6f3b051a3 data/create/advancements/recipes/create.base/crafting/curiosities/brown_toolbox_from_other_toolbox.json f2afe58a26566aac8abce76f0ab6d0924c5badb6 data/create/advancements/recipes/create.base/crafting/curiosities/cyan_toolbox_from_main_toolbox.json dea244d3f78e4aaf13132d48dcf071e5046bf154 data/create/advancements/recipes/create.base/crafting/curiosities/cyan_toolbox_from_other_toolbox.json @@ -3035,7 +3034,6 @@ e89b2dd52cfe2d4d723f49aeec8f4f8c37a82dca data/create/recipes/crafting/curiositie 5588aa83b6fbb2ee3dc01e95b3261ccc38e40ad1 data/create/recipes/crafting/curiosities/blue_toolbox_from_main_toolbox.json 19c9fe34e311e7a11114acc10cc3777fc95ed3ab data/create/recipes/crafting/curiosities/blue_toolbox_from_other_toolbox.json 4754ca20a7efdf382f32be150f38bdf4e8183fc4 data/create/recipes/crafting/curiosities/brown_toolbox.json -7635daa89502a79cc5b99b146c1097fa166958e5 data/create/recipes/crafting/curiosities/brown_toolbox_from_main_toolbox.json 14a85c9011a6ca667ac83e95dd7e8eabfac4a4c5 data/create/recipes/crafting/curiosities/brown_toolbox_from_other_toolbox.json 39e6d65af1c8ca0dec19e5b15a2f0e28e69542eb data/create/recipes/crafting/curiosities/cyan_toolbox_from_main_toolbox.json 39e055d841536e691c798acc09145f821eeb32ae data/create/recipes/crafting/curiosities/cyan_toolbox_from_other_toolbox.json diff --git a/src/generated/resources/data/create/advancements/recipes/create.base/crafting/curiosities/brown_toolbox_from_main_toolbox.json b/src/generated/resources/data/create/advancements/recipes/create.base/crafting/curiosities/brown_toolbox_from_main_toolbox.json deleted file mode 100644 index dbef931eb..000000000 --- a/src/generated/resources/data/create/advancements/recipes/create.base/crafting/curiosities/brown_toolbox_from_main_toolbox.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "create:crafting/curiosities/brown_toolbox_from_main_toolbox" - ] - }, - "criteria": { - "has_toolbox": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { - "tag": "create:toolboxes" - } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "create:crafting/curiosities/brown_toolbox_from_main_toolbox" - } - } - }, - "requirements": [ - [ - "has_toolbox", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/generated/resources/data/create/recipes/crafting/curiosities/brown_toolbox_from_main_toolbox.json b/src/generated/resources/data/create/recipes/crafting/curiosities/brown_toolbox_from_main_toolbox.json deleted file mode 100644 index 0db80fc97..000000000 --- a/src/generated/resources/data/create/recipes/crafting/curiosities/brown_toolbox_from_main_toolbox.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "#", - "-" - ], - "key": { - "#": { - "tag": "forge:dyes/brown" - }, - "-": { - "item": "create:brown_toolbox" - } - }, - "result": { - "item": "create:brown_toolbox" - } -} \ No newline at end of file diff --git a/src/main/java/com/simibubi/create/AllBlocks.java b/src/main/java/com/simibubi/create/AllBlocks.java index a7e176e76..ae99b8f62 100644 --- a/src/main/java/com/simibubi/create/AllBlocks.java +++ b/src/main/java/com/simibubi/create/AllBlocks.java @@ -1380,14 +1380,14 @@ public class AllBlocks { .define('-', AllItemTags.TOOLBOXES.tag) .unlockedBy("has_toolbox", RegistrateRecipeProvider.hasItem(AllItemTags.TOOLBOXES.tag)) .save(p, Create.asResource("crafting/curiosities/" + c.getName() + "_from_other_toolbox")); - - ShapedRecipeBuilder.shaped(c.get()) - .pattern("#") - .pattern("-") - .define('#', DyeHelper.getTagOfDye(colour)) - .define('-', ToolboxBlock.getMainBox()) - .unlockedBy("has_toolbox", RegistrateRecipeProvider.hasItem(AllItemTags.TOOLBOXES.tag)) - .save(p, Create.asResource("crafting/curiosities/" + c.getName() + "_from_main_toolbox")); + if (colour != DyeColor.BROWN) + ShapedRecipeBuilder.shaped(c.get()) + .pattern("#") + .pattern("-") + .define('#', DyeHelper.getTagOfDye(colour)) + .define('-', ToolboxBlock.getMainBox()) + .unlockedBy("has_toolbox", RegistrateRecipeProvider.hasItem(AllItemTags.TOOLBOXES.tag)) + .save(p, Create.asResource("crafting/curiosities/" + c.getName() + "_from_main_toolbox")); }) .onRegisterAfter(Item.class, v -> TooltipHelper.referTo(v, "block.create.toolbox")) .tag(AllBlockTags.TOOLBOXES.tag) diff --git a/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxScreen.java b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxScreen.java index f2e3ab3ea..a6ecd7889 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxScreen.java +++ b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxScreen.java @@ -53,7 +53,8 @@ public class ToolboxScreen extends AbstractSimiContainerScreen widgets.add(disposeButton); color = menu.contentHolder.getColor(); - extraAreas = ImmutableList.of(new Rectangle2d(118, 155, 80, 100), new Rectangle2d(308, 125, 100, 70)); + extraAreas = ImmutableList.of(new Rectangle2d(getGuiLeft() + -28, getGuiTop() + 141, 80, 100), + new Rectangle2d(getGuiLeft() + 162, getGuiTop() + 111, 100, 70)); } @Override @@ -114,7 +115,7 @@ public class ToolboxScreen extends AbstractSimiContainerScreen private void renderToolbox(MatrixStack ms, int mouseX, int mouseY, float partialTicks) { ms.pushPose(); - ms.translate(397, 190, 100); + ms.translate(leftPos + 247, topPos + 180, 100); MatrixTransformStack.of(ms) .scale(50) .rotateX(-22) diff --git a/src/main/java/com/simibubi/create/foundation/data/CreateRegistrate.java b/src/main/java/com/simibubi/create/foundation/data/CreateRegistrate.java index 8f7490658..f5427fb4a 100644 --- a/src/main/java/com/simibubi/create/foundation/data/CreateRegistrate.java +++ b/src/main/java/com/simibubi/create/foundation/data/CreateRegistrate.java @@ -218,19 +218,22 @@ public class CreateRegistrate extends AbstractRegistrate { public static NonNullUnaryOperator> customRenderedItem( Supplier>> supplier) { - return b -> b.properties(p -> p.setISTER(() -> () -> supplier.get().get())) - .onRegister(entry -> onClient(() -> () -> { - ItemStackTileEntityRenderer ister = entry.getItemStackTileEntityRenderer(); - if (ister instanceof CustomRenderedItemModelRenderer) { - registerCustomRenderedItem(entry, (CustomRenderedItemModelRenderer) ister); - } - })); + return b -> b.properties(p -> p.setISTER(() -> () -> supplier.get() + .get())) + .onRegister(entry -> onClient(() -> () -> registerCustomRenderedItem(entry))); } protected static void onClient(Supplier toRun) { DistExecutor.unsafeRunWhenOn(Dist.CLIENT, toRun); } + @OnlyIn(Dist.CLIENT) + private static void registerCustomRenderedItem(Item entry) { + ItemStackTileEntityRenderer ister = entry.getItemStackTileEntityRenderer(); + if (ister instanceof CustomRenderedItemModelRenderer) + registerCustomRenderedItem(entry, (CustomRenderedItemModelRenderer) ister); + } + @OnlyIn(Dist.CLIENT) private static void registerCTBehviour(Block entry, ConnectedTextureBehaviour behavior) { CreateClient.MODEL_SWAPPER.getCustomBlockModels()