Added log errors option for async display

This commit is contained in:
Auxilor
2021-11-02 18:39:29 +00:00
parent bc652a8154
commit 1f95a33385
2 changed files with 6 additions and 1 deletions

View File

@@ -51,7 +51,9 @@ class PacketWindowItems(plugin: EcoPlugin) : AbstractPacketAdapter(plugin, Packe
try {
modifyWindowItems(itemStacks, windowId, player)
} catch (e: Exception) {
// Don't do anything, just accept defeat
if (this.getPlugin().configYml.getBool("async-display.log-errors")) {
this.getPlugin().logger.warning("Error happened in async processing! Disable async display (/plugins/eco/config.yml) if this is a frequent issue")
}
}
val newPacket = packet.deepClone()

View File

@@ -51,6 +51,9 @@ async-display:
# If async display should always be used.
enabled: false
# Log errors that occur in async processing.
log-errors: true
# If the server is running under heavy load (below a certain TPS value), enable
# async display automatically. This can prevent some server crashes under load.
emergency: