First commit

This commit is contained in:
2021-09-26 22:47:34 +01:00
commit 3dde554e9c
16 changed files with 1100 additions and 0 deletions

View File

@ -0,0 +1,20 @@
package com.micle.loginprotection.events;
import com.micle.loginprotection.LoginProtection;
import net.minecraft.world.entity.player.Player;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.event.entity.player.PlayerEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
public class OnPlayerJoinEventHandler {
@SubscribeEvent
@OnlyIn(Dist.DEDICATED_SERVER)
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!");
}
}