Optimized imports. Fixed pattern variable that didn't want to work in OnLivingSetAttackTargetEventHandler.

This commit is contained in:
2021-09-29 19:33:56 +01:00
parent dbd0a0b3ee
commit 8d077b17f4
2 changed files with 2 additions and 2 deletions

View File

@ -11,7 +11,8 @@ import net.minecraftforge.eventbus.api.SubscribeEvent;
public class OnLivingSetAttackTargetEventHandler {
@SubscribeEvent
public void LivingSetAttackTargetEvent(LivingSetAttackTargetEvent event) {
if (!(event.getTarget() instanceof PlayerEntity target)) { return; }
if (!(event.getTarget() instanceof PlayerEntity)) { return; }
PlayerEntity target = (PlayerEntity) event.getTarget();
ProtectedPlayer player = LoginProtection.protected_players.getPlayer(target.getUUID());
if (player == null) { return; }

View File

@ -1,7 +1,6 @@
package com.micle.loginprotection.events;
import com.micle.loginprotection.LoginProtection;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;