Skip to content

Commit

Permalink
fixed hatch texture blocks not getting setwhen using custom IHatchStr…
Browse files Browse the repository at this point in the history
…ucturePredicate
  • Loading branch information
Trinsdar committed Dec 12, 2023
1 parent 768e828 commit 4e6c358
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ public class AntimatterStructureUtility {
public static <T extends BlockEntityBasicMultiMachine<T>> IStructureElement<T> 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;
});
}
Expand All @@ -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;
}
Expand Down

0 comments on commit 4e6c358

Please sign in to comment.