Introduced Brigadier Command System. More Formatting Coming in next commit.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user