Skip to content

Commit

Permalink
"Log report to console" config option (#208)
Browse files Browse the repository at this point in the history
* log-report-to-console added to config.yml

* logReportToConsole added to ConfigSetting

* Check if isLogReportToConsolet to show report

* Fix return logReportToConsole
  • Loading branch information
YellowZaki committed Jan 25, 2021
1 parent 4b196f4 commit 25ba4dc
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ private void showResult(User user, UUID playerUUID, Island island, long oldLevel
.filter(u -> !u.equals(user.getUniqueId()))
.forEach(m -> User.getInstance(m).sendMessage(ISLAND_LEVEL_IS, LEVEL, addon.getManager().getIslandLevelString(getWorld(), playerUUID)));
}
} else {
} else if (this.addon.getSettings().isLogReportToConsole()) {
results.getReport().forEach(BentoBox.getInstance()::log);
}

Expand Down
13 changes: 13 additions & 0 deletions src/main/java/world/bentobox/level/config/ConfigSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ public class ConfigSettings implements ConfigObject {
@ConfigEntry(path = "disabled-game-modes")
private List<String> gameModes = Collections.emptyList();

@ConfigComment("")
@ConfigComment("When executing level command from console, should a report be shown?")
@ConfigEntry(path = "log-report-to-console")
private boolean logReportToConsole = true;

@ConfigComment("")
@ConfigComment("Number of concurrent island calculations")
@ConfigComment("If your CPU can handle it, you can run parallel island calcs if there are more than one in the queue")
Expand Down Expand Up @@ -363,5 +368,13 @@ public int getCalculationTimeout() {
public void setCalculationTimeout(int calculationTimeout) {
this.calculationTimeout = calculationTimeout;
}


/**
* @return logReportToConsole
*/
public boolean isLogReportToConsole() {
return logReportToConsole;
}

}
3 changes: 3 additions & 0 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
disabled-game-modes:
- AOneBlock
#
# When executing level command from console, should a report be shown?
log-report-to-console: true
#
# Number of concurrent island calculations
# If your CPU can handle it, you can run parallel island calcs if there are more than one in the queue
concurrent-island-calcs: 1
Expand Down

0 comments on commit 25ba4dc

Please sign in to comment.