Create: Steam 'n' Rails

Create: Steam 'n' Rails

20M Downloads

Train name keeps getting added "Split off from:" when decoupling leading to a fatal crash when the string overflows

d-513 opened this issue · 3 comments

commented

Describe the Bug

Train name keeps getting added "Split off from:" when decoupling leading to a fatal crash when the string overflows the max character limit

This has also the effect of not being able to read the train coupling block's tooltip as the train's name doesn't fit on the screen.

Reproduction Steps

  1. Create a train
  2. Make any kind of automated system that will decouple cars using the coupler blocks (e.g sending a redstone link signal via train schedule to a redstone link next to a decoupling block). Get a chunk loader so the signal works even when no one is playing.
  3. Every time it's decoupled and recoupled, a "Split off from: " is added to the front of the train's name.
  4. Keep it running for a couple of days, server will crash due to overflow

Expected Result

"Split off from:" being removed when recoupling, or using a randomly generated string to identify the split off's
A config option to disable the renaming would be fine as well.

Screenshots and Videos

Screenshot_20240321_102449
My station coupling setup:

Screenshot_20240321_102438

Crash Report or Log

https://mclo.gs/OhinZt3

Operating System

Debian 12

Mod Version

1.5.3

Create Mod Version

0.5.1f

Minecraft Version

1.20.1

ModLoader and Version

Forge

Other Mods

image

Additional Context

It attempts that an attempt was made to remedy this issue, however it proved insufficient

train.doubleEnded = train.carriages.stream().anyMatch(carriage -> carriage.anyAvailableEntity().getContraption() i>
        if(!train.name.getString().contains("Split off from: ")){
            newTrain.name = Components.literal("Split off from: "+train.name.getString());
        }
        else newTrain.name = Components.literal(train.name.getString());

This condition should prevent this from happening, but it does not. There must be an issue here or somewhere else in the code.

FIX FOR WORLD BROKEN BY THIS
Warning: probably will not give you back the shedule, have a backup

  1. Download world/data/create_tracks.dat
  2. Open nbt editor e.g https://irath96.github.io/webNBT/
  3. Edit the train name to something that doesn't overflow
commented

This should be fixed by 48d26db already

commented

This should be fixed by 48d26db already

Yes, I saw the code, but the issue hasn’t been fixed. I have steam and rails 1.5.3

edit: unless that hasn’t been in the release yet

commented

This should be fixed by 48d26db already

Yes, I saw the code, but the issue hasn’t been fixed. I have steam and rails 1.5.3

edit: unless that hasn’t been in the release yet

Correct, it's scheduled to be released in 1.6.0