Does sponge keep an internal list of entities contained in a chunk or does it simply do a distance check on all entities in the world when using Chunk.getEntities()? The same can be asked about Player.getNearbyEntities() (simply a distance check in O(n) time where n is ALL entities?).
Want to know the best way to retrieve entities (i.e. if I should implement my own system or if sponge already keeps internal lists in some classes) (I guess the “best” way is to directly use the UUID since it’s probably implemented using a hashset, but that isn’t an option in my scenario).