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 OnPlayerJoinEventHandler {
    @SubscribeEvent
    public void EntityJoinWorldEvent(PlayerEvent.PlayerLoggedInEvent event) {
        if (!(event.getEntity() instanceof Player player)) {
            return;
        }

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