18 lines
708 B
Java
Executable File
18 lines
708 B
Java
Executable File
package com.micle.loginprotection.events;
|
|
|
|
import com.micle.loginprotection.LoginProtection;
|
|
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)) { return; }
|
|
Player player = (Player) event.getEntity();
|
|
|
|
LoginProtection.protected_players.addPlayer(player.getUUID());
|
|
System.out.println(player.getUUID() + " (" + player.getDisplayName().getString() + ") is being protected!");
|
|
}
|
|
}
|