Updated to version 2.1.1. Fixed issue where the mod didn't work in single-player and LAN.

This commit is contained in:
2021-10-01 15:45:47 +01:00
parent 096875a29c
commit 1868de277e
5 changed files with 9 additions and 12 deletions

View File

@ -2,14 +2,11 @@ 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();