mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-01-19 08:55:25 +01:00
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:
parent
2b3b947143
commit
66730794d6
5
pom.xml
5
pom.xml
@ -39,6 +39,7 @@
|
|||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-jar-plugin</artifactId>
|
<artifactId>maven-jar-plugin</artifactId>
|
||||||
|
<version>2.3.2</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>bukkit</id>
|
<id>bukkit</id>
|
||||||
@ -146,13 +147,11 @@
|
|||||||
<artifactId>javax.websocket-api</artifactId>
|
<artifactId>javax.websocket-api</artifactId>
|
||||||
<version>1.1</version>
|
<version>1.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!--
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.spongepowered</groupId>
|
<groupId>org.spongepowered</groupId>
|
||||||
<artifactId>spongeapi</artifactId>
|
<artifactId>spongeapi</artifactId>
|
||||||
<version>2.1-SNAPSHOT</version>
|
<version>2.1-20150828.013112-189</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
-->
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bukkit</groupId>
|
<groupId>org.bukkit</groupId>
|
||||||
<artifactId>bukkit</artifactId>
|
<artifactId>bukkit</artifactId>
|
||||||
|
@ -16,6 +16,7 @@ import com.intellectualcrafters.plot.util.SchematicHandler;
|
|||||||
import com.intellectualcrafters.plot.util.SetupUtils;
|
import com.intellectualcrafters.plot.util.SetupUtils;
|
||||||
import com.intellectualcrafters.plot.util.TaskManager;
|
import com.intellectualcrafters.plot.util.TaskManager;
|
||||||
import com.intellectualcrafters.plot.util.UUIDHandlerImplementation;
|
import com.intellectualcrafters.plot.util.UUIDHandlerImplementation;
|
||||||
|
import com.sk89q.worldedit.WorldEdit;
|
||||||
|
|
||||||
public interface IPlotMain {
|
public interface IPlotMain {
|
||||||
|
|
||||||
@ -114,7 +115,7 @@ public interface IPlotMain {
|
|||||||
/**
|
/**
|
||||||
* Register the WorldEdit hook
|
* Register the WorldEdit hook
|
||||||
*/
|
*/
|
||||||
void registerWorldEditEvents();
|
boolean initWorldEdit();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register TNT related events (if TNT protection is enabled)
|
* Register TNT related events (if TNT protection is enabled)
|
||||||
|
@ -31,6 +31,8 @@ import java.util.zip.ZipInputStream;
|
|||||||
|
|
||||||
import com.intellectualcrafters.configuration.ConfigurationSection;
|
import com.intellectualcrafters.configuration.ConfigurationSection;
|
||||||
import com.intellectualcrafters.configuration.file.YamlConfiguration;
|
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.C;
|
||||||
import com.intellectualcrafters.plot.config.Configuration;
|
import com.intellectualcrafters.plot.config.Configuration;
|
||||||
import com.intellectualcrafters.plot.config.Settings;
|
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.StringMan;
|
||||||
import com.intellectualcrafters.plot.util.TaskManager;
|
import com.intellectualcrafters.plot.util.TaskManager;
|
||||||
import com.intellectualcrafters.plot.util.UUIDHandler;
|
import com.intellectualcrafters.plot.util.UUIDHandler;
|
||||||
|
import com.plotsquared.listener.WESubscriber;
|
||||||
|
import com.sk89q.worldedit.WorldEdit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An implementation of the core,
|
* An implementation of the core,
|
||||||
@ -103,6 +107,7 @@ public class PS {
|
|||||||
public YamlConfiguration storage;
|
public YamlConfiguration storage;
|
||||||
public IPlotMain IMP = null;
|
public IPlotMain IMP = null;
|
||||||
public TaskManager TASK;
|
public TaskManager TASK;
|
||||||
|
public WorldEdit worldedit;
|
||||||
public URL update;
|
public URL update;
|
||||||
|
|
||||||
// private:
|
// private:
|
||||||
@ -167,8 +172,13 @@ public class PS {
|
|||||||
if (Settings.KILL_ROAD_MOBS || Settings.KILL_ROAD_VEHICLES) {
|
if (Settings.KILL_ROAD_MOBS || Settings.KILL_ROAD_VEHICLES) {
|
||||||
IMP.runEntityTask();
|
IMP.runEntityTask();
|
||||||
}
|
}
|
||||||
|
if (IMP.initWorldEdit()) {
|
||||||
|
worldedit = WorldEdit.getInstance();
|
||||||
|
WorldEdit.getInstance().getEventBus().register(new WESubscriber());
|
||||||
|
MainCommand.getInstance().createCommand(new WE_Anywhere());
|
||||||
|
}
|
||||||
|
|
||||||
// Events
|
// Events
|
||||||
IMP.registerWorldEditEvents();
|
|
||||||
IMP.registerCommands();
|
IMP.registerCommands();
|
||||||
IMP.registerPlayerEvents();
|
IMP.registerPlayerEvents();
|
||||||
IMP.registerInventoryEvents();
|
IMP.registerInventoryEvents();
|
||||||
|
@ -25,6 +25,7 @@ import java.util.Arrays;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
|
import com.intellectualcrafters.plot.PS;
|
||||||
import com.intellectualcrafters.plot.config.C;
|
import com.intellectualcrafters.plot.config.C;
|
||||||
import com.intellectualcrafters.plot.object.PlotPlayer;
|
import com.intellectualcrafters.plot.object.PlotPlayer;
|
||||||
import com.intellectualcrafters.plot.util.MainUtil;
|
import com.intellectualcrafters.plot.util.MainUtil;
|
||||||
@ -105,7 +106,7 @@ public class Toggle extends SubCommand {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (BukkitMain.worldEdit != null) {
|
if (PS.get().worldedit != null) {
|
||||||
toggles.put("worldedit",
|
toggles.put("worldedit",
|
||||||
new Command<PlotPlayer>("worldedit", "/plot toggle worldedit", "Toggle worldedit bypass", C.PERMISSION_WORLDEDIT_BYPASS.s()) {
|
new Command<PlotPlayer>("worldedit", "/plot toggle worldedit", "Toggle worldedit bypass", C.PERMISSION_WORLDEDIT_BYPASS.s()) {
|
||||||
|
|
||||||
|
@ -25,8 +25,8 @@ import com.intellectualcrafters.plot.object.PlotPlayer;
|
|||||||
import com.intellectualcrafters.plot.util.MainUtil;
|
import com.intellectualcrafters.plot.util.MainUtil;
|
||||||
import com.intellectualcrafters.plot.util.Permissions;
|
import com.intellectualcrafters.plot.util.Permissions;
|
||||||
import com.plotsquared.bukkit.BukkitMain;
|
import com.plotsquared.bukkit.BukkitMain;
|
||||||
import com.plotsquared.bukkit.listeners.worldedit.WEManager;
|
|
||||||
import com.plotsquared.general.commands.CommandDeclaration;
|
import com.plotsquared.general.commands.CommandDeclaration;
|
||||||
|
import com.plotsquared.listener.WEManager;
|
||||||
|
|
||||||
@CommandDeclaration(
|
@CommandDeclaration(
|
||||||
command = "weanywhere",
|
command = "weanywhere",
|
||||||
|
@ -64,7 +64,6 @@ import com.plotsquared.bukkit.listeners.PlotPlusListener;
|
|||||||
import com.plotsquared.bukkit.listeners.TNTListener;
|
import com.plotsquared.bukkit.listeners.TNTListener;
|
||||||
import com.plotsquared.bukkit.listeners.WorldEvents;
|
import com.plotsquared.bukkit.listeners.WorldEvents;
|
||||||
import com.plotsquared.bukkit.listeners.worldedit.WEListener;
|
import com.plotsquared.bukkit.listeners.worldedit.WEListener;
|
||||||
import com.plotsquared.bukkit.listeners.worldedit.WESubscriber;
|
|
||||||
import com.plotsquared.bukkit.titles.DefaultTitle;
|
import com.plotsquared.bukkit.titles.DefaultTitle;
|
||||||
import com.plotsquared.bukkit.util.BukkitChatManager;
|
import com.plotsquared.bukkit.util.BukkitChatManager;
|
||||||
import com.plotsquared.bukkit.util.BukkitChunkManager;
|
import com.plotsquared.bukkit.util.BukkitChunkManager;
|
||||||
@ -90,6 +89,7 @@ import com.plotsquared.bukkit.uuid.FileUUIDHandler;
|
|||||||
import com.plotsquared.bukkit.uuid.LowerOfflineUUIDWrapper;
|
import com.plotsquared.bukkit.uuid.LowerOfflineUUIDWrapper;
|
||||||
import com.plotsquared.bukkit.uuid.OfflineUUIDWrapper;
|
import com.plotsquared.bukkit.uuid.OfflineUUIDWrapper;
|
||||||
import com.plotsquared.bukkit.uuid.SQLUUIDHandler;
|
import com.plotsquared.bukkit.uuid.SQLUUIDHandler;
|
||||||
|
import com.plotsquared.listener.WESubscriber;
|
||||||
import com.sk89q.worldedit.WorldEdit;
|
import com.sk89q.worldedit.WorldEdit;
|
||||||
import com.sk89q.worldedit.bukkit.WorldEditPlugin;
|
import com.sk89q.worldedit.bukkit.WorldEditPlugin;
|
||||||
|
|
||||||
@ -368,7 +368,7 @@ public class BukkitMain extends JavaPlugin implements Listener, IPlotMain {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerWorldEditEvents() {
|
public boolean initWorldEdit() {
|
||||||
if (getServer().getPluginManager().getPlugin("WorldEdit") != null) {
|
if (getServer().getPluginManager().getPlugin("WorldEdit") != null) {
|
||||||
BukkitMain.worldEdit = (WorldEditPlugin) getServer().getPluginManager().getPlugin("WorldEdit");
|
BukkitMain.worldEdit = (WorldEditPlugin) getServer().getPluginManager().getPlugin("WorldEdit");
|
||||||
final String version = BukkitMain.worldEdit.getDescription().getVersion();
|
final String version = BukkitMain.worldEdit.getDescription().getVersion();
|
||||||
@ -378,10 +378,10 @@ public class BukkitMain extends JavaPlugin implements Listener, IPlotMain {
|
|||||||
log("&c - http://builds.enginehub.org/job/worldedit");
|
log("&c - http://builds.enginehub.org/job/worldedit");
|
||||||
} else {
|
} else {
|
||||||
getServer().getPluginManager().registerEvents(new WEListener(), this);
|
getServer().getPluginManager().registerEvents(new WEListener(), this);
|
||||||
WorldEdit.getInstance().getEventBus().register(new WESubscriber());
|
return true;
|
||||||
MainCommand.getInstance().createCommand(new WE_Anywhere());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -117,10 +117,10 @@ import com.intellectualcrafters.plot.util.StringMan;
|
|||||||
import com.intellectualcrafters.plot.util.TaskManager;
|
import com.intellectualcrafters.plot.util.TaskManager;
|
||||||
import com.intellectualcrafters.plot.util.UUIDHandler;
|
import com.intellectualcrafters.plot.util.UUIDHandler;
|
||||||
import com.plotsquared.bukkit.BukkitMain;
|
import com.plotsquared.bukkit.BukkitMain;
|
||||||
import com.plotsquared.bukkit.listeners.worldedit.WEManager;
|
|
||||||
import com.plotsquared.bukkit.object.BukkitLazyBlock;
|
import com.plotsquared.bukkit.object.BukkitLazyBlock;
|
||||||
import com.plotsquared.bukkit.object.BukkitPlayer;
|
import com.plotsquared.bukkit.object.BukkitPlayer;
|
||||||
import com.plotsquared.bukkit.util.BukkitUtil;
|
import com.plotsquared.bukkit.util.BukkitUtil;
|
||||||
|
import com.plotsquared.listener.WEManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Player Events involving plots
|
* Player Events involving plots
|
||||||
|
@ -26,6 +26,7 @@ import com.intellectualcrafters.plot.util.SetBlockQueue;
|
|||||||
import com.plotsquared.bukkit.BukkitMain;
|
import com.plotsquared.bukkit.BukkitMain;
|
||||||
import com.plotsquared.bukkit.util.BukkitUtil;
|
import com.plotsquared.bukkit.util.BukkitUtil;
|
||||||
import com.plotsquared.bukkit.util.SetBlockFast;
|
import com.plotsquared.bukkit.util.SetBlockFast;
|
||||||
|
import com.plotsquared.listener.WEManager;
|
||||||
import com.sk89q.worldedit.BlockVector;
|
import com.sk89q.worldedit.BlockVector;
|
||||||
import com.sk89q.worldedit.WorldEdit;
|
import com.sk89q.worldedit.WorldEdit;
|
||||||
import com.sk89q.worldedit.bukkit.WorldEditPlugin;
|
import com.sk89q.worldedit.bukkit.WorldEditPlugin;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package com.plotsquared.bukkit.listeners.worldedit;
|
package com.plotsquared.listener;
|
||||||
|
|
||||||
import com.sk89q.worldedit.extent.AbstractDelegateExtent;
|
import com.sk89q.worldedit.extent.AbstractDelegateExtent;
|
||||||
import com.sk89q.worldedit.extent.Extent;
|
import com.sk89q.worldedit.extent.Extent;
|
@ -1,4 +1,4 @@
|
|||||||
package com.plotsquared.bukkit.listeners.worldedit;
|
package com.plotsquared.listener;
|
||||||
|
|
||||||
import com.sk89q.worldedit.Vector;
|
import com.sk89q.worldedit.Vector;
|
||||||
import com.sk89q.worldedit.WorldEditException;
|
import com.sk89q.worldedit.WorldEditException;
|
@ -1,4 +1,4 @@
|
|||||||
package com.plotsquared.bukkit.listeners.worldedit;
|
package com.plotsquared.listener;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
@ -1,4 +1,4 @@
|
|||||||
package com.plotsquared.bukkit.listeners.worldedit;
|
package com.plotsquared.listener;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
@ -7,9 +7,7 @@ import com.intellectualcrafters.plot.PS;
|
|||||||
import com.intellectualcrafters.plot.config.Settings;
|
import com.intellectualcrafters.plot.config.Settings;
|
||||||
import com.intellectualcrafters.plot.object.PlotBlock;
|
import com.intellectualcrafters.plot.object.PlotBlock;
|
||||||
import com.intellectualcrafters.plot.object.RegionWrapper;
|
import com.intellectualcrafters.plot.object.RegionWrapper;
|
||||||
import com.intellectualcrafters.plot.util.BlockManager;
|
|
||||||
import com.intellectualcrafters.plot.util.SetBlockQueue;
|
import com.intellectualcrafters.plot.util.SetBlockQueue;
|
||||||
import com.plotsquared.bukkit.util.BukkitUtil;
|
|
||||||
import com.sk89q.worldedit.Vector;
|
import com.sk89q.worldedit.Vector;
|
||||||
import com.sk89q.worldedit.Vector2D;
|
import com.sk89q.worldedit.Vector2D;
|
||||||
import com.sk89q.worldedit.WorldEditException;
|
import com.sk89q.worldedit.WorldEditException;
|
@ -1,4 +1,4 @@
|
|||||||
package com.plotsquared.bukkit.listeners.worldedit;
|
package com.plotsquared.listener;
|
||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package com.plotsquared.bukkit.listeners.worldedit;
|
package com.plotsquared.listener;
|
||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
@ -1,11 +1,8 @@
|
|||||||
package com.plotsquared.bukkit.listeners.worldedit;
|
package com.plotsquared.listener;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.inventory.ItemStack;
|
|
||||||
|
|
||||||
import com.intellectualcrafters.plot.PS;
|
import com.intellectualcrafters.plot.PS;
|
||||||
import com.intellectualcrafters.plot.config.C;
|
import com.intellectualcrafters.plot.config.C;
|
||||||
import com.intellectualcrafters.plot.config.Settings;
|
import com.intellectualcrafters.plot.config.Settings;
|
||||||
@ -14,31 +11,18 @@ import com.intellectualcrafters.plot.object.PlotWorld;
|
|||||||
import com.intellectualcrafters.plot.object.RegionWrapper;
|
import com.intellectualcrafters.plot.object.RegionWrapper;
|
||||||
import com.intellectualcrafters.plot.util.MainUtil;
|
import com.intellectualcrafters.plot.util.MainUtil;
|
||||||
import com.intellectualcrafters.plot.util.Permissions;
|
import com.intellectualcrafters.plot.util.Permissions;
|
||||||
import com.intellectualcrafters.plot.util.UUIDHandler;
|
|
||||||
import com.plotsquared.bukkit.BukkitMain;
|
|
||||||
import com.plotsquared.bukkit.object.BukkitPlayer;
|
|
||||||
import com.sk89q.worldedit.EditSession;
|
|
||||||
import com.sk89q.worldedit.WorldEdit;
|
|
||||||
import com.sk89q.worldedit.EditSession.Stage;
|
|
||||||
import com.sk89q.worldedit.LocalSession;
|
import com.sk89q.worldedit.LocalSession;
|
||||||
import com.sk89q.worldedit.bukkit.WorldEditPlugin;
|
import com.sk89q.worldedit.WorldEdit;
|
||||||
import com.sk89q.worldedit.command.tool.BrushTool;
|
import com.sk89q.worldedit.command.tool.BrushTool;
|
||||||
import com.sk89q.worldedit.command.tool.Tool;
|
import com.sk89q.worldedit.command.tool.Tool;
|
||||||
|
import com.sk89q.worldedit.entity.Player;
|
||||||
import com.sk89q.worldedit.event.extent.EditSessionEvent;
|
import com.sk89q.worldedit.event.extent.EditSessionEvent;
|
||||||
import com.sk89q.worldedit.extension.platform.Actor;
|
import com.sk89q.worldedit.extension.platform.Actor;
|
||||||
import com.sk89q.worldedit.extent.AbstractDelegateExtent;
|
import com.sk89q.worldedit.extent.AbstractDelegateExtent;
|
||||||
import com.sk89q.worldedit.extent.ChangeSetExtent;
|
import com.sk89q.worldedit.extent.ChangeSetExtent;
|
||||||
import com.sk89q.worldedit.extent.Extent;
|
|
||||||
import com.sk89q.worldedit.extent.MaskingExtent;
|
import com.sk89q.worldedit.extent.MaskingExtent;
|
||||||
import com.sk89q.worldedit.extent.cache.LastAccessExtentCache;
|
|
||||||
import com.sk89q.worldedit.extent.inventory.BlockBagExtent;
|
|
||||||
import com.sk89q.worldedit.extent.reorder.MultiStageReorder;
|
import com.sk89q.worldedit.extent.reorder.MultiStageReorder;
|
||||||
import com.sk89q.worldedit.extent.validation.DataValidatorExtent;
|
|
||||||
import com.sk89q.worldedit.extent.world.BlockQuirkExtent;
|
|
||||||
import com.sk89q.worldedit.extent.world.ChunkLoadingExtent;
|
|
||||||
import com.sk89q.worldedit.extent.world.FastModeExtent;
|
import com.sk89q.worldedit.extent.world.FastModeExtent;
|
||||||
import com.sk89q.worldedit.extent.world.SurvivalModeExtent;
|
|
||||||
import com.sk89q.worldedit.function.mask.Mask;
|
|
||||||
import com.sk89q.worldedit.util.eventbus.EventHandler.Priority;
|
import com.sk89q.worldedit.util.eventbus.EventHandler.Priority;
|
||||||
import com.sk89q.worldedit.util.eventbus.Subscribe;
|
import com.sk89q.worldedit.util.eventbus.Subscribe;
|
||||||
import com.sk89q.worldedit.world.World;
|
import com.sk89q.worldedit.world.World;
|
||||||
@ -47,9 +31,9 @@ public class WESubscriber {
|
|||||||
|
|
||||||
@Subscribe(priority=Priority.VERY_EARLY)
|
@Subscribe(priority=Priority.VERY_EARLY)
|
||||||
public void onEditSession(EditSessionEvent event) {
|
public void onEditSession(EditSessionEvent event) {
|
||||||
WorldEditPlugin worldedit = BukkitMain.worldEdit;
|
WorldEdit worldedit = PS.get().worldedit;
|
||||||
if (worldedit == null) {
|
if (worldedit == null) {
|
||||||
WorldEdit.getInstance().getEventBus().unregister(this);
|
worldedit.getEventBus().unregister(this);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
World worldObj = event.getWorld();
|
World worldObj = event.getWorld();
|
||||||
@ -61,12 +45,11 @@ public class WESubscriber {
|
|||||||
if (pp != null && pp.getAttribute("worldedit")) {
|
if (pp != null && pp.getAttribute("worldedit")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
PlotPlayer player = UUIDHandler.getPlayer(actor.getName());
|
HashSet<RegionWrapper> mask = WEManager.getMask(pp);
|
||||||
HashSet<RegionWrapper> mask = WEManager.getMask(player);
|
|
||||||
PlotWorld plotworld = PS.get().getPlotWorld(world);
|
PlotWorld plotworld = PS.get().getPlotWorld(world);
|
||||||
if (mask.size() == 0) {
|
if (mask.size() == 0) {
|
||||||
if (Permissions.hasPermission(player, "plots.worldedit.bypass")) {
|
if (Permissions.hasPermission(pp, "plots.worldedit.bypass")) {
|
||||||
MainUtil.sendMessage(player, C.WORLDEDIT_BYPASS);
|
MainUtil.sendMessage(pp, C.WORLDEDIT_BYPASS);
|
||||||
}
|
}
|
||||||
if (plotworld != null) {
|
if (plotworld != null) {
|
||||||
event.setExtent(new NullExtent());
|
event.setExtent(new NullExtent());
|
||||||
@ -76,13 +59,13 @@ public class WESubscriber {
|
|||||||
if (Settings.CHUNK_PROCESSOR) {
|
if (Settings.CHUNK_PROCESSOR) {
|
||||||
if (Settings.EXPERIMENTAL_FAST_ASYNC_WORLDEDIT) {
|
if (Settings.EXPERIMENTAL_FAST_ASYNC_WORLDEDIT) {
|
||||||
try {
|
try {
|
||||||
LocalSession session = worldedit.getWorldEdit().getSession(name);
|
LocalSession session = worldedit.getSession(name);
|
||||||
boolean hasMask = session.getMask() != null;
|
boolean hasMask = session.getMask() != null;
|
||||||
Player objPlayer = ((BukkitPlayer) player).player;
|
Player objPlayer = (Player) actor;
|
||||||
ItemStack item = objPlayer.getItemInHand();
|
int item = objPlayer.getItemInHand();
|
||||||
if (item != null && !hasMask) {
|
if (!hasMask) {
|
||||||
try {
|
try {
|
||||||
Tool tool = session.getTool(item.getTypeId());
|
Tool tool = session.getTool(item);
|
||||||
if (tool != null && tool instanceof BrushTool) {
|
if (tool != null && tool instanceof BrushTool) {
|
||||||
hasMask = ((BrushTool) tool).getMask() != null;
|
hasMask = ((BrushTool) tool).getMask() != null;
|
||||||
}
|
}
|
||||||
@ -149,7 +132,7 @@ public class WESubscriber {
|
|||||||
event.setExtent(new ProcessedWEExtent(world, mask, event.getMaxBlocks(), event.getExtent(), event.getExtent()));
|
event.setExtent(new ProcessedWEExtent(world, mask, event.getMaxBlocks(), event.getExtent(), event.getExtent()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (PS.get().isPlotWorld(world)) {
|
else if (plotworld != null) {
|
||||||
event.setExtent(new WEExtent(mask, event.getExtent()));
|
event.setExtent(new WEExtent(mask, event.getExtent()));
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -21,7 +21,9 @@ import org.spongepowered.api.block.BlockState;
|
|||||||
import org.spongepowered.api.block.BlockType;
|
import org.spongepowered.api.block.BlockType;
|
||||||
import org.spongepowered.api.block.BlockTypes;
|
import org.spongepowered.api.block.BlockTypes;
|
||||||
import org.spongepowered.api.entity.player.Player;
|
import org.spongepowered.api.entity.player.Player;
|
||||||
|
import org.spongepowered.api.event.Subscribe;
|
||||||
import org.spongepowered.api.event.entity.player.PlayerChatEvent;
|
import org.spongepowered.api.event.entity.player.PlayerChatEvent;
|
||||||
|
import org.spongepowered.api.event.state.InitializationEvent;
|
||||||
import org.spongepowered.api.event.state.PreInitializationEvent;
|
import org.spongepowered.api.event.state.PreInitializationEvent;
|
||||||
import org.spongepowered.api.event.state.ServerAboutToStartEvent;
|
import org.spongepowered.api.event.state.ServerAboutToStartEvent;
|
||||||
import org.spongepowered.api.plugin.Plugin;
|
import org.spongepowered.api.plugin.Plugin;
|
||||||
@ -36,7 +38,6 @@ import org.spongepowered.api.world.GeneratorTypes;
|
|||||||
import org.spongepowered.api.world.World;
|
import org.spongepowered.api.world.World;
|
||||||
|
|
||||||
import com.google.common.base.Optional;
|
import com.google.common.base.Optional;
|
||||||
import com.google.common.eventbus.Subscribe;
|
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
import com.intellectualcrafters.configuration.ConfigurationSection;
|
import com.intellectualcrafters.configuration.ConfigurationSection;
|
||||||
import com.intellectualcrafters.plot.IPlotMain;
|
import com.intellectualcrafters.plot.IPlotMain;
|
||||||
@ -79,12 +80,13 @@ import com.plotsquared.sponge.util.SpongeUtil;
|
|||||||
import com.plotsquared.sponge.uuid.SpongeLowerOfflineUUIDWrapper;
|
import com.plotsquared.sponge.uuid.SpongeLowerOfflineUUIDWrapper;
|
||||||
import com.plotsquared.sponge.uuid.SpongeOnlineUUIDWrapper;
|
import com.plotsquared.sponge.uuid.SpongeOnlineUUIDWrapper;
|
||||||
import com.plotsquared.sponge.uuid.SpongeUUIDHandler;
|
import com.plotsquared.sponge.uuid.SpongeUUIDHandler;
|
||||||
|
import com.sk89q.worldedit.WorldEdit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by robin on 01/11/2014
|
* Created by robin on 01/11/2014
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Plugin(id = "PlotSquared", name = "PlotSquared", version = "3.0.0")
|
@Plugin(id = "PlotSquared", name = "PlotSquared", version = "3.0.0", dependencies="before:WorldEdit")
|
||||||
public class SpongeMain implements IPlotMain, PluginContainer {
|
public class SpongeMain implements IPlotMain, PluginContainer {
|
||||||
public static SpongeMain THIS;
|
public static SpongeMain THIS;
|
||||||
|
|
||||||
@ -211,6 +213,11 @@ public class SpongeMain implements IPlotMain, PluginContainer {
|
|||||||
///////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
///////////////////// ON ENABLE /////////////////////
|
///////////////////// ON ENABLE /////////////////////
|
||||||
|
@Subscribe
|
||||||
|
public void init(InitializationEvent event) {
|
||||||
|
log("INIT");
|
||||||
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void onInit(PreInitializationEvent event) {
|
public void onInit(PreInitializationEvent event) {
|
||||||
log("PRE INIT");
|
log("PRE INIT");
|
||||||
@ -218,13 +225,11 @@ public class SpongeMain implements IPlotMain, PluginContainer {
|
|||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void onServerAboutToStart(ServerAboutToStartEvent event) {
|
public void onServerAboutToStart(ServerAboutToStartEvent event) {
|
||||||
log("INIT");
|
log("ABOUT START");
|
||||||
THIS = this;
|
THIS = this;
|
||||||
|
|
||||||
//
|
//
|
||||||
resolver = game.getServiceManager().provide(GameProfileResolver.class).get();
|
resolver = game.getServiceManager().provide(GameProfileResolver.class).get();
|
||||||
plugin = game.getPluginManager().getPlugin("PlotSquared").get().getInstance();
|
|
||||||
log("PLUGIN IS THIS: " + (plugin == this));
|
|
||||||
plugin = this;
|
plugin = this;
|
||||||
server = game.getServer();
|
server = game.getServer();
|
||||||
//
|
//
|
||||||
@ -514,7 +519,7 @@ public class SpongeMain implements IPlotMain, PluginContainer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerCommands() {
|
public void registerCommands() {
|
||||||
getGame().getCommandDispatcher().register(plugin, new SpongeCommand(), "plots", "p", "plot", "ps", "plotsquared", "p2", "2");
|
getGame().getCommandDispatcher().register(plugin, new SpongeCommand(), new String[] {"plots", "p", "plot", "ps", "plotsquared", "p2", "2"});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -541,9 +546,15 @@ public class SpongeMain implements IPlotMain, PluginContainer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerWorldEditEvents() {
|
public boolean initWorldEdit() {
|
||||||
// TODO Auto-generated method stub
|
try {
|
||||||
log("registerWorldEditEvents is not implemented!");
|
log("CHECKING FOR WORLDEDIT!?");
|
||||||
|
Class.forName("com.sk89q.worldedit.WorldEdit");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch (Throwable e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -43,11 +43,11 @@ public class WorldModify implements WorldGeneratorModifier {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "PlotSquared";
|
return "plotsquared";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getId() {
|
public String getId() {
|
||||||
return "PlotSquared";
|
return "plotsquared";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,7 @@ import org.spongepowered.api.entity.living.monster.Monster;
|
|||||||
import org.spongepowered.api.entity.player.Player;
|
import org.spongepowered.api.entity.player.Player;
|
||||||
import org.spongepowered.api.entity.vehicle.Boat;
|
import org.spongepowered.api.entity.vehicle.Boat;
|
||||||
import org.spongepowered.api.entity.vehicle.minecart.Minecart;
|
import org.spongepowered.api.entity.vehicle.minecart.Minecart;
|
||||||
|
import org.spongepowered.api.event.Subscribe;
|
||||||
import org.spongepowered.api.event.block.BlockMoveEvent;
|
import org.spongepowered.api.event.block.BlockMoveEvent;
|
||||||
import org.spongepowered.api.event.block.BlockRedstoneUpdateEvent;
|
import org.spongepowered.api.event.block.BlockRedstoneUpdateEvent;
|
||||||
import org.spongepowered.api.event.block.FloraGrowEvent;
|
import org.spongepowered.api.event.block.FloraGrowEvent;
|
||||||
@ -45,7 +46,6 @@ import org.spongepowered.api.world.extent.Extent;
|
|||||||
import com.flowpowered.math.vector.Vector3d;
|
import com.flowpowered.math.vector.Vector3d;
|
||||||
import com.flowpowered.math.vector.Vector3i;
|
import com.flowpowered.math.vector.Vector3i;
|
||||||
import com.google.common.base.Predicate;
|
import com.google.common.base.Predicate;
|
||||||
import com.google.common.eventbus.Subscribe;
|
|
||||||
import com.intellectualcrafters.plot.PS;
|
import com.intellectualcrafters.plot.PS;
|
||||||
import com.intellectualcrafters.plot.config.C;
|
import com.intellectualcrafters.plot.config.C;
|
||||||
import com.intellectualcrafters.plot.config.Settings;
|
import com.intellectualcrafters.plot.config.Settings;
|
||||||
|
@ -98,9 +98,6 @@ public class SpongePlayer extends PlotPlayer {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
boolean value = this.player.hasPermission(perm);
|
boolean value = this.player.hasPermission(perm);
|
||||||
|
|
||||||
// TODO check children
|
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user