Fixed mobs not ignoring player when config option is enabled.
This commit is contained in:
@ -3,7 +3,6 @@ package dev.micle.loginprotection.events.common;
|
|||||||
import dev.micle.loginprotection.data.ProtectedPlayer;
|
import dev.micle.loginprotection.data.ProtectedPlayer;
|
||||||
import dev.micle.loginprotection.data.ProtectedPlayerManager;
|
import dev.micle.loginprotection.data.ProtectedPlayerManager;
|
||||||
import dev.micle.loginprotection.setup.Config;
|
import dev.micle.loginprotection.setup.Config;
|
||||||
import net.minecraft.world.entity.Mob;
|
|
||||||
import net.minecraft.world.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
import net.minecraftforge.event.entity.living.LivingChangeTargetEvent;
|
import net.minecraftforge.event.entity.living.LivingChangeTargetEvent;
|
||||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||||
@ -25,7 +24,7 @@ public class OnLivingSetAttackTargetEventHandler {
|
|||||||
(player.getState().equals(ProtectedPlayer.State.AFK) && Config.Server.AFK_MOBS_IGNORE_PLAYER.get()) ||
|
(player.getState().equals(ProtectedPlayer.State.AFK) && Config.Server.AFK_MOBS_IGNORE_PLAYER.get()) ||
|
||||||
(player.getState().equals(ProtectedPlayer.State.LOGIN_GRACE) && Config.Server.LOGIN_GRACE_MOBS_IGNORE_PLAYER.get()) ||
|
(player.getState().equals(ProtectedPlayer.State.LOGIN_GRACE) && Config.Server.LOGIN_GRACE_MOBS_IGNORE_PLAYER.get()) ||
|
||||||
(player.getState().equals(ProtectedPlayer.State.AFK_GRACE) && Config.Server.AFK_GRACE_MOBS_IGNORE_PLAYER.get())) {
|
(player.getState().equals(ProtectedPlayer.State.AFK_GRACE) && Config.Server.AFK_GRACE_MOBS_IGNORE_PLAYER.get())) {
|
||||||
((Mob) event.getEntity()).setTarget(null);
|
event.setNewTarget(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user