PlotSquared/src/main/java/com/intellectualcrafters/plot/uuid/DefaultUUIDWrapper.java

44 lines
1.3 KiB
Java
Raw Normal View History

2014-12-16 05:58:54 +01:00
package com.intellectualcrafters.plot.uuid;
2015-01-13 17:38:15 +01:00
import java.util.UUID;
2014-12-16 05:58:54 +01:00
import org.bukkit.Bukkit;
2015-02-26 12:13:17 +01:00
import org.bukkit.OfflinePlayer;
2015-02-22 07:47:15 +01:00
2015-07-26 16:51:12 +02:00
import com.plotsquared.bukkit.object.BukkitOfflinePlayer;
import com.plotsquared.bukkit.object.BukkitPlayer;
2015-02-26 12:13:17 +01:00
import com.intellectualcrafters.plot.object.OfflinePlotPlayer;
2015-02-21 13:52:50 +01:00
import com.intellectualcrafters.plot.object.PlotPlayer;
2014-12-16 05:58:54 +01:00
public class DefaultUUIDWrapper extends UUIDWrapper {
@Override
2015-02-21 13:52:50 +01:00
public UUID getUUID(final PlotPlayer player) {
return ((BukkitPlayer) player).player.getUniqueId();
2014-12-16 05:58:54 +01:00
}
2015-02-23 02:32:27 +01:00
2014-12-16 05:58:54 +01:00
@Override
2015-02-26 12:13:17 +01:00
public UUID getUUID(final OfflinePlotPlayer player) {
2015-02-21 13:52:50 +01:00
return player.getUUID();
2014-12-16 05:58:54 +01:00
}
2015-02-23 02:32:27 +01:00
2014-12-16 05:58:54 +01:00
@Override
2015-02-26 12:13:17 +01:00
public OfflinePlotPlayer getOfflinePlayer(final UUID uuid) {
2015-02-21 13:52:50 +01:00
return new BukkitOfflinePlayer(Bukkit.getOfflinePlayer(uuid));
2014-12-16 05:58:54 +01:00
}
2015-02-23 02:32:27 +01:00
@Override
2015-02-20 07:34:19 +01:00
public UUID getUUID(final String name) {
return Bukkit.getOfflinePlayer(name).getUniqueId();
}
2015-02-26 12:13:17 +01:00
@Override
public OfflinePlotPlayer[] getOfflinePlayers() {
OfflinePlayer[] ops = Bukkit.getOfflinePlayers();
BukkitOfflinePlayer[] toReturn = new BukkitOfflinePlayer[ops.length] ;
for (int i = 0; i < ops.length; i++) {
toReturn[i] = new BukkitOfflinePlayer(ops[i]);
}
return toReturn;
}
2014-12-16 05:58:54 +01:00
}