mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 13:16:45 +01:00
Fix /plot sethome
returning usage message & working on unclaimed plots
This commit is contained in:
parent
8bfdf8ecf2
commit
891230c78e
@ -42,6 +42,10 @@ public class SetHome extends SetCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean set(PlotPlayer<?> player, Plot plot, String value) {
|
public boolean set(PlotPlayer<?> player, Plot plot, String value) {
|
||||||
|
if (!plot.hasOwner()) {
|
||||||
|
player.sendMessage(TranslatableCaption.of("info.plot_unowned"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
switch (value.toLowerCase()) {
|
switch (value.toLowerCase()) {
|
||||||
case "unset":
|
case "unset":
|
||||||
case "reset":
|
case "reset":
|
||||||
@ -50,8 +54,9 @@ public class SetHome extends SetCommand {
|
|||||||
Plot base = plot.getBasePlot(false);
|
Plot base = plot.getBasePlot(false);
|
||||||
base.setHome(null);
|
base.setHome(null);
|
||||||
player.sendMessage(TranslatableCaption.of("position.position_unset"));
|
player.sendMessage(TranslatableCaption.of("position.position_unset"));
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
case "":
|
case "": {
|
||||||
Plot base = plot.getBasePlot(false);
|
Plot base = plot.getBasePlot(false);
|
||||||
Location bottom = base.getBottomAbs();
|
Location bottom = base.getBottomAbs();
|
||||||
Location location = player.getLocationFull();
|
Location location = player.getLocationFull();
|
||||||
@ -60,6 +65,8 @@ public class SetHome extends SetCommand {
|
|||||||
);
|
);
|
||||||
base.setHome(rel);
|
base.setHome(rel);
|
||||||
player.sendMessage(TranslatableCaption.of("position.position_set"));
|
player.sendMessage(TranslatableCaption.of("position.position_set"));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("commandconfig.command_syntax"),
|
TranslatableCaption.of("commandconfig.command_syntax"),
|
||||||
|
@ -316,7 +316,7 @@
|
|||||||
"info.server": "<gray>Server</gray>",
|
"info.server": "<gray>Server</gray>",
|
||||||
"info.everyone": "<gray>Everyone</gray>",
|
"info.everyone": "<gray>Everyone</gray>",
|
||||||
"info.infinite": "<gray>Infinite</gray>",
|
"info.infinite": "<gray>Infinite</gray>",
|
||||||
"info.plot_unowned": "<prefix><gray>The current plot must have an owner to perform this action.</gray>",
|
"info.plot_unowned": "<prefix><red>The current plot must have an owner to perform this action.</red>",
|
||||||
"info.plot_info_unclaimed": "<prefix><gray>Plot <gold><plot></gold> is not yet claimed.</gray>",
|
"info.plot_info_unclaimed": "<prefix><gray>Plot <gold><plot></gold> is not yet claimed.</gray>",
|
||||||
"info.plot_info_header": "<dark_gray><strikethrough>--------- <reset><gold>INFO </gold><dark_gray><strikethrough>---------</dark_gray><reset>",
|
"info.plot_info_header": "<dark_gray><strikethrough>--------- <reset><gold>INFO </gold><dark_gray><strikethrough>---------</dark_gray><reset>",
|
||||||
"info.plot_info_hidden": "<prefix><red>You cannot view the information about this plot.</red>",
|
"info.plot_info_hidden": "<prefix><red>You cannot view the information about this plot.</red>",
|
||||||
|
Loading…
Reference in New Issue
Block a user