CC: Tweaked turtles cannot be carried
SquidDev opened this issue · 5 comments
Expected Behavior
One may pick up and place down a turtle as normal.
Actual Behavior
Turtles from ComputerCraft/CC:Tweaked can be picked up correctly. However, when placed at a different position, the tile thinks has a cached block state of air, which causes crashes and/or rendering issues.
The problem here is that turtles read the block state when NBT is read (yes, they shouldn't, but that's a whole 'nother issue). However, as deserializeNBT
is called with an incorrect position, the block state will be wrong. Moreover, as TileEnity
's block states are cached, even after setPos
is called, TileEntity.getBlockState()
will continue to be incorrect.
Steps to Reproduce
- Pick up a turtle
- Place it down somewhere else
Version of Minecraft, Carry On, Forge
- Forge 1.15.2-31.2.47
- Carry On 1.15.2-1.13.2
- CC: Tweaked 1.15.2-1.95.0
This should still happen on 1.16.4 as the code is largely the same in both mods.
Screenshots encouraged
A video can be found on the CC:T issue tracker - cc-tweaked/CC-Tweaked#643.
I think the cleanest solution here would be for Carry On to patch the position NBT before calling deserializeNBT
, rather than calling setPos
afterwards.
Obviously there's some cleanup which needs to be done on CC:T's end, but I think these changes are worth making anyway - I'm sure there's other mods doing the same silly things.
This has been fixed on the next 1.16.5 release, but I'm not sure if I will be backporting this to 1.15, because not many people seem to play on that version anymore.
If the diff is easy to backport, and you're still supporting 1.15 then yes. Don't go out of your way to do it though :).