mirror of
https://github.com/PlayPro/CoreProtect.git
synced 2024-11-28 12:55:34 +01:00
Blocked access to BlocksHub to prevent duplicate data from being logged
This commit is contained in:
parent
1aaff4e2b0
commit
a596dd66a9
@ -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<String[]> blockLookup(Block block, int time) {
|
||||
|
Loading…
Reference in New Issue
Block a user