mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 13:16:45 +01:00
Fixed
This commit is contained in:
parent
dc80fce05d
commit
1dd0b5de5f
@ -423,7 +423,7 @@ public class PlotHelper {
|
|||||||
public static boolean createPlot(Player player, Plot plot) {
|
public static boolean createPlot(Player player, Plot plot) {
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
World w = plot.getWorld();
|
World w = plot.getWorld();
|
||||||
Plot p = new Plot(plot.id, player.getUniqueId(), plot.settings.getBiome(), null, null, w.getName());
|
Plot p = new Plot(plot.id, player.getUniqueId(), plot.settings.getBiome(), new ArrayList<UUID>(), new ArrayList<UUID>(), w.getName());
|
||||||
PlotMain.updatePlot(p);
|
PlotMain.updatePlot(p);
|
||||||
DBFunc.createPlot(p);
|
DBFunc.createPlot(p);
|
||||||
DBFunc.createPlotSettings(DBFunc.getId(w.getName(), p.id), p);
|
DBFunc.createPlotSettings(DBFunc.getId(w.getName(), p.id), p);
|
||||||
@ -824,10 +824,12 @@ public class PlotHelper {
|
|||||||
int startZ = (pos1.getBlockZ() / 16) * 16;
|
int startZ = (pos1.getBlockZ() / 16) * 16;
|
||||||
int chunkX = 16 + pos2.getBlockX();
|
int chunkX = 16 + pos2.getBlockX();
|
||||||
int chunkZ = 16 + pos2.getBlockZ();
|
int chunkZ = 16 + pos2.getBlockZ();
|
||||||
int plotMinX = getPlotBottomLoc(world, plot.id).getBlockX() + 1;
|
Location l1 = getPlotBottomLoc(world, plot.id);
|
||||||
int plotMinZ = getPlotBottomLoc(world, plot.id).getBlockZ() + 1;
|
Location l2 = getPlotTopLoc(world, plot.id);
|
||||||
int plotMaxX = getPlotTopLoc(world, plot.id).getBlockX();
|
int plotMinX = l1.getBlockX() + 1;
|
||||||
int plotMaxZ = getPlotTopLoc(world, plot.id).getBlockZ();
|
int plotMinZ = l1.getBlockZ() + 1;
|
||||||
|
int plotMaxX = l2.getBlockX();
|
||||||
|
int plotMaxZ = l2.getBlockZ();
|
||||||
Location min = null;
|
Location min = null;
|
||||||
Location max = null;
|
Location max = null;
|
||||||
for (int i = startX; i < chunkX; i += 16) {
|
for (int i = startX; i < chunkX; i += 16) {
|
||||||
@ -878,7 +880,7 @@ public class PlotHelper {
|
|||||||
if (max.getBlockX() > plotMaxX) {
|
if (max.getBlockX() > plotMaxX) {
|
||||||
max.setX(plotMaxX);
|
max.setX(plotMaxX);
|
||||||
}
|
}
|
||||||
if (max.getBlockX() > plotMaxZ) {
|
if (max.getBlockZ() > plotMaxZ) {
|
||||||
max.setZ(plotMaxZ);
|
max.setZ(plotMaxZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ public enum Command {
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
DELETE("delete", "d", new CommandPermission("plots.clear.delete")),
|
DELETE("delete", "d", new CommandPermission("plots.delete")),
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@ -38,7 +38,7 @@ public class Delete extends SubCommand {
|
|||||||
PlayerFunctions.sendMessage(plr, C.UNLINK_REQUIRED);
|
PlayerFunctions.sendMessage(plr, C.UNLINK_REQUIRED);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(plr.getUniqueId())) && !plr.hasPermission("plots.admin")) {
|
if ((((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(plr.getUniqueId()))) && !plr.hasPermission("plots.admin")) {
|
||||||
PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS);
|
PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -31,10 +31,9 @@ public class Denied extends SubCommand {
|
|||||||
super(Command.DENIED, "Manage plot helpers", "denied {add|remove} {player}", CommandCategory.ACTIONS);
|
super(Command.DENIED, "Manage plot helpers", "denied {add|remove} {player}", CommandCategory.ACTIONS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecated")
|
|
||||||
private boolean hasBeenOnServer(String name) {
|
private boolean hasBeenOnServer(String name) {
|
||||||
Player plr;
|
Player plr = Bukkit.getPlayerExact(name);
|
||||||
if ((plr = Bukkit.getPlayer(name)) == null) {
|
if (plr == null) {
|
||||||
OfflinePlayer oplr = Bukkit.getOfflinePlayer(name);
|
OfflinePlayer oplr = Bukkit.getOfflinePlayer(name);
|
||||||
if (oplr == null) {
|
if (oplr == null) {
|
||||||
return false;
|
return false;
|
||||||
@ -78,11 +77,15 @@ public class Denied extends SubCommand {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
UUID uuid = null;
|
UUID uuid = null;
|
||||||
if ((Bukkit.getPlayer(args[1]) != null) && Bukkit.getPlayer(args[1]).isOnline()) {
|
if ((Bukkit.getPlayerExact(args[1]) != null)) {
|
||||||
uuid = Bukkit.getPlayer(args[1]).getUniqueId();
|
uuid = Bukkit.getPlayerExact(args[1]).getUniqueId();
|
||||||
} else {
|
} else {
|
||||||
uuid = Bukkit.getOfflinePlayer(args[1]).getUniqueId();
|
uuid = Bukkit.getOfflinePlayer(args[1]).getUniqueId();
|
||||||
}
|
}
|
||||||
|
if (uuid == null) {
|
||||||
|
PlayerFunctions.sendMessage(plr, C.PLAYER_HAS_NOT_BEEN_ON);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
plot.addDenied(uuid);
|
plot.addDenied(uuid);
|
||||||
DBFunc.setDenied(plr.getWorld().getName(), plot, Bukkit.getOfflinePlayer(args[1]));
|
DBFunc.setDenied(plr.getWorld().getName(), plot, Bukkit.getOfflinePlayer(args[1]));
|
||||||
PlayerPlotDeniedEvent event = new PlayerPlotDeniedEvent(plr, plot, uuid, true);
|
PlayerPlotDeniedEvent event = new PlayerPlotDeniedEvent(plr, plot, uuid, true);
|
||||||
@ -112,8 +115,8 @@ public class Denied extends SubCommand {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
UUID uuid = null;
|
UUID uuid = null;
|
||||||
if (Bukkit.getPlayer(args[1]).isOnline()) {
|
if (Bukkit.getPlayerExact(args[1])!=null) {
|
||||||
uuid = Bukkit.getPlayer(args[1]).getUniqueId();
|
uuid = Bukkit.getPlayerExact(args[1]).getUniqueId();
|
||||||
} else {
|
} else {
|
||||||
uuid = Bukkit.getOfflinePlayer(args[1]).getUniqueId();
|
uuid = Bukkit.getOfflinePlayer(args[1]).getUniqueId();
|
||||||
}
|
}
|
||||||
@ -121,6 +124,10 @@ public class Denied extends SubCommand {
|
|||||||
PlayerFunctions.sendMessage(plr, C.WAS_NOT_ADDED);
|
PlayerFunctions.sendMessage(plr, C.WAS_NOT_ADDED);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
if (uuid == null) {
|
||||||
|
PlayerFunctions.sendMessage(plr, C.PLAYER_HAS_NOT_BEEN_ON);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
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]));
|
||||||
PlayerPlotDeniedEvent event = new PlayerPlotDeniedEvent(plr, plot, uuid, false);
|
PlayerPlotDeniedEvent event = new PlayerPlotDeniedEvent(plr, plot, uuid, false);
|
||||||
|
Loading…
Reference in New Issue
Block a user