Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
hkkongou opened this issue Jan 14, 2022 · 7 comments
Open

Comments

@hkkongou
Copy link

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)
@DarrylSSY
Copy link

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

@timbru31
Copy link
Owner

I'm afraid this sounds like a Vanilla bug

@hkkongou
Copy link
Author

hkkongou commented Feb 21, 2022

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

@t00thpick1
Copy link

t00thpick1 commented Mar 29, 2022

@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.

@timbru31
Copy link
Owner

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.

@t00thpick1
Copy link

t00thpick1 commented Mar 29, 2022

@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.

@t00thpick1
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants