Fix default mapheight

This commit is contained in:
Trent Hensler 2018-02-10 16:27:49 -08:00
parent 50930d7583
commit 0f6bd8eabd
3 changed files with 10 additions and 9 deletions

View File

@ -11,7 +11,7 @@ public class CmdMapHeight extends FCommand {
this.aliases.add("mapheight");
this.aliases.add("mh");
this.requiredArgs.add("height");
this.optionalArgs.put("height", "height");
this.permission = Permission.MAPHEIGHT.node;
@ -20,18 +20,18 @@ public class CmdMapHeight extends FCommand {
@Override
public void perform() {
int height = argAsInt(0, -1);
if (height == -1) {
fme.sendMessage(TL.COMMAND_MAPHEIGHT_DESCRIPTION.toString());
if (args.size() == 0) {
fme.sendMessage(TL.COMMAND_MAPHEIGHT_CURRENT.format(fme.getMapHeight()));
return;
}
int height = argAsInt(0);
fme.setMapHeight(height);
fme.sendMessage(TL.COMMAND_MAPHEIGHT_SET.format(height));
}
@Override
@Override
public TL getUsageTranslation() {
return TL.COMMAND_MAPHEIGHT_DESCRIPTION;
}

View File

@ -59,7 +59,7 @@ public abstract class MemoryFPlayer implements FPlayer {
protected boolean isAdminBypassing = false;
protected int kills, deaths;
protected boolean willAutoLeave = true;
protected int mapHeight;
protected int mapHeight = 8; // default to old value
protected transient FLocation lastStoodAt = new FLocation(); // Where did this player stand the last time we checked?
protected transient boolean mapAutoUpdating;

View File

@ -295,8 +295,9 @@ public enum TL {
COMMAND_MAP_UPDATE_DISABLED("<i>Map auto update <red>DISABLED."),
COMMAND_MAP_DESCRIPTION("Show the territory map, and set optional auto update"),
COMMAND_MAPHEIGHT_DESCRIPTION("Update the lines that /f map sends"),
COMMAND_MAPHEIGHT_SET("Set /f map lines to %1$d"),
COMMAND_MAPHEIGHT_DESCRIPTION("&eUpdate the lines that /f map sends"),
COMMAND_MAPHEIGHT_SET("&eSet /f map lines to &a%1$d"),
COMMAND_MAPHEIGHT_CURRENT("&eCurrent mapheight: &a%1$d"),
COMMAND_MOD_CANDIDATES("Players you can promote: "),
COMMAND_MOD_CLICKTOPROMOTE("Click to promote "),