mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 21:26:45 +01:00
delete
This commit is contained in:
parent
37367adfcf
commit
ffc7a5c7b7
@ -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);
|
||||
}
|
||||
|
||||
}
|
@ -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<UUID, StringWrapper> 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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -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);
|
||||
}
|
Loading…
Reference in New Issue
Block a user