friendlyhj / ZenUtils

https://www.curseforge.com/minecraft/mc-mods/zenutil
MIT License
19 stars 8 forks source link

[Feature Request] Check if block is in loaded chunk #27

Closed Krutoy242 closed 1 year ago

Krutoy242 commented 1 year ago

Using CraftTweaker and ZenUtils I made Portal Spread mechanic.

When portal is spawned, it saved with setCustomWorldData(). Then I iterate all portals in onWorldTick event.

https://github.com/friendlyhj/ZenUtils/assets/936618/8269985d-15e3-4890-a3eb-502891566044

The problem is that CraftTweaker's functions always load chunks for calls like world.getBlockState(). So, each time i want to tick the portal, it would call getBlockState and actually work as chunk loader.

Please, add function to check if block is in loaded chunk.

With such function I could check if portal is in loaded chunk and tick it only if loaded.

friendlyhj commented 1 year ago

Added in CraftTweaker/CraftTweaker#1685

Krutoy242 commented 1 year ago

Incredible! 😲