SilkSpawners

SilkSpawners

3M Downloads

1.18 world/ 1.18 world height cause spawner to be invalid (and become pig)

hkkongou opened this issue · 7 comments

commented

What steps will reproduce the problem?

place spawner in 1.18 worlds
or place spawner in world thats is originally 1.18 below, but upgraded to 1.18, at location y>255 or y<0

Expected output

spawner placed normal

What do you see instead?

placing default spawner message is showing in each placement, the spawner turns into pig.

video:
https://youtu.be/jzKZBy__MnU

at start, is in 1.17.1->1.18.1 upgraded world, placing between 255~
at the end, that world is a 1.18.1 world

Log file of the issue/error

no error

/version output?

[14:34:51 INFO]: This server is running Paper version git-Paper-151 (MC: 1.18.1) (Implementing API version 1.18.1-R0.1-SNAPSHOT) (Git: 6663747)
You are 1 version(s) behind
Download the new version at: https://papermc.io/downloads
Previous version: git-Paper-407 (MC: 1.17.1)

SilkSpawners version

SilkSpawners#263 or 7.2.0

Please provide any additional information below.

Checklist

  • [✅] I am aware that issues caused by /reload are ignored
  • [✅] If there is a (potential) plugin conflict, I've identified the conflicting plugin
  • [✅] I have added a valid /version output
  • [✅] I have added a valid SilkSpawners version
  • [✅] I have attached necessary information like a screenshot, my list of plugins, config or permissions file(s)
commented

kinda sad that after a month there is still no updates...

i tried with other plugin support mining spawner in 1.18 such as wildstacker, which works normally, so even if is vanilla bug , it should be able to avoid or fix

commented

I am having the same issue too, some spawners are turning into pig

commented

I'm afraid this sounds like a Vanilla bug

commented

Thanks for the debugging @t00thpick1
Have you tried to v7.3.0? I've added the proper NBT path in 42a9fc0 and look in both places.

If Vanilla does not upgrade old spawners correctly this needs to be reported to Mojang, too.

commented

@timbru31 Ok: I dug down to find the cause of this bug.

Bug Summary:
In 1.17 the NBT structure for SpawnData was "SpawnData.ID", but in 1.18 its "SpawnData.Entity.ID". The spawner items do not seem to have auto-upgraded with the world.
Reproduction Steps:

  • This bug occurs with Spawners that were mined/spawned in 1.17 (or lower)
  • The bug is occurs when the spawner item is converted into a spawner block during NBT serialization/deserialization, as shown by the error messages in console:

7:57:36 PM CONSOLE:WARN]: Invalid SpawnData: No key entity in MapLike[{id:"minecraft:magma_cube"}]
7:57:36 PM CONSOLE:WARN]: Invalid SpawnData: No key entity in MapLike[{id:"minecraft:magma_cube"}]

Proposed Solution: Automatically fix old SpawnData NBT tags in items.

commented

@timbru31 I am using v7.3.0, which is why spawners mined/spawned in 1.18 work. But the old spawners still have the old NBT, which you do properly read (so the boss bar description and such are correct) but because it is never re-written, when it is placed it creates a block with the old NBT as well, and this is what causes the pig reversion. You could fix this by adding a correction in say onPlayerHoldItem() that detects the old NBT and upgrades it.

commented

I think its wrong to consider this a vanilla bug as there is no supported method in vanilla minecraft to obtain spawner items. (Specifying NBT in a command is not considered supported). Rather it is the responsibility of the plugin that made the now-incorrect spawner items in the first place (i.e. silkspawners) to ensure they continue working in new versions.