Skip to content

Commit

Permalink
Validator and suggested options for HUDLoggerUpdateInterval
Browse files Browse the repository at this point in the history
  • Loading branch information
Fallen-Breath committed Oct 2, 2020
1 parent 3e1d716 commit bf7ee11
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/main/java/carpet/settings/CarpetSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,25 @@ public String description()

@Rule(
desc = "HUD Logger update interval",
options = {"2", "5", "20", "100", "1200"},
validate = ValidateHUDLoggerUpdateInterval.class,
category = FEATURE
)
public static int HUDLoggerUpdateInterval = 20;

private static class ValidateHUDLoggerUpdateInterval extends Validator<Integer>
{
@Override
public Integer validate(CommandSource source, ParsedRule<Integer> currentRule, Integer newValue, String string)
{
return 1 <= newValue && newValue <= 1200 ? newValue : null;
}
public String description()
{
return "You must choose a integer from 1 to 1200";
}
}

@Rule(
desc = "Disable some command to prevent accidentally cheating",
extra = "Affects command list: /gamemode, /tp, /teleport, /give, /setblock, /summon",
Expand Down

0 comments on commit bf7ee11

Please sign in to comment.