diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotMain.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotMain.java index 757b0b4a3..c02f6dd63 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotMain.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotMain.java @@ -1523,11 +1523,17 @@ import java.util.concurrent.TimeUnit; } // Handle UUIDS { + boolean checkVersion = checkVersion(); + if (!checkVersion && Settings.TITLES) { + sendConsoleSenderMessage(C.PREFIX.s()+" &c[WARN] Titles are enabled - please update your version of Bukkit to support this feature."); + Settings.TITLES = false; + FlagManager.removeFlag(FlagManager.getFlag("titles")); + } if (Settings.OFFLINE_MODE) { UUIDHandler.uuidWrapper = new OfflineUUIDWrapper(); Settings.OFFLINE_MODE = true; } - else if (checkVersion() && Bukkit.getOnlineMode()) { + else if (checkVersion && Bukkit.getOnlineMode()) { UUIDHandler.uuidWrapper = new DefaultUUIDWrapper(); Settings.OFFLINE_MODE = false; } @@ -1536,7 +1542,7 @@ import java.util.concurrent.TimeUnit; Settings.OFFLINE_MODE = true; } if (Settings.OFFLINE_MODE) { - sendConsoleSenderMessage(C.PREFIX.s()+" &6PlotSquared is using Offline Mode UUIDs either because of user preference, or because of the version of the Bukkit API"); + sendConsoleSenderMessage(C.PREFIX.s()+" &6PlotSquared is using Offline Mode UUIDs either because of user preference, or because you are using an old version of Bukkit"); } else { sendConsoleSenderMessage(C.PREFIX.s()+" &6PlotSquared is using online UUIDs"); diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Copy.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Copy.java index 7e011cbe0..52ed3fb56 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Copy.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Copy.java @@ -27,6 +27,8 @@ import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.object.PlotSelection; import com.intellectualcrafters.plot.util.PlayerFunctions; import com.intellectualcrafters.plot.util.PlotHelper; +import com.intellectualcrafters.plot.util.UUIDHandler; + import org.bukkit.entity.Player; public class Copy extends SubCommand { @@ -42,7 +44,7 @@ public class Copy extends SubCommand { return false; } final Plot plot = PlayerFunctions.getCurrentPlot(plr); - if (((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(plr.getUniqueId())) && !PlotMain.hasPermission(plr, "plots.admin")) { + if (((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(UUIDHandler.getUUID(plr))) && !PlotMain.hasPermission(plr, "plots.admin")) { PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS); return false; } diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Database.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Database.java index d7323ddcf..4713fa2bb 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Database.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Database.java @@ -122,7 +122,7 @@ public class Database extends SubCommand { } UUID requester = null; if (plr != null) { - requester = plr.getUniqueId(); + requester = UUIDHandler.getUUID(plr); } insertPlots(manager, requester, n); break; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Delete.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Delete.java index 95f25d9aa..aab8da4b7 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Delete.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Delete.java @@ -27,6 +27,7 @@ import com.intellectualcrafters.plot.database.DBFunc; import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.object.PlotWorld; import com.intellectualcrafters.plot.util.PlayerFunctions; +import com.intellectualcrafters.plot.util.UUIDHandler; import net.milkbowl.vault.economy.Economy; import org.bukkit.entity.Player; @@ -45,12 +46,14 @@ public class Delete extends SubCommand { if (!PlayerFunctions.getTopPlot(plr.getWorld(), plot).equals(PlayerFunctions.getBottomPlot(plr.getWorld(), plot))) { return !sendMessage(plr, C.UNLINK_REQUIRED); } - if ((((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(plr.getUniqueId()))) && !PlotMain.hasPermission(plr, "plots.admin")) { + if ((((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(UUIDHandler.uuidWrapper.getUUID(plr)))) && !PlotMain.hasPermission(plr, "plots.admin")) { + System.out.print(UUIDHandler.uuidWrapper.getUUID(plr)); + System.out.print(plot.getOwner()); return !sendMessage(plr, C.NO_PLOT_PERMS); } assert plot != null; final PlotWorld pWorld = PlotMain.getWorldSettings(plot.getWorld()); - if (PlotMain.useEconomy && pWorld.USE_ECONOMY && (plot != null) && plot.hasOwner() && plot.getOwner().equals(plr.getUniqueId())) { + if (PlotMain.useEconomy && pWorld.USE_ECONOMY && (plot != null) && plot.hasOwner() && plot.getOwner().equals(UUIDHandler.getUUID(plr))) { final double c = pWorld.SELL_PRICE; if (c > 0d) { final Economy economy = PlotMain.economy; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Denied.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Denied.java index bf9e8fe2e..22ad7ccdf 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Denied.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Denied.java @@ -51,7 +51,7 @@ import java.util.UUID; return true; } final Plot plot = PlayerFunctions.getCurrentPlot(plr); - if (((plot.owner == null) || !plot.getOwner().equals(plr.getUniqueId())) && !PlotMain.hasPermission(plr, "plots.admin")) { + if (((plot.owner == null) || !plot.getOwner().equals(UUIDHandler.getUUID(plr))) && !PlotMain.hasPermission(plr, "plots.admin")) { PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS); return true; } @@ -115,18 +115,6 @@ import java.util.UUID; PlayerFunctions.sendMessage(plr, C.DENIED_REMOVED); return true; } - /* - * if (!hasBeenOnServer(args[1])) { - * PlayerFunctions.sendMessage(plr, C.PLAYER_HAS_NOT_BEEN_ON); - * return true; } UUID uuid = null; if - * (Bukkit.getPlayer(args[1])!=null) { uuid = - * Bukkit.getPlayer(args[1]).getUniqueId(); } else { uuid = - * Bukkit.getOfflinePlayer(args[1]).getUniqueId(); } if - * (!plot.denied.contains(uuid)) { - * PlayerFunctions.sendMessage(plr, C.WAS_NOT_ADDED); return - * true; } if (uuid == null) { PlayerFunctions.sendMessage(plr, - * C.PLAYER_HAS_NOT_BEEN_ON); return true; } - */ final UUID uuid = UUIDHandler.getUUID(args[1]); plot.removeDenied(uuid); DBFunc.removeDenied(plr.getWorld().getName(), plot, Bukkit.getOfflinePlayer(args[1])); diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Helpers.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Helpers.java index 8a5cbc9f1..882fc85af 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Helpers.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Helpers.java @@ -51,7 +51,7 @@ import java.util.UUID; return true; } final Plot plot = PlayerFunctions.getCurrentPlot(plr); - if (((plot.owner == null) || !plot.getOwner().equals(plr.getUniqueId())) && !PlotMain.hasPermission(plr, "plots.admin")) { + if (((plot.owner == null) || !plot.getOwner().equals(UUIDHandler.getUUID(plr))) && !PlotMain.hasPermission(plr, "plots.admin")) { PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS); return true; } diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Home.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Home.java index 2dbf6db91..16b7d8869 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Home.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Home.java @@ -25,6 +25,8 @@ import com.intellectualcrafters.plot.PlotMain; import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.util.PlayerFunctions; +import com.intellectualcrafters.plot.util.UUIDHandler; + import org.bukkit.entity.Player; /** @@ -62,7 +64,7 @@ public class Home extends SubCommand { Plot temp; if ((temp = isAlias(args[0])) != null) { if (temp.hasOwner()) { - if (temp.getOwner().equals(plr.getUniqueId())) { + if (temp.getOwner().equals(UUIDHandler.getUUID(plr))) { PlotMain.teleportPlayer(plr, plr.getLocation(), temp); return true; } diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Inbox.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Inbox.java index f4ea43fc0..be77723a9 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Inbox.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Inbox.java @@ -27,6 +27,8 @@ import com.intellectualcrafters.plot.database.DBFunc; import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.object.PlotComment; import com.intellectualcrafters.plot.util.PlayerFunctions; +import com.intellectualcrafters.plot.util.UUIDHandler; + import org.bukkit.Bukkit; import org.bukkit.entity.Player; @@ -54,7 +56,7 @@ public class Inbox extends SubCommand { } Integer tier; - final UUID uuid = plr.getUniqueId(); + final UUID uuid = UUIDHandler.getUUID(plr); if (PlotMain.hasPermission(plr, "plots.admin")) { tier = 0; } else if (plot.owner == uuid) { diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Kick.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Kick.java index c853a9503..d09b8307c 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Kick.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Kick.java @@ -25,6 +25,8 @@ import com.intellectualcrafters.plot.PlotMain; import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.util.PlayerFunctions; +import com.intellectualcrafters.plot.util.UUIDHandler; + import org.bukkit.Bukkit; import org.bukkit.entity.Player; @@ -41,7 +43,7 @@ import org.bukkit.entity.Player; return false; } final Plot plot = PlayerFunctions.getCurrentPlot(plr); - if (((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(plr.getUniqueId())) && !PlotMain.hasPermission(plr, "plots.admin")) { + if (((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(UUIDHandler.getUUID(plr))) && !PlotMain.hasPermission(plr, "plots.admin")) { PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS); return false; } diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Merge.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Merge.java index 6dfc5eecd..0848c3fc4 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Merge.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Merge.java @@ -30,7 +30,10 @@ import com.intellectualcrafters.plot.object.PlotWorld; import com.intellectualcrafters.plot.util.PlayerFunctions; import com.intellectualcrafters.plot.util.PlotHelper; import com.intellectualcrafters.plot.util.SetBlockFast; +import com.intellectualcrafters.plot.util.UUIDHandler; + import net.milkbowl.vault.economy.Economy; + import org.apache.commons.lang.StringUtils; import org.bukkit.Bukkit; import org.bukkit.World; @@ -83,7 +86,7 @@ public class Merge extends SubCommand { PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS); return false; } - if (!plot.getOwner().equals(plr.getUniqueId())) { + if (!plot.getOwner().equals(UUIDHandler.getUUID(plr))) { PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS); return false; } @@ -126,7 +129,7 @@ public class Merge extends SubCommand { } for (final PlotId myid : plots) { final Plot myplot = PlotMain.getPlots(world).get(myid); - if ((myplot == null) || !myplot.hasOwner() || !(myplot.getOwner().equals(plr.getUniqueId()))) { + if ((myplot == null) || !myplot.hasOwner() || !(myplot.getOwner().equals(UUIDHandler.getUUID(plr)))) { PlayerFunctions.sendMessage(plr, C.NO_PERM_MERGE.s().replaceAll("%plot%", myid.toString())); return false; } diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Paste.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Paste.java index 162d95d83..86a47cca9 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Paste.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Paste.java @@ -27,6 +27,8 @@ import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.object.PlotSelection; import com.intellectualcrafters.plot.util.PlayerFunctions; import com.intellectualcrafters.plot.util.PlotHelper; +import com.intellectualcrafters.plot.util.UUIDHandler; + import org.bukkit.entity.Player; public class Paste extends SubCommand { @@ -42,7 +44,7 @@ public class Paste extends SubCommand { return false; } final Plot plot = PlayerFunctions.getCurrentPlot(plr); - if (((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(plr.getUniqueId())) && !PlotMain.hasPermission(plr, "plots.admin")) { + if (((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(UUIDHandler.getUUID(plr))) && !PlotMain.hasPermission(plr, "plots.admin")) { PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS); return false; } diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Rate.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Rate.java index a58ce1d3e..d05c1d27c 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Rate.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Rate.java @@ -25,6 +25,8 @@ import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.database.DBFunc; import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.util.PlayerFunctions; +import com.intellectualcrafters.plot.util.UUIDHandler; + import org.bukkit.entity.Player; @SuppressWarnings({"unused", "deprecated", "javadoc"}) public class Rate extends SubCommand { @@ -53,7 +55,7 @@ import org.bukkit.entity.Player; sendMessage(plr, C.RATING_NOT_OWNED); return true; } - if (plot.getOwner().equals(plr.getUniqueId())) { + if (plot.getOwner().equals(UUIDHandler.getUUID(plr))) { sendMessage(plr, C.RATING_NOT_YOUR_OWN); return true; } diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Swap.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Swap.java index 9c7a874ee..4b645cb7f 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Swap.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Swap.java @@ -29,6 +29,8 @@ import com.intellectualcrafters.plot.object.PlotSelection; import com.intellectualcrafters.plot.util.PlayerFunctions; import com.intellectualcrafters.plot.util.PlotHelper; import com.intellectualcrafters.plot.util.SetBlockFast; +import com.intellectualcrafters.plot.util.UUIDHandler; + import org.bukkit.World; import org.bukkit.entity.Player; @@ -55,7 +57,7 @@ public class Swap extends SubCommand { return false; } final Plot plot = PlayerFunctions.getCurrentPlot(plr); - if (((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(plr.getUniqueId())) && !PlotMain.hasPermission(plr, "plots.admin")) { + if (((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(UUIDHandler.getUUID(plr))) && !PlotMain.hasPermission(plr, "plots.admin")) { PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS); return false; } @@ -69,7 +71,7 @@ public class Swap extends SubCommand { try { plotid = new PlotId(Integer.parseInt(id.split(";")[0]), Integer.parseInt(id.split(";")[1])); final Plot plot2 = PlotMain.getPlots(world).get(plotid); - if (((plot2 == null) || !plot2.hasOwner() || (plot2.owner != plr.getUniqueId())) && !PlotMain.hasPermission(plr, "plots.admin")) { + if (((plot2 == null) || !plot2.hasOwner() || (plot2.owner != UUIDHandler.getUUID(plr))) && !PlotMain.hasPermission(plr, "plots.admin")) { PlayerFunctions.sendMessage(plr, C.NO_PERM_MERGE, plotid.toString()); return false; } diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Trusted.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Trusted.java index b07c697eb..d2fe2af03 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Trusted.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Trusted.java @@ -51,7 +51,7 @@ import java.util.UUID; return true; } final Plot plot = PlayerFunctions.getCurrentPlot(plr); - if (((plot.owner == null) || !plot.getOwner().equals(plr.getUniqueId())) && !PlotMain.hasPermission(plr, "plots.admin")) { + if (((plot.owner == null) || !plot.getOwner().equals(UUIDHandler.getUUID(plr))) && !PlotMain.hasPermission(plr, "plots.admin")) { PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS); return true; } @@ -107,19 +107,6 @@ import java.util.UUID; PlayerFunctions.sendMessage(plr, C.TRUSTED_REMOVED); return true; } - /* - * if (!hasBeenOnServer(args[1])) { - * PlayerFunctions.sendMessage(plr, C.PLAYER_HAS_NOT_BEEN_ON); - * return true; } UUID uuid = null; if - * (Bukkit.getPlayer(args[1]) != null) { uuid = - * Bukkit.getPlayer(args[1]).getUniqueId(); } else { uuid = - * Bukkit.getOfflinePlayer(args[1]).getUniqueId(); } if (uuid == - * null) { PlayerFunctions.sendMessage(plr, - * C.PLAYER_HAS_NOT_BEEN_ON); return true; } if - * (!plot.trusted.contains(uuid)) { - * PlayerFunctions.sendMessage(plr, C.T_WAS_NOT_ADDED); return - * true; } - */ final UUID uuid = UUIDHandler.getUUID(args[1]); plot.removeTrusted(uuid); DBFunc.removeTrusted(plr.getWorld().getName(), plot, Bukkit.getOfflinePlayer(args[1])); diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Unclaim.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Unclaim.java index 84d0b373e..e434c0189 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Unclaim.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Unclaim.java @@ -27,7 +27,10 @@ import com.intellectualcrafters.plot.database.DBFunc; import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.object.PlotWorld; import com.intellectualcrafters.plot.util.PlayerFunctions; +import com.intellectualcrafters.plot.util.UUIDHandler; + import net.milkbowl.vault.economy.Economy; + import org.bukkit.entity.Player; public class Unclaim extends SubCommand { @@ -45,7 +48,7 @@ public class Unclaim extends SubCommand { if (!PlayerFunctions.getTopPlot(plr.getWorld(), plot).equals(PlayerFunctions.getBottomPlot(plr.getWorld(), plot))) { return !sendMessage(plr, C.UNLINK_REQUIRED); } - if ((((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(plr.getUniqueId()))) && !PlotMain.hasPermission(plr, "plots.admin")) { + if ((((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(UUIDHandler.getUUID(plr)))) && !PlotMain.hasPermission(plr, "plots.admin")) { return !sendMessage(plr, C.NO_PLOT_PERMS); } assert plot != null; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Unlink.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Unlink.java index fdd3389f3..f36c1bef6 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Unlink.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Unlink.java @@ -56,7 +56,7 @@ public class Unlink extends SubCommand { return sendMessage(plr, C.NOT_IN_PLOT); } final Plot plot = PlayerFunctions.getCurrentPlot(plr); - if (((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(plr.getUniqueId())) && !PlotMain.hasPermission(plr, "plots.admin")) { + if (((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(UUIDHandler.getUUID(plr))) && !PlotMain.hasPermission(plr, "plots.admin")) { return sendMessage(plr, C.NO_PLOT_PERMS); } if (PlayerFunctions.getTopPlot(plr.getWorld(), plot).equals(PlayerFunctions.getBottomPlot(plr.getWorld(), plot))) { diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/list.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/list.java index 26aab7b6b..095ace3b8 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/list.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/list.java @@ -86,7 +86,7 @@ public class list extends SubCommand { final StringBuilder string = new StringBuilder(); string.append(C.PLOT_LIST_HEADER.s().replaceAll("%word%", "all")).append("\n"); for (final Plot p : PlotMain.getPlotsSorted()) { - if (p.helpers.contains(plr.getUniqueId())) { + if (p.helpers.contains(UUIDHandler.getUUID(plr))) { string.append(C.PLOT_LIST_ITEM.s().replaceAll("%id", p.id.toString()).replaceAll("%world", p.world).replaceAll("%owner", getName(p.owner))).append("\n"); } } diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlotPlusListener.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlotPlusListener.java index 6de24967d..e7440d852 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlotPlusListener.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlotPlusListener.java @@ -180,7 +180,7 @@ import java.util.*; if (player == null) { return; } - if (UUIDHandler.getUUID(player).equals(event.getPlayer().getUniqueId())) { + if (UUIDHandler.getUUID(player).equals(UUIDHandler.getUUID(event.getPlayer()))) { return; } if (player.isOnline()) { @@ -219,7 +219,7 @@ import java.util.*; if (player == null) { return; } - if (UUIDHandler.getUUID(player).equals(event.getPlayer().getUniqueId())) { + if (UUIDHandler.getUUID(player).equals(UUIDHandler.getUUID(event.getPlayer()))) { return; } if (player.isOnline()) { diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/WorldEditListener.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/WorldEditListener.java index e1626ff08..8e61c5cad 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/WorldEditListener.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/WorldEditListener.java @@ -124,7 +124,7 @@ import java.util.Set; } final Plot plot = PlotHelper.getCurrentPlot(b.getLocation()); if (plot != null) { - if (plot.hasOwner() && (plot.helpers != null) && (plot.helpers.contains(DBFunc.everyone) || plot.helpers.contains(p.getUniqueId()))) { + if (plot.hasOwner() && (plot.helpers != null) && (plot.helpers.contains(DBFunc.everyone) || plot.helpers.contains(UUIDHandler.getUUID(p)))) { PWE.setMask(p, l); } } @@ -143,7 +143,7 @@ import java.util.Set; } if (this.restrictedcmds.contains(cmd)) { final Plot plot = PlayerFunctions.getCurrentPlot(p); - if ((plot == null) || !(plot.helpers.contains(DBFunc.everyone) || plot.helpers.contains(p.getUniqueId()))) { + if ((plot == null) || !(plot.helpers.contains(DBFunc.everyone) || plot.helpers.contains(UUIDHandler.getUUID(p)))) { e.setCancelled(true); } return; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/PWE.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/PWE.java index 18a768ceb..dac0bcd4e 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/PWE.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/PWE.java @@ -33,6 +33,7 @@ import com.sk89q.worldedit.bukkit.BukkitPlayer; import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.function.mask.RegionMask; import com.sk89q.worldedit.regions.CuboidRegion; + import org.bukkit.Location; import org.bukkit.World; import org.bukkit.entity.Player; @@ -57,7 +58,7 @@ import org.bukkit.entity.Player; final Plot plot = PlotMain.getPlots(l.getWorld()).get(id); if (plot != null) { boolean r; - r = ((plot.getOwner() != null) && plot.getOwner().equals(p.getUniqueId())) || plot.helpers.contains(DBFunc.everyone) || plot.helpers.contains(p.getUniqueId()); + r = ((plot.getOwner() != null) && plot.getOwner().equals(UUIDHandler.getUUID(p))) || plot.helpers.contains(DBFunc.everyone) || plot.helpers.contains(UUIDHandler.getUUID(p)); if (!r) { if (p.hasPermission("plots.worldedit.bypass")) { removeMask(p, s); diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/PlayerFunctions.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/PlayerFunctions.java index fed476eb3..43bee1b79 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/PlayerFunctions.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/PlayerFunctions.java @@ -220,7 +220,7 @@ import java.util.*; * @return */ public static int getPlayerPlotCount(final World world, final Player plr) { - final UUID uuid = plr.getUniqueId(); + final UUID uuid = UUIDHandler.getUUID(plr); int count = 0; for (final Plot plot : PlotMain.getPlots(world).values()) { if (plot.hasOwner() && plot.owner.equals(uuid) && plot.countsTowardsMax) {