Added make leader (WIP)

This commit is contained in:
tastybento 2017-08-08 20:49:06 -07:00
parent 95c80a89f8
commit 389b9f52f4
3 changed files with 437 additions and 340 deletions

View File

@ -41,6 +41,7 @@ general:
no-island: "You do not have an island!" no-island: "You do not have an island!"
not-leader: "You are not the leader of your island!" not-leader: "You are not the leader of your island!"
offline-player: "That player is offline or doesn't exist." offline-player: "That player is offline or doesn't exist."
unknown-player: "Unknown player!"
# TODO: These are legacy strings and should be converted to a better format but will do for now # TODO: These are legacy strings and should be converted to a better format but will do for now
acidBottle: "Acid Bottle" acidBottle: "Acid Bottle"

View File

@ -2,7 +2,7 @@ name: BSkyBlock
main: us.tastybento.bskyblock.BSkyBlock main: us.tastybento.bskyblock.BSkyBlock
version: ${version} version: ${version}
authors: [Tastybento, Poslovitch] authors: [tastybento, Poslovitch]
depend: [Vault] depend: [Vault]
softdepend: [Herochat, DeluxeChat, PlaceholderAPI, MVdWPlaceholderAPI] softdepend: [Herochat, DeluxeChat, PlaceholderAPI, MVdWPlaceholderAPI]
@ -16,11 +16,11 @@ commands:
aliases: [is, island] aliases: [is, island]
usage: | usage: |
/island help /island help
asadmin: bsadmin:
description: Admin commands description: Admin commands
usage: | usage: |
/asadmin /bsadmin
asc: bsc:
description: Game challenges description: Game challenges
aliases: [c, challenge, aschallenge, challenges] aliases: [c, challenge, aschallenge, challenges]
usage: | usage: |

View File

@ -269,14 +269,14 @@ public class IslandCommand extends AbstractCommand {
// Get the player's old island // Get the player's old island
Island oldIsland = plugin.getIslands().getIsland(playerUUID); Island oldIsland = plugin.getIslands().getIsland(playerUUID);
if (DEBUG) if (DEBUG)
plugin.getLogger().info("DEBUG: old island is at " + oldIsland.getCenter().getBlockX() + "," + oldIsland.getCenter().getBlockZ()); plugin.getLogger().info("DEBUG: old island is at " + oldIsland.getCenter().getBlockX() + "," + oldIsland.getCenter().getBlockZ());
// Remove them from this island (it still exists and will be deleted later) // Remove them from this island (it still exists and will be deleted later)
plugin.getIslands().removePlayer(playerUUID); plugin.getIslands().removePlayer(playerUUID);
if (DEBUG) if (DEBUG)
plugin.getLogger().info("DEBUG: old island's owner is " + oldIsland.getOwner()); plugin.getLogger().info("DEBUG: old island's owner is " + oldIsland.getOwner());
// Create new island and then delete the old one // Create new island and then delete the old one
if (DEBUG) if (DEBUG)
plugin.getLogger().info("DEBUG: making new island "); plugin.getLogger().info("DEBUG: making new island ");
Schematic schematic = plugin.getSchematics().getSchematic("default"); Schematic schematic = plugin.getSchematics().getSchematic("default");
plugin.getIslands().newIsland(player, schematic, oldIsland); plugin.getIslands().newIsland(player, schematic, oldIsland);
} else { } else {
@ -435,7 +435,7 @@ public class IslandCommand extends AbstractCommand {
@Override @Override
public void execute(CommandSender sender, String[] args) { public void execute(CommandSender sender, String[] args) {
if (DEBUG) if (DEBUG)
plugin.getLogger().info("DEBUG: executing team command"); plugin.getLogger().info("DEBUG: executing team command");
if (inTeam) { if (inTeam) {
if (teamLeaderUUID.equals(playerUUID)) { if (teamLeaderUUID.equals(playerUUID)) {
int maxSize = Settings.maxTeamSize; int maxSize = Settings.maxTeamSize;
@ -486,7 +486,7 @@ public class IslandCommand extends AbstractCommand {
@Override @Override
public String[] usage(CommandSender sender){ public String[] usage(CommandSender sender){
if (DEBUG) if (DEBUG)
plugin.getLogger().info("DEBUG: executing team help"); plugin.getLogger().info("DEBUG: executing team help");
return new String[] {null, plugin.getLocale(sender).get("help.island.team")}; return new String[] {null, plugin.getLocale(sender).get("help.island.team")};
} }
@ -721,7 +721,7 @@ public class IslandCommand extends AbstractCommand {
leavingPlayers.remove(playerUUID); leavingPlayers.remove(playerUUID);
// Remove from team // Remove from team
if (!plugin.getIslands().setLeaveTeam(playerUUID)) { if (!plugin.getIslands().setLeaveTeam(playerUUID)) {
//Util.sendMessage(player, ChatColor.RED + plugin.myLocale(player.getUniqueId()).leaveerrorYouCannotLeaveIsland); //Util.sendMessage(player, ChatColor.RED + plugin.getLocale(playerUUID).get("leaveerrorYouCannotLeaveIsland);
// If this is canceled, fail silently // If this is canceled, fail silently
return; return;
} }
@ -870,7 +870,7 @@ public class IslandCommand extends AbstractCommand {
@Override @Override
public CanUseResp canUse(CommandSender sender) { public CanUseResp canUse(CommandSender sender) {
if (VaultHelper.hasPerm(player, Settings.PERMPREFIX + "team.create")) { if (VaultHelper.hasPerm(player, Settings.PERMPREFIX + "team.join")) {
return new CanUseResp(true); return new CanUseResp(true);
} }
return new CanUseResp(ChatColor.RED + plugin.getLocale(sender).get("general.errors.no-permission")); return new CanUseResp(ChatColor.RED + plugin.getLocale(sender).get("general.errors.no-permission"));
@ -878,7 +878,21 @@ public class IslandCommand extends AbstractCommand {
@Override @Override
public void execute(CommandSender sender, String[] args) { public void execute(CommandSender sender, String[] args) {
// Reject /island reject
if (inviteList.containsKey(player.getUniqueId())) {
Util.sendMessage(player, ChatColor.YELLOW + plugin.getLocale(playerUUID).get("reject.youHaveRejectedInvitation"));
// If the player is online still then tell them directly
// about the rejection
if (Bukkit.getPlayer(inviteList.get(player.getUniqueId())) != null) {
Util.sendMessage(Bukkit.getPlayer(inviteList.get(playerUUID)),
ChatColor.RED + plugin.getLocale(playerUUID).get("reject.nameHasRejectedInvite").replace("[name]", player.getName()));
}
// Remove this player from the global invite list
inviteList.remove(player.getUniqueId());
} else {
// Someone typed /island reject and had not been invited
Util.sendMessage(player, ChatColor.RED + plugin.getLocale(playerUUID).get("reject.youHaveNotBeenInvited"));
}
} }
@Override @Override
@ -905,8 +919,90 @@ public class IslandCommand extends AbstractCommand {
@Override @Override
public void execute(CommandSender sender, String[] args) { public void execute(CommandSender sender, String[] args) {
UUID targetPlayer = plugin.getPlayers().getUUID(args[0]);
if (targetPlayer == null) {
Util.sendMessage(player, ChatColor.RED + plugin.getLocale(playerUUID).get("general.errors.unknown-player"));
return;
}
if (!plugin.getPlayers().inTeam(playerUUID)) {
Util.sendMessage(player, ChatColor.RED + plugin.getLocale(playerUUID).get("makeLeader.errorYouMustBeInTeam"));
return;
}
if (teamLeaderUUID.equals(playerUUID)) {
Util.sendMessage(player, ChatColor.RED + plugin.getLocale(playerUUID).get("makeLeader.errorNotYourIsland"));
return;
}
if (targetPlayer.equals(playerUUID)) {
Util.sendMessage(player, ChatColor.RED + plugin.getLocale(playerUUID).get("makeLeader.errorGeneralError"));
return;
}
if (!teamMembers.contains(targetPlayer)) {
Util.sendMessage(player, ChatColor.RED + plugin.getLocale(playerUUID).get("makeLeader.errorThatPlayerIsNotInTeam"));
return;
}
// targetPlayer is the new leader
//plugin.getIslands().getIsland(playerUUID).makeLeader(targetPlayer);
Util.sendMessage(player, ChatColor.GREEN
+ plugin.getLocale(playerUUID).get("makeLeader.nameIsNowTheOwner").replace("[name]", plugin.getPlayers().getName(targetPlayer)));
} // Check if online
Player target = plugin.getServer().getPlayer(targetPlayer);
if (target == null) {
// TODO offline messaging
//plugin.getMessages().setMessage(targetPlayer, plugin.getLocale(playerUUID).get("makeLeader.youAreNowTheOwner"));
} else {
// Online
Util.sendMessage(plugin.getServer().getPlayer(targetPlayer), ChatColor.GREEN + plugin.getLocale(targetPlayer).get("makeLeader.youAreNowTheOwner"));
// Check if new leader has a lower range permission than the island size
boolean hasARangePerm = false;
int range = Settings.islandProtectionRange;
// Check for zero protection range
Island islandByOwner = plugin.getIslands().getIsland(targetPlayer);
if (islandByOwner.getProtectionRange() == 0) {
plugin.getLogger().warning("Player " + player.getName() + "'s island had a protection range of 0. Setting to default " + range);
islandByOwner.setProtectionRange(range);
}
for (PermissionAttachmentInfo perms : target.getEffectivePermissions()) {
if (perms.getPermission().startsWith(Settings.PERMPREFIX + "island.range.")) {
if (perms.getPermission().contains(Settings.PERMPREFIX + "island.range.*")) {
// Ignore
break;
} else {
String[] spl = perms.getPermission().split(Settings.PERMPREFIX + "island.range.");
if (spl.length > 1) {
if (!NumberUtils.isDigits(spl[1])) {
plugin.getLogger().severe("Player " + player.getName() + " has permission: " + perms.getPermission() + " <-- the last part MUST be a number! Ignoring...");
} else {
hasARangePerm = true;
range = Math.max(range, Integer.valueOf(spl[1]));
}
}
}
}
}
// Only set the island range if the player has a perm to override the default
if (hasARangePerm) {
// Do some sanity checking
if (range % 2 != 0) {
range--;
}
// Get island range
// Range can go up or down
if (range != islandByOwner.getProtectionRange()) {
Util.sendMessage(player, ChatColor.GOLD + plugin.getLocale(targetPlayer).get("admin.SetRangeUpdated").replace("[number]", String.valueOf(range)));
Util.sendMessage(target, ChatColor.GOLD + plugin.getLocale(targetPlayer).get("admin.SetRangeUpdated").replace("[number]", String.valueOf(range)));
plugin.getLogger().info(
"Makeleader: Island protection range changed from " + islandByOwner.getProtectionRange() + " to "
+ range + " for " + player.getName() + " due to permission.");
}
islandByOwner.setProtectionRange(range);
}
}
plugin.getIslands().save(true);
}
@Override @Override
public Set<String> tabComplete(CommandSender sender, String[] args) { public Set<String> tabComplete(CommandSender sender, String[] args) {
@ -919,384 +1015,384 @@ public class IslandCommand extends AbstractCommand {
} }
}); });
/* /is teamchat - Toggle TeamChat */ /* /is teamchat - Toggle TeamChat */
addArgument(new String[] {"teamchat", "tc"}, new ArgumentHandler() { addArgument(new String[] {"teamchat", "tc"}, new ArgumentHandler() {
@Override @Override
public CanUseResp canUse(CommandSender sender) { public CanUseResp canUse(CommandSender sender) {
return new CanUseResp(true); return new CanUseResp(true);
} }
@Override @Override
public void execute(CommandSender sender, String[] args) { public void execute(CommandSender sender, String[] args) {
} }
@Override @Override
public Set<String> tabComplete(CommandSender sender, String[] args) { public Set<String> tabComplete(CommandSender sender, String[] args) {
return null; return null;
} }
@Override @Override
public String[] usage(CommandSender sender){ public String[] usage(CommandSender sender){
return new String[] {null, plugin.getLocale(sender).get("help.island.teamchat")}; return new String[] {null, plugin.getLocale(sender).get("help.island.teamchat")};
} }
}); });
/* /is expel <player> - Expel a visitor/coop from the island */ /* /is expel <player> - Expel a visitor/coop from the island */
addArgument(new String[] {"expel"}, new ArgumentHandler() { addArgument(new String[] {"expel"}, new ArgumentHandler() {
@Override @Override
public CanUseResp canUse(CommandSender sender) { public CanUseResp canUse(CommandSender sender) {
return new CanUseResp(true); return new CanUseResp(true);
} }
@Override @Override
public void execute(CommandSender sender, String[] args) { public void execute(CommandSender sender, String[] args) {
} }
@Override @Override
public Set<String> tabComplete(CommandSender sender, String[] args) { public Set<String> tabComplete(CommandSender sender, String[] args) {
return null; return null;
} }
@Override @Override
public String[] usage(CommandSender sender){ public String[] usage(CommandSender sender){
return new String[] {"<player>", plugin.getLocale(sender).get("help.island.expel")}; return new String[] {"<player>", plugin.getLocale(sender).get("help.island.expel")};
} }
}); });
/* /is expel - Expel every visitor/coop from the island */ /* /is expel - Expel every visitor/coop from the island */
addArgument(new String[] {"expelall", "expel!"}, new ArgumentHandler() { addArgument(new String[] {"expelall", "expel!"}, new ArgumentHandler() {
@Override @Override
public CanUseResp canUse(CommandSender sender) { public CanUseResp canUse(CommandSender sender) {
return new CanUseResp(true); return new CanUseResp(true);
} }
@Override @Override
public void execute(CommandSender sender, String[] args) { public void execute(CommandSender sender, String[] args) {
} }
@Override @Override
public Set<String> tabComplete(CommandSender sender, String[] args) { public Set<String> tabComplete(CommandSender sender, String[] args) {
return null; return null;
} }
@Override @Override
public String[] usage(CommandSender sender){ public String[] usage(CommandSender sender){
return new String[] {null, plugin.getLocale(sender).get("help.island.expelall")}; return new String[] {null, plugin.getLocale(sender).get("help.island.expelall")};
} }
}); });
/* /is ban <player> - Ban a player from the island */ /* /is ban <player> - Ban a player from the island */
addArgument(new String[] {"ban"}, new ArgumentHandler() { addArgument(new String[] {"ban"}, new ArgumentHandler() {
@Override @Override
public CanUseResp canUse(CommandSender sender) { public CanUseResp canUse(CommandSender sender) {
return new CanUseResp(true); return new CanUseResp(true);
} }
@Override @Override
public void execute(CommandSender sender, String[] args) { public void execute(CommandSender sender, String[] args) {
} }
@Override @Override
public Set<String> tabComplete(CommandSender sender, String[] args) { public Set<String> tabComplete(CommandSender sender, String[] args) {
return null; return null;
} }
@Override @Override
public String[] usage(CommandSender sender){ public String[] usage(CommandSender sender){
return new String[] {"<player>", plugin.getLocale(sender).get("help.island.ban")}; return new String[] {"<player>", plugin.getLocale(sender).get("help.island.ban")};
} }
}); });
/* /is unban <player> - Unban player from the island */ /* /is unban <player> - Unban player from the island */
addArgument(new String[] {"unban"}, new ArgumentHandler() { addArgument(new String[] {"unban"}, new ArgumentHandler() {
@Override @Override
public CanUseResp canUse(CommandSender sender) { public CanUseResp canUse(CommandSender sender) {
return new CanUseResp(true); return new CanUseResp(true);
} }
@Override @Override
public void execute(CommandSender sender, String[] args) { public void execute(CommandSender sender, String[] args) {
} }
@Override @Override
public Set<String> tabComplete(CommandSender sender, String[] args) { public Set<String> tabComplete(CommandSender sender, String[] args) {
return null; return null;
} }
@Override @Override
public String[] usage(CommandSender sender){ public String[] usage(CommandSender sender){
return new String[] {"<player>", plugin.getLocale(sender).get("help.island.unban")}; return new String[] {"<player>", plugin.getLocale(sender).get("help.island.unban")};
} }
}); });
/* /is banlist - Display island banned players */ /* /is banlist - Display island banned players */
addArgument(new String[] {"banlist", "bl"}, new ArgumentHandler() { addArgument(new String[] {"banlist", "bl"}, new ArgumentHandler() {
@Override @Override
public CanUseResp canUse(CommandSender sender) { public CanUseResp canUse(CommandSender sender) {
return new CanUseResp(true); return new CanUseResp(true);
} }
@Override @Override
public void execute(CommandSender sender, String[] args) { public void execute(CommandSender sender, String[] args) {
} }
@Override @Override
public Set<String> tabComplete(CommandSender sender, String[] args) { public Set<String> tabComplete(CommandSender sender, String[] args) {
return null; return null;
} }
@Override @Override
public String[] usage(CommandSender sender){ public String[] usage(CommandSender sender){
return new String[] {null, plugin.getLocale(sender).get("help.island.banlist")}; return new String[] {null, plugin.getLocale(sender).get("help.island.banlist")};
} }
}); });
/* /is trust <player> - Trust a player */ /* /is trust <player> - Trust a player */
addArgument(new String[] {"trust"}, new ArgumentHandler() { addArgument(new String[] {"trust"}, new ArgumentHandler() {
@Override @Override
public CanUseResp canUse(CommandSender sender) { public CanUseResp canUse(CommandSender sender) {
return new CanUseResp(true); return new CanUseResp(true);
} }
@Override @Override
public void execute(CommandSender sender, String[] args) { public void execute(CommandSender sender, String[] args) {
} }
@Override @Override
public Set<String> tabComplete(CommandSender sender, String[] args) { public Set<String> tabComplete(CommandSender sender, String[] args) {
return null; return null;
} }
@Override @Override
public String[] usage(CommandSender sender){ public String[] usage(CommandSender sender){
return new String[] {"<player>", plugin.getLocale(sender).get("help.island.trust")}; return new String[] {"<player>", plugin.getLocale(sender).get("help.island.trust")};
} }
}); });
/* /is untrust <player> - Untrust a player */ /* /is untrust <player> - Untrust a player */
addArgument(new String[] {"untrust"}, new ArgumentHandler() { addArgument(new String[] {"untrust"}, new ArgumentHandler() {
@Override @Override
public CanUseResp canUse(CommandSender sender) { public CanUseResp canUse(CommandSender sender) {
return new CanUseResp(true); return new CanUseResp(true);
} }
@Override @Override
public void execute(CommandSender sender, String[] args) { public void execute(CommandSender sender, String[] args) {
} }
@Override @Override
public Set<String> tabComplete(CommandSender sender, String[] args) { public Set<String> tabComplete(CommandSender sender, String[] args) {
return null; return null;
} }
@Override @Override
public String[] usage(CommandSender sender){ public String[] usage(CommandSender sender){
return new String[] {"<player>", plugin.getLocale(sender).get("help.island.untrust")}; return new String[] {"<player>", plugin.getLocale(sender).get("help.island.untrust")};
} }
}); });
/* /is trustlist - Display trust players */ /* /is trustlist - Display trust players */
addArgument(new String[] {"trustlist", "tl"}, new ArgumentHandler() { addArgument(new String[] {"trustlist", "tl"}, new ArgumentHandler() {
@Override @Override
public CanUseResp canUse(CommandSender sender) { public CanUseResp canUse(CommandSender sender) {
return new CanUseResp(true); return new CanUseResp(true);
} }
@Override @Override
public void execute(CommandSender sender, String[] args) { public void execute(CommandSender sender, String[] args) {
} }
@Override @Override
public Set<String> tabComplete(CommandSender sender, String[] args) { public Set<String> tabComplete(CommandSender sender, String[] args) {
return null; return null;
} }
@Override @Override
public String[] usage(CommandSender sender){ public String[] usage(CommandSender sender){
return new String[] {null, plugin.getLocale(sender).get("help.island.trustlist")}; return new String[] {null, plugin.getLocale(sender).get("help.island.trustlist")};
} }
}); });
/* /is coop <player> - Coop a player */ /* /is coop <player> - Coop a player */
addArgument(new String[] {"coop"}, new ArgumentHandler() { addArgument(new String[] {"coop"}, new ArgumentHandler() {
@Override @Override
public CanUseResp canUse(CommandSender sender) { public CanUseResp canUse(CommandSender sender) {
return new CanUseResp(true); return new CanUseResp(true);
} }
@Override @Override
public void execute(CommandSender sender, String[] args) { public void execute(CommandSender sender, String[] args) {
} }
@Override @Override
public Set<String> tabComplete(CommandSender sender, String[] args) { public Set<String> tabComplete(CommandSender sender, String[] args) {
return null; return null;
} }
@Override @Override
public String[] usage(CommandSender sender){ public String[] usage(CommandSender sender){
return new String[] {"<player>", plugin.getLocale(sender).get("help.island.coop")}; return new String[] {"<player>", plugin.getLocale(sender).get("help.island.coop")};
} }
}); });
/* /is uncoop <player> - Uncoop a player */ /* /is uncoop <player> - Uncoop a player */
addArgument(new String[] {"uncoop"}, new ArgumentHandler() { addArgument(new String[] {"uncoop"}, new ArgumentHandler() {
@Override @Override
public CanUseResp canUse(CommandSender sender) { public CanUseResp canUse(CommandSender sender) {
return new CanUseResp(true); return new CanUseResp(true);
} }
@Override @Override
public void execute(CommandSender sender, String[] args) { public void execute(CommandSender sender, String[] args) {
} }
@Override @Override
public Set<String> tabComplete(CommandSender sender, String[] args) { public Set<String> tabComplete(CommandSender sender, String[] args) {
return null; return null;
} }
@Override @Override
public String[] usage(CommandSender sender){ public String[] usage(CommandSender sender){
return new String[] {"<player>", plugin.getLocale(sender).get("help.island.uncoop")}; return new String[] {"<player>", plugin.getLocale(sender).get("help.island.uncoop")};
} }
}); });
/* /is cooplist - Display coop players */ /* /is cooplist - Display coop players */
addArgument(new String[] {"cooplist", "cl"}, new ArgumentHandler() { addArgument(new String[] {"cooplist", "cl"}, new ArgumentHandler() {
@Override @Override
public CanUseResp canUse(CommandSender sender) { public CanUseResp canUse(CommandSender sender) {
return new CanUseResp(true); return new CanUseResp(true);
} }
@Override @Override
public void execute(CommandSender sender, String[] args) { public void execute(CommandSender sender, String[] args) {
} }
@Override @Override
public Set<String> tabComplete(CommandSender sender, String[] args) { public Set<String> tabComplete(CommandSender sender, String[] args) {
return null; return null;
} }
@Override @Override
public String[] usage(CommandSender sender){ public String[] usage(CommandSender sender){
return new String[] {null, plugin.getLocale(sender).get("help.island.cooplist")}; return new String[] {null, plugin.getLocale(sender).get("help.island.cooplist")};
} }
}); });
/* /is lock - Toggle island lock */ /* /is lock - Toggle island lock */
addArgument(new String[] {"lock", "unlock"}, new ArgumentHandler() { addArgument(new String[] {"lock", "unlock"}, new ArgumentHandler() {
@Override @Override
public CanUseResp canUse(CommandSender sender) { public CanUseResp canUse(CommandSender sender) {
if (!VaultHelper.hasPerm(player, Settings.PERMPREFIX + "island.lock")) { if (!VaultHelper.hasPerm(player, Settings.PERMPREFIX + "island.lock")) {
return new CanUseResp(ChatColor.RED + plugin.getLocale(sender).get("general.errors.no-permission")); return new CanUseResp(ChatColor.RED + plugin.getLocale(sender).get("general.errors.no-permission"));
} }
if (!plugin.getIslands().hasIsland(playerUUID)) { if (!plugin.getIslands().hasIsland(playerUUID)) {
return new CanUseResp(ChatColor.RED + plugin.getLocale(sender).get("general.errors.no-island")); return new CanUseResp(ChatColor.RED + plugin.getLocale(sender).get("general.errors.no-island"));
} }
return new CanUseResp(true); return new CanUseResp(true);
} }
@Override @Override
public void execute(CommandSender sender, String[] args) { public void execute(CommandSender sender, String[] args) {
Island island = plugin.getIslands().getIsland(playerUUID); Island island = plugin.getIslands().getIsland(playerUUID);
if(!island.getLocked()){ if(!island.getLocked()){
// TODO: Expel all visitors // TODO: Expel all visitors
// TODO: send offline messages // TODO: send offline messages
island.setLocked(true); island.setLocked(true);
} else { } else {
Util.sendMessage(player, ChatColor.GREEN + plugin.getLocale(sender).get("island.lock.unlocking")); Util.sendMessage(player, ChatColor.GREEN + plugin.getLocale(sender).get("island.lock.unlocking"));
// TODO: send offline messages // TODO: send offline messages
island.setLocked(false); island.setLocked(false);
} }
} }
@Override @Override
public Set<String> tabComplete(CommandSender sender, String[] args) { public Set<String> tabComplete(CommandSender sender, String[] args) {
return null; return null;
} }
@Override @Override
public String[] usage(CommandSender sender){ public String[] usage(CommandSender sender){
return new String[] {null, plugin.getLocale(sender).get("help.island.lock")}; return new String[] {null, plugin.getLocale(sender).get("help.island.lock")};
} }
}); });
/* /is settings - Display Settings menu */ /* /is settings - Display Settings menu */
addArgument(new String[] {"settings"}, new ArgumentHandler() { addArgument(new String[] {"settings"}, new ArgumentHandler() {
@Override @Override
public CanUseResp canUse(CommandSender sender) { public CanUseResp canUse(CommandSender sender) {
return new CanUseResp(true); return new CanUseResp(true);
} }
@Override @Override
public void execute(CommandSender sender, String[] args) { public void execute(CommandSender sender, String[] args) {
} }
@Override @Override
public Set<String> tabComplete(CommandSender sender, String[] args) { public Set<String> tabComplete(CommandSender sender, String[] args) {
return null; return null;
} }
@Override @Override
public String[] usage(CommandSender sender){ public String[] usage(CommandSender sender){
return new String[] {null, plugin.getLocale(sender).get("help.island.settings")}; return new String[] {null, plugin.getLocale(sender).get("help.island.settings")};
} }
}); });
/* /is language <id> - Set the language */ /* /is language <id> - Set the language */
addArgument(new String[] {"language", "lang"}, new ArgumentHandler() { addArgument(new String[] {"language", "lang"}, new ArgumentHandler() {
@Override @Override
public CanUseResp canUse(CommandSender sender) { public CanUseResp canUse(CommandSender sender) {
return new CanUseResp(true); return new CanUseResp(true);
} }
@Override @Override
public void execute(CommandSender sender, String[] args) { public void execute(CommandSender sender, String[] args) {
} }
@Override @Override
public Set<String> tabComplete(CommandSender sender, String[] args) { public Set<String> tabComplete(CommandSender sender, String[] args) {
return null; return null;
} }
@Override @Override
public String[] usage(CommandSender sender){ public String[] usage(CommandSender sender){
return new String[] {"<id>", plugin.getLocale(sender).get("help.island.language")}; return new String[] {"<id>", plugin.getLocale(sender).get("help.island.language")};
} }
}); });
} }
/** /**