From 4e6c3586d92738ea2e4d6d322ffd3d33dd4162bc Mon Sep 17 00:00:00 2001 From: trinsdar <30245301+Trinsdar@users.noreply.github.com> Date: Mon, 11 Dec 2023 19:21:15 -0500 Subject: [PATCH] fixed hatch texture blocks not getting setwhen using custom IHatchStructurePredicate --- .../antimatter/structure/AntimatterStructureUtility.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/common/src/main/java/muramasa/antimatter/structure/AntimatterStructureUtility.java b/common/src/main/java/muramasa/antimatter/structure/AntimatterStructureUtility.java index 18099bb50..fbec30eaf 100644 --- a/common/src/main/java/muramasa/antimatter/structure/AntimatterStructureUtility.java +++ b/common/src/main/java/muramasa/antimatter/structure/AntimatterStructureUtility.java @@ -16,9 +16,6 @@ public class AntimatterStructureUtility { public static > IStructureElement ofHatch(HatchMachine machine){ return ofHatch(machine, (t, world, pos, machine1, handler) -> { t.addComponent(machine1.getId(), handler); - if (world.getBlockEntity(pos) instanceof BlockEntityHatch hatch) { - hatch.setTextureBlock(t.getHatchBlock(pos)); - } return true; }); } @@ -44,7 +41,11 @@ public boolean check(T t, Level world, int x, int y, int z) { if (component.getComponentHandler().isPresent()) { IComponentHandler componentHandler = component.getComponentHandler().orElse(null); if (machine.getId().equals(componentHandler.getId())) { - return callback.test(t, world, pos, machine, componentHandler); + boolean test = callback.test(t, world, pos, machine, componentHandler); + if (test && world.getBlockEntity(pos) instanceof BlockEntityHatch hatch) { + hatch.setTextureBlock(t.getHatchBlock(pos)); + } + return test; } return false; }