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 58953dc988
commit fea005cef5
2 changed files with 2 additions and 2 deletions

View File

@ -11,7 +11,8 @@ import net.minecraftforge.eventbus.api.SubscribeEvent;
public class OnLivingSetAttackTargetEventHandler { public class OnLivingSetAttackTargetEventHandler {
@SubscribeEvent @SubscribeEvent
public void LivingSetAttackTargetEvent(LivingSetAttackTargetEvent event) { 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()); ProtectedPlayer player = LoginProtection.protected_players.getPlayer(target.getUUID());
if (player == null) { return; } if (player == null) { return; }

View File

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