From 3ffb5ff00d2ec3a7dc1a9a35546aa197832a9be1 Mon Sep 17 00:00:00 2001 From: IronApollo Date: Wed, 27 Feb 2019 08:09:04 -0500 Subject: [PATCH] Changes to fix some PlotSquared compatibility issues, plus fix block Mask parsing --- .../java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java | 1 - worldedit-core/src/main/java/com/boydti/fawe/Fawe.java | 8 ++++---- .../fawe/regions/general/plot/PlotSquaredFeature.java | 2 +- .../src/main/java/com/sk89q/worldedit/EditSession.java | 7 +++---- .../java/com/sk89q/worldedit/command/RegionCommands.java | 3 +-- .../extension/factory/parser/mask/DefaultMaskParser.java | 4 ++-- 6 files changed, 11 insertions(+), 14 deletions(-) diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java index 1752bf497..78f8c8091 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java @@ -189,7 +189,6 @@ public class WorldEditPlugin extends JavaPlugin //implements TabCompleter } } } - System.out.println("finished enable"); } private void rename() { diff --git a/worldedit-core/src/main/java/com/boydti/fawe/Fawe.java b/worldedit-core/src/main/java/com/boydti/fawe/Fawe.java index 640a39579..4829dd13c 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/Fawe.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/Fawe.java @@ -213,10 +213,10 @@ public class Fawe { try { transformParser = new DefaultTransformParser(getWorldEdit()); visualQueue = new VisualQueue(3); -// WEManager.IMP.managers.addAll(Fawe.this.IMP.getMaskManagers()); -// WEManager.IMP.managers.add(new PlotSquaredFeature()); -// Fawe.debug("Plugin 'PlotSquared' found. Using it now."); - } catch (Throwable e) {e.printStackTrace();} + WEManager.IMP.managers.addAll(Fawe.this.IMP.getMaskManagers()); + WEManager.IMP.managers.add(new PlotSquaredFeature()); + Fawe.debug("Plugin 'PlotSquared' found. Using it now."); + } catch (Throwable e) {} }, 0); TaskManager.IMP.repeat(timer, 1); diff --git a/worldedit-core/src/main/java/com/boydti/fawe/regions/general/plot/PlotSquaredFeature.java b/worldedit-core/src/main/java/com/boydti/fawe/regions/general/plot/PlotSquaredFeature.java index 2f018f611..1dc34efd0 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/regions/general/plot/PlotSquaredFeature.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/regions/general/plot/PlotSquaredFeature.java @@ -33,7 +33,7 @@ public class PlotSquaredFeature extends FaweMaskManager { public PlotSquaredFeature() { super("PlotSquared"); Fawe.debug("Optimizing PlotSquared"); - PlotSquared.get().worldedit = null; +// PlotSquared.get().worldedit = null; setupBlockQueue(); setupSchematicHandler(); setupChunkManager(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java index dca81a5cf..530793a5e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java @@ -542,10 +542,9 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue, return new NullExtent(extent, BBC.WORLDEDIT_CANCEL_REASON_MANUAL); } final Extent toReturn = event.getExtent(); -// if(toReturn instanceof com.sk89q.worldedit.extent.NullExtent) { -// return new NullExtent(toReturn, null); -// return new AbstractDelegateExtent(toReturn); -// }); + if(toReturn instanceof com.sk89q.worldedit.extent.NullExtent) { + return new NullExtent(toReturn, null); + } if (!(toReturn instanceof AbstractDelegateExtent)) { Fawe.debug("Extent " + toReturn + " must be AbstractDelegateExtent"); return extent; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java index e7b8e2fd6..1f678beed 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java @@ -335,8 +335,7 @@ public class RegionCommands extends MethodCommands { @Logging(REGION) public void set(FawePlayer player, LocalSession session, EditSession editSession, @Selection Region selection, Pattern to, CommandContext context) throws WorldEditException { player.checkConfirmationRegion(() -> { - int affected; - affected = editSession.setBlocks(selection, to); + int affected = editSession.setBlocks(selection, to); if (affected != 0) { BBC.OPERATION.send(player, affected); if (!player.hasPermission("fawe.tips")) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/DefaultMaskParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/DefaultMaskParser.java index 5c5ba62b5..29ebdec39 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/DefaultMaskParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/DefaultMaskParser.java @@ -213,12 +213,12 @@ public class DefaultMaskParser extends FaweParser { throw new InputParseException(e2.getMessage()); } }); + } } if (pe.and) { masks.add(new ArrayList<>()); } masks.get(masks.size() - 1).add(mask); - } } } catch (InputParseException rethrow) { throw rethrow; @@ -240,7 +240,7 @@ public class DefaultMaskParser extends FaweParser { return new MaskIntersection(maskUnions); } else { return null; - } + } } }