Introduced Brigadier Command System. More Formatting Coming in next commit.

This commit is contained in:
Driftay
2019-09-14 15:13:01 -04:00
parent b06e6e0f04
commit 3c9b606bb9
207 changed files with 4465 additions and 4017 deletions

View File

@@ -10,26 +10,24 @@ public class CmdMapHeight extends FCommand {
this.aliases.add("mapheight");
this.aliases.add("mh");
this.optionalArgs.put("height", "height");
this.permission = Permission.MAPHEIGHT.node;
this.senderMustBePlayer = true;
this.requirements = new CommandRequirements.Builder(Permission.MAPHEIGHT)
.playerOnly()
.build();
}
@Override
public void perform() {
if (args.size() == 0) {
fme.sendMessage(TL.COMMAND_MAPHEIGHT_CURRENT.format(fme.getMapHeight()));
public void perform(CommandContext context) {
if (context.args.size() == 0) {
context.fPlayer.sendMessage(TL.COMMAND_MAPHEIGHT_CURRENT.format(context.fPlayer.getMapHeight()));
return;
}
int height = argAsInt(0);
int height = context.argAsInt(0);
fme.setMapHeight(height);
fme.sendMessage(TL.COMMAND_MAPHEIGHT_SET.format(fme.getMapHeight()));
context.fPlayer.setMapHeight(height);
context.msg(TL.COMMAND_MAPHEIGHT_SET.format(context.fPlayer.getMapHeight()));
}
@Override