@Override public void registerWorldEditEvents() { if (getServer().getPluginManager().getPlugin("WorldEdit") != null) { PS.get().worldEdit = (WorldEditPlugin) getServer().getPluginManager().getPlugin("WorldEdit"); final String version = PS.get().worldEdit.getDescription().getVersion(); if ((version != null) && version.startsWith("5.")) { log("&cThis version of WorldEdit does not support PlotSquared."); log("&cPlease use WorldEdit 6+ for masking support"); log("&c - http://builds.enginehub.org/job/worldedit"); } else { getServer().getPluginManager().registerEvents(new WEListener(), this); WorldEdit.getInstance().getEventBus().register(new WESubscriber()); MainCommand.subCommands.add(new WE_Anywhere()); } } }
@Override public final ChunkGenerator getDefaultWorldGenerator(final String world, final String id) { WorldEvents.lastWorld = world; if (!PS.get().setupPlotWorld(world, id)) { return null; } HybridGen result = new HybridGen(world); TaskManager.runTaskLater( new Runnable() { @Override public void run() { if (WorldEvents.lastWorld != null && WorldEvents.lastWorld.equals(world)) { WorldEvents.lastWorld = null; } } }, 20); return result; }
@Override public void onDisable() { PS.get().disable(); THIS = null; }