Fixes for sponge + minor tweaks for spigot

- Updated to sponge 591
- Added optional WorldEdit restriction
- several fixes (including greeting/farewell flag)
This commit is contained in:
boy0001
2015-09-07 22:17:48 +10:00
parent 2b3b947143
commit 66730794d6
21 changed files with 68 additions and 67 deletions

View File

@ -16,6 +16,7 @@ import com.intellectualcrafters.plot.util.SchematicHandler;
import com.intellectualcrafters.plot.util.SetupUtils;
import com.intellectualcrafters.plot.util.TaskManager;
import com.intellectualcrafters.plot.util.UUIDHandlerImplementation;
import com.sk89q.worldedit.WorldEdit;
public interface IPlotMain {
@ -114,7 +115,7 @@ public interface IPlotMain {
/**
* Register the WorldEdit hook
*/
void registerWorldEditEvents();
boolean initWorldEdit();
/**
* Register TNT related events (if TNT protection is enabled)

View File

@ -31,6 +31,8 @@ import java.util.zip.ZipInputStream;
import com.intellectualcrafters.configuration.ConfigurationSection;
import com.intellectualcrafters.configuration.file.YamlConfiguration;
import com.intellectualcrafters.plot.commands.MainCommand;
import com.intellectualcrafters.plot.commands.WE_Anywhere;
import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.config.Configuration;
import com.intellectualcrafters.plot.config.Settings;
@ -78,6 +80,8 @@ import com.intellectualcrafters.plot.util.SetupUtils;
import com.intellectualcrafters.plot.util.StringMan;
import com.intellectualcrafters.plot.util.TaskManager;
import com.intellectualcrafters.plot.util.UUIDHandler;
import com.plotsquared.listener.WESubscriber;
import com.sk89q.worldedit.WorldEdit;
/**
* An implementation of the core,
@ -103,6 +107,7 @@ public class PS {
public YamlConfiguration storage;
public IPlotMain IMP = null;
public TaskManager TASK;
public WorldEdit worldedit;
public URL update;
// private:
@ -167,8 +172,13 @@ public class PS {
if (Settings.KILL_ROAD_MOBS || Settings.KILL_ROAD_VEHICLES) {
IMP.runEntityTask();
}
if (IMP.initWorldEdit()) {
worldedit = WorldEdit.getInstance();
WorldEdit.getInstance().getEventBus().register(new WESubscriber());
MainCommand.getInstance().createCommand(new WE_Anywhere());
}
// Events
IMP.registerWorldEditEvents();
IMP.registerCommands();
IMP.registerPlayerEvents();
IMP.registerInventoryEvents();

View File

@ -25,6 +25,7 @@ import java.util.Arrays;
import java.util.HashMap;
import java.util.Map.Entry;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.util.MainUtil;
@ -105,7 +106,7 @@ public class Toggle extends SubCommand {
return true;
}
});
if (BukkitMain.worldEdit != null) {
if (PS.get().worldedit != null) {
toggles.put("worldedit",
new Command<PlotPlayer>("worldedit", "/plot toggle worldedit", "Toggle worldedit bypass", C.PERMISSION_WORLDEDIT_BYPASS.s()) {

View File

@ -25,8 +25,8 @@ import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.Permissions;
import com.plotsquared.bukkit.BukkitMain;
import com.plotsquared.bukkit.listeners.worldedit.WEManager;
import com.plotsquared.general.commands.CommandDeclaration;
import com.plotsquared.listener.WEManager;
@CommandDeclaration(
command = "weanywhere",