mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-03 14:38:46 +00:00
Make sure plugin-generated NPCs don't get checked.
This commit is contained in:
1 parent
dfa5c105c6
commit
b4b1f62ee7
1 file changed
+15
-1
@@ -22,6 +22,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -97,7 +98,20 @@ public class CheckManager
|
|||||||
|
|
||||||
public boolean willCheck(Player player, CheckType type)
|
public boolean willCheck(Player player, CheckType type)
|
||||||
{
|
{
|
||||||
return isActive(type) && manager.getConfiguration().checkInWorld(player.getWorld()) && !isExempt(player, type) && !type.checkPermission(player);
|
return isActive(type) && manager.getConfiguration().checkInWorld(player.getWorld()) && !isExempt(player, type) && !type.checkPermission(player) && isOnline(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isOnline(Player player)
|
||||||
|
{
|
||||||
|
// Check if the player is on the user list, e.g. is not an NPC
|
||||||
|
for(Player p : Bukkit.getOnlinePlayers())
|
||||||
|
{
|
||||||
|
if(p.getName().equals(player.getName()))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getExempt()
|
public int getExempt()
|
||||||
|
|||||||
Reference in new issue
Block a user