Skip to content

Commit f1d9cec

Browse files
committed
Small improvement.
1 parent 2d052e5 commit f1d9cec

File tree

1 file changed

+15
-0
lines changed
  • multiblocks/src/main/java/sunsetsatellite/catalyst/multiblocks

1 file changed

+15
-0
lines changed

multiblocks/src/main/java/sunsetsatellite/catalyst/multiblocks/Multiblock.java

+15
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,19 @@ public boolean isValidAt(World world, BlockInstance origin, Direction dir){
3939
return true;
4040
}
4141

42+
public boolean isValidAtSilent(World world, BlockInstance origin, Direction dir){
43+
dir = Direction.Z_POS;
44+
ArrayList<BlockInstance> blocks = getBlocks(origin.pos,dir);
45+
ArrayList<BlockInstance> substitutions = getSubstitutions(origin.pos,dir);
46+
for (BlockInstance block : blocks) {
47+
if (!block.exists(world)) {
48+
boolean foundSub = substitutions.stream().anyMatch((BI) -> BI.pos.equals(block.pos) && BI.exists(world));
49+
if (!foundSub) {
50+
return false;
51+
}
52+
}
53+
}
54+
return true;
55+
}
56+
4257
}

0 commit comments

Comments
 (0)