mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 23:26:45 +01:00
Finish updating UUID system
This commit is contained in:
parent
bb4e91e943
commit
d505329134
@ -1523,11 +1523,17 @@ import java.util.concurrent.TimeUnit;
|
|||||||
}
|
}
|
||||||
// Handle UUIDS
|
// 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) {
|
if (Settings.OFFLINE_MODE) {
|
||||||
UUIDHandler.uuidWrapper = new OfflineUUIDWrapper();
|
UUIDHandler.uuidWrapper = new OfflineUUIDWrapper();
|
||||||
Settings.OFFLINE_MODE = true;
|
Settings.OFFLINE_MODE = true;
|
||||||
}
|
}
|
||||||
else if (checkVersion() && Bukkit.getOnlineMode()) {
|
else if (checkVersion && Bukkit.getOnlineMode()) {
|
||||||
UUIDHandler.uuidWrapper = new DefaultUUIDWrapper();
|
UUIDHandler.uuidWrapper = new DefaultUUIDWrapper();
|
||||||
Settings.OFFLINE_MODE = false;
|
Settings.OFFLINE_MODE = false;
|
||||||
}
|
}
|
||||||
@ -1536,7 +1542,7 @@ import java.util.concurrent.TimeUnit;
|
|||||||
Settings.OFFLINE_MODE = true;
|
Settings.OFFLINE_MODE = true;
|
||||||
}
|
}
|
||||||
if (Settings.OFFLINE_MODE) {
|
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 {
|
else {
|
||||||
sendConsoleSenderMessage(C.PREFIX.s()+" &6PlotSquared is using online UUIDs");
|
sendConsoleSenderMessage(C.PREFIX.s()+" &6PlotSquared is using online UUIDs");
|
||||||
|
@ -27,6 +27,8 @@ import com.intellectualcrafters.plot.object.Plot;
|
|||||||
import com.intellectualcrafters.plot.object.PlotSelection;
|
import com.intellectualcrafters.plot.object.PlotSelection;
|
||||||
import com.intellectualcrafters.plot.util.PlayerFunctions;
|
import com.intellectualcrafters.plot.util.PlayerFunctions;
|
||||||
import com.intellectualcrafters.plot.util.PlotHelper;
|
import com.intellectualcrafters.plot.util.PlotHelper;
|
||||||
|
import com.intellectualcrafters.plot.util.UUIDHandler;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
public class Copy extends SubCommand {
|
public class Copy extends SubCommand {
|
||||||
@ -42,7 +44,7 @@ public class Copy extends SubCommand {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
final Plot plot = PlayerFunctions.getCurrentPlot(plr);
|
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);
|
PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -122,7 +122,7 @@ public class Database extends SubCommand {
|
|||||||
}
|
}
|
||||||
UUID requester = null;
|
UUID requester = null;
|
||||||
if (plr != null) {
|
if (plr != null) {
|
||||||
requester = plr.getUniqueId();
|
requester = UUIDHandler.getUUID(plr);
|
||||||
}
|
}
|
||||||
insertPlots(manager, requester, n);
|
insertPlots(manager, requester, n);
|
||||||
break;
|
break;
|
||||||
|
@ -27,6 +27,7 @@ import com.intellectualcrafters.plot.database.DBFunc;
|
|||||||
import com.intellectualcrafters.plot.object.Plot;
|
import com.intellectualcrafters.plot.object.Plot;
|
||||||
import com.intellectualcrafters.plot.object.PlotWorld;
|
import com.intellectualcrafters.plot.object.PlotWorld;
|
||||||
import com.intellectualcrafters.plot.util.PlayerFunctions;
|
import com.intellectualcrafters.plot.util.PlayerFunctions;
|
||||||
|
import com.intellectualcrafters.plot.util.UUIDHandler;
|
||||||
import net.milkbowl.vault.economy.Economy;
|
import net.milkbowl.vault.economy.Economy;
|
||||||
import org.bukkit.entity.Player;
|
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))) {
|
if (!PlayerFunctions.getTopPlot(plr.getWorld(), plot).equals(PlayerFunctions.getBottomPlot(plr.getWorld(), plot))) {
|
||||||
return !sendMessage(plr, C.UNLINK_REQUIRED);
|
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);
|
return !sendMessage(plr, C.NO_PLOT_PERMS);
|
||||||
}
|
}
|
||||||
assert plot != null;
|
assert plot != null;
|
||||||
final PlotWorld pWorld = PlotMain.getWorldSettings(plot.getWorld());
|
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;
|
final double c = pWorld.SELL_PRICE;
|
||||||
if (c > 0d) {
|
if (c > 0d) {
|
||||||
final Economy economy = PlotMain.economy;
|
final Economy economy = PlotMain.economy;
|
||||||
|
@ -51,7 +51,7 @@ import java.util.UUID;
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
final Plot plot = PlayerFunctions.getCurrentPlot(plr);
|
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);
|
PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -115,18 +115,6 @@ import java.util.UUID;
|
|||||||
PlayerFunctions.sendMessage(plr, C.DENIED_REMOVED);
|
PlayerFunctions.sendMessage(plr, C.DENIED_REMOVED);
|
||||||
return true;
|
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]);
|
final UUID uuid = UUIDHandler.getUUID(args[1]);
|
||||||
plot.removeDenied(uuid);
|
plot.removeDenied(uuid);
|
||||||
DBFunc.removeDenied(plr.getWorld().getName(), plot, Bukkit.getOfflinePlayer(args[1]));
|
DBFunc.removeDenied(plr.getWorld().getName(), plot, Bukkit.getOfflinePlayer(args[1]));
|
||||||
|
@ -51,7 +51,7 @@ import java.util.UUID;
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
final Plot plot = PlayerFunctions.getCurrentPlot(plr);
|
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);
|
PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,8 @@ import com.intellectualcrafters.plot.PlotMain;
|
|||||||
import com.intellectualcrafters.plot.config.C;
|
import com.intellectualcrafters.plot.config.C;
|
||||||
import com.intellectualcrafters.plot.object.Plot;
|
import com.intellectualcrafters.plot.object.Plot;
|
||||||
import com.intellectualcrafters.plot.util.PlayerFunctions;
|
import com.intellectualcrafters.plot.util.PlayerFunctions;
|
||||||
|
import com.intellectualcrafters.plot.util.UUIDHandler;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -62,7 +64,7 @@ public class Home extends SubCommand {
|
|||||||
Plot temp;
|
Plot temp;
|
||||||
if ((temp = isAlias(args[0])) != null) {
|
if ((temp = isAlias(args[0])) != null) {
|
||||||
if (temp.hasOwner()) {
|
if (temp.hasOwner()) {
|
||||||
if (temp.getOwner().equals(plr.getUniqueId())) {
|
if (temp.getOwner().equals(UUIDHandler.getUUID(plr))) {
|
||||||
PlotMain.teleportPlayer(plr, plr.getLocation(), temp);
|
PlotMain.teleportPlayer(plr, plr.getLocation(), temp);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,8 @@ import com.intellectualcrafters.plot.database.DBFunc;
|
|||||||
import com.intellectualcrafters.plot.object.Plot;
|
import com.intellectualcrafters.plot.object.Plot;
|
||||||
import com.intellectualcrafters.plot.object.PlotComment;
|
import com.intellectualcrafters.plot.object.PlotComment;
|
||||||
import com.intellectualcrafters.plot.util.PlayerFunctions;
|
import com.intellectualcrafters.plot.util.PlayerFunctions;
|
||||||
|
import com.intellectualcrafters.plot.util.UUIDHandler;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
@ -54,7 +56,7 @@ public class Inbox extends SubCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Integer tier;
|
Integer tier;
|
||||||
final UUID uuid = plr.getUniqueId();
|
final UUID uuid = UUIDHandler.getUUID(plr);
|
||||||
if (PlotMain.hasPermission(plr, "plots.admin")) {
|
if (PlotMain.hasPermission(plr, "plots.admin")) {
|
||||||
tier = 0;
|
tier = 0;
|
||||||
} else if (plot.owner == uuid) {
|
} else if (plot.owner == uuid) {
|
||||||
|
@ -25,6 +25,8 @@ import com.intellectualcrafters.plot.PlotMain;
|
|||||||
import com.intellectualcrafters.plot.config.C;
|
import com.intellectualcrafters.plot.config.C;
|
||||||
import com.intellectualcrafters.plot.object.Plot;
|
import com.intellectualcrafters.plot.object.Plot;
|
||||||
import com.intellectualcrafters.plot.util.PlayerFunctions;
|
import com.intellectualcrafters.plot.util.PlayerFunctions;
|
||||||
|
import com.intellectualcrafters.plot.util.UUIDHandler;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
@ -41,7 +43,7 @@ import org.bukkit.entity.Player;
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
final Plot plot = PlayerFunctions.getCurrentPlot(plr);
|
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);
|
PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,10 @@ import com.intellectualcrafters.plot.object.PlotWorld;
|
|||||||
import com.intellectualcrafters.plot.util.PlayerFunctions;
|
import com.intellectualcrafters.plot.util.PlayerFunctions;
|
||||||
import com.intellectualcrafters.plot.util.PlotHelper;
|
import com.intellectualcrafters.plot.util.PlotHelper;
|
||||||
import com.intellectualcrafters.plot.util.SetBlockFast;
|
import com.intellectualcrafters.plot.util.SetBlockFast;
|
||||||
|
import com.intellectualcrafters.plot.util.UUIDHandler;
|
||||||
|
|
||||||
import net.milkbowl.vault.economy.Economy;
|
import net.milkbowl.vault.economy.Economy;
|
||||||
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
@ -83,7 +86,7 @@ public class Merge extends SubCommand {
|
|||||||
PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS);
|
PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!plot.getOwner().equals(plr.getUniqueId())) {
|
if (!plot.getOwner().equals(UUIDHandler.getUUID(plr))) {
|
||||||
PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS);
|
PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -126,7 +129,7 @@ public class Merge extends SubCommand {
|
|||||||
}
|
}
|
||||||
for (final PlotId myid : plots) {
|
for (final PlotId myid : plots) {
|
||||||
final Plot myplot = PlotMain.getPlots(world).get(myid);
|
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()));
|
PlayerFunctions.sendMessage(plr, C.NO_PERM_MERGE.s().replaceAll("%plot%", myid.toString()));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,8 @@ import com.intellectualcrafters.plot.object.Plot;
|
|||||||
import com.intellectualcrafters.plot.object.PlotSelection;
|
import com.intellectualcrafters.plot.object.PlotSelection;
|
||||||
import com.intellectualcrafters.plot.util.PlayerFunctions;
|
import com.intellectualcrafters.plot.util.PlayerFunctions;
|
||||||
import com.intellectualcrafters.plot.util.PlotHelper;
|
import com.intellectualcrafters.plot.util.PlotHelper;
|
||||||
|
import com.intellectualcrafters.plot.util.UUIDHandler;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
public class Paste extends SubCommand {
|
public class Paste extends SubCommand {
|
||||||
@ -42,7 +44,7 @@ public class Paste extends SubCommand {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
final Plot plot = PlayerFunctions.getCurrentPlot(plr);
|
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);
|
PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,8 @@ import com.intellectualcrafters.plot.config.C;
|
|||||||
import com.intellectualcrafters.plot.database.DBFunc;
|
import com.intellectualcrafters.plot.database.DBFunc;
|
||||||
import com.intellectualcrafters.plot.object.Plot;
|
import com.intellectualcrafters.plot.object.Plot;
|
||||||
import com.intellectualcrafters.plot.util.PlayerFunctions;
|
import com.intellectualcrafters.plot.util.PlayerFunctions;
|
||||||
|
import com.intellectualcrafters.plot.util.UUIDHandler;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
@SuppressWarnings({"unused", "deprecated", "javadoc"}) public class Rate extends SubCommand {
|
@SuppressWarnings({"unused", "deprecated", "javadoc"}) public class Rate extends SubCommand {
|
||||||
@ -53,7 +55,7 @@ import org.bukkit.entity.Player;
|
|||||||
sendMessage(plr, C.RATING_NOT_OWNED);
|
sendMessage(plr, C.RATING_NOT_OWNED);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (plot.getOwner().equals(plr.getUniqueId())) {
|
if (plot.getOwner().equals(UUIDHandler.getUUID(plr))) {
|
||||||
sendMessage(plr, C.RATING_NOT_YOUR_OWN);
|
sendMessage(plr, C.RATING_NOT_YOUR_OWN);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -29,6 +29,8 @@ import com.intellectualcrafters.plot.object.PlotSelection;
|
|||||||
import com.intellectualcrafters.plot.util.PlayerFunctions;
|
import com.intellectualcrafters.plot.util.PlayerFunctions;
|
||||||
import com.intellectualcrafters.plot.util.PlotHelper;
|
import com.intellectualcrafters.plot.util.PlotHelper;
|
||||||
import com.intellectualcrafters.plot.util.SetBlockFast;
|
import com.intellectualcrafters.plot.util.SetBlockFast;
|
||||||
|
import com.intellectualcrafters.plot.util.UUIDHandler;
|
||||||
|
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
@ -55,7 +57,7 @@ public class Swap extends SubCommand {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
final Plot plot = PlayerFunctions.getCurrentPlot(plr);
|
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);
|
PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -69,7 +71,7 @@ public class Swap extends SubCommand {
|
|||||||
try {
|
try {
|
||||||
plotid = new PlotId(Integer.parseInt(id.split(";")[0]), Integer.parseInt(id.split(";")[1]));
|
plotid = new PlotId(Integer.parseInt(id.split(";")[0]), Integer.parseInt(id.split(";")[1]));
|
||||||
final Plot plot2 = PlotMain.getPlots(world).get(plotid);
|
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());
|
PlayerFunctions.sendMessage(plr, C.NO_PERM_MERGE, plotid.toString());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ import java.util.UUID;
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
final Plot plot = PlayerFunctions.getCurrentPlot(plr);
|
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);
|
PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -107,19 +107,6 @@ import java.util.UUID;
|
|||||||
PlayerFunctions.sendMessage(plr, C.TRUSTED_REMOVED);
|
PlayerFunctions.sendMessage(plr, C.TRUSTED_REMOVED);
|
||||||
return true;
|
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]);
|
final UUID uuid = UUIDHandler.getUUID(args[1]);
|
||||||
plot.removeTrusted(uuid);
|
plot.removeTrusted(uuid);
|
||||||
DBFunc.removeTrusted(plr.getWorld().getName(), plot, Bukkit.getOfflinePlayer(args[1]));
|
DBFunc.removeTrusted(plr.getWorld().getName(), plot, Bukkit.getOfflinePlayer(args[1]));
|
||||||
|
@ -27,7 +27,10 @@ import com.intellectualcrafters.plot.database.DBFunc;
|
|||||||
import com.intellectualcrafters.plot.object.Plot;
|
import com.intellectualcrafters.plot.object.Plot;
|
||||||
import com.intellectualcrafters.plot.object.PlotWorld;
|
import com.intellectualcrafters.plot.object.PlotWorld;
|
||||||
import com.intellectualcrafters.plot.util.PlayerFunctions;
|
import com.intellectualcrafters.plot.util.PlayerFunctions;
|
||||||
|
import com.intellectualcrafters.plot.util.UUIDHandler;
|
||||||
|
|
||||||
import net.milkbowl.vault.economy.Economy;
|
import net.milkbowl.vault.economy.Economy;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
public class Unclaim extends SubCommand {
|
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))) {
|
if (!PlayerFunctions.getTopPlot(plr.getWorld(), plot).equals(PlayerFunctions.getBottomPlot(plr.getWorld(), plot))) {
|
||||||
return !sendMessage(plr, C.UNLINK_REQUIRED);
|
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);
|
return !sendMessage(plr, C.NO_PLOT_PERMS);
|
||||||
}
|
}
|
||||||
assert plot != null;
|
assert plot != null;
|
||||||
|
@ -56,7 +56,7 @@ public class Unlink extends SubCommand {
|
|||||||
return sendMessage(plr, C.NOT_IN_PLOT);
|
return sendMessage(plr, C.NOT_IN_PLOT);
|
||||||
}
|
}
|
||||||
final Plot plot = PlayerFunctions.getCurrentPlot(plr);
|
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);
|
return sendMessage(plr, C.NO_PLOT_PERMS);
|
||||||
}
|
}
|
||||||
if (PlayerFunctions.getTopPlot(plr.getWorld(), plot).equals(PlayerFunctions.getBottomPlot(plr.getWorld(), plot))) {
|
if (PlayerFunctions.getTopPlot(plr.getWorld(), plot).equals(PlayerFunctions.getBottomPlot(plr.getWorld(), plot))) {
|
||||||
|
@ -86,7 +86,7 @@ public class list extends SubCommand {
|
|||||||
final StringBuilder string = new StringBuilder();
|
final StringBuilder string = new StringBuilder();
|
||||||
string.append(C.PLOT_LIST_HEADER.s().replaceAll("%word%", "all")).append("\n");
|
string.append(C.PLOT_LIST_HEADER.s().replaceAll("%word%", "all")).append("\n");
|
||||||
for (final Plot p : PlotMain.getPlotsSorted()) {
|
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");
|
string.append(C.PLOT_LIST_ITEM.s().replaceAll("%id", p.id.toString()).replaceAll("%world", p.world).replaceAll("%owner", getName(p.owner))).append("\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -180,7 +180,7 @@ import java.util.*;
|
|||||||
if (player == null) {
|
if (player == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (UUIDHandler.getUUID(player).equals(event.getPlayer().getUniqueId())) {
|
if (UUIDHandler.getUUID(player).equals(UUIDHandler.getUUID(event.getPlayer()))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (player.isOnline()) {
|
if (player.isOnline()) {
|
||||||
@ -219,7 +219,7 @@ import java.util.*;
|
|||||||
if (player == null) {
|
if (player == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (UUIDHandler.getUUID(player).equals(event.getPlayer().getUniqueId())) {
|
if (UUIDHandler.getUUID(player).equals(UUIDHandler.getUUID(event.getPlayer()))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (player.isOnline()) {
|
if (player.isOnline()) {
|
||||||
|
@ -124,7 +124,7 @@ import java.util.Set;
|
|||||||
}
|
}
|
||||||
final Plot plot = PlotHelper.getCurrentPlot(b.getLocation());
|
final Plot plot = PlotHelper.getCurrentPlot(b.getLocation());
|
||||||
if (plot != null) {
|
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);
|
PWE.setMask(p, l);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -143,7 +143,7 @@ import java.util.Set;
|
|||||||
}
|
}
|
||||||
if (this.restrictedcmds.contains(cmd)) {
|
if (this.restrictedcmds.contains(cmd)) {
|
||||||
final Plot plot = PlayerFunctions.getCurrentPlot(p);
|
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);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -33,6 +33,7 @@ import com.sk89q.worldedit.bukkit.BukkitPlayer;
|
|||||||
import com.sk89q.worldedit.function.mask.Mask;
|
import com.sk89q.worldedit.function.mask.Mask;
|
||||||
import com.sk89q.worldedit.function.mask.RegionMask;
|
import com.sk89q.worldedit.function.mask.RegionMask;
|
||||||
import com.sk89q.worldedit.regions.CuboidRegion;
|
import com.sk89q.worldedit.regions.CuboidRegion;
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -57,7 +58,7 @@ import org.bukkit.entity.Player;
|
|||||||
final Plot plot = PlotMain.getPlots(l.getWorld()).get(id);
|
final Plot plot = PlotMain.getPlots(l.getWorld()).get(id);
|
||||||
if (plot != null) {
|
if (plot != null) {
|
||||||
boolean r;
|
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 (!r) {
|
||||||
if (p.hasPermission("plots.worldedit.bypass")) {
|
if (p.hasPermission("plots.worldedit.bypass")) {
|
||||||
removeMask(p, s);
|
removeMask(p, s);
|
||||||
|
@ -220,7 +220,7 @@ import java.util.*;
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static int getPlayerPlotCount(final World world, final Player plr) {
|
public static int getPlayerPlotCount(final World world, final Player plr) {
|
||||||
final UUID uuid = plr.getUniqueId();
|
final UUID uuid = UUIDHandler.getUUID(plr);
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for (final Plot plot : PlotMain.getPlots(world).values()) {
|
for (final Plot plot : PlotMain.getPlots(world).values()) {
|
||||||
if (plot.hasOwner() && plot.owner.equals(uuid) && plot.countsTowardsMax) {
|
if (plot.hasOwner() && plot.owner.equals(uuid) && plot.countsTowardsMax) {
|
||||||
|
Loading…
Reference in New Issue
Block a user