From ffc7a5c7b7d17461d180a4ae48a03f72f54cac27 Mon Sep 17 00:00:00 2001 From: boy0001 Date: Tue, 16 Dec 2014 15:59:27 +1100 Subject: [PATCH] delete --- .../plot/util/DefaultUUIDWrapper.java | 31 ----------- .../plot/util/OfflineUUIDWrapper.java | 54 ------------------- .../plot/util/UUIDWrapper.java | 16 ------ 3 files changed, 101 deletions(-) delete mode 100644 PlotSquared/src/main/java/com/intellectualcrafters/plot/util/DefaultUUIDWrapper.java delete mode 100644 PlotSquared/src/main/java/com/intellectualcrafters/plot/util/OfflineUUIDWrapper.java delete mode 100644 PlotSquared/src/main/java/com/intellectualcrafters/plot/util/UUIDWrapper.java diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/DefaultUUIDWrapper.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/DefaultUUIDWrapper.java deleted file mode 100644 index ff538103f..000000000 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/DefaultUUIDWrapper.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.intellectualcrafters.plot.util; - -import java.util.UUID; - -import org.bukkit.Bukkit; -import org.bukkit.OfflinePlayer; -import org.bukkit.entity.Player; - -public class DefaultUUIDWrapper extends UUIDWrapper { - - @Override - public UUID getUUID(Player player) { - return player.getUniqueId(); - } - - @Override - public UUID getUUID(OfflinePlayer player) { - return player.getUniqueId(); - } - - @Override - public OfflinePlayer getOfflinePlayer(UUID uuid) { - return Bukkit.getOfflinePlayer(uuid); - } - - @Override - public Player getPlayer(UUID uuid) { - return Bukkit.getPlayer(uuid); - } - -} diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/OfflineUUIDWrapper.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/OfflineUUIDWrapper.java deleted file mode 100644 index fbf1e39e3..000000000 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/OfflineUUIDWrapper.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.intellectualcrafters.plot.util; - -import java.util.UUID; - -import org.bukkit.Bukkit; -import org.bukkit.OfflinePlayer; -import org.bukkit.entity.Player; - -import com.google.common.base.Charsets; -import com.google.common.collect.BiMap; -import com.intellectualcrafters.plot.object.StringWrapper; - -public class OfflineUUIDWrapper extends UUIDWrapper { - - @Override - public UUID getUUID(Player player) { - return UUID.nameUUIDFromBytes(("OfflinePlayer:" + player.getName()).getBytes(Charsets.UTF_8)); - } - - @Override - public UUID getUUID(OfflinePlayer player) { - return UUID.nameUUIDFromBytes(("OfflinePlayer:" + player.getName()).getBytes(Charsets.UTF_8)); - } - - @Override - public OfflinePlayer getOfflinePlayer(UUID uuid) { - BiMap map = UUIDHandler.getUuidMap().inverse(); - String name = map.get(uuid).value; - if (name != null) { - return Bukkit.getOfflinePlayer(name); - } - else { - for (OfflinePlayer player : Bukkit.getOfflinePlayers()) { - if (getUUID(player).equals(uuid)) { - return player; - } - } - } - return Bukkit.getOfflinePlayer(uuid.toString()); - } - - @Override - public Player getPlayer(UUID uuid) { - for (Player player : Bukkit.getOnlinePlayers()) { - if (getUUID(player).equals(uuid)) { - return player; - } - } - return null; - } - - - -} diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/UUIDWrapper.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/UUIDWrapper.java deleted file mode 100644 index e1fc1b3a7..000000000 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/UUIDWrapper.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.intellectualcrafters.plot.util; - -import java.util.UUID; - -import org.bukkit.OfflinePlayer; -import org.bukkit.entity.Player; - -public abstract class UUIDWrapper { - public abstract UUID getUUID(Player player); - - public abstract UUID getUUID(OfflinePlayer player); - - public abstract OfflinePlayer getOfflinePlayer(UUID uuid); - - public abstract Player getPlayer(UUID uuid); -}