mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 13:16:45 +01:00
Fixes
Fixes #701 Fixes set components for other plots Add setowner uuid. Probably some other stuff
This commit is contained in:
parent
7ed693dfc8
commit
7db30590c6
@ -46,18 +46,29 @@ public class Owner extends SetCommand {
|
||||
public boolean set(PlotPlayer plr, Plot plot, String value) {
|
||||
HashSet<Plot> 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)) {
|
||||
|
@ -177,7 +177,7 @@ public class Set extends SubCommand {
|
||||
// components
|
||||
HashSet<String> components = new HashSet<String>(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
|
||||
{
|
||||
|
@ -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),
|
||||
|
@ -519,6 +519,7 @@ public abstract class SchematicHandler {
|
||||
}
|
||||
|
||||
public List<String> 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;
|
||||
}
|
||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user