From 3f469e18b2c19692a2f7c60a1fe3967f15a090a7 Mon Sep 17 00:00:00 2001 From: Swedz Date: Wed, 25 Sep 2024 22:10:21 -0400 Subject: [PATCH] Create shape matcher with separate method (#20) --- .../multiblock/BasicMultiblockMachineBlockEntity.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/swedz/tesseract/neoforge/compat/mi/machine/blockentity/multiblock/BasicMultiblockMachineBlockEntity.java b/src/main/java/net/swedz/tesseract/neoforge/compat/mi/machine/blockentity/multiblock/BasicMultiblockMachineBlockEntity.java index 8e86e0c8..08fc0c48 100644 --- a/src/main/java/net/swedz/tesseract/neoforge/compat/mi/machine/blockentity/multiblock/BasicMultiblockMachineBlockEntity.java +++ b/src/main/java/net/swedz/tesseract/neoforge/compat/mi/machine/blockentity/multiblock/BasicMultiblockMachineBlockEntity.java @@ -64,11 +64,16 @@ public void tick() this.link(); } + protected ShapeMatcher createShapeMatcher() + { + return new ShapeMatcher(level, worldPosition, orientation.facingDirection, this.getActiveShape()); + } + protected void link() { if(shapeMatcher == null) { - shapeMatcher = new ShapeMatcher(level, worldPosition, orientation.facingDirection, this.getActiveShape()); + shapeMatcher = this.createShapeMatcher(); shapeMatcher.registerListeners(level); this.onLink(shapeMatcher);