Sollace / Unicopia

The pony powers mod to power in your pony pony pony
https://modrinth.com/mod/unicopia
56 stars 22 forks source link

[Investigating] Server crash and player lockout when dispelling spell #274

Closed karcsesz closed 6 months ago

karcsesz commented 6 months ago

Hello there ^c^

@ryze312 recently ran into a pretty severe issue when trying to dispel a spell she cast as a unicorn on a server I've set up.

The entire server crashed with the following error log, and after it recovered, she could not rejoin due to invalid player data.

minecraft-1  | [21:20:28] [Server thread/ERROR]: Couldn't place player in world
minecraft-1  | net.minecraft.class_148: Loading entity NBT
[snip]
minecraft-1  | Caused by: java.lang.NullPointerException
minecraft-1  | at java.util.Objects.requireNonNull(Objects.java:208) ~[?:?]
minecraft-1  | at java.util.ImmutableCollections$List12.<init>(ImmutableCollections.java:556) ~[?:?]
minecraft-1  | at java.util.List.of(List.java:812) ~[?:?]
minecraft-1  | at com.minelittlepony.unicopia.ability.magic.spell.PlaceableSpell.getDelegates(PlaceableSpell.java:106) ~[Unicopia-1.3.0+1.20.2.jar:?]
minecraft-1  | at com.minelittlepony.unicopia.ability.magic.spell.AbstractDelegatingSpell.isDirty(AbstractDelegatingSpell.java:88) ~[Unicopia-1.3.0+1.20.2.jar:?]
minecraft-1  | at com.minelittlepony.unicopia.ability.magic.spell.SpellReference.hasDirtySpell(SpellReference.java:26) ~[Unicopia-1.3.0+1.20.2.jar:?]
minecraft-1  | at com.minelittlepony.unicopia.network.datasync.SpellNetworkedReference.isDirty(SpellNetworkedReference.java:46) ~[Unicopia-1.3.0+1.20.2.jar:?]
minecraft-1  | at com.minelittlepony.unicopia.network.datasync.SpellNetworkedReference.fromNbt(SpellNetworkedReference.java:35) ~[Unicopia-1.3.0+1.20.2.jar:?]
minecraft-1  | at com.minelittlepony.unicopia.network.datasync.NetworkedReferenceSet.lambda$fromNbt$5(NetworkedReferenceSet.java:122) ~[Unicopia-1.3.0+1.20.2.jar:?]
minecraft-1  | at java.util.ArrayList.forEach(ArrayList.java:1511) ~[?:?]
minecraft-1  | at com.minelittlepony.unicopia.network.datasync.NetworkedReferenceSet.fromNbt(NetworkedReferenceSet.java:120) ~[Unicopia-1.3.0+1.20.2.jar:?]
minecraft-1  | at com.minelittlepony.unicopia.network.datasync.EffectSync.fromNBT(EffectSync.java:191) ~[Unicopia-1.3.0+1.20.2.jar:?]
minecraft-1  | at com.minelittlepony.unicopia.entity.Living.fromNBT(Living.java:595) ~[Unicopia-1.3.0+1.20.2.jar:?]
minecraft-1  | at net.minecraft.class_1309.handler$bam001$unicopia$onReadCustomDataFromTag(class_1309.java:9358) ~[server-intermediary.jar:?]
[snip]

I've looked inside her player.dat and it seems like her character ended up with a spell under ./unicopia_caster/spells that has an empty spell collection.

Deleting that spell using NBTExplorer let her join, but casting it once again crashed the server and caused the same error when rejoining.

ryze312 commented 6 months ago

Looks like the crash only occurs when trying to dispel scorching from the graph view., the one that opens up when pressing V key by default. Dispelling by holding V works as expected.

Sollace commented 6 months ago

I'm already aware of this issue. It's been fixed in development and will be part of the 1.3.1 update once I can get to fixing a couple other bugs. ^-^