mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-07-05 07:04:43 +02:00
begin integration with fawe
This commit is contained in:
@ -186,6 +186,7 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
||||
private Method methodUnloadChunk0;
|
||||
private boolean methodUnloadSetup = false;
|
||||
private boolean metricsStarted;
|
||||
private boolean faweHook = false;
|
||||
private EconHandler econ;
|
||||
|
||||
private Injector injector;
|
||||
@ -317,14 +318,28 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
||||
// WorldEdit
|
||||
if (Settings.Enabled_Components.WORLDEDIT_RESTRICTIONS) {
|
||||
try {
|
||||
LOGGER.info("{} hooked into WorldEdit", this.pluginName());
|
||||
WorldEdit.getInstance().getEventBus().register(this.injector().getInstance(WESubscriber.class));
|
||||
LOGGER.info("{} hooked into WorldEdit", this.pluginName());
|
||||
} catch (Throwable e) {
|
||||
LOGGER.error(
|
||||
"Incompatible version of WorldEdit, please upgrade: https://builds.enginehub.org/job/worldedit?branch=master");
|
||||
}
|
||||
}
|
||||
|
||||
// FAWE
|
||||
if (Settings.FAWE_Components.FAWE_HOOK) {
|
||||
Plugin fawe = getServer().getPluginManager().getPlugin("FastAsyncWorldEdit");
|
||||
if (fawe != null) {
|
||||
try {
|
||||
Class.forName("com.boydti.fawe.bukkit.regions.plotsquared.FaweQueueCoordinator");
|
||||
faweHook = true;
|
||||
} catch (Exception ignored) {
|
||||
LOGGER.error("Incompatible version of FAWE to enable hook, please upgrade: https://ci.athion" +
|
||||
".net/job/FastAsyncWorldEdit-P2-V6/");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (Settings.Enabled_Components.EVENTS) {
|
||||
getServer().getPluginManager().registerEvents(injector().getInstance(PlayerEventListener.class), this);
|
||||
getServer().getPluginManager().registerEvents(injector().getInstance(BlockEventListener.class), this);
|
||||
@ -1209,4 +1224,9 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
||||
return LegacyComponentSerializer.legacyAmpersand().serialize(component);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFaweHooking() {
|
||||
return faweHook;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user