TerraFirmaCraft

TerraFirmaCraft

2M Downloads

Crash due to alliums

JonJonsonsSon opened this issue ยท 5 comments

commented

https://pastebin.com/wgAQrqCf
This occurred after teleporting to another dimension, moving about 1.5k blocks away from my initial starting point, then teleporting back to the overworld. The two dimensions share a 1:1 spatial ratio, I.E. if you teleport from -100, 180, +100 in the overworld to the other dimension, you'll wind up at those same coordinates.

commented

Looks like getStateFromMeta is trying to set the dayperiod property to "-4" which is strange because it is pulling numbers from CalendarTFC that (I thought) should never be negative.

Here's the relevant code in BlockPlantTFC that splits the day into 4 equal dayperiods:
Math.floorDiv(CalendarTFC.getHourOfDay(), CalendarTFC.HOURS_IN_DAY / 4)

commented

Wait, that shouldn't be called in getStateFromMeta, no? That is only meant to load properties from disk. dayperiod should only be applied in getActualState

My guess is the calendar isn't synced properly while in the other dimension, and then when loading the overworld from disk it calls getStateFromMeta before the calendar is synced, thus getting a strange result.

commented

Ah. Well. I guess I'll remove that for my next PR. I had it in both places for some reason.

commented

Should be fixed by #44

commented

Closing as it should be fixed. If it persists in v0.2.2+, reopen this issue