1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-01-04 23:37:49 +01:00
Jobs/com/gamingmesh/jobs/container/TopList.java
Zrips 02d6b5e0c2 Added jobs action logging
Small improvements
Small change for getting players permissions
2015-09-17 18:28:23 +03:00

46 lines
1.0 KiB
Java

package com.gamingmesh.jobs.container;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import org.bukkit.entity.Player;
import com.gamingmesh.jobs.stuff.OfflinePlayerList;
import com.gamingmesh.jobs.stuff.UUIDUtil;
public final class TopList {
private String player;
private int level;
private int exp;
private byte[] uuid;
public TopList(String player, int level, int exp, byte[] uuid) {
this.player = player;
this.level = level;
this.exp = exp;
this.uuid = uuid;
}
public String getPlayerName() {
if (this.player == null || this.player == "") {
Player player = Bukkit.getPlayer(UUIDUtil.fromBytes(this.uuid));
if (player != null)
return player.getName();
else {
OfflinePlayer Offlineplayer = OfflinePlayerList.getPlayer(UUIDUtil.fromBytes(this.uuid));
if (Offlineplayer != null)
return Offlineplayer.getName();
else
return "Unknown";
}
}
return this.player;
}
public int getLevel() {
return this.level;
}
public int getExp() {
return this.exp;
}
}