Create

Create

86M Downloads

Train Signals fail to remove themselves from track graph when broken

techno-sam opened this issue ยท 1 comments

commented

Describe the Bug

When a Train Signal is placed on a track, and subsequently broken, the track graph remains split into separate signal blocks, as indicated by the multiple colors on a track while holding a Train Signal.
Furthermore, attempting to place a different track targeting block, like the Train Station, on the same track block will display the error "Targeted track is occupied."

Additionally, on saving and reloading the world, this persists, indicating that it is not a client/network sync issue.

Reproduction Steps

  1. Place down a track, several blocks long.
  2. Hold a train signal, notice that a single color line appears through the track, indicating a single signal block.
  3. Place the track signal on the track, and notice that there are now two lines, of different colors, indicating two signal blocks
  4. Break the track signal, and hold a track signal. Notice that there are still two lines of different colors, indicating two signal blocks. You can confirm this by executing /create trains and noting that the graph will still be listed as having '1 Signals.'
  5. Break a block of the track, and replace it. Hold a train signal, and note that there is now only one colored line, indicating that it has been restored to consisting of only one signal block.

Expected Result

I would expect that the signal edge point would be removed from the track graph when the Train Signal block is broken.

Screenshots and Videos

Before placing a signal:
2022-12-26_13 58 08

After placing a signal:
2022-12-26_13 58 24

After breaking the signal:
2022-12-26_13 59 09

After breaking and replacing a track block:
2022-12-26_13 59 40

Output from /create trains (note that the relevant network is id 68a73):
Screenshot from 2022-12-26 13-59-25

Crash Report or Log

N/A

Operating System

Ubuntu 22.04

Mod Version

0.5.0g

Minecraft Version

1.19.2

Forge Version

43.1.52

Other Mods

None

Additional Context

This is caused because com.simibubi.create.content.logistics.trains.management.edgePoint.signal.SignalBlock does not call ITE.onRemove in its onRemove method (in fact, it doesn't overwride the onRemove method at all).

The issue can be fixed by adding the following code to SignalBlock:

	@Override
	public void onRemove(BlockState pState, Level pLevel, BlockPos pPos, BlockState pNewState, boolean pIsMoving) {
		ITE.onRemove(pState, pLevel, pPos, pNewState);
	}
commented

This was fixed long ago, closing.