Skip to content

Commit

Permalink
fix: wires connecting to frame motor front face
Browse files Browse the repository at this point in the history
  • Loading branch information
MrTJP committed May 10, 2024
1 parent f8c29db commit 8a7c1ef
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,13 @@ default boolean canOrient() {

default void rotateBlock() {
setRotation((getRotation() + 1) % 4);
onOrientationChange();
}

default void orientBlock() {
setSide((getSide() + 1) % 6);
onOrientationChange();
}

void onOrientationChange();
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import codechicken.multipart.api.RedstoneInteractions;
import codechicken.multipart.api.tile.RedstoneConnector;
import mrtjp.projectred.api.Frame;
import mrtjp.projectred.api.IConnectable;
import mrtjp.projectred.api.MovementDescriptor;
import mrtjp.projectred.api.ProjectRedAPI;
import mrtjp.projectred.core.block.ProjectRedBlock;
Expand Down Expand Up @@ -109,6 +110,19 @@ public void onNeighborBlockChanged(BlockPos neighborPos) {
}
}

@Override
public void onOrientationChange() {
if (!getLevel().isClientSide) {
updateExternals();
}
}

@Override
public boolean canConnectPart(IConnectable part, int s, int edgeRot) {
// Dont allow power wires on front side. Redstone is handled by getConnectionMask
return s != getFrontSide() && super.canConnectPart(part, s, edgeRot);
}

@Override
public BlockState storeBlockState(BlockState defaultState) {
return super.storeBlockState(defaultState)
Expand Down

0 comments on commit 8a7c1ef

Please sign in to comment.