diff --git a/src/main/java/net/coreprotect/database/logger/BlockBreakLogger.java b/src/main/java/net/coreprotect/database/logger/BlockBreakLogger.java index c5fd2c6..7e10669 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.sql.PreparedStatement; import java.util.List; import java.util.Locale; +import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; @@ -54,7 +55,7 @@ public class BlockBreakLogger { } 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 cfc30e1..85c6613 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.sql.PreparedStatement; 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 @@ public class BlockPlaceLogger { } 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 759bb31..046d4a3 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 @@ package net.coreprotect.database.logger; 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 class CommandLogger { } 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 8e09e98..04655f1 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.List; 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 @@ public class ContainerLogger extends Queue { } 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 2fd3d9c..5225a5b 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.sql.ResultSet; 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 class EntityKillLogger { } 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 4c32003..ba399eb 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.List; 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 @@ public class ItemLogger { } 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 f279159..e8fafc4 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 @@ package net.coreprotect.database.logger; 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 class PlayerInteractLogger { } 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 fe0fb0b..2b81c3d 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 @@ package net.coreprotect.database.logger; 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 class PlayerKillLogger { } 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 0572ee8..3241e33 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 @@ package net.coreprotect.database.logger; 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 class SignTextLogger { } CoreProtectPreLogEvent event = new CoreProtectPreLogEvent(user); - if (Config.getGlobal().API_ENABLED) { + if (Config.getGlobal().API_ENABLED && !Bukkit.isPrimaryThread()) { CoreProtect.getInstance().getServer().getPluginManager().callEvent(event); }