Blocked access to BlocksHub to prevent duplicate data from being logged
This commit is contained in:
parent
1aaff4e2b0
commit
a596dd66a9
1 changed files with 20 additions and 0 deletions
|
|
@ -31,6 +31,8 @@ import net.coreprotect.utility.Util;
|
||||||
|
|
||||||
public class CoreProtectAPI extends Queue {
|
public class CoreProtectAPI extends Queue {
|
||||||
|
|
||||||
|
private boolean checkedBlocksHub = false;
|
||||||
|
|
||||||
public class ParseResult {
|
public class ParseResult {
|
||||||
String[] parse;
|
String[] parse;
|
||||||
|
|
||||||
|
|
@ -167,6 +169,24 @@ public class CoreProtectAPI extends Queue {
|
||||||
|
|
||||||
public int APIVersion() {
|
public int APIVersion() {
|
||||||
return 8;
|
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) {
|
public List<String[]> blockLookup(Block block, int time) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue