Added config option to disable economy logging

This commit is contained in:
Eric 2017-08-15 11:43:54 +02:00
parent 397304c748
commit a8f589c1b7
3 changed files with 39 additions and 28 deletions

View File

@ -113,6 +113,9 @@ public class Config {
/** Whether the debug log file should be created **/ /** Whether the debug log file should be created **/
public boolean enable_debug_log; public boolean enable_debug_log;
/** Whether buys and sells should be logged in the database **/
public boolean enable_ecomomy_log;
/** Whether WorldGuard integration should be enabled **/ /** Whether WorldGuard integration should be enabled **/
public boolean enable_worldguard_integration; public boolean enable_worldguard_integration;
@ -365,6 +368,7 @@ public class Config {
enable_quality_mode = plugin.getConfig().getBoolean("enable-quality-mode"); enable_quality_mode = plugin.getConfig().getBoolean("enable-quality-mode");
enable_hologram_interaction = plugin.getConfig().getBoolean("enable-hologram-interaction"); enable_hologram_interaction = plugin.getConfig().getBoolean("enable-hologram-interaction");
enable_debug_log = plugin.getConfig().getBoolean("enable-debug-log"); enable_debug_log = plugin.getConfig().getBoolean("enable-debug-log");
enable_ecomomy_log = plugin.getConfig().getBoolean("enable-economy-log");
enable_worldguard_integration = plugin.getConfig().getBoolean("enable-worldguard-integration"); enable_worldguard_integration = plugin.getConfig().getBoolean("enable-worldguard-integration");
enable_towny_integration = plugin.getConfig().getBoolean("enable-towny-integration"); enable_towny_integration = plugin.getConfig().getBoolean("enable-towny-integration");
enable_authme_integration = plugin.getConfig().getBoolean("enable-authme-integration"); enable_authme_integration = plugin.getConfig().getBoolean("enable-authme-integration");

View File

@ -368,6 +368,7 @@ public abstract class Database {
* @param callback Callback that - if succeeded - returns {@code null} * @param callback Callback that - if succeeded - returns {@code null}
*/ */
public void logEconomy(final Player executor, final ItemStack product, final OfflinePlayer vendor, final ShopType shopType, final Location location, final double price, final ShopBuySellEvent.Type type, final Callback<Void> callback) { public void logEconomy(final Player executor, final ItemStack product, final OfflinePlayer vendor, final ShopType shopType, final Location location, final double price, final ShopBuySellEvent.Type type, final Callback<Void> callback) {
if (plugin.getShopChestConfig().enable_ecomomy_log) {
new BukkitRunnable() { new BukkitRunnable() {
@Override @Override
public void run() { public void run() {
@ -400,6 +401,9 @@ public abstract class Database {
} }
} }
}.runTaskAsynchronously(plugin); }.runTaskAsynchronously(plugin);
} else {
if (callback != null) callback.callSyncResult(null);
}
} }
/** /**

View File

@ -33,6 +33,9 @@ shop-info-item: "STICK"
# are the vendor or have permission. # are the vendor or have permission.
enable-hologram-interaction: true enable-hologram-interaction: true
# Set whether buys and sells should be logged in the database.
enable-economy-log: false
# Set whether a debug log file should be created. # Set whether a debug log file should be created.
# The file may get large! Please enable this setting when reporting bugs. # The file may get large! Please enable this setting when reporting bugs.
enable-debug-log: false enable-debug-log: false