Entity Counting is flawed on large plots #4362
Labels
Approved
A project maintainer or developer has reproduced this issue
Bug
Something isn't working
Low Priority
Server Implementation
Paper
Server Version
1.20.4
Describe the bug
BukkitRegionManager#countEntities(Plot)
usesgetChunkAtAsync
to count entities on unloaded chunks. However, this is conceptually flawed, because the array is returned and used directly. Entity counts on unloaded chunks are therefore not respected in entity caps.This was discovered during #4356.
To Reproduce
Not easy to reproduce, as it requires a setup where entities are counted in a plot that has unloaded chunks. That's rather atypical.
Expected behaviour
The expected behavior is rather unclear. It might be fine to just ignore unloaded chunks (basically what's happening at the moment). Alternatively, a rework of the system is needed most likely, to allow including entities of unloaded chunks.
Screenshots / Videos
No response
Error log (if applicable)
No response
Plot Debugpaste
https://athion.net/ISPaster/paste/view/a9b1f24c31f542faac77c1b561359ef6
PlotSquared Version
PlotSquared version 7.3.4-SNAPSHOT
Checklist
Anything else?
No response
The text was updated successfully, but these errors were encountered: