Skip to content

Commit

Permalink
fixed virtual connection not actually being set
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinsdar committed Oct 19, 2023
1 parent 06a2896 commit b8cd135
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,17 @@ public boolean isConnector() {

public void onBlockUpdate(BlockPos neighbor) {
Direction facing = Utils.getOffsetFacing(this.getBlockPos(), neighbor);
if (canConnect(facing.get3DDataValue())){
if (level != null && level.isLoaded(this.getBlockPos()) && canConnect(facing.get3DDataValue())){
BlockEntityPipe<?> pipe = getPipe(neighbor);
if (pipe == null){
if (Connectivity.has(virtualConnection, facing.get3DDataValue())){
if (!validate(facing)){
Connectivity.clear(virtualConnection, facing.get3DDataValue());
virtualConnection = Connectivity.clear(virtualConnection, facing.get3DDataValue());
refreshConnection();
}
} else {
if (validate(facing)){
Connectivity.set(virtualConnection, facing.get3DDataValue());
virtualConnection = Connectivity.set(virtualConnection, facing.get3DDataValue());
refreshConnection();
}
}
Expand Down

0 comments on commit b8cd135

Please sign in to comment.