Started /bsb range display

This commit is contained in:
Florian CUNY 2018-07-18 15:37:20 +02:00
parent 2e26c6a20c
commit f8a7c1af48
3 changed files with 69 additions and 1 deletions

View File

@ -14,6 +14,7 @@ import us.tastybento.bskyblock.commands.admin.AdminSetRankCommand;
import us.tastybento.bskyblock.commands.admin.AdminTeleportCommand; import us.tastybento.bskyblock.commands.admin.AdminTeleportCommand;
import us.tastybento.bskyblock.commands.admin.AdminUnregisterCommand; import us.tastybento.bskyblock.commands.admin.AdminUnregisterCommand;
import us.tastybento.bskyblock.commands.admin.AdminVersionCommand; import us.tastybento.bskyblock.commands.admin.AdminVersionCommand;
import us.tastybento.bskyblock.commands.admin.range.AdminRangeCommand;
import us.tastybento.bskyblock.commands.admin.team.AdminTeamAddCommand; import us.tastybento.bskyblock.commands.admin.team.AdminTeamAddCommand;
import us.tastybento.bskyblock.commands.admin.team.AdminTeamDisbandCommand; import us.tastybento.bskyblock.commands.admin.team.AdminTeamDisbandCommand;
import us.tastybento.bskyblock.commands.admin.team.AdminTeamKickCommand; import us.tastybento.bskyblock.commands.admin.team.AdminTeamKickCommand;
@ -51,10 +52,12 @@ public class AdminCommand extends CompositeCommand {
// Register/unregister islands // Register/unregister islands
new AdminRegisterCommand(this); new AdminRegisterCommand(this);
new AdminUnregisterCommand(this); new AdminUnregisterCommand(this);
// Range
new AdminRangeCommand(this);
} }
@Override @Override
public boolean execute(User user, List<String> args) { public boolean execute(User user, String label, List<String> args) {
if (!args.isEmpty()) { if (!args.isEmpty()) {
user.sendMessage("general.errors.unknown-command", TextVariables.LABEL, getTopLabel()); user.sendMessage("general.errors.unknown-command", TextVariables.LABEL, getTopLabel());
return false; return false;

View File

@ -0,0 +1,31 @@
package us.tastybento.bskyblock.commands.admin.range;
import us.tastybento.bskyblock.api.commands.CompositeCommand;
import us.tastybento.bskyblock.api.user.User;
import java.util.List;
/**
* @author Poslovitch
*/
public class AdminRangeCommand extends CompositeCommand {
public AdminRangeCommand(CompositeCommand parent) {
super (parent, "range");
}
@Override
public void setup() {
setPermission("admin.range");
setParameters("commands.admin.range.parameters");
setDescription("commands.admin.range.description");
new AdminRangeDisplayCommand(this);
}
@Override
public boolean execute(User user, String label, List<String> args) {
showHelp(this, user);
return true;
}
}

View File

@ -0,0 +1,34 @@
package us.tastybento.bskyblock.commands.admin.range;
import us.tastybento.bskyblock.api.commands.CompositeCommand;
import us.tastybento.bskyblock.api.user.User;
import java.util.List;
/**
* @author Poslovitch
*/
public class AdminRangeDisplayCommand extends CompositeCommand {
public AdminRangeDisplayCommand(CompositeCommand parent) {
super(parent, "display", "show", "hide");
}
@Override
public void setup() {
setOnlyPlayer(true);
setPermission("admin.range.display");
setParameters("commands.admin.range.display.parameters");
setDescription("commands.admin.range.display.description");
}
@Override
public boolean execute(User user, String label, List<String> args) {
// Just to try out the things
user.sendRawMessage(label);
for (String a: args) {
user.sendRawMessage(a);
}
return false;
}
}