Commit Graph

1 Commits

Author SHA1 Message Date
Aikar
5ef5f3b67b
Optimize Server World Map
Minecraft moved worlds to a hashmap in 1.13.1.
This creates inconsistent order for iteration of the map.

This patch restores World management to be back as an Array.

.values() will allow us to iterate as it was pre 1.13.1 by
ArrayList, giving consistent ordering and effecient iteration performance.

KeySet and EntrySet iteration is proxied to the List iterator,
and should retain manipulation behavior but nothing should be doing that.

Getting a World by dimension ID is now back a constant time operation.

Hopefully no other plugins try to mess with this map, as we are only handling
known NMS used methods, but we can add more if naughty plugins are found later.

Multiverse was tested with this and no breakage.
2018-09-18 01:34:44 -04:00