Use weakhashmap

This commit is contained in:
KennyTV 2019-05-21 19:02:03 +02:00
parent 5cc421cff9
commit 10d8ce86b3

View File

@ -45,7 +45,7 @@ public class PlayerSneakListener extends ViaBukkitListener {
// From 1.9 upwards the server hitbox is set in every entity tick, so we have to reset it everytime // From 1.9 upwards the server hitbox is set in every entity tick, so we have to reset it everytime
if (ProtocolRegistry.SERVER_PROTOCOL >= ProtocolVersion.v1_9.getId()) { if (ProtocolRegistry.SERVER_PROTOCOL >= ProtocolVersion.v1_9.getId()) {
sneaking = new HashMap<>(); sneaking = new WeakHashMap<>();
useCache = true; useCache = true;
plugin.getServer().getScheduler().runTaskTimer(plugin, new Runnable() { plugin.getServer().getScheduler().runTaskTimer(plugin, new Runnable() {
@Override @Override