Chunk Loaders

Chunk Loaders

5M Downloads

[Bug] Create contraptions being able to be move chunkloaders

studkid opened this issue ยท 1 comments

commented

Version Info

  • Minecraft, 1.20.1
  • Chunk Loaders, v1.2.7

Are you using OptiFine?: no

Description of the Bug
Create is allowed to move chunkloaders via contraptions. This causes a major issue of allowing chunks to stay loaded regardless of the existence of the chunkloader block and will only fix itself if a chunkloaders to placed on the same tile the original was placed.

Adding the tag create:non_movable if Create is found to be loaded would fix this issue.

Steps to Reproduce

  1. Attach a chunkloader to any moving contraption via super glue
  2. Active the contraption to move it to a different location
  3. Remove the chunkloader
  4. The chunks in the original radius are still available to be loaded

Screenshots

Cart.Contraption.mp4
Mechanical.Piston.mp4
commented

Seems Create doesn't notify blocks that they are being removed to avoid things like chests dropping their contents. However, this also means the chunk loaders are not notified and thus the chunk loading manager thingy thinks they are still there.

There is a method for block entities called setRemoved which Create does call, however that method also just gets called whenever a chunk is unloaded.
I now added a workaround which queues a task for 1 tick later whenever setRemoved is called. The task then checks if the area is still loaded and if so, if the chunk loader block is still there. If not, it will notify the chunk loading manager of it.

The change is available in Chunk Loaders version 1.0.8, so moving Chunk Loaders should now work fine. I have not blacklisted the chunk loaders in the create:non_movable tag as I don't think that's necessary.
Thank you for reporting the issue!