Skip to content

Commit

Permalink
made pipes with only plate covers not get added as nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinsdar committed Nov 30, 2023
1 parent 31a6408 commit 53a9665
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import muramasa.antimatter.capability.*;
import muramasa.antimatter.capability.pipe.PipeCoverHandler;
import muramasa.antimatter.cover.CoverFactory;
import muramasa.antimatter.cover.CoverPlate;
import muramasa.antimatter.cover.ICover;
import muramasa.antimatter.gui.GuiData;
import muramasa.antimatter.gui.GuiInstance;
Expand Down Expand Up @@ -90,7 +91,14 @@ public Holder getPipeCapHolder() {
}

public boolean isConnector() {
return !this.getBlockState().getValue(BlockPipe.TICKING);
return !this.getBlockState().getValue(BlockPipe.TICKING) || this.coverHandler.map(p -> {
for (ICover cover : p.getAll()) {
if (cover.isNode()){
return false;
}
}
return true;
}).orElse(true);
}

public void onBlockUpdate(BlockPos neighbor) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,9 @@ public InteractionResult onInteract(Player player, InteractionHand hand, Directi
public <T> boolean blocksCapability(Class<T> cap, Direction side) {
return super.blocksCapability(cap, side) && !(source().getTile() instanceof BlockEntityPipe<?>);
}

@Override
public boolean isNode() {
return false;
}
}
3 changes: 3 additions & 0 deletions common/src/main/java/muramasa/antimatter/cover/ICover.java
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@ default boolean isEmpty() {
return this == empty;
}

default boolean isNode(){
return !isEmpty();
}

ICover empty = new ICover() {
@Override
Expand Down

0 comments on commit 53a9665

Please sign in to comment.