Create

Create

86M Downloads

IndexOutOfBoundsException when applying invalid train schedule with computercraft

Aquaxoc opened this issue · 9 comments

commented

Context

Hi,

I tried to apply this schedule with zero entries {cyclic = false,entries = {}} using computercraft and my game instantly crashed with an IndexOutOfBoundsException.
I cannot log into my world anymore, as I get the same crash every time.

Maybe "empty" schedules cannot be set to trains, but somehow computercraft allow it.
This would require create to either remove the "empty" schedule from the train if it is invalid (eg. has zero entries), and/or to check that the schedule we're trying to set to the train using a computer is valid.

(I wonder how I'm going to recover my world because my last backup was several days ago)

Crash Report

https://mclo.gs/FLAA66c

commented

update steam n rails

commented

update steam n rails

Sorry i'm already using steam n rails 1.6.4 for Minecraft 1.20.1. Is there an update I'm not seeing on modrinth/curse or should I just compile it ?

Try compiling it, this issue should already be fixed

commented

update steam n rails

Sorry i'm already using steam n rails 1.6.4 for Minecraft 1.20.1. Is there an update I'm not seeing on modrinth/curse or should I just compile it ?

commented

I believe that the ability to get a world into this state got fixed by c013173?

As to get your world back, you’ll probably need to use something like NBTExplorer to open data/create_tracks.dat, find the train with an empty schedule and remove the schedule (or the train in its entirety) (make a backup of course), as the faulty data is already saved.

commented

I'm still having the crash on a clean minecraft instance with only Create, Steam n rails "1.6.5" (compiled from branch 1.20/dev commit 5462606) and CC:Tweaked.
Every time I call setSchedule({}) or setSchedule({cyclic = false,entries = {}}) it crashes and the world needs a NBT fix to work again.

commented

This should be fixed by Layers-of-Railways/Railway@cbaf1cc not sure why it isn't, open a issue on the steam 'n' rails github

commented

I mean, the error still occurs when I don't even have Steam n rails. It might not be related to it.

commented

I mean, the error still occurs when I don't even have Steam n rails. It might not be related to it.

I'm that case send the log of when it crashes with just create + cc tweaked

commented

Alright, I compiled create (commit 1e2289f from branch mc1.20.1/dev) and the issue is indeed fixed.
I thought 0.5.1.f included the fix, sorry. So I guess the issue will be fixed for Create 0.5.1.g.