diff --git a/src/main/java/net/coreprotect/database/logger/BlockBreakLogger.java b/src/main/java/net/coreprotect/database/logger/BlockBreakLogger.java index c5fd2c6a..7e106695 100644 --- a/src/main/java/net/coreprotect/database/logger/BlockBreakLogger.java +++ b/src/main/java/net/coreprotect/database/logger/BlockBreakLogger.java @@ -4,6 +4,7 @@ import java.util.List; import java.util.Locale; +import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; @@ -54,7 +55,7 @@ else if (checkType == Material.PAINTING || BukkitAdapter.ADAPTER.isItemFrame(che } CoreProtectPreLogEvent event = new CoreProtectPreLogEvent(user); - if (Config.getGlobal().API_ENABLED) { + if (Config.getGlobal().API_ENABLED && !Bukkit.isPrimaryThread()) { CoreProtect.getInstance().getServer().getPluginManager().callEvent(event); } diff --git a/src/main/java/net/coreprotect/database/logger/BlockPlaceLogger.java b/src/main/java/net/coreprotect/database/logger/BlockPlaceLogger.java index cfc30e17..85c66139 100644 --- a/src/main/java/net/coreprotect/database/logger/BlockPlaceLogger.java +++ b/src/main/java/net/coreprotect/database/logger/BlockPlaceLogger.java @@ -4,6 +4,7 @@ import java.util.List; import java.util.Locale; +import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.block.BlockState; @@ -84,7 +85,7 @@ else if (type == Material.WATER || type == Material.LAVA) { } CoreProtectPreLogEvent event = new CoreProtectPreLogEvent(user); - if (Config.getGlobal().API_ENABLED) { + if (Config.getGlobal().API_ENABLED && !Bukkit.isPrimaryThread()) { CoreProtect.getInstance().getServer().getPluginManager().callEvent(event); } diff --git a/src/main/java/net/coreprotect/database/logger/CommandLogger.java b/src/main/java/net/coreprotect/database/logger/CommandLogger.java index 759bb31c..046d4a3e 100644 --- a/src/main/java/net/coreprotect/database/logger/CommandLogger.java +++ b/src/main/java/net/coreprotect/database/logger/CommandLogger.java @@ -3,6 +3,7 @@ import java.sql.PreparedStatement; import java.util.Locale; +import org.bukkit.Bukkit; import org.bukkit.Location; import net.coreprotect.CoreProtect; @@ -29,7 +30,7 @@ public static void log(PreparedStatement preparedStmt, int batchCount, long time } CoreProtectPreLogEvent event = new CoreProtectPreLogEvent(user); - if (Config.getGlobal().API_ENABLED) { + if (Config.getGlobal().API_ENABLED && !Bukkit.isPrimaryThread()) { CoreProtect.getInstance().getServer().getPluginManager().callEvent(event); } diff --git a/src/main/java/net/coreprotect/database/logger/ContainerLogger.java b/src/main/java/net/coreprotect/database/logger/ContainerLogger.java index 8e09e98d..04655f10 100644 --- a/src/main/java/net/coreprotect/database/logger/ContainerLogger.java +++ b/src/main/java/net/coreprotect/database/logger/ContainerLogger.java @@ -7,6 +7,7 @@ import java.util.Locale; import java.util.Map; +import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.BlockFace; @@ -173,7 +174,7 @@ protected static void logTransaction(PreparedStatement preparedStmt, int batchCo } CoreProtectPreLogEvent event = new CoreProtectPreLogEvent(user); - if (Config.getGlobal().API_ENABLED) { + if (Config.getGlobal().API_ENABLED && !Bukkit.isPrimaryThread()) { CoreProtect.getInstance().getServer().getPluginManager().callEvent(event); } diff --git a/src/main/java/net/coreprotect/database/logger/EntityKillLogger.java b/src/main/java/net/coreprotect/database/logger/EntityKillLogger.java index 2fd3d9ce..5225a5bd 100644 --- a/src/main/java/net/coreprotect/database/logger/EntityKillLogger.java +++ b/src/main/java/net/coreprotect/database/logger/EntityKillLogger.java @@ -5,6 +5,7 @@ import java.util.List; import java.util.Locale; +import org.bukkit.Bukkit; import org.bukkit.block.BlockState; import net.coreprotect.CoreProtect; @@ -30,7 +31,7 @@ public static void log(PreparedStatement preparedStmt, PreparedStatement prepare } CoreProtectPreLogEvent event = new CoreProtectPreLogEvent(user); - if (Config.getGlobal().API_ENABLED) { + if (Config.getGlobal().API_ENABLED && !Bukkit.isPrimaryThread()) { CoreProtect.getInstance().getServer().getPluginManager().callEvent(event); } diff --git a/src/main/java/net/coreprotect/database/logger/ItemLogger.java b/src/main/java/net/coreprotect/database/logger/ItemLogger.java index 4c32003d..ba399ebe 100644 --- a/src/main/java/net/coreprotect/database/logger/ItemLogger.java +++ b/src/main/java/net/coreprotect/database/logger/ItemLogger.java @@ -6,6 +6,7 @@ import java.util.Locale; import java.util.Map; +import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.inventory.ItemStack; @@ -126,7 +127,7 @@ protected static void logTransaction(PreparedStatement preparedStmt, int batchCo } CoreProtectPreLogEvent event = new CoreProtectPreLogEvent(user); - if (Config.getGlobal().API_ENABLED) { + if (Config.getGlobal().API_ENABLED && !Bukkit.isPrimaryThread()) { CoreProtect.getInstance().getServer().getPluginManager().callEvent(event); } diff --git a/src/main/java/net/coreprotect/database/logger/PlayerInteractLogger.java b/src/main/java/net/coreprotect/database/logger/PlayerInteractLogger.java index f2791594..e8fafc49 100644 --- a/src/main/java/net/coreprotect/database/logger/PlayerInteractLogger.java +++ b/src/main/java/net/coreprotect/database/logger/PlayerInteractLogger.java @@ -3,6 +3,7 @@ import java.sql.PreparedStatement; import java.util.Locale; +import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.block.BlockState; @@ -28,7 +29,7 @@ public static void log(PreparedStatement preparedStmt, int batchCount, String us } CoreProtectPreLogEvent event = new CoreProtectPreLogEvent(user); - if (Config.getGlobal().API_ENABLED) { + if (Config.getGlobal().API_ENABLED && !Bukkit.isPrimaryThread()) { CoreProtect.getInstance().getServer().getPluginManager().callEvent(event); } diff --git a/src/main/java/net/coreprotect/database/logger/PlayerKillLogger.java b/src/main/java/net/coreprotect/database/logger/PlayerKillLogger.java index fe0fb0bf..2b81c3de 100644 --- a/src/main/java/net/coreprotect/database/logger/PlayerKillLogger.java +++ b/src/main/java/net/coreprotect/database/logger/PlayerKillLogger.java @@ -3,6 +3,7 @@ import java.sql.PreparedStatement; import java.util.Locale; +import org.bukkit.Bukkit; import org.bukkit.block.BlockState; import net.coreprotect.CoreProtect; @@ -30,7 +31,7 @@ public static void log(PreparedStatement preparedStmt, int batchCount, String us } CoreProtectPreLogEvent event = new CoreProtectPreLogEvent(user); - if (Config.getGlobal().API_ENABLED) { + if (Config.getGlobal().API_ENABLED && !Bukkit.isPrimaryThread()) { CoreProtect.getInstance().getServer().getPluginManager().callEvent(event); } diff --git a/src/main/java/net/coreprotect/database/logger/SignTextLogger.java b/src/main/java/net/coreprotect/database/logger/SignTextLogger.java index 0572ee82..3241e33c 100644 --- a/src/main/java/net/coreprotect/database/logger/SignTextLogger.java +++ b/src/main/java/net/coreprotect/database/logger/SignTextLogger.java @@ -3,6 +3,7 @@ import java.sql.PreparedStatement; import java.util.Locale; +import org.bukkit.Bukkit; import org.bukkit.Location; import net.coreprotect.CoreProtect; @@ -26,7 +27,7 @@ public static void log(PreparedStatement preparedStmt, int batchCount, String us } CoreProtectPreLogEvent event = new CoreProtectPreLogEvent(user); - if (Config.getGlobal().API_ENABLED) { + if (Config.getGlobal().API_ENABLED && !Bukkit.isPrimaryThread()) { CoreProtect.getInstance().getServer().getPluginManager().callEvent(event); }