PlotSquared/Bukkit/src/main/java/com/plotsquared/bukkit/object/BukkitOfflinePlayer.java

40 lines
900 B
Java
Raw Normal View History

2015-07-26 16:51:12 +02:00
package com.plotsquared.bukkit.object;
2015-02-21 13:52:50 +01:00
2016-03-23 02:41:37 +01:00
import com.intellectualcrafters.plot.object.OfflinePlotPlayer;
2015-02-21 13:52:50 +01:00
import org.bukkit.OfflinePlayer;
2016-03-23 02:41:37 +01:00
import java.util.UUID;
2015-07-27 19:50:04 +02:00
2015-09-13 06:04:31 +02:00
public class BukkitOfflinePlayer implements OfflinePlotPlayer {
2015-02-23 02:32:27 +01:00
public final OfflinePlayer player;
2015-09-13 06:04:31 +02:00
2015-02-21 13:52:50 +01:00
/**
* Please do not use this method. Instead use BukkitUtil.getPlayer(Player), as it caches player objects.
* @param player
*/
2016-03-23 02:41:37 +01:00
public BukkitOfflinePlayer(OfflinePlayer player) {
2015-02-21 13:52:50 +01:00
this.player = player;
}
2015-09-13 06:04:31 +02:00
2015-02-21 13:52:50 +01:00
@Override
2015-09-13 06:04:31 +02:00
public UUID getUUID() {
2016-03-23 02:41:37 +01:00
return this.player.getUniqueId();
2015-02-21 13:52:50 +01:00
}
2015-09-13 06:04:31 +02:00
2015-02-21 13:52:50 +01:00
@Override
2015-09-13 06:04:31 +02:00
public long getLastPlayed() {
2016-03-23 02:41:37 +01:00
return this.player.getLastPlayed();
2015-02-21 13:52:50 +01:00
}
2015-09-13 06:04:31 +02:00
2015-02-21 13:52:50 +01:00
@Override
2015-09-13 06:04:31 +02:00
public boolean isOnline() {
2016-03-23 02:41:37 +01:00
return this.player.isOnline();
2015-02-21 13:52:50 +01:00
}
2015-09-13 06:04:31 +02:00
2015-02-21 13:52:50 +01:00
@Override
2015-09-13 06:04:31 +02:00
public String getName() {
2016-03-23 02:41:37 +01:00
return this.player.getName();
2015-02-21 13:52:50 +01:00
}
}