#TheJimmyJ57 8993 JonsStuff 8658 Please
1 messages · Page 1 of 1 (latest)
Alr got a thread here
Yeah so using v1.19.4 of spigot-api. I can't seem to get the persistentDataContainer from a sign
alrighty, please paste the whole class where you try to use getPersistentDataContainer()
?paste
no, thank you! haha
yeah you are suppoed to import "org.bukkit.block.Sign"
change line 8 to "import org.bukkit.block.Sign"
Okay good to know. Thank you!
are you using maven?
Yup
please paste your pom.xml file
No
looks like you have the old spigot version in your pom, that's why your IDE shows you the wrong imports
The one you used is for block data
ooh ok
It suggested two imports and I just chose the wrong one
It works now with the correct one 🙂
does it also work ingame?
Will let you know shortly when I build it
But it has been working fine if thats what you mean
alrighty. if not, the issue is that you're confusing BlockData with BlockStates - but that's an easy fix
so yeah just try it out, and if it doesn't work, let us know
Doesn’t help that Spigot has them reversed
BlockData handles what Mojang calls the states of blocks
And BlockState is what Mojang calls IBlockData
I got a follow up question. So I am setting some PDC data to the block during a SignChangeEvent. But then in a PlayerInteractEvent on that sign I can't retrieve the same PersistentDataContainer data. Thoughts?
You may have to delay the update call 1 tick in the sign change event
I can try that. But I think it might lose them when it runs the getstate cast to Sign. See here https://paste.md-5.net/bozominiso.cpp. The sign2 that tries to retrieve the keys right after they were set doesn't return anything. If I do sign#getPersistentDataContainer() from the same object it works tho