package dev.micle.loginprotection.events.common;

import dev.micle.loginprotection.data.ProtectedPlayerManager;
import net.minecraft.world.entity.player.Player;
import net.minecraftforge.event.entity.player.PlayerEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;

public class OnPlayerLeaveEventHandler {
    @SubscribeEvent
    public void PlayerLeaveEvent(PlayerEvent.PlayerLoggedOutEvent event) {
        if (!(event.getEntity() instanceof Player player)) {
            return;
        }

        ProtectedPlayerManager.removePlayer(player.getUUID());
    }
}
