Support for latest Leaves
This commit is contained in:
parent
2fe0da569b
commit
18ab6623ff
@ -10,7 +10,7 @@ public final class PlayerUtils {
|
|||||||
// Utility class
|
// Utility class
|
||||||
private PlayerUtils() {
|
private PlayerUtils() {
|
||||||
}
|
}
|
||||||
private static final boolean IS_LEAVES_SERVER = Utils.isClassLoaded("top.leavesmc.leaves.LeavesConfig");
|
private static final boolean isLeavesServer = Utils.isClassLoaded("top.leavesmc.leaves.LeavesConfig") || Utils.isClassLoaded("org.leavesmc.leaves.LeavesConfig");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the IP of the given player.
|
* Returns the IP of the given player.
|
||||||
@ -29,7 +29,7 @@ public final class PlayerUtils {
|
|||||||
* @return True if the player is an NPC, false otherwise
|
* @return True if the player is an NPC, false otherwise
|
||||||
*/
|
*/
|
||||||
public static boolean isNpc(Player player) {
|
public static boolean isNpc(Player player) {
|
||||||
if (IS_LEAVES_SERVER) {
|
if (isLeavesServer) {
|
||||||
return player.hasMetadata("NPC") || player.getAddress() == null;
|
return player.hasMetadata("NPC") || player.getAddress() == null;
|
||||||
} else {
|
} else {
|
||||||
return player.hasMetadata("NPC");
|
return player.hasMetadata("NPC");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user