Current implementation never removes player UUIDs from maps and uses Map for things that can be replaced with Set.
This PR replaced Map with Set (with weak set created via WeakHash, Java does not have native weak sets) and stores Player objects insteads of UUIDs which should be automatically cleaned when player is not online and Garbage Collector is running in any free time.
EDIT: Also players is removed manually on quit now, just to make it cooler.
Current implementation never removes player UUIDs from maps and uses
Map
for things that can be replaced withSet
. This PR replacedMap
withSet
(with weak set created viaWeakHash
, Java does not have native weak sets) and storesPlayer
objects insteads ofUUID
s which should be automatically cleaned when player is not online and Garbage Collector is running in any free time. EDIT: Also players is removed manually on quit now, just to make it cooler.