Skip to content

Commit

Permalink
add comments in regional activity modules
Browse files Browse the repository at this point in the history
  • Loading branch information
xGinko committed Jan 4, 2025
1 parent 2626cdc commit 28cd893
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ public RegionalActivityModule(
super("lag-preventions.regional-activity."+subConfigPath, defEnabled, comment);
String configPath = "lag-preventions.regional-activity." + subConfigPath;
this.logIsEnabled = config.getBoolean(configPath + ".log", deflogEnabled);
this.totalActivityLimit = config.getInt(configPath + ".total-limit", defTotalLimit);
this.totalActivityLimit = config.getInt(configPath + ".total-limit", defTotalLimit,
"The maximum amount of measured activity of this type that is allowed\n" +
"to happen within the configured timeframe (cache-millis).\n" +
"This value should always be higher than any of the configured per type limits.");
this.checkRadius = config.getDouble(configPath + ".check-radius-blocks", defCheckRadius,
"The radius in blocks in which activity will be grouped together and measured.");
this.pauseTimeMillis = config.getInt(configPath + ".pause-time-millis", defPauseMillis,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ public RegionalBlockActivityModule(
defaultKV.put(entry.getKey().get().name(), entry.getValue());
}
}
ConfigSection typedSection = config.getConfigSection(configPath + ".typed-limits", defaultKV);
ConfigSection typedSection = config.getConfigSection(configPath + ".typed-limits", defaultKV, """
Set activity limits per Material (BlockType).
Note that you cannot set a value higher than the one configured in total-limit.""");
for (String configuredMaterial : typedSection.getKeys(false)) {
try {
typedActivityLimit.put(Material.valueOf(configuredMaterial), Integer.parseInt(typedSection.getString(configuredMaterial)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ public RegionalEntityActivityModule(
defaultKV.put(entry.getKey().get().name(), entry.getValue());
}
}
ConfigSection typedSection = config.getConfigSection(configPath + ".typed-limits", defaultKV);
ConfigSection typedSection = config.getConfigSection(configPath + ".typed-limits", defaultKV, """
Set activity limits per EntityType.
Note that you cannot set a value higher than the one configured in total-limit.""");
for (String configuredEntity : typedSection.getKeys(false)) {
try {
typedActivityLimit.put(EntityType.valueOf(configuredEntity), Integer.parseInt(typedSection.getString(configuredEntity)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ public RegionalActivityModule(
super("lag-preventions.regional-activity."+subConfigPath, defEnabled, comment);
String configPath = "lag-preventions.regional-activity." + subConfigPath;
this.logIsEnabled = config.getBoolean(configPath + ".log", deflogEnabled);
this.totalActivityLimit = config.getInt(configPath + ".total-limit", defTotalLimit);
this.totalActivityLimit = config.getInt(configPath + ".total-limit", defTotalLimit,
"The maximum amount of measured activity of this type that is allowed\n" +
"to happen within the configured timeframe (cache-millis).\n" +
"This value should always be higher than any of the configured per type limits.");
this.checkRadius = config.getDouble(configPath + ".check-radius-blocks", defCheckRadius,
"The radius in blocks in which activity will be grouped together and measured.");
this.pauseTimeMillis = config.getInt(configPath + ".pause-time-millis", defPauseMillis,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ public RegionalBlockActivityModule(
defaultKV.put(entry.getKey().get().name(), entry.getValue());
}
}
ConfigSection typedSection = config.getConfigSection(configPath + ".typed-limits", defaultKV);
ConfigSection typedSection = config.getConfigSection(configPath + ".typed-limits", defaultKV,
"Set activity limits per Material (BlockType)." +
"Note that you cannot set a value higher than the one configured in total-limit.");
for (String configuredMaterial : typedSection.getKeys(false)) {
try {
typedActivityLimit.put(Material.valueOf(configuredMaterial), Integer.parseInt(typedSection.getString(configuredMaterial)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ public RegionalEntityActivityModule(
defaultKV.put(entry.getKey().get().name(), entry.getValue());
}
}
ConfigSection typedSection = config.getConfigSection(configPath + ".typed-limits", defaultKV);
ConfigSection typedSection = config.getConfigSection(configPath + ".typed-limits", defaultKV,
"Set activity limits per EntityType." +
"Note that you cannot set a value higher than the one configured in total-limit.");
for (String configuredEntity : typedSection.getKeys(false)) {
try {
typedActivityLimit.put(EntityType.valueOf(configuredEntity), Integer.parseInt(typedSection.getString(configuredEntity)));
Expand Down

0 comments on commit 28cd893

Please sign in to comment.