diff --git a/src/main/java/com/intellectualcrafters/plot/commands/Owner.java b/src/main/java/com/intellectualcrafters/plot/commands/Owner.java index e38b04835..0d95e1b39 100644 --- a/src/main/java/com/intellectualcrafters/plot/commands/Owner.java +++ b/src/main/java/com/intellectualcrafters/plot/commands/Owner.java @@ -46,18 +46,29 @@ public class Owner extends SetCommand { public boolean set(PlotPlayer plr, Plot plot, String value) { HashSet plots = MainUtil.getConnectedPlots(plot); final PlotPlayer other = UUIDHandler.getPlayer(value); - UUID uuid; - uuid = other == null ? (Permissions.hasPermission(plr, "plots.admin.command.setowner") ? UUIDHandler.getUUID(value, null) : null) : other.getUUID(); + UUID uuid = null; + if (other == null) { + if (Permissions.hasPermission(plr, "plots.admin.command.setowner")) { + if ((uuid = UUIDHandler.getUUID(value, null)) == null) { + try { + uuid = UUID.fromString(value); + } catch (Exception e) {} + } + } + } + else { + other.getUUID(); + } if (uuid == null) { MainUtil.sendMessage(plr, C.INVALID_PLAYER, value); return false; } - String name = other == null ? UUIDHandler.getName(uuid) : other.getName(); + String name = other == null ? MainUtil.getName(uuid) : other.getName(); if (plot.isOwner(uuid)) { C.ALREADY_OWNER.send(plr); return false; } - if (!Permissions.hasPermission(plr, "plots.admin.command.setowner")) { + if (other != null && !Permissions.hasPermission(plr, "plots.admin.command.setowner")) { final int size = plots.size(); final int currentPlots = (Settings.GLOBAL_LIMIT ? MainUtil.getPlayerPlotCount(other) : MainUtil.getPlayerPlotCount(plot.world, other)) + size; if (currentPlots > MainUtil.getAllowedPlots(other)) { diff --git a/src/main/java/com/intellectualcrafters/plot/commands/Set.java b/src/main/java/com/intellectualcrafters/plot/commands/Set.java index 21c02acd8..f85042991 100644 --- a/src/main/java/com/intellectualcrafters/plot/commands/Set.java +++ b/src/main/java/com/intellectualcrafters/plot/commands/Set.java @@ -177,7 +177,7 @@ public class Set extends SubCommand { // components HashSet components = new HashSet(Arrays.asList(plot.getManager().getPlotComponents(plot.getWorld(), plot.id))); if (components.contains(args[0].toLowerCase())) { - return component.onCommand(plr, Arrays.copyOfRange(args, 1, args.length)); + return component.onCommand(plr, Arrays.copyOfRange(args, 0, args.length)); } // flag { diff --git a/src/main/java/com/intellectualcrafters/plot/generator/ClassicPlotManager.java b/src/main/java/com/intellectualcrafters/plot/generator/ClassicPlotManager.java index 730217706..475dd8aee 100644 --- a/src/main/java/com/intellectualcrafters/plot/generator/ClassicPlotManager.java +++ b/src/main/java/com/intellectualcrafters/plot/generator/ClassicPlotManager.java @@ -227,7 +227,7 @@ public class ClassicPlotManager extends SquarePlotManager { final int sz = pos1.getZ() - 2; final int ez = pos2.getZ() + 2; MainUtil.setSimpleCuboidAsync(plotworld.worldname, new Location(plotworld.worldname, sx, Math.min(dpw.WALL_HEIGHT, dpw.ROAD_HEIGHT) + 1, sz + 1), new Location(plotworld.worldname, ex, 255, ez - 1), new PlotBlock((short) 0, (byte) 0)); - MainUtil.setSimpleCuboidAsync(plotworld.worldname, new Location(plotworld.worldname, sx, 1, sz + 1), new Location(plotworld.worldname, ex, dpw.PLOT_HEIGHT, ez - 1), new PlotBlock((short) 7, + MainUtil.setSimpleCuboidAsync(plotworld.worldname, new Location(plotworld.worldname, sx, 0, sz + 1), new Location(plotworld.worldname, ex, 0, ez - 1), new PlotBlock((short) 7, (byte) 0)); MainUtil.setSimpleCuboidAsync(plotworld.worldname, new Location(plotworld.worldname, sx, 1, sz + 1), new Location(plotworld.worldname, sx, dpw.WALL_HEIGHT, ez - 1), dpw.WALL_FILLING); MainUtil.setSimpleCuboidAsync(plotworld.worldname, new Location(plotworld.worldname, sx, dpw.WALL_HEIGHT + 1, sz + 1), new Location(plotworld.worldname, sx, dpw.WALL_HEIGHT + 1, ez - 1), diff --git a/src/main/java/com/intellectualcrafters/plot/util/SchematicHandler.java b/src/main/java/com/intellectualcrafters/plot/util/SchematicHandler.java index 5cd5c8980..107c253ec 100644 --- a/src/main/java/com/intellectualcrafters/plot/util/SchematicHandler.java +++ b/src/main/java/com/intellectualcrafters/plot/util/SchematicHandler.java @@ -519,6 +519,7 @@ public abstract class SchematicHandler { } public List getSaves(final UUID uuid) { + final StringBuilder rawJSON = new StringBuilder(); try { final String website = Settings.WEB_URL + "list.php?" + uuid.toString(); final URL url = new URL(website); @@ -526,7 +527,6 @@ public abstract class SchematicHandler { connection.setRequestProperty("User-Agent", "Mozilla/5.0"); final BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream())); String line; - final StringBuilder rawJSON = new StringBuilder(); while ((line = reader.readLine()) != null) { rawJSON.append(line); } @@ -540,6 +540,7 @@ public abstract class SchematicHandler { return Lists.reverse(schematics); } catch (final Exception e) { e.printStackTrace(); + PS.debug("ERROR PARSING: " + rawJSON); } return null; } diff --git a/target/PlotSquared-Bukkit.jar b/target/PlotSquared-Bukkit.jar index 694be72ea..6daf137ca 100644 Binary files a/target/PlotSquared-Bukkit.jar and b/target/PlotSquared-Bukkit.jar differ