diff --git a/Plan/bukkit/src/main/java/com/djrapitops/plan/system/listeners/bukkit/AFKListener.java b/Plan/bukkit/src/main/java/com/djrapitops/plan/system/listeners/bukkit/AFKListener.java index 76de01411..3ad918ca0 100644 --- a/Plan/bukkit/src/main/java/com/djrapitops/plan/system/listeners/bukkit/AFKListener.java +++ b/Plan/bukkit/src/main/java/com/djrapitops/plan/system/listeners/bukkit/AFKListener.java @@ -25,10 +25,7 @@ import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; -import org.bukkit.event.player.AsyncPlayerChatEvent; -import org.bukkit.event.player.PlayerCommandPreprocessEvent; -import org.bukkit.event.player.PlayerEvent; -import org.bukkit.event.player.PlayerMoveEvent; +import org.bukkit.event.player.*; import javax.inject.Inject; import java.util.HashMap; @@ -109,4 +106,9 @@ public class AFKListener implements Listener { } } + @EventHandler(priority = EventPriority.MONITOR) + public void onLeave(PlayerQuitEvent event) { + ignorePermissionInfo.remove(event.getPlayer().getUniqueId()); + } + } \ No newline at end of file diff --git a/Plan/sponge/src/main/java/com/djrapitops/plan/system/listeners/sponge/SpongeAFKListener.java b/Plan/sponge/src/main/java/com/djrapitops/plan/system/listeners/sponge/SpongeAFKListener.java index bc1a60927..9f5c3c8b6 100644 --- a/Plan/sponge/src/main/java/com/djrapitops/plan/system/listeners/sponge/SpongeAFKListener.java +++ b/Plan/sponge/src/main/java/com/djrapitops/plan/system/listeners/sponge/SpongeAFKListener.java @@ -30,6 +30,7 @@ import org.spongepowered.api.event.entity.living.humanoid.player.PlayerChangeCli import org.spongepowered.api.event.entity.living.humanoid.player.TargetPlayerEvent; import org.spongepowered.api.event.filter.cause.First; import org.spongepowered.api.event.message.MessageChannelEvent; +import org.spongepowered.api.event.network.ClientConnectionEvent; import javax.inject.Inject; import java.util.HashMap; @@ -118,4 +119,8 @@ public class SpongeAFKListener { event(event); } + @Listener(order = Order.POST) + public void onLeave(ClientConnectionEvent.Disconnect event) { + ignorePermissionInfo.remove(event.getTargetEntity().getUniqueId()); + } } \ No newline at end of file