Skip to content

Commit

Permalink
fix RailPlacement not powering rails
Browse files Browse the repository at this point in the history
  • Loading branch information
2No2Name committed Jul 20, 2023
1 parent 67dad8e commit c1d412d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ private void cancelUpdates(BlockState state, World world, BlockPos pos, BlockSta
BlockPos noUpdatePos = NO_CONNECT_POS.get();
if (pos.equals(noUpdatePos)) {
ci.cancel();
if (this.forbidCurves) {
world.updateNeighbor(state, pos, this, pos, notify);
}
}

if (noUpdatePos != null) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package mendedminecarts.mixin.placement;

import net.minecraft.block.AbstractRailBlock;
import net.minecraft.block.BlockState;
import net.minecraft.block.DetectorRailBlock;
import net.minecraft.util.math.BlockPos;
Expand All @@ -13,7 +14,11 @@
import static mendedminecarts.RailPlacementHelper.NO_CONNECT_POS;

@Mixin(DetectorRailBlock.class)
public abstract class DetectorRailBlockMixin {
public abstract class DetectorRailBlockMixin extends AbstractRailBlock {

protected DetectorRailBlockMixin(boolean forbidCurves, Settings settings) {
super(forbidCurves, settings);
}

@Shadow protected abstract void updatePoweredStatus(World world, BlockPos pos, BlockState state);

Expand All @@ -24,6 +29,7 @@ private void cancelUpdates(BlockState state, World world, BlockPos pos, BlockSta
BlockPos noUpdatePos = NO_CONNECT_POS.get();
if (pos.equals(noUpdatePos)) {
ci.cancel();
world.updateNeighbor(state, pos, this, pos, notify);
this.updatePoweredStatus(world, pos, state);
}

Expand Down

0 comments on commit c1d412d

Please sign in to comment.