Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ protected BlockCutoffSwitchBase(String registryName)
setResistance(15.0f);
setDefaultState(blockState.getBaseState()
.withProperty(FACING, EnumFacing.NORTH)
.withProperty(ACTIVE, false));
.withProperty(ACTIVE, true));
RealGridRegistry.registerBlock(this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ public void applyStateChange() {

// Secondary render guarantee using non-IE-reserved event IDs.
world.addBlockEvent(getPos(), getBlockType(),
active ? EVENT_OPEN : EVENT_CLOSE, 0);
active ? EVENT_CLOSE : EVENT_OPEN, 0);
}
} finally {
stateChanging = false;
Expand Down Expand Up @@ -352,7 +352,7 @@ public boolean hammerUseSide(EnumFacing side, EntityPlayer player,
@Override
public boolean receiveClientEvent(int id, int arg) {
if (id == EVENT_OPEN || id == EVENT_CLOSE) {
this.active = (id == EVENT_OPEN);
this.active = (id == EVENT_CLOSE);
if (world != null) {
world.markBlockRangeForRenderUpdate(pos, pos);
}
Expand All @@ -366,7 +366,12 @@ public boolean receiveClientEvent(int id, int arg) {
// -----------------------------------------------------------------------

public boolean isRedstonePowered() {
// Only poll the four faces that are NOT the switch's output faces (facing /
// facing.getOpposite()). Polling those two faces reads back the switch's own
// redstone output (canProvidePower=true), creating a feedback loop that forces
// the switch permanently open on every tick.
for (EnumFacing side : EnumFacing.VALUES) {
if (side == facing || side == facing.getOpposite()) continue;
if (world.getRedstonePower(pos.offset(side), side) > 0) return true;
}
return false;
Expand Down