mirror of
https://github.com/PlayPro/CoreProtect.git
synced 2024-12-27 17:37:34 +01:00
Re-enabled BlocksHub & disabled logging integration with AWE
This commit is contained in:
parent
0bbeee65e8
commit
6a22903240
@ -31,8 +31,6 @@ import net.coreprotect.utility.Util;
|
||||
|
||||
public class CoreProtectAPI extends Queue {
|
||||
|
||||
private boolean checkedBlocksHub = false;
|
||||
|
||||
public class ParseResult {
|
||||
String[] parse;
|
||||
|
||||
@ -168,24 +166,6 @@ public class CoreProtectAPI extends Queue {
|
||||
}
|
||||
|
||||
public int APIVersion() {
|
||||
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
|
||||
}
|
||||
|
||||
return 8;
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,7 @@ import net.coreprotect.utility.Chat;
|
||||
public class CoreProtectEditSessionEvent {
|
||||
|
||||
private static boolean initialized = false;
|
||||
private static boolean isFAWE = false;
|
||||
private static CoreProtectEditSessionEvent event = new CoreProtectEditSessionEvent();
|
||||
|
||||
public static boolean isInitialized() {
|
||||
@ -30,9 +31,12 @@ public class CoreProtectEditSessionEvent {
|
||||
}
|
||||
|
||||
try {
|
||||
WorldEdit.getInstance().getEventBus().register(event);
|
||||
initialized = true;
|
||||
ConfigHandler.worldeditEnabled = true;
|
||||
if (Bukkit.getServer().getPluginManager().getPlugin("AsyncWorldEdit") == null) {
|
||||
WorldEdit.getInstance().getEventBus().register(event);
|
||||
initialized = true;
|
||||
ConfigHandler.worldeditEnabled = true;
|
||||
isFAWE = (Bukkit.getServer().getPluginManager().getPlugin("FastAsyncWorldEdit") != null);
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
// Failed to initialize WorldEdit logging
|
||||
@ -73,7 +77,7 @@ public class CoreProtectEditSessionEvent {
|
||||
public void wrapForLogging(EditSessionEvent event) {
|
||||
Actor actor = event.getActor();
|
||||
World world = event.getWorld();
|
||||
if (actor != null && event.getStage() == Stage.BEFORE_HISTORY) {
|
||||
if (actor != null && event.getStage() == (isFAWE ? Stage.BEFORE_HISTORY : Stage.BEFORE_CHANGE)) {
|
||||
event.setExtent(new CoreProtectLogger(actor, world, event.getExtent()));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user