Remove 1.7 support
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package fr.xephi.authme.util;
|
||||
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
/**
|
||||
@@ -12,42 +11,24 @@ public final class PlayerUtils {
|
||||
private PlayerUtils() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get player's UUID if can, name otherwise.
|
||||
*
|
||||
* @param player Player to retrieve
|
||||
*
|
||||
* @return player's UUID or Name in String.
|
||||
*/
|
||||
public static String getUuidOrName(OfflinePlayer player) {
|
||||
// We may made this configurable in future
|
||||
// so we can have uuid support.
|
||||
try {
|
||||
return player.getUniqueId().toString();
|
||||
} catch (NoSuchMethodError ignore) {
|
||||
return player.getName();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the IP of the given player.
|
||||
*
|
||||
* @param p The player to return the IP address for
|
||||
*
|
||||
* @param player The player to return the IP address for
|
||||
* @return The player's IP address
|
||||
*/
|
||||
public static String getPlayerIp(Player p) {
|
||||
return p.getAddress().getAddress().getHostAddress();
|
||||
public static String getPlayerIp(Player player) {
|
||||
return player.getAddress().getAddress().getHostAddress();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns if the player is an NPC or not.
|
||||
*
|
||||
* @param player The player to check
|
||||
*
|
||||
* @return True if the player is an NPC, false otherwise
|
||||
*/
|
||||
public static boolean isNpc(Player player) {
|
||||
return player.hasMetadata("NPC");
|
||||
return player.hasMetadata("NPC");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user