PlotSquared/src/main/java/com/plotsquared/bukkit/uuid/DefaultUUIDWrapper.java

44 lines
1.3 KiB
Java
Raw Normal View History

package com.plotsquared.bukkit.uuid;
2014-12-16 05:58:54 +01:00
2015-07-27 19:50:04 +02:00
import com.intellectualcrafters.plot.object.OfflinePlotPlayer;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.uuid.UUIDWrapper;
2015-07-27 19:50:04 +02:00
import com.plotsquared.bukkit.object.BukkitOfflinePlayer;
import com.plotsquared.bukkit.object.BukkitPlayer;
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-27 19:50:04 +02:00
import java.util.UUID;
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
}