From ef58cf567bd8912f9eee51e43f6c9e613de3e426 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Sat, 11 Jul 2020 12:39:27 +0100 Subject: [PATCH 1/6] Clean up P2 v5 hook a little. Should be a good step at removing any OOBs and incorrect-height-sets --- .../plotsquared/FaweRegionManager.java | 26 +++++++------------ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/plotsquared/FaweRegionManager.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/plotsquared/FaweRegionManager.java index 6db889f5b..d1b057cf5 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/plotsquared/FaweRegionManager.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/plotsquared/FaweRegionManager.java @@ -115,17 +115,15 @@ public class FaweRegionManager extends RegionManager { final Pattern plotfloor = hybridPlotWorld.TOP_BLOCK.toPattern(); final BiomeType biome = hybridPlotWorld.getPlotBiome(); - BlockVector3 pos1 = plot.getBottomAbs().getBlockVector3(); - BlockVector3 pos2 = plot.getExtendedTopAbs().getBlockVector3(); + BlockVector3 pos1 = BlockVector3.ZERO; + BlockVector3 pos2 = BlockVector3.at(hybridPlotWorld.PLOT_WIDTH, 255, hybridPlotWorld.PLOT_WIDTH); - Region bedrockRegion = new CuboidRegion(pos1.withY(0), pos2.withY(0)); + Region bedrockRegion = new CuboidRegion(pos1, pos2.withY(0)); Region fillingRegion = new CuboidRegion(pos1.withY(1), pos2.withY(hybridPlotWorld.PLOT_HEIGHT - 1)); - Region floorRegion = new CuboidRegion(pos1.withY(hybridPlotWorld.PLOT_HEIGHT), - pos2.withY(hybridPlotWorld.PLOT_HEIGHT)); - Region airRegion = new CuboidRegion(pos1.withY(hybridPlotWorld.PLOT_HEIGHT + 1), - pos2.withY(manager.getWorldHeight())); + Region floorRegion = new CuboidRegion(pos1.withY(hybridPlotWorld.PLOT_HEIGHT), pos2.withY(hybridPlotWorld.PLOT_HEIGHT)); + Region airRegion = new CuboidRegion(pos1.withY(hybridPlotWorld.PLOT_HEIGHT + 1), pos2.withY(manager.getWorldHeight())); - Clipboard clipboard = new BlockArrayClipboard(new CuboidRegion(pos1.withY(0), pos2.withY(255))); + Clipboard clipboard = new BlockArrayClipboard(new CuboidRegion(pos1, pos2)); clipboard.setBlocks(bedrockRegion, bedrock); clipboard.setBlocks(fillingRegion, filling); @@ -137,7 +135,7 @@ public class FaweRegionManager extends RegionManager { } } - clipboard.paste(editSession, pos1, true, false, true); + clipboard.paste(editSession, plot.getBottomAbs().getBlockVector3().withY(0), true, false, true); } if (hybridPlotWorld.PLOT_SCHEMATIC) { @@ -172,8 +170,7 @@ public class FaweRegionManager extends RegionManager { //todo because of the following code this should proably be in the Bukkit module World pos1World = BukkitAdapter.adapt(getWorld(pos1.getWorld())); World pos3World = BukkitAdapter.adapt(getWorld(pos3.getWorld())); - WorldEdit.getInstance().getEditSessionFactory().getEditSession( - pos1World,-1); + WorldEdit.getInstance().getEditSessionFactory().getEditSession(pos1World,-1); EditSession sessionA = new EditSessionBuilder(pos1World).checkMemory(false).fastmode(true).limitUnlimited().changeSetNull().autoQueue(false).build(); EditSession sessionB = new EditSessionBuilder(pos3World).checkMemory(false).fastmode(true).limitUnlimited().changeSetNull().autoQueue(false).build(); CuboidRegion regionA = new CuboidRegion(BlockVector3.at(pos1.getX(), pos1.getY(), pos1.getZ()), BlockVector3.at(pos2.getX(), pos2.getY(), pos2.getZ())); @@ -246,11 +243,8 @@ public class FaweRegionManager extends RegionManager { TaskManager.IMP.async(() -> { synchronized (FaweRegionManager.class) { World pos1World = BukkitAdapter.adapt(getWorld(pos1.getWorld())); - try (EditSession editSession = new EditSessionBuilder(pos1World).checkMemory(false) - .fastmode(true).limitUnlimited().changeSetNull().autoQueue(false).build()) { - CuboidRegion region = new CuboidRegion( - BlockVector3.at(pos1.getX(), pos1.getY(), pos1.getZ()), - BlockVector3.at(pos2.getX(), pos2.getY(), pos2.getZ())); + try (EditSession editSession = new EditSessionBuilder(pos1World).checkMemory(false).fastmode(true).limitUnlimited().changeSetNull().autoQueue(false).build()) { + CuboidRegion region = new CuboidRegion(BlockVector3.at(pos1.getX(), pos1.getY(), pos1.getZ()), BlockVector3.at(pos2.getX(), pos2.getY(), pos2.getZ())); editSession.regenerate(region); editSession.flushQueue(); } From eb9ed098bb493e8ee4470a7b24b14c217dfcb26f Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Sat, 11 Jul 2020 12:41:33 +0100 Subject: [PATCH 2/6] use z not x --- .../fawe/bukkit/regions/plotsquared/FaweRegionManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/plotsquared/FaweRegionManager.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/plotsquared/FaweRegionManager.java index d1b057cf5..58c3b5101 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/plotsquared/FaweRegionManager.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/plotsquared/FaweRegionManager.java @@ -130,7 +130,7 @@ public class FaweRegionManager extends RegionManager { clipboard.setBlocks(floorRegion, plotfloor); clipboard.setBlocks(airRegion, air); for (int x = pos1.getX(); x <= pos2.getX(); x ++) { - for (int z = pos1.getX(); z <= pos2.getX(); z ++) { + for (int z = pos1.getZ(); z <= pos2.getZ(); z ++) { clipboard.setBiome(BlockVector2.at(x, z), biome); } } From 8e33ff95497565534e2ad5a06103111e21a42735 Mon Sep 17 00:00:00 2001 From: Hannes Greule Date: Mon, 13 Jul 2020 02:18:05 +0200 Subject: [PATCH 3/6] Make mask parsing actually working --- .../extension/factory/parser/mask/BlocksMaskParser.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/BlocksMaskParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/BlocksMaskParser.java index 2bbcbf98d..f9d8f8ebc 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/BlocksMaskParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/BlocksMaskParser.java @@ -56,7 +56,7 @@ public class BlocksMaskParser extends InputParser { return null; } return new BlockMask(context.requireExtent(), holders); - } catch (NoMatchException e) { + } catch (InputParseException e) { return null; } } From 7198c03cd3cb19754871da1f656d32e6ccf2b194 Mon Sep 17 00:00:00 2001 From: Hannes Greule Date: Mon, 13 Jul 2020 02:25:30 +0200 Subject: [PATCH 4/6] Reimplement angle mask parsing --- .../extension/factory/MaskFactory.java | 1 + .../factory/parser/mask/AngleMaskParser.java | 46 +++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/AngleMaskParser.java diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/MaskFactory.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/MaskFactory.java index 21c495ad4..40a7c0a3b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/MaskFactory.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/MaskFactory.java @@ -70,6 +70,7 @@ public final class MaskFactory extends AbstractFactory { register(new YAxisMaskParser(worldEdit)); register(new ZAxisMaskParser(worldEdit)); register(new SimplexMaskParser(worldEdit)); + register(new AngleMaskParser(worldEdit)); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/AngleMaskParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/AngleMaskParser.java new file mode 100644 index 000000000..e150d836a --- /dev/null +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/AngleMaskParser.java @@ -0,0 +1,46 @@ +package com.sk89q.worldedit.extension.factory.parser.mask; + +import com.boydti.fawe.object.mask.AngleMask; +import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.extension.factory.parser.RichParser; +import com.sk89q.worldedit.extension.input.InputParseException; +import com.sk89q.worldedit.extension.input.ParserContext; +import com.sk89q.worldedit.function.mask.Mask; +import org.jetbrains.annotations.NotNull; + +import java.util.stream.Stream; + +public class AngleMaskParser extends RichParser { + + public AngleMaskParser(WorldEdit worldEdit) { + super(worldEdit, "/"); + } + + @Override + protected Stream getSuggestions(String argumentInput, int index) { + return null; + } + + @Override + protected Mask parseFromInput(@NotNull String[] arguments, ParserContext context) throws InputParseException { + if (arguments.length != 2) return null; + String minArg = arguments[0]; + String maxArg = arguments[1]; + boolean degree = minArg.endsWith("d"); + if (degree ^ maxArg.endsWith("d")) { + throw new InputParseException("Cannot combine degree with block-step"); + } + double min, max; + if (degree) { + double minDeg = Double.parseDouble(minArg.substring(0, minArg.length() - 1)); + double maxDeg = Double.parseDouble(maxArg.substring(0, maxArg.length() - 1)); + min = (Math.tan(minDeg * (Math.PI / 180))); + max = (Math.tan(maxDeg * (Math.PI / 180))); + } else { + min = Double.parseDouble(minArg); + max = Double.parseDouble(maxArg); + } + + return new AngleMask(context.getExtent(), min, max, false, 1); + } +} From 11e762f07a2a4582580de9bcc4db0728abb594d8 Mon Sep 17 00:00:00 2001 From: Hannes Greule Date: Mon, 13 Jul 2020 11:15:01 +0200 Subject: [PATCH 5/6] Add basic angle mask suggestions Mask suggestions are a bit broken in general so this doesn't change much --- .../extension/factory/parser/mask/AngleMaskParser.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/AngleMaskParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/AngleMaskParser.java index e150d836a..0957a7e8c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/AngleMaskParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/AngleMaskParser.java @@ -18,6 +18,9 @@ public class AngleMaskParser extends RichParser { @Override protected Stream getSuggestions(String argumentInput, int index) { + if (index == 0 || index == 1) { + return suggestPositiveDoubles(argumentInput).flatMap(s -> Stream.of(s, s + "d")); + } return null; } From da96365504241fa4ed99c5f15747318f02e5727b Mon Sep 17 00:00:00 2001 From: N0tMyFaultOG Date: Mon, 13 Jul 2020 13:13:43 +0200 Subject: [PATCH 6/6] Updating a few links --- ...---issue-report-for-fastasyncworldedit-1-13-2.md | 10 +++++----- .github/PULL_REQUEST_TEMPLATE.md | 2 +- README.md | 13 ++++--------- .../sk89q/worldedit/command/WorldEditCommands.java | 2 +- 4 files changed, 11 insertions(+), 16 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug---issue-report-for-fastasyncworldedit-1-13-2.md b/.github/ISSUE_TEMPLATE/bug---issue-report-for-fastasyncworldedit-1-13-2.md index 47f004ca3..261b049fb 100644 --- a/.github/ISSUE_TEMPLATE/bug---issue-report-for-fastasyncworldedit-1-13-2.md +++ b/.github/ISSUE_TEMPLATE/bug---issue-report-for-fastasyncworldedit-1-13-2.md @@ -1,5 +1,5 @@ --- -name: Bug / Issue report for FastAsyncWorldEdit v1.15.2 +name: Bug / Issue report for FastAsyncWorldEdit v1.16.1 about: Bug / Issue report about this plugin title: '' labels: Requires Testing @@ -7,9 +7,9 @@ assignees: '' --- -# Bug report for FastAsyncWorldEdit 1.15.2 - - +# Bug report for FastAsyncWorldEdit 1.16.1 + + @@ -41,5 +41,5 @@ assignees: '' - [] I included all information required in the sections above - [] I made sure there are no duplicates of this report [(Use Search)](https://github.com/IntellectualSites/FastAsyncWorldEdit/issues?q=is%3Aissue) -- [] I made sure I am using an up-to-date version of [FastAsyncWorldEdit for 1.15.2](https://ci.athion.net/job/FastAsyncWorldEdit-1.15/) +- [] I made sure I am using an up-to-date version of [FastAsyncWorldEdit for 1.16.1](https://ci.athion.net/job/FastAsyncWorldEdit-1.16/) - [] I made sure the bug/error is not caused by any other plugin diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index ac23f5a75..58e192ab0 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -16,4 +16,4 @@ You can do so here: https://github.com/IntellectualSites/FastAsyncWorldEdit/issu - [] I included all information required in the sections above - [] I tested my changes and approved their functionality - [] I ensured my changes do not break other parts of the code -- [] I read and followed the [contribution guidelines](https://github.com/IntellectualSites/FastAsyncWorldEdit/blob/1.15/CONTRIBUTING.md) +- [] I read and followed the [contribution guidelines](https://github.com/IntellectualSites/FastAsyncWorldEdit/blob/1.16/CONTRIBUTING.md) diff --git a/README.md b/README.md index 09b28f24b..8c90a3c07 100644 --- a/README.md +++ b/README.md @@ -11,20 +11,15 @@ FAWE is a fork of WorldEdit that has huge speed and memory improvements and cons * [Spigot Page](https://www.spigotmc.org/threads/fast-async-worldedit.100104/) * [Discord](https://discord.gg/KxkjDVg) * [Wiki](https://wiki.intellectualsites.com/FastAsyncWorldEdit/index) -* [Report Issue](https://github.com/IntellectualSites/FastAsyncWorldEdit-1.13/issues) +* [Report Issue](https://github.com/IntellectualSites/FastAsyncWorldEdit/issues) * [Crowdin](https://intellectualsites.crowdin.com/fastasyncworldedit) +* [JavaDocs](https://ci.athion.net/job/FastAsyncWorldEdit-1.16/javadoc/) ## Downloads -### 1.13+ +### 1.14+ * [Download](https://intellectualsites.github.io/download/fawe.html) * [Jenkins](https://ci.athion.net/job/FastAsyncWorldEdit-1.16/) -### < 1.12.2 -* [Download](https://intellectualsites.github.io/download/fawe.html) -* [Jenkins](https://ci.athion.net/job/FastAsyncWorldEdit/) -* [Repository](https://github.com/boy0001/FastAsyncWorldedit) -* [JavaDoc](https://ci.athion.net/job/FastAsyncWorldEdit/javadoc/) - ## Building FAWE uses gradle to build @@ -32,7 +27,7 @@ You can safely ignore `gradlew setupDecompWorkspace` if you are not planning to ``` $ gradlew setupDecompWorkspace -$ gradlew build +$ gradlew clean build -x test ``` The jar is located in `worldedit-bukkit/build/libs/FastAsyncWorldEdit-1.16-###.jar` diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/WorldEditCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/WorldEditCommands.java index 3287fad18..581f73ad6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/WorldEditCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/WorldEditCommands.java @@ -77,7 +77,7 @@ public class WorldEditCommands { public void version(Actor actor) { FaweVersion fVer = Fawe.get().getVersion(); String fVerStr = fVer == null ? "unknown" : "-" + fVer.build; - actor.print(TextComponent.of("FastAsyncWorldEdit" + fVerStr + " created by Empire92")); + actor.print(TextComponent.of("FastAsyncWorldEdit" + fVerStr + " created by Empire92, MattBDev, IronApollo, dordsor21 and NotMyFault")); if (fVer != null) { FaweVersion version = Fawe.get().getVersion();