1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-12-03 07:54:07 +01:00
Jobs/com/gamingmesh/jobs/container/TopList.java

47 lines
1001 B
Java
Raw Normal View History

2015-08-21 15:10:08 +02:00
package com.gamingmesh.jobs.container;
2015-12-10 14:13:57 +01:00
import java.util.UUID;
2015-08-21 15:10:08 +02:00
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import org.bukkit.entity.Player;
import com.gamingmesh.jobs.stuff.OfflinePlayerList;
2015-08-21 15:10:08 +02:00
public final class TopList {
private String player;
private int level;
private int exp;
2015-12-10 14:13:57 +01:00
private UUID uuid;
2015-08-21 15:10:08 +02:00
2015-12-10 14:13:57 +01:00
public TopList(String player, int level, int exp, UUID uuid) {
this.player = player;
this.level = level;
this.exp = exp;
this.uuid = uuid;
}
2015-08-21 15:10:08 +02:00
public String getPlayerName() {
if (this.player == null || this.player == "") {
2015-12-10 14:13:57 +01:00
Player player = Bukkit.getPlayer(this.uuid);
if (player != null)
return player.getName();
else {
2015-12-10 14:13:57 +01:00
OfflinePlayer Offlineplayer = OfflinePlayerList.getPlayer(this.uuid);
if (Offlineplayer != null)
return Offlineplayer.getName();
else
return "Unknown";
}
2015-08-21 15:10:08 +02:00
}
return this.player;
}
2015-08-21 15:10:08 +02:00
public int getLevel() {
return this.level;
}
2015-08-21 15:10:08 +02:00
public int getExp() {
return this.exp;
}
2015-08-21 15:10:08 +02:00
}