mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-26 18:54:43 +02:00
Huge UUID Update.
This commit is contained in:
@ -32,6 +32,7 @@ import com.intellectualcrafters.plot.util.EventUtil;
|
||||
import com.intellectualcrafters.plot.util.MainUtil;
|
||||
import com.intellectualcrafters.plot.util.Permissions;
|
||||
import com.intellectualcrafters.plot.util.bukkit.UUIDHandler;
|
||||
import com.intellectualcrafters.plot.util.bukkit.uuid.SQLUUIDHandler;
|
||||
|
||||
public class Add extends SubCommand {
|
||||
public Add() {
|
||||
@ -64,7 +65,11 @@ public class Add extends SubCommand {
|
||||
uuid = UUIDHandler.getUUID(args[0]);
|
||||
}
|
||||
if (uuid == null) {
|
||||
MainUtil.sendMessage(plr, C.INVALID_PLAYER, args[0]);
|
||||
if (UUIDHandler.implementation instanceof SQLUUIDHandler) {
|
||||
MainUtil.sendMessage(plr, C.INVALID_PLAYER_WAIT, args[0]);
|
||||
} else {
|
||||
MainUtil.sendMessage(plr, C.INVALID_PLAYER, args[0]);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (plot.isOwner(uuid)) {
|
||||
|
@ -99,7 +99,7 @@ public class Buy extends SubCommand {
|
||||
}
|
||||
EconHandler.manager.withdrawMoney(plr, price);
|
||||
sendMessage(plr, C.REMOVED_BALANCE, price + "");
|
||||
EconHandler.manager.depositMoney(UUIDHandler.uuidWrapper.getOfflinePlayer(plot.owner), initPrice);
|
||||
EconHandler.manager.depositMoney(UUIDHandler.getUUIDWrapper().getOfflinePlayer(plot.owner), initPrice);
|
||||
final PlotPlayer owner = UUIDHandler.getPlayer(plot.owner);
|
||||
if (owner != null) {
|
||||
sendMessage(plr, C.PLOT_SOLD, plot.id + "", plr.getName(), initPrice + "");
|
||||
|
@ -216,7 +216,7 @@ public class DebugExec extends SubCommand {
|
||||
if (uuid == null) {
|
||||
return MainUtil.sendMessage(player, "player not found: " + args[1]);
|
||||
}
|
||||
final OfflinePlotPlayer op = UUIDHandler.uuidWrapper.getOfflinePlayer(uuid);
|
||||
final OfflinePlotPlayer op = UUIDHandler.getUUIDWrapper().getOfflinePlayer(uuid);
|
||||
if ((op == null) || (op.getLastPlayed() == 0)) {
|
||||
return MainUtil.sendMessage(player, "player hasn't connected before: " + args[1]);
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ public class DebugUUID extends SubCommand {
|
||||
return false;
|
||||
}
|
||||
|
||||
UUIDWrapper currentUUIDWrapper = UUIDHandler.uuidWrapper;
|
||||
UUIDWrapper currentUUIDWrapper = UUIDHandler.getUUIDWrapper();
|
||||
UUIDWrapper newWrapper = null;
|
||||
|
||||
switch (args[0].toLowerCase()) {
|
||||
@ -109,7 +109,7 @@ public class DebugUUID extends SubCommand {
|
||||
}
|
||||
MainUtil.sendConsoleMessage("&6Beginning UUID mode conversion");
|
||||
MainUtil.sendConsoleMessage("&7 - Disconnecting players");
|
||||
for (PlotPlayer user : UUIDHandler.players.values()) {
|
||||
for (PlotPlayer user : UUIDHandler.getPlayers().values()) {
|
||||
PlayerManager.manager.kickPlayer(user, "PlotSquared UUID conversion has been initiated. You may reconnect when finished.");
|
||||
}
|
||||
|
||||
@ -212,7 +212,7 @@ public class DebugUUID extends SubCommand {
|
||||
}
|
||||
|
||||
MainUtil.sendConsoleMessage("&7 - Replacing wrapper");
|
||||
UUIDHandler.uuidWrapper = newWrapper;
|
||||
UUIDHandler.setUUIDWrapper(newWrapper);
|
||||
|
||||
MainUtil.sendConsoleMessage("&7 - Updating plot objects");
|
||||
|
||||
|
@ -50,7 +50,7 @@ public class Delete extends SubCommand {
|
||||
if (!MainUtil.getTopPlot(plot).equals(MainUtil.getBottomPlot(plot))) {
|
||||
return !sendMessage(plr, C.UNLINK_REQUIRED);
|
||||
}
|
||||
if ((((plot == null) || !plot.hasOwner() || !plot.isOwner(UUIDHandler.uuidWrapper.getUUID(plr)))) && !Permissions.hasPermission(plr, "plots.admin.command.delete")) {
|
||||
if ((((plot == null) || !plot.hasOwner() || !plot.isOwner(UUIDHandler.getUUIDWrapper().getUUID(plr)))) && !Permissions.hasPermission(plr, "plots.admin.command.delete")) {
|
||||
return !sendMessage(plr, C.NO_PLOT_PERMS);
|
||||
}
|
||||
assert plot != null;
|
||||
|
@ -35,6 +35,7 @@ import com.intellectualcrafters.plot.util.Permissions;
|
||||
import com.intellectualcrafters.plot.util.bukkit.BukkitUtil;
|
||||
import com.intellectualcrafters.plot.util.bukkit.UUIDHandler;
|
||||
|
||||
import com.intellectualcrafters.plot.util.bukkit.uuid.SQLUUIDHandler;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@ -69,7 +70,11 @@ public class Deny extends SubCommand {
|
||||
uuid = UUIDHandler.getUUID(args[0]);
|
||||
}
|
||||
if (uuid == null) {
|
||||
MainUtil.sendMessage(plr, C.INVALID_PLAYER, args[0]);
|
||||
if (UUIDHandler.implementation instanceof SQLUUIDHandler) {
|
||||
MainUtil.sendMessage(plr, C.INVALID_PLAYER_WAIT, args[0]);
|
||||
} else {
|
||||
MainUtil.sendMessage(plr, C.INVALID_PLAYER, args[0]);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (plot.isOwner(uuid)) {
|
||||
|
@ -31,6 +31,7 @@ import com.intellectualcrafters.plot.object.PlotPlayer;
|
||||
import com.intellectualcrafters.plot.util.MainUtil;
|
||||
import com.intellectualcrafters.plot.util.Permissions;
|
||||
import com.intellectualcrafters.plot.util.bukkit.UUIDHandler;
|
||||
import com.intellectualcrafters.plot.util.bukkit.uuid.SQLUUIDHandler;
|
||||
|
||||
public class Remove extends SubCommand {
|
||||
public Remove() {
|
||||
@ -112,7 +113,11 @@ public class Remove extends SubCommand {
|
||||
}
|
||||
}
|
||||
if (count == 0) {
|
||||
MainUtil.sendMessage(plr, C.INVALID_PLAYER, args[0]);
|
||||
if (UUIDHandler.implementation instanceof SQLUUIDHandler) {
|
||||
MainUtil.sendMessage(plr, C.INVALID_PLAYER_WAIT, args[0]);
|
||||
} else {
|
||||
MainUtil.sendMessage(plr, C.INVALID_PLAYER, args[0]);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
|
@ -32,6 +32,7 @@ import com.intellectualcrafters.plot.util.EventUtil;
|
||||
import com.intellectualcrafters.plot.util.MainUtil;
|
||||
import com.intellectualcrafters.plot.util.Permissions;
|
||||
import com.intellectualcrafters.plot.util.bukkit.UUIDHandler;
|
||||
import com.intellectualcrafters.plot.util.bukkit.uuid.SQLUUIDHandler;
|
||||
|
||||
public class Trust extends SubCommand {
|
||||
public Trust() {
|
||||
@ -64,7 +65,11 @@ public class Trust extends SubCommand {
|
||||
uuid = UUIDHandler.getUUID(args[0]);
|
||||
}
|
||||
if (uuid == null) {
|
||||
MainUtil.sendMessage(plr, C.INVALID_PLAYER, args[0]);
|
||||
if (UUIDHandler.implementation instanceof SQLUUIDHandler) {
|
||||
MainUtil.sendMessage(plr, C.INVALID_PLAYER_WAIT, args[0]);
|
||||
} else {
|
||||
MainUtil.sendMessage(plr, C.INVALID_PLAYER, args[0]);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (plot.isOwner(uuid)) {
|
||||
|
@ -30,6 +30,7 @@ import com.intellectualcrafters.plot.object.PlotPlayer;
|
||||
import com.intellectualcrafters.plot.util.MainUtil;
|
||||
import com.intellectualcrafters.plot.util.Permissions;
|
||||
import com.intellectualcrafters.plot.util.bukkit.UUIDHandler;
|
||||
import com.intellectualcrafters.plot.util.bukkit.uuid.SQLUUIDHandler;
|
||||
|
||||
public class Undeny extends SubCommand {
|
||||
public Undeny() {
|
||||
@ -83,7 +84,11 @@ public class Undeny extends SubCommand {
|
||||
}
|
||||
}
|
||||
if (count == 0) {
|
||||
MainUtil.sendMessage(plr, C.INVALID_PLAYER, args[0]);
|
||||
if (UUIDHandler.implementation instanceof SQLUUIDHandler) {
|
||||
MainUtil.sendMessage(plr, C.INVALID_PLAYER_WAIT, args[0]);
|
||||
} else {
|
||||
MainUtil.sendMessage(plr, C.INVALID_PLAYER, args[0]);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
|
Reference in New Issue
Block a user