mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 15:16:45 +01:00
Fixed setowner
This commit is contained in:
parent
4475290443
commit
3bd7f6a3a9
@ -8,7 +8,7 @@
|
|||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
<artifactId>PlotSquared</artifactId>
|
<artifactId>PlotSquared</artifactId>
|
||||||
<version>2.6.0</version>
|
<version>2.6.1</version>
|
||||||
<name>PlotSquared</name>
|
<name>PlotSquared</name>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<build>
|
<build>
|
||||||
|
@ -39,7 +39,7 @@ import com.intellectualcrafters.plot.util.UUIDHandler;
|
|||||||
public class SetOwner extends SubCommand {
|
public class SetOwner extends SubCommand {
|
||||||
|
|
||||||
public SetOwner() {
|
public SetOwner() {
|
||||||
super("setowner", "plots.admin.command.setowner", "Set the plot owner", "setowner {player}", "so", CommandCategory.ACTIONS, true);
|
super("setowner", "plots.set.owner", "Set the plot owner", "setowner {player}", "so", CommandCategory.ACTIONS, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -57,19 +57,21 @@ public class SetOwner extends SubCommand {
|
|||||||
Plot plot = PlayerFunctions.getCurrentPlot(plr);
|
Plot plot = PlayerFunctions.getCurrentPlot(plr);
|
||||||
if (plot == null || plot.owner == null) {
|
if (plot == null || plot.owner == null) {
|
||||||
PlayerFunctions.sendMessage(plr, C.NOT_IN_PLOT);
|
PlayerFunctions.sendMessage(plr, C.NOT_IN_PLOT);
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
if (args.length < 1) {
|
if (args.length < 1) {
|
||||||
PlayerFunctions.sendMessage(plr, C.NEED_USER);
|
PlayerFunctions.sendMessage(plr, C.NEED_USER);
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!plot.owner.equals(UUIDHandler.getUUID(plr))) {
|
||||||
|
PlayerFunctions.sendMessage(plr, C.NO_PERMISSION, "plots.admin.command.setowner");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
final World world = plr.getWorld();
|
final World world = plr.getWorld();
|
||||||
final PlotId bot = PlayerFunctions.getBottomPlot(world, plot).id;
|
final PlotId bot = PlayerFunctions.getBottomPlot(world, plot).id;
|
||||||
final PlotId top = PlayerFunctions.getTopPlot(world, plot).id;
|
final PlotId top = PlayerFunctions.getTopPlot(world, plot).id;
|
||||||
|
|
||||||
final ArrayList<PlotId> plots = PlayerFunctions.getPlotSelectionIds(bot, top);
|
final ArrayList<PlotId> plots = PlayerFunctions.getPlotSelectionIds(bot, top);
|
||||||
|
|
||||||
for (final PlotId id : plots) {
|
for (final PlotId id : plots) {
|
||||||
final Plot current = PlotMain.getPlots(world).get(id);
|
final Plot current = PlotMain.getPlots(world).get(id);
|
||||||
|
|
||||||
@ -89,9 +91,7 @@ public class SetOwner extends SubCommand {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
PlotHelper.setSign(world, args[0], plot);
|
PlotHelper.setSign(world, args[0], plot);
|
||||||
|
|
||||||
PlayerFunctions.sendMessage(plr, C.SET_OWNER);
|
PlayerFunctions.sendMessage(plr, C.SET_OWNER);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user