IEntity update(Idata) updates ForgeData not NBT data.
unnecessarymb opened this issue ยท 6 comments
Issue description
The nbt setter, setNBT method, and update method of IEntity sets the ForgeData, not the nbt data as expected.
Steps to reproduce
The example script is supposed to keep the Ender Dragon locked into it's perch behavior. However, it merely adds data to the ForgeData and lets it despawn. You may test this by summoning the Ender Dragon.
Script used
https://gist.github.com/unnecessarymb/0af6827b5d36547b78fa0a845986536f
The crafttweaker.log file
https://gist.github.com/unnecessarymb/ff8f1662e33755dca25dfc0624b84c32
Minecraft version
1.12
Modloader
Forge
Modloader version
14.23.5.2859
CraftTweaker version
1.12-4.1.20.693
Other relevant information
No response
The latest.log file
https://gist.github.com/unnecessarymb/81f295b0f212af73fd7d487e58b088c3
1.12.2 is currently in a "If someone else makes the PR, I'll merge and release" state, so unfortunately I don't know how long you will be waiting for a solution.
I think a good "solution" to this though, would be adding another method that is like setEntityNBT
or similar, as changing the current method would be a breaking change.
Unfortunately, I don't know Java that well, or I would have prepared a fix myself. I remember spending eight hours getting Gradle to work and figuring out Git and everything just to submit a one line fix to another repository on my highschool GitHub account. Whereas here, I have no idea where to even begin...
I'll take a stab at a fix. I'll attempt to add a mergeNBT
method, which is sufficient for all usecases.
I couldn't get gradle to work. It keeps trying to draw resources using "http://" and minecraft.net doesn't like that.
I added it to my CrT addon before (why I didn't post a PR)
https://github.com/friendlyhj/ZenUtils/wiki/ZenUtilsEntity