mirror of
https://e.coding.net/circlecloud/Residence.git
synced 2025-11-24 21:46:16 +00:00
@@ -18,7 +18,7 @@ public class CommandLease extends BaseCommand {
|
|||||||
Residence plugin;
|
Residence plugin;
|
||||||
|
|
||||||
public CommandLease(final Residence plugin) {
|
public CommandLease(final Residence plugin) {
|
||||||
super("?");
|
super("lease");
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
setOnlyPlayerExecutable(true);
|
setOnlyPlayerExecutable(true);
|
||||||
setMinimumArguments(2);
|
setMinimumArguments(2);
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ public class CommandLimits extends BaseCommand {
|
|||||||
public CommandLimits(final Residence plugin) {
|
public CommandLimits(final Residence plugin) {
|
||||||
super("limits");
|
super("limits");
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
|
setOnlyPlayerExecutable(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ public class CommandList extends BaseCommand {
|
|||||||
public CommandList(final Residence plugin) {
|
public CommandList(final Residence plugin) {
|
||||||
super("list");
|
super("list");
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
|
setOnlyPlayerExecutable(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ public class CommandListAll extends BaseCommand {
|
|||||||
public CommandListAll(final Residence plugin) {
|
public CommandListAll(final Residence plugin) {
|
||||||
super("listall");
|
super("listall");
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
|
setOnlyPlayerExecutable(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ public class CommandListHidden extends BaseCommand {
|
|||||||
public CommandListHidden(final Residence plugin) {
|
public CommandListHidden(final Residence plugin) {
|
||||||
super("listhidden");
|
super("listhidden");
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
|
setOnlyPlayerExecutable(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -26,7 +26,9 @@ public class CommandSelect extends BaseCommand {
|
|||||||
public CommandSelect(final Residence plugin) {
|
public CommandSelect(final Residence plugin) {
|
||||||
super("select");
|
super("select");
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
|
setMinimumArguments(1);
|
||||||
setOnlyPlayerExecutable(true);
|
setOnlyPlayerExecutable(true);
|
||||||
|
setPossibleArguments("请使用/res select ? 查看帮助");
|
||||||
setPermission("residence.select");
|
setPermission("residence.select");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,8 +50,13 @@ public class CommandSelect extends BaseCommand {
|
|||||||
player.sendMessage(ChatColor.RED + language.getPhrase("SelectDiabled"));
|
player.sendMessage(ChatColor.RED + language.getPhrase("SelectDiabled"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (args.length == 1) {
|
|
||||||
if (args[0].equals("size") || args[0].equals("cost")) {
|
final String subcmd = args[0];
|
||||||
|
switch (args.length) {
|
||||||
|
case 1:
|
||||||
|
switch (subcmd) {
|
||||||
|
case "size":
|
||||||
|
case "cost":
|
||||||
if (smanager.hasPlacedBoth(player.getName())) {
|
if (smanager.hasPlacedBoth(player.getName())) {
|
||||||
try {
|
try {
|
||||||
smanager.showSelectionInfo(player);
|
smanager.showSelectionInfo(player);
|
||||||
@@ -67,16 +74,17 @@ public class CommandSelect extends BaseCommand {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (args[0].equals("vert")) {
|
return;
|
||||||
|
case "vert":
|
||||||
smanager.vert(player, resadmin);
|
smanager.vert(player, resadmin);
|
||||||
return;
|
return;
|
||||||
} else if (args[0].equals("sky")) {
|
case "sky":
|
||||||
smanager.sky(player, resadmin);
|
smanager.sky(player, resadmin);
|
||||||
return;
|
return;
|
||||||
} else if (args[0].equals("bedrock")) {
|
case "bedrock":
|
||||||
smanager.bedrock(player, resadmin);
|
smanager.bedrock(player, resadmin);
|
||||||
return;
|
return;
|
||||||
} else if (args[0].equals("coords")) {
|
case "coords":
|
||||||
final Location playerLoc1 = smanager.getPlayerLoc1(player.getName());
|
final Location playerLoc1 = smanager.getPlayerLoc1(player.getName());
|
||||||
if (playerLoc1 != null) {
|
if (playerLoc1 != null) {
|
||||||
player.sendMessage(ChatColor.GREEN + language.getPhrase("Primary.Selection") + ":" + ChatColor.AQUA + " (" + playerLoc1.getBlockX() + ", " + playerLoc1.getBlockY() + ", "
|
player.sendMessage(ChatColor.GREEN + language.getPhrase("Primary.Selection") + ":" + ChatColor.AQUA + " (" + playerLoc1.getBlockX() + ", " + playerLoc1.getBlockY() + ", "
|
||||||
@@ -88,76 +96,72 @@ public class CommandSelect extends BaseCommand {
|
|||||||
+ playerLoc2.getBlockZ() + ")");
|
+ playerLoc2.getBlockZ() + ")");
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
} else if (args[0].equals("chunk")) {
|
case "chunk":
|
||||||
smanager.selectChunk(player);
|
smanager.selectChunk(player);
|
||||||
return;
|
return;
|
||||||
} else if (args[0].equals("worldedit")) {
|
case "worldedit":
|
||||||
if (smanager.worldEdit(player)) {
|
if (smanager.worldEdit(player)) {
|
||||||
player.sendMessage(ChatColor.GREEN + plugin.getLanguage().getPhrase("SelectionSuccess"));
|
player.sendMessage(ChatColor.GREEN + plugin.getLanguage().getPhrase("SelectionSuccess"));
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else if (args.length == 2) {
|
return;
|
||||||
if (args[0].equals("expand")) {
|
case 2:
|
||||||
int amount;
|
int amount;
|
||||||
try {
|
try {
|
||||||
amount = Integer.parseInt(args[1]);
|
amount = Integer.parseInt(args[1]);
|
||||||
} catch (final Exception ex) {
|
} catch (final Exception ex) {
|
||||||
player.sendMessage(ChatColor.RED + language.getPhrase("InvalidAmount"));
|
player.sendMessage(ChatColor.RED + language.getPhrase("InvalidAmount"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
switch (subcmd) {
|
||||||
|
case "expand":
|
||||||
smanager.modify(player, false, amount);
|
smanager.modify(player, false, amount);
|
||||||
return;
|
return;
|
||||||
} else if (args[0].equals("shift")) {
|
case "shift":
|
||||||
int amount;
|
|
||||||
try {
|
|
||||||
amount = Integer.parseInt(args[1]);
|
|
||||||
} catch (final Exception ex) {
|
|
||||||
player.sendMessage(ChatColor.RED + language.getPhrase("InvalidAmount"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
smanager.modify(player, true, amount);
|
smanager.modify(player, true, amount);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (args.length > 0 && args[0].equals("residence")) {
|
|
||||||
String resName;
|
|
||||||
String areaName;
|
|
||||||
ClaimedResidence res = null;
|
|
||||||
if (args.length > 1) {
|
|
||||||
res = rmanager.getByName(args[1]);
|
|
||||||
} else {
|
|
||||||
res = rmanager.getByLoc(player.getLocation());
|
|
||||||
}
|
|
||||||
if (res == null) {
|
|
||||||
player.sendMessage(ChatColor.RED + language.getPhrase("InvalidResidence"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
resName = res.getName();
|
|
||||||
CuboidArea area = null;
|
|
||||||
if (args.length > 2) {
|
|
||||||
area = res.getArea(args[2]);
|
|
||||||
areaName = args[2];
|
|
||||||
} else {
|
|
||||||
areaName = res.getAreaIDbyLoc(player.getLocation());
|
|
||||||
area = res.getArea(areaName);
|
|
||||||
}
|
|
||||||
if (area != null) {
|
|
||||||
smanager.placeLoc1(player, area.getHighLoc());
|
|
||||||
smanager.placeLoc2(player, area.getLowLoc());
|
|
||||||
player.sendMessage(ChatColor.GREEN + language.getPhrase("SelectionArea", ChatColor.GOLD + areaName + ChatColor.GREEN + "." + ChatColor.GOLD + resName + ChatColor.GREEN));
|
|
||||||
} else {
|
|
||||||
player.sendMessage(ChatColor.RED + language.getPhrase("AreaNonExist"));
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
} else {
|
case 3:
|
||||||
try {
|
try {
|
||||||
smanager.selectBySize(player, Integer.parseInt(args[0]), Integer.parseInt(args[1]), Integer.parseInt(args[2]));
|
smanager.selectBySize(player, Integer.parseInt(args[0]), Integer.parseInt(args[1]), Integer.parseInt(args[2]));
|
||||||
return;
|
|
||||||
} catch (final Exception ex) {
|
} catch (final Exception ex) {
|
||||||
player.sendMessage(ChatColor.RED + language.getPhrase("SelectionFail"));
|
player.sendMessage(ChatColor.RED + language.getPhrase("SelectionFail"));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
|
default:
|
||||||
|
if (args.length > 0) {
|
||||||
|
String resName;
|
||||||
|
String areaName;
|
||||||
|
ClaimedResidence res = null;
|
||||||
|
if (args.length > 1) {
|
||||||
|
res = rmanager.getByName(args[0]);
|
||||||
|
} else {
|
||||||
|
res = rmanager.getByLoc(player.getLocation());
|
||||||
|
}
|
||||||
|
if (res == null) {
|
||||||
|
player.sendMessage(ChatColor.RED + language.getPhrase("InvalidResidence"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
resName = res.getName();
|
||||||
|
CuboidArea area = null;
|
||||||
|
if (args.length > 2) {
|
||||||
|
area = res.getArea(args[1]);
|
||||||
|
areaName = args[1];
|
||||||
|
} else {
|
||||||
|
areaName = res.getAreaIDbyLoc(player.getLocation());
|
||||||
|
area = res.getArea(areaName);
|
||||||
|
}
|
||||||
|
if (area != null) {
|
||||||
|
smanager.placeLoc1(player, area.getHighLoc());
|
||||||
|
smanager.placeLoc2(player, area.getLowLoc());
|
||||||
|
player.sendMessage(ChatColor.GREEN + language.getPhrase("SelectionArea", ChatColor.GOLD + areaName + ChatColor.GREEN + "." + ChatColor.GOLD + resName + ChatColor.GREEN));
|
||||||
|
} else {
|
||||||
|
player.sendMessage(ChatColor.RED + language.getPhrase("AreaNonExist"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user