diff --git a/src/main/java/net/coreprotect/CoreProtectAPI.java b/src/main/java/net/coreprotect/CoreProtectAPI.java index f1c5730..edb53c7 100755 --- a/src/main/java/net/coreprotect/CoreProtectAPI.java +++ b/src/main/java/net/coreprotect/CoreProtectAPI.java @@ -31,6 +31,8 @@ import net.coreprotect.utility.Util; public class CoreProtectAPI extends Queue { + private boolean checkedBlocksHub = false; + public class ParseResult { String[] parse; @@ -167,6 +169,24 @@ public class CoreProtectAPI extends Queue { public int APIVersion() { return 8; + try { + // deny access to BlocksHub to prevent duplicate data from being logged + if (!checkedBlocksHub && Bukkit.getPluginManager().getPlugin("BlocksHub") != null) { + for (StackTraceElement element : Thread.currentThread().getStackTrace()) { + if (element.getClassName().startsWith("org.primesoft.blockshub")) { + checkedBlocksHub = true; + return 0; + } + } + } + else if (!checkedBlocksHub) { + checkedBlocksHub = true; + } + } + catch (Exception e) { + // proceed with returning API version + } + } public List blockLookup(Block block, int time) {