Skip to content

Commit

Permalink
Fix cable placement with commands initializing networks
Browse files Browse the repository at this point in the history
This was broken since CyclopsMC/IntegratedTunnels#243
  • Loading branch information
rubensworks committed Dec 6, 2024
1 parent 8a69ac9 commit 8a8d651
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
import org.cyclops.integrateddynamics.RegistryEntries;
import org.cyclops.integrateddynamics.api.block.IDynamicLight;
import org.cyclops.integrateddynamics.api.block.IDynamicRedstone;
import org.cyclops.integrateddynamics.api.block.cable.ICableFakeable;
import org.cyclops.integrateddynamics.api.part.IPartContainer;
import org.cyclops.integrateddynamics.api.part.IPartState;
import org.cyclops.integrateddynamics.api.part.IPartType;
Expand Down Expand Up @@ -264,8 +265,11 @@ public InteractionResult use(BlockState state, Level world, BlockPos pos, Player
@Override
public void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean isMoving) {
super.onPlace(state, world, pos, oldState, isMoving);
if (!world.isClientSide() && !state.hasBlockEntity()) {
CableHelpers.onCableAdded(world, pos);
if (!world.isClientSide()) {
ICableFakeable cableFakeable = CableHelpers.getCableFakeable(world, pos, null).orElse(null);
if (cableFakeable != null && cableFakeable.isRealCable()) {
CableHelpers.onCableAdded(world, pos);
}
}
}

Expand Down

0 comments on commit 8a8d651

Please sign in to comment.