mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-28 19:54:43 +02:00
Fixes
Fixes #701 Fixes set components for other plots Add setowner uuid. Probably some other stuff
This commit is contained in:
@ -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
|
||||
{
|
||||
|
Reference in New Issue
Block a user