Added "logs.clean-super-flat-chunks" to config

Closes #483
This commit is contained in:
Florian CUNY 2019-01-22 14:39:44 +01:00
parent 77f9f4869b
commit 4958304aa5
2 changed files with 18 additions and 1 deletions

View File

@ -86,6 +86,13 @@ public class Settings implements DataObject {
@ConfigEntry(path = "panel.close-on-click-outside") @ConfigEntry(path = "panel.close-on-click-outside")
private boolean closePanelOnClickOutside = true; private boolean closePanelOnClickOutside = true;
@ConfigComment("Toggle whether superflat chunks regeneration should be logged in the server logs or not.")
@ConfigComment("It can be spammy if there are a lot of superflat chunks to regenerate.")
@ConfigComment("However, as superflat chunks regeneration can be performance-intensive, it is recommended to keep")
@ConfigComment("this setting set to true, as it will help you know if there are regenerations taking place.")
@ConfigEntry(path = "logs.clean-super-flat-chunks", since = "1.1")
private boolean logCleanSuperFlatChunks = true;
/* /*
* Island * Island
*/ */
@ -418,4 +425,12 @@ public class Settings implements DataObject {
public void setUniqueId(String uniqueId) { public void setUniqueId(String uniqueId) {
this.uniqueId = uniqueId; this.uniqueId = uniqueId;
} }
public boolean isLogCleanSuperFlatChunks() {
return logCleanSuperFlatChunks;
}
public void setLogCleanSuperFlatChunks(boolean logCleanSuperFlatChunks) {
this.logCleanSuperFlatChunks = logCleanSuperFlatChunks;
}
} }

View File

@ -75,8 +75,10 @@ public class CleanSuperFlatListener extends FlagListener {
if (!chunkQueue.isEmpty()) { if (!chunkQueue.isEmpty()) {
Pair<Integer, Integer> chunkXZ = chunkQueue.poll(); Pair<Integer, Integer> chunkXZ = chunkQueue.poll();
world.regenerateChunk(chunkXZ.x, chunkXZ.z); // NOSONAR - the deprecation doesn't cause any issues to us world.regenerateChunk(chunkXZ.x, chunkXZ.z); // NOSONAR - the deprecation doesn't cause any issues to us
if (plugin.getSettings().isLogCleanSuperFlatChunks()) {
plugin.log(chunkQueue.size() + " Regenerating superflat chunk " + world.getName() + " " + chunkXZ.x + ", " + chunkXZ.z); plugin.log(chunkQueue.size() + " Regenerating superflat chunk " + world.getName() + " " + chunkXZ.x + ", " + chunkXZ.z);
} }
}
}, 0L, 1L); }, 0L, 1L);
} }
} }