diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index d75377ab6..9c915669a 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -5,9 +5,6 @@ Thank you for your interest in contributing to FastAsyncWorldEdit! We appreciate
effort, but to make sure that the inclusion of your patch is a smooth process, we
ask that you make note of the following guidelines.
-* **Follow the [Oracle coding conventions](http://www.oracle.com/technetwork/java/codeconv-138413.html).**
- We can't stress this enough; if your code has notable issues, it may delay
- the process significantly.
* **Target Java 11 for source and compilation.** Make sure to mark methods with
` @Override` that override methods of parent classes, or that implement
methods of interfaces.
@@ -24,6 +21,8 @@ ask that you make note of the following guidelines.
around ten minutes to think about what the code is doing and whether it
seems awfully roundabout. If you had to copy the same large piece of
code in several places, that's bad.
+* **Annotate modified upstream (WorldEdit) code.** Doing so makes it easier to differentiate
+ between modifications. Take a look at the [Examples](#example) how that's been done.
* **Keep commit summaries under 70 characters.** For more details, place two
new lines after the summary line and write away!
* **Test your code.** We're not interested in broken code, for the obvious reasons.
@@ -60,15 +59,33 @@ adjust past changes.
Example
-------
+### Code style
This is **GOOD:**
+```java
if (var.func(param1, param2)) {
// do things
}
+```
This is **VERY BAD:**
-
+```java
if(var.func( param1, param2 ))
{
// do things
}
+```
+
+### Diff Annotations
+```java
+//FAWE start
+public Region[] getCurrentRegions(FaweMaskManager.MaskType type) {
+ return WEManager.IMP.getMask(this, type);
+}
+//FAWE end
+```
+```java
+//FAWE start - extends PassthroughExtent > implements Extent
+public class EditSession extends PassthroughExtent implements AutoCloseable {
+//FAWE end
+```
diff --git a/worldedit-bukkit/build.gradle.kts b/worldedit-bukkit/build.gradle.kts
index b64b6e3ce..ed73c93fc 100644
--- a/worldedit-bukkit/build.gradle.kts
+++ b/worldedit-bukkit/build.gradle.kts
@@ -99,6 +99,8 @@ dependencies {
api("com.intellectualsites.paster:Paster:1.0.1-SNAPSHOT")
api("org.lz4:lz4-java:1.8.0")
api("net.jpountz:lz4-java-stream:1.0.0") { isTransitive = false }
+ api("com.zaxxer:SparseBitSet:1.2") { isTransitive = false }
+ api("org.anarres:parallelgzip:1.0.5") { isTransitive = false }
// Third party
implementation("org.bstats:bstats-bukkit:2.2.1")
implementation("org.bstats:bstats-base:2.2.1")
@@ -179,7 +181,14 @@ tasks.named("shadowJar") {
relocate("net.kyori", "com.fastasyncworldedit.core.adventure") {
include(dependency("net.kyori:adventure-nbt:4.8.1"))
}
+ relocate("com.zaxxer", "com.fastasyncworldedit.core.math") {
+ include(dependency("com.zaxxer:SparseBitSet:1.2"))
+ }
+ relocate("org.anarres", "com.fastasyncworldedit.core.internal.io") {
+ include(dependency("org.anarres:parallelgzip:1.0.5"))
+ }
}
+ minimize()
}
tasks.named("assemble").configure {
diff --git a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/FaweBukkit.java b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/FaweBukkit.java
index dc2dff706..3b97d5140 100644
--- a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/FaweBukkit.java
+++ b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/FaweBukkit.java
@@ -4,9 +4,9 @@ import com.fastasyncworldedit.bukkit.util.image.BukkitImageViewer;
import com.fastasyncworldedit.core.FAWEPlatformAdapterImpl;
import com.fastasyncworldedit.core.Fawe;
import com.fastasyncworldedit.core.IFawe;
-import com.fastasyncworldedit.core.beta.implementation.preloader.AsyncPreloader;
-import com.fastasyncworldedit.core.beta.implementation.preloader.Preloader;
-import com.fastasyncworldedit.core.beta.implementation.queue.QueueHandler;
+import com.fastasyncworldedit.core.queue.implementation.preloader.AsyncPreloader;
+import com.fastasyncworldedit.core.queue.implementation.preloader.Preloader;
+import com.fastasyncworldedit.core.queue.implementation.QueueHandler;
import com.fastasyncworldedit.bukkit.adapter.BukkitQueueHandler;
import com.fastasyncworldedit.bukkit.adapter.NMSAdapter;
import com.fastasyncworldedit.bukkit.listener.BrushListener;
diff --git a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/adapter/BukkitQueueHandler.java b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/adapter/BukkitQueueHandler.java
index 1170acf56..a843ec0d5 100644
--- a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/adapter/BukkitQueueHandler.java
+++ b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/adapter/BukkitQueueHandler.java
@@ -1,7 +1,7 @@
package com.fastasyncworldedit.bukkit.adapter;
import co.aikar.timings.Timings;
-import com.fastasyncworldedit.core.beta.implementation.queue.QueueHandler;
+import com.fastasyncworldedit.core.queue.implementation.QueueHandler;
import com.fastasyncworldedit.bukkit.listener.ChunkListener;
import com.sk89q.worldedit.internal.util.LogManagerCompat;
import org.apache.logging.log4j.Logger;
diff --git a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/adapter/IDelegateBukkitImplAdapter.java b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/adapter/IDelegateBukkitImplAdapter.java
index b6f3c1a34..5ef39ed05 100644
--- a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/adapter/IDelegateBukkitImplAdapter.java
+++ b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/adapter/IDelegateBukkitImplAdapter.java
@@ -1,7 +1,6 @@
package com.fastasyncworldedit.bukkit.adapter;
-import com.fastasyncworldedit.core.beta.implementation.packet.ChunkPacket;
-import com.sk89q.jnbt.CompoundTag;
+import com.fastasyncworldedit.core.queue.implementation.packet.ChunkPacket;
import com.sk89q.jnbt.Tag;
import com.sk89q.worldedit.blocks.BaseItem;
import com.sk89q.worldedit.blocks.BaseItemStack;
diff --git a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/adapter/MapChunkUtil.java b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/adapter/MapChunkUtil.java
index 4841771ee..48a22340e 100644
--- a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/adapter/MapChunkUtil.java
+++ b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/adapter/MapChunkUtil.java
@@ -1,6 +1,6 @@
package com.fastasyncworldedit.bukkit.adapter;
-import com.fastasyncworldedit.core.beta.implementation.packet.ChunkPacket;
+import com.fastasyncworldedit.core.queue.implementation.packet.ChunkPacket;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.worldedit.bukkit.adapter.BukkitImplAdapter;
import com.sk89q.worldedit.math.BlockVector3;
diff --git a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/adapter/NMSAdapter.java b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/adapter/NMSAdapter.java
index 2b6f736f2..bed4f7e80 100644
--- a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/adapter/NMSAdapter.java
+++ b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/adapter/NMSAdapter.java
@@ -1,11 +1,11 @@
package com.fastasyncworldedit.bukkit.adapter;
import com.fastasyncworldedit.core.FAWEPlatformAdapterImpl;
-import com.fastasyncworldedit.core.beta.IChunkGet;
+import com.fastasyncworldedit.core.queue.IChunkGet;
import com.fastasyncworldedit.core.configuration.Settings;
import com.sk89q.worldedit.bukkit.WorldEditPlugin;
import com.sk89q.worldedit.math.BlockVector3;
-import com.sk89q.worldedit.world.block.BlockID;
+import com.fastasyncworldedit.core.world.block.BlockID;
import com.sk89q.worldedit.world.block.BlockState;
import com.sk89q.worldedit.world.block.BlockTypesCache;
diff --git a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/adapter/NMSRelighterFactory.java b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/adapter/NMSRelighterFactory.java
index ff436f235..5a81211f5 100644
--- a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/adapter/NMSRelighterFactory.java
+++ b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/adapter/NMSRelighterFactory.java
@@ -1,12 +1,12 @@
package com.fastasyncworldedit.bukkit.adapter;
-import com.fastasyncworldedit.core.beta.IQueueChunk;
-import com.fastasyncworldedit.core.beta.IQueueExtent;
-import com.fastasyncworldedit.core.beta.implementation.lighting.NMSRelighter;
-import com.fastasyncworldedit.core.beta.implementation.lighting.Relighter;
-import com.fastasyncworldedit.core.beta.implementation.lighting.RelighterFactory;
+import com.fastasyncworldedit.core.queue.IQueueChunk;
+import com.fastasyncworldedit.core.queue.IQueueExtent;
+import com.fastasyncworldedit.core.extent.processor.lighting.NMSRelighter;
+import com.fastasyncworldedit.core.extent.processor.lighting.Relighter;
+import com.fastasyncworldedit.core.extent.processor.lighting.RelighterFactory;
import com.fastasyncworldedit.core.configuration.Settings;
-import com.fastasyncworldedit.core.object.RelightMode;
+import com.fastasyncworldedit.core.extent.processor.lighting.RelightMode;
import com.sk89q.worldedit.world.World;
import org.jetbrains.annotations.NotNull;
diff --git a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/adapter/Regenerator.java b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/adapter/Regenerator.java
index 65ce4ff07..a0c75720e 100644
--- a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/adapter/Regenerator.java
+++ b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/adapter/Regenerator.java
@@ -1,8 +1,8 @@
package com.fastasyncworldedit.bukkit.adapter;
-import com.fastasyncworldedit.core.beta.IChunkCache;
-import com.fastasyncworldedit.core.beta.IChunkGet;
-import com.fastasyncworldedit.core.beta.implementation.queue.SingleThreadQueueExtent;
+import com.fastasyncworldedit.core.queue.IChunkCache;
+import com.fastasyncworldedit.core.queue.IChunkGet;
+import com.fastasyncworldedit.core.queue.implementation.SingleThreadQueueExtent;
import com.fastasyncworldedit.core.configuration.Settings;
import com.fastasyncworldedit.core.util.MathMan;
import com.sk89q.worldedit.extent.Extent;
diff --git a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/filter/GriefDefenderFilter.java b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/filter/GriefDefenderFilter.java
index 9679af1c6..5f4e79629 100644
--- a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/filter/GriefDefenderFilter.java
+++ b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/filter/GriefDefenderFilter.java
@@ -1,6 +1,6 @@
package com.fastasyncworldedit.bukkit.filter;
-import com.fastasyncworldedit.core.regions.general.CuboidRegionFilter;
+import com.fastasyncworldedit.core.regions.filter.CuboidRegionFilter;
import com.fastasyncworldedit.core.util.TaskManager;
import com.sk89q.worldedit.math.BlockVector2;
import com.griefdefender.api.claim.Claim;
diff --git a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/filter/GriefPreventionFilter.java b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/filter/GriefPreventionFilter.java
index 3087e01cc..e95b83310 100644
--- a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/filter/GriefPreventionFilter.java
+++ b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/filter/GriefPreventionFilter.java
@@ -1,6 +1,6 @@
package com.fastasyncworldedit.bukkit.filter;
-import com.fastasyncworldedit.core.regions.general.CuboidRegionFilter;
+import com.fastasyncworldedit.core.regions.filter.CuboidRegionFilter;
import com.fastasyncworldedit.core.util.TaskManager;
import com.sk89q.worldedit.math.BlockVector2;
import me.ryanhamshire.GriefPrevention.Claim;
diff --git a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/filter/WorldGuardFilter.java b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/filter/WorldGuardFilter.java
index eff5c6864..1838c8fc1 100644
--- a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/filter/WorldGuardFilter.java
+++ b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/filter/WorldGuardFilter.java
@@ -1,7 +1,7 @@
package com.fastasyncworldedit.bukkit.filter;
import com.fastasyncworldedit.core.Fawe;
-import com.fastasyncworldedit.core.regions.general.CuboidRegionFilter;
+import com.fastasyncworldedit.core.regions.filter.CuboidRegionFilter;
import com.sk89q.worldedit.bukkit.BukkitAdapter;
import com.sk89q.worldedit.internal.util.LogManagerCompat;
import com.sk89q.worldedit.math.BlockVector3;
diff --git a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/listener/BrushListener.java b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/listener/BrushListener.java
index 888f59924..c2f5100fe 100644
--- a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/listener/BrushListener.java
+++ b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/listener/BrushListener.java
@@ -1,8 +1,8 @@
package com.fastasyncworldedit.bukkit.listener;
-import com.fastasyncworldedit.core.object.brush.MovableTool;
-import com.fastasyncworldedit.core.object.brush.ResettableTool;
-import com.fastasyncworldedit.core.object.brush.scroll.ScrollTool;
+import com.fastasyncworldedit.core.command.tool.MovableTool;
+import com.fastasyncworldedit.core.command.tool.ResettableTool;
+import com.fastasyncworldedit.core.command.tool.scroll.ScrollTool;
import com.sk89q.worldedit.LocalSession;
import com.sk89q.worldedit.bukkit.BukkitAdapter;
import com.sk89q.worldedit.bukkit.BukkitPlayer;
diff --git a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/GriefDefenderFeature.java b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/GriefDefenderFeature.java
index ae7634cf6..50078c63c 100644
--- a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/GriefDefenderFeature.java
+++ b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/GriefDefenderFeature.java
@@ -2,7 +2,7 @@ package com.fastasyncworldedit.bukkit.regions;
import com.fastasyncworldedit.bukkit.filter.GriefDefenderFilter;
import com.fastasyncworldedit.core.regions.FaweMask;
-import com.fastasyncworldedit.core.regions.general.RegionFilter;
+import com.fastasyncworldedit.core.regions.filter.RegionFilter;
import com.flowpowered.math.vector.Vector3i;
import com.griefdefender.api.GriefDefender;
import com.griefdefender.api.claim.Claim;
diff --git a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/GriefPreventionFeature.java b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/GriefPreventionFeature.java
index cde423567..fd741d0e9 100644
--- a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/GriefPreventionFeature.java
+++ b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/GriefPreventionFeature.java
@@ -2,7 +2,7 @@ package com.fastasyncworldedit.bukkit.regions;
import com.fastasyncworldedit.bukkit.filter.GriefPreventionFilter;
import com.fastasyncworldedit.core.regions.FaweMask;
-import com.fastasyncworldedit.core.regions.general.RegionFilter;
+import com.fastasyncworldedit.core.regions.filter.RegionFilter;
import com.sk89q.worldedit.bukkit.BukkitAdapter;
import com.sk89q.worldedit.internal.util.LogManagerCompat;
import com.sk89q.worldedit.math.BlockVector3;
diff --git a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/WorldGuardFeature.java b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/WorldGuardFeature.java
index b49bceb13..3b833954d 100644
--- a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/WorldGuardFeature.java
+++ b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/WorldGuardFeature.java
@@ -1,9 +1,9 @@
package com.fastasyncworldedit.bukkit.regions;
import com.fastasyncworldedit.bukkit.filter.WorldGuardFilter;
-import com.fastasyncworldedit.core.object.RegionWrapper;
+import com.fastasyncworldedit.core.regions.RegionWrapper;
import com.fastasyncworldedit.core.regions.FaweMask;
-import com.fastasyncworldedit.core.regions.general.RegionFilter;
+import com.fastasyncworldedit.core.regions.filter.RegionFilter;
import com.sk89q.worldedit.bukkit.BukkitAdapter;
import com.sk89q.worldedit.internal.util.LogManagerCompat;
import com.sk89q.worldedit.math.BlockVector3;
diff --git a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquared/FaweDelegateRegionManager.java b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquared/FaweDelegateRegionManager.java
index ea6abd83c..63750e071 100644
--- a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquared/FaweDelegateRegionManager.java
+++ b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquared/FaweDelegateRegionManager.java
@@ -1,7 +1,7 @@
package com.fastasyncworldedit.bukkit.regions.plotsquared;
import com.fastasyncworldedit.core.FaweAPI;
-import com.fastasyncworldedit.core.object.RelightMode;
+import com.fastasyncworldedit.core.extent.processor.lighting.RelightMode;
import com.fastasyncworldedit.core.util.EditSessionBuilder;
import com.fastasyncworldedit.core.util.TaskManager;
import com.plotsquared.core.configuration.Settings;
diff --git a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquared/FaweDelegateSchematicHandler.java b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquared/FaweDelegateSchematicHandler.java
index c14032e58..91ed24a7e 100644
--- a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquared/FaweDelegateSchematicHandler.java
+++ b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquared/FaweDelegateSchematicHandler.java
@@ -3,7 +3,6 @@ package com.fastasyncworldedit.bukkit.regions.plotsquared;
import com.fastasyncworldedit.core.Fawe;
import com.fastasyncworldedit.core.FaweAPI;
import com.fastasyncworldedit.core.FaweCache;
-import com.fastasyncworldedit.core.object.io.PGZIPOutputStream;
import com.fastasyncworldedit.core.util.EditSessionBuilder;
import com.fastasyncworldedit.core.util.IOUtil;
import com.plotsquared.core.PlotSquared;
@@ -16,22 +15,23 @@ import com.plotsquared.core.util.SchematicHandler;
import com.plotsquared.core.util.task.RunnableVal;
import com.plotsquared.core.util.task.TaskManager;
import com.sk89q.jnbt.CompoundTag;
-import com.sk89q.jnbt.CompressedCompoundTag;
+import com.fastasyncworldedit.core.jnbt.CompressedCompoundTag;
import com.sk89q.jnbt.NBTInputStream;
import com.sk89q.jnbt.NBTOutputStream;
import com.sk89q.jnbt.Tag;
-import com.sk89q.jnbt.fawe.CompressedSchematicTag;
+import com.fastasyncworldedit.core.jnbt.CompressedSchematicTag;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.extent.clipboard.Clipboard;
import com.sk89q.worldedit.extent.clipboard.io.BuiltInClipboardFormat;
-import com.sk89q.worldedit.extent.clipboard.io.FastSchematicReader;
-import com.sk89q.worldedit.extent.clipboard.io.FastSchematicWriter;
+import com.fastasyncworldedit.core.extent.clipboard.io.FastSchematicReader;
+import com.fastasyncworldedit.core.extent.clipboard.io.FastSchematicWriter;
import com.sk89q.worldedit.extent.clipboard.io.MCEditSchematicReader;
import com.sk89q.worldedit.extent.clipboard.io.SpongeSchematicReader;
import com.sk89q.worldedit.internal.util.LogManagerCompat;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.regions.CuboidRegion;
import net.jpountz.lz4.LZ4BlockInputStream;
+import org.anarres.parallelgzip.ParallelGZIPOutputStream;
import org.apache.logging.log4j.Logger;
import org.jetbrains.annotations.NotNull;
@@ -136,19 +136,19 @@ public class FaweDelegateSchematicHandler {
Clipboard clipboard = (Clipboard) cTag.getSource();
try (OutputStream stream = new FileOutputStream(tmp);
NBTOutputStream output = new NBTOutputStream(
- new BufferedOutputStream(new PGZIPOutputStream(stream)))) {
+ new BufferedOutputStream(new ParallelGZIPOutputStream(stream)))) {
new FastSchematicWriter(output).write(clipboard);
}
} else {
try (OutputStream stream = new FileOutputStream(tmp);
- BufferedOutputStream output = new BufferedOutputStream(new PGZIPOutputStream(stream))) {
+ BufferedOutputStream output = new BufferedOutputStream(new ParallelGZIPOutputStream(stream))) {
LZ4BlockInputStream is = cTag.adapt(cTag.getSource());
IOUtil.copy(is, output);
}
}
} else {
try (OutputStream stream = new FileOutputStream(tmp);
- NBTOutputStream output = new NBTOutputStream(new PGZIPOutputStream(stream))) {
+ NBTOutputStream output = new NBTOutputStream(new ParallelGZIPOutputStream(stream))) {
Map map = tag.getValue();
output.writeNamedTag("Schematic", map.getOrDefault("Schematic", tag));
}
@@ -177,7 +177,7 @@ public class FaweDelegateSchematicHandler {
BuiltInClipboardFormat.SPONGE_SCHEMATIC.write(output, clipboard);
}
try {
- try (PGZIPOutputStream gzip = new PGZIPOutputStream(output)) {
+ try (ParallelGZIPOutputStream gzip = new ParallelGZIPOutputStream(output)) {
try (NBTOutputStream nos = new NBTOutputStream(gzip)) {
Map map = weTag.getValue();
nos.writeNamedTag("Schematic", map.getOrDefault("Schematic", weTag));
diff --git a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquared/FaweQueueCoordinator.java b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquared/FaweQueueCoordinator.java
index 22802403d..7946af39f 100644
--- a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquared/FaweQueueCoordinator.java
+++ b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquared/FaweQueueCoordinator.java
@@ -2,8 +2,8 @@ package com.fastasyncworldedit.bukkit.regions.plotsquared;
import com.fastasyncworldedit.core.Fawe;
import com.fastasyncworldedit.core.FaweCache;
-import com.fastasyncworldedit.core.beta.IQueueChunk;
-import com.fastasyncworldedit.core.beta.IQueueExtent;
+import com.fastasyncworldedit.core.queue.IQueueChunk;
+import com.fastasyncworldedit.core.queue.IQueueExtent;
import com.plotsquared.core.queue.LightingMode;
import com.plotsquared.core.queue.QueueCoordinator;
import com.plotsquared.core.queue.subscriber.ProgressSubscriber;
@@ -12,7 +12,7 @@ import com.sk89q.worldedit.entity.Entity;
import com.sk89q.worldedit.function.pattern.Pattern;
import com.sk89q.worldedit.math.BlockVector2;
import com.sk89q.worldedit.math.BlockVector3;
-import com.sk89q.worldedit.math.MutableBlockVector3;
+import com.fastasyncworldedit.core.math.MutableBlockVector3;
import com.sk89q.worldedit.regions.CuboidRegion;
import com.sk89q.worldedit.world.World;
import com.sk89q.worldedit.world.biome.BiomeType;
diff --git a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquared/PlotRegionFilter.java b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquared/PlotRegionFilter.java
index f343401a4..9eeb549b4 100644
--- a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquared/PlotRegionFilter.java
+++ b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquared/PlotRegionFilter.java
@@ -1,6 +1,6 @@
package com.fastasyncworldedit.bukkit.regions.plotsquared;
-import com.fastasyncworldedit.core.regions.general.CuboidRegionFilter;
+import com.fastasyncworldedit.core.regions.filter.CuboidRegionFilter;
import com.plotsquared.core.location.Location;
import com.plotsquared.core.plot.Plot;
import com.plotsquared.core.plot.PlotArea;
diff --git a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquared/PlotSquaredFeature.java b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquared/PlotSquaredFeature.java
index 0f35e54ee..984b4d6b4 100644
--- a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquared/PlotSquaredFeature.java
+++ b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquared/PlotSquaredFeature.java
@@ -3,7 +3,7 @@ package com.fastasyncworldedit.bukkit.regions.plotsquared;
import com.fastasyncworldedit.core.FaweAPI;
import com.fastasyncworldedit.core.regions.FaweMask;
import com.fastasyncworldedit.core.regions.FaweMaskManager;
-import com.fastasyncworldedit.core.regions.general.RegionFilter;
+import com.fastasyncworldedit.core.regions.filter.RegionFilter;
import com.github.intellectualsites.plotsquared.plot.util.UUIDHandler;
import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.command.MainCommand;
diff --git a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquaredv4/FaweLocalBlockQueue.java b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquaredv4/FaweLocalBlockQueue.java
index 62e63f214..1e8e3531d 100644
--- a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquaredv4/FaweLocalBlockQueue.java
+++ b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquaredv4/FaweLocalBlockQueue.java
@@ -3,13 +3,13 @@ package com.fastasyncworldedit.bukkit.regions.plotsquaredv4;
import com.fastasyncworldedit.core.Fawe;
import com.fastasyncworldedit.core.FaweAPI;
import com.fastasyncworldedit.core.FaweCache;
-import com.fastasyncworldedit.core.beta.IQueueChunk;
-import com.fastasyncworldedit.core.beta.IQueueExtent;
+import com.fastasyncworldedit.core.queue.IQueueChunk;
+import com.fastasyncworldedit.core.queue.IQueueExtent;
import com.github.intellectualsites.plotsquared.plot.util.block.LocalBlockQueue;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.worldedit.function.pattern.Pattern;
import com.sk89q.worldedit.math.BlockVector3;
-import com.sk89q.worldedit.math.MutableBlockVector3;
+import com.fastasyncworldedit.core.math.MutableBlockVector3;
import com.sk89q.worldedit.world.World;
import com.sk89q.worldedit.world.biome.BiomeType;
import com.sk89q.worldedit.world.block.BaseBlock;
diff --git a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquaredv4/FaweSchematicHandler.java b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquaredv4/FaweSchematicHandler.java
index f67b62009..02a87e35b 100644
--- a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquaredv4/FaweSchematicHandler.java
+++ b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquaredv4/FaweSchematicHandler.java
@@ -2,8 +2,7 @@ package com.fastasyncworldedit.bukkit.regions.plotsquaredv4;
import com.fastasyncworldedit.core.FaweAPI;
import com.fastasyncworldedit.core.FaweCache;
-import com.fastasyncworldedit.core.object.clipboard.ReadOnlyClipboard;
-import com.fastasyncworldedit.core.object.io.PGZIPOutputStream;
+import com.fastasyncworldedit.core.extent.clipboard.ReadOnlyClipboard;
import com.fastasyncworldedit.core.util.EditSessionBuilder;
import com.fastasyncworldedit.core.util.IOUtil;
import com.fastasyncworldedit.core.util.TaskManager;
@@ -14,8 +13,8 @@ import com.github.intellectualsites.plotsquared.plot.util.MainUtil;
import com.github.intellectualsites.plotsquared.plot.util.SchematicHandler;
import com.github.intellectualsites.plotsquared.plot.util.block.LocalBlockQueue;
import com.sk89q.jnbt.CompoundTag;
-import com.sk89q.jnbt.CompressedCompoundTag;
-import com.sk89q.jnbt.fawe.CompressedSchematicTag;
+import com.fastasyncworldedit.core.jnbt.CompressedCompoundTag;
+import com.fastasyncworldedit.core.jnbt.CompressedSchematicTag;
import com.sk89q.jnbt.NBTOutputStream;
import com.sk89q.jnbt.Tag;
import com.sk89q.worldedit.EditSession;
@@ -23,11 +22,12 @@ import com.sk89q.worldedit.bukkit.BukkitAdapter;
import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard;
import com.sk89q.worldedit.extent.clipboard.Clipboard;
import com.sk89q.worldedit.extent.clipboard.io.BuiltInClipboardFormat;
-import com.sk89q.worldedit.extent.clipboard.io.FastSchematicWriter;
+import com.fastasyncworldedit.core.extent.clipboard.io.FastSchematicWriter;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.regions.CuboidRegion;
import com.sk89q.worldedit.world.World;
import net.jpountz.lz4.LZ4BlockInputStream;
+import org.anarres.parallelgzip.ParallelGZIPOutputStream;
import java.io.BufferedOutputStream;
import java.io.File;
@@ -84,17 +84,17 @@ public class FaweSchematicHandler extends SchematicHandler {
CompressedCompoundTag cTag = (CompressedCompoundTag) tag;
if (cTag instanceof CompressedSchematicTag) {
Clipboard clipboard = (Clipboard) cTag.getSource();
- try (OutputStream stream = new FileOutputStream(tmp); NBTOutputStream output = new NBTOutputStream(new BufferedOutputStream(new PGZIPOutputStream(stream)))) {
+ try (OutputStream stream = new FileOutputStream(tmp); NBTOutputStream output = new NBTOutputStream(new BufferedOutputStream(new ParallelGZIPOutputStream(stream)))) {
new FastSchematicWriter(output).write(clipboard);
}
} else {
- try (OutputStream stream = new FileOutputStream(tmp); BufferedOutputStream output = new BufferedOutputStream(new PGZIPOutputStream(stream))) {
+ try (OutputStream stream = new FileOutputStream(tmp); BufferedOutputStream output = new BufferedOutputStream(new ParallelGZIPOutputStream(stream))) {
LZ4BlockInputStream is = cTag.adapt(cTag.getSource());
IOUtil.copy(is, stream);
}
}
} else {
- try (OutputStream stream = new FileOutputStream(tmp); NBTOutputStream output = new NBTOutputStream(new PGZIPOutputStream(stream))) {
+ try (OutputStream stream = new FileOutputStream(tmp); NBTOutputStream output = new NBTOutputStream(new ParallelGZIPOutputStream(stream))) {
Map map = tag.getValue();
output.writeNamedTag("Schematic", map.getOrDefault("Schematic", tag));
}
@@ -126,7 +126,7 @@ public class FaweSchematicHandler extends SchematicHandler {
@Override
public void run(OutputStream output) {
try {
- try (PGZIPOutputStream gzip = new PGZIPOutputStream(output)) {
+ try (ParallelGZIPOutputStream gzip = new ParallelGZIPOutputStream(output)) {
try (NBTOutputStream nos = new NBTOutputStream(gzip)) {
Map map = weTag.getValue();
nos.writeNamedTag("Schematic", map.getOrDefault("Schematic", weTag));
diff --git a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquaredv4/PlotRegionFilter.java b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquaredv4/PlotRegionFilter.java
index 403f28fc4..5043e1b1f 100644
--- a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquaredv4/PlotRegionFilter.java
+++ b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquaredv4/PlotRegionFilter.java
@@ -1,6 +1,6 @@
package com.fastasyncworldedit.bukkit.regions.plotsquaredv4;
-import com.fastasyncworldedit.core.regions.general.CuboidRegionFilter;
+import com.fastasyncworldedit.core.regions.filter.CuboidRegionFilter;
import com.github.intellectualsites.plotsquared.plot.object.Location;
import com.github.intellectualsites.plotsquared.plot.object.Plot;
import com.github.intellectualsites.plotsquared.plot.object.PlotArea;
diff --git a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquaredv4/PlotSquaredFeature.java b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquaredv4/PlotSquaredFeature.java
index 9b31c0c3b..9c25b5076 100644
--- a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquaredv4/PlotSquaredFeature.java
+++ b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquaredv4/PlotSquaredFeature.java
@@ -1,10 +1,10 @@
package com.fastasyncworldedit.bukkit.regions.plotsquaredv4;
import com.fastasyncworldedit.core.FaweAPI;
-import com.fastasyncworldedit.core.object.RegionWrapper;
+import com.fastasyncworldedit.core.regions.RegionWrapper;
import com.fastasyncworldedit.core.regions.FaweMask;
import com.fastasyncworldedit.core.regions.FaweMaskManager;
-import com.fastasyncworldedit.core.regions.general.RegionFilter;
+import com.fastasyncworldedit.core.regions.filter.RegionFilter;
import com.github.intellectualsites.plotsquared.plot.PlotSquared;
import com.github.intellectualsites.plotsquared.plot.commands.MainCommand;
import com.github.intellectualsites.plotsquared.plot.config.Settings;
diff --git a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/util/WorldUnloadedException.java b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/util/WorldUnloadedException.java
index 5c36e6716..606da898d 100644
--- a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/util/WorldUnloadedException.java
+++ b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/util/WorldUnloadedException.java
@@ -1,22 +1,3 @@
-/*
- * WorldEdit, a Minecraft world manipulation toolkit
- * Copyright (C) sk89q
- * Copyright (C) WorldEdit team and contributors
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
package com.fastasyncworldedit.bukkit.util;
import com.fastasyncworldedit.core.configuration.Caption;
diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitAdapter.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitAdapter.java
index fd3a8c816..2c6f3e063 100644
--- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitAdapter.java
+++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitAdapter.java
@@ -62,7 +62,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
/**
* Adapts between Bukkit and WorldEdit equivalent objects.
*/
-// FAWE start - enum-ized
+//FAWE start - enum-ized
public enum BukkitAdapter {
INSTANCE;
@@ -77,7 +77,7 @@ public enum BukkitAdapter {
return INSTANCE.adapter;
}
- // FAWE end
+ //FAWE end
private static final ParserContext TO_BLOCK_CONTEXT = new ParserContext();
@@ -93,9 +93,9 @@ public enum BukkitAdapter {
* @return If they are equal
*/
public static boolean equals(BlockType blockType, Material type) {
- // FAWE start - swapped reference to getAdapter
+ //FAWE start - swapped reference to getAdapter
return getAdapter().equals(blockType, type);
- // FAWE end
+ //FAWE end
}
/**
@@ -108,9 +108,9 @@ public enum BukkitAdapter {
* @return a wrapped Bukkit world
*/
public static BukkitWorld asBukkitWorld(World world) {
- // FAWE start - logic moved to IBukkitAdapter
+ //FAWE start - logic moved to IBukkitAdapter
return getAdapter().asBukkitWorld(world);
- // FAWE end
+ //FAWE end
}
/**
@@ -120,9 +120,9 @@ public enum BukkitAdapter {
* @return a WorldEdit world
*/
public static World adapt(org.bukkit.World world) {
- // FAWE start - logic moved to IBukkitAdapter
+ //FAWE start - logic moved to IBukkitAdapter
return getAdapter().adapt(world);
- // FAWE end
+ //FAWE end
}
/**
diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBlockRegistry.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBlockRegistry.java
index b2350aa1c..f8c73ca8a 100644
--- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBlockRegistry.java
+++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBlockRegistry.java
@@ -146,7 +146,7 @@ public class BukkitBlockRegistry extends BundledBlockRegistry {
}
}
- // FAWE start
+ //FAWE start
@Override
public Collection values() {
ArrayList blocks = new ArrayList<>();
diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java
index 6b483b3ff..bb0b3aaa7 100644
--- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java
+++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java
@@ -21,7 +21,7 @@ package com.sk89q.worldedit.bukkit;
import com.fastasyncworldedit.core.configuration.Caption;
import com.fastasyncworldedit.core.configuration.Settings;
-import com.fastasyncworldedit.core.object.RunnableVal;
+import com.fastasyncworldedit.core.util.task.RunnableVal;
import com.fastasyncworldedit.core.util.TaskManager;
import com.sk89q.util.StringUtil;
import com.sk89q.wepif.VaultResolver;
diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java
index 1b054ceff..ecac5bc43 100644
--- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java
+++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java
@@ -25,7 +25,7 @@ import com.sk89q.worldedit.extent.inventory.BlockBag;
import com.sk89q.worldedit.extent.inventory.BlockBagException;
import com.sk89q.worldedit.extent.inventory.OutOfBlocksException;
import com.sk89q.worldedit.extent.inventory.OutOfSpaceException;
-import com.sk89q.worldedit.extent.inventory.SlottableBlockBag;
+import com.fastasyncworldedit.core.extent.inventory.SlottableBlockBag;
import com.sk89q.worldedit.util.Location;
import com.sk89q.worldedit.world.block.BlockState;
import org.bukkit.entity.Player;
diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitServerInterface.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitServerInterface.java
index 9426b29bc..b16b75330 100644
--- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitServerInterface.java
+++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitServerInterface.java
@@ -19,7 +19,7 @@
package com.sk89q.worldedit.bukkit;
-import com.fastasyncworldedit.core.beta.implementation.lighting.RelighterFactory;
+import com.fastasyncworldedit.core.extent.processor.lighting.RelighterFactory;
import com.google.common.collect.Sets;
import com.sk89q.bukkit.util.CommandInfo;
import com.sk89q.bukkit.util.CommandRegistration;
@@ -218,12 +218,12 @@ public class BukkitServerInterface extends AbstractPlatform implements MultiUser
return plugin.getDescription().getVersion();
}
- // FAWE start
+ //FAWE start
@Override
public String getId() {
return "intellectualsites:bukkit";
}
- // FAWE end
+ //FAWE end
@Override
public Map getCapabilities() {
diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java
index 8dfb39b2a..5ee117033 100644
--- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java
+++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java
@@ -21,8 +21,8 @@ package com.sk89q.worldedit.bukkit;
import com.fastasyncworldedit.bukkit.util.WorldUnloadedException;
import com.fastasyncworldedit.core.Fawe;
-import com.fastasyncworldedit.core.beta.IChunkGet;
-import com.fastasyncworldedit.core.beta.implementation.packet.ChunkPacket;
+import com.fastasyncworldedit.core.queue.IChunkGet;
+import com.fastasyncworldedit.core.queue.implementation.packet.ChunkPacket;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;
import com.sk89q.jnbt.CompoundTag;
@@ -311,11 +311,11 @@ public class BukkitWorld extends AbstractWorld {
for (TreeGenerator.TreeType type : TreeGenerator.TreeType.values()) {
if (treeTypeMapping.get(type) == null) {
LOGGER.error("No TreeType mapping for TreeGenerator.TreeType." + type);
- // FAWE start
+ //FAWE start
LOGGER.warn("Your FAWE version is newer than " + Bukkit.getVersion() +
" and contains features of future minecraft versions which do not exist in "
+ Bukkit.getVersion() + ", hence the tree type " + type + " is not available.");
- // FAWE end
+ //FAWE end
}
}
}
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 ca3233385..4de9ee2c6 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
@@ -112,7 +112,7 @@ public class WorldEditPlugin extends JavaPlugin {
@Override
public void onLoad() {
- // FAWE start
+ //FAWE start
// This is already covered by Spigot, however, a more pesky warning with a proper explanation over "Ambiguous plugin name..." can't hurt.
Plugin[] plugins = Bukkit.getServer().getPluginManager().getPlugins();
for (Plugin p : plugins) {
@@ -122,7 +122,7 @@ public class WorldEditPlugin extends JavaPlugin {
"Stop your server and delete the 'worldedit-bukkit' jar from your plugins folder.");
}
}
- // FAWE end
+ //FAWE end
INSTANCE = this;
diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java
index c84613c80..5994fc68f 100644
--- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java
+++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java
@@ -23,9 +23,9 @@ import com.fastasyncworldedit.bukkit.FaweBukkit;
import com.fastasyncworldedit.bukkit.adapter.IBukkitAdapter;
import com.fastasyncworldedit.bukkit.adapter.NMSRelighterFactory;
import com.fastasyncworldedit.core.Fawe;
-import com.fastasyncworldedit.core.beta.IChunkGet;
-import com.fastasyncworldedit.core.beta.implementation.lighting.RelighterFactory;
-import com.fastasyncworldedit.core.beta.implementation.packet.ChunkPacket;
+import com.fastasyncworldedit.core.queue.IChunkGet;
+import com.fastasyncworldedit.core.extent.processor.lighting.RelighterFactory;
+import com.fastasyncworldedit.core.queue.implementation.packet.ChunkPacket;
import com.sk89q.jnbt.AdventureNBTConverter;
import com.sk89q.jnbt.Tag;
import com.sk89q.worldedit.blocks.BaseItem;
@@ -67,9 +67,9 @@ import javax.annotation.Nullable;
/**
* An interface for adapters of various Bukkit implementations.
*/
-// FAWE start - Generic & extends IBukkitAdapter
+//FAWE start - Generic & extends IBukkitAdapter
public interface BukkitImplAdapter extends IBukkitAdapter {
-// FAWE end
+//FAWE end
/**
* Get a data fixer, or null if not supported.
@@ -225,10 +225,10 @@ public interface BukkitImplAdapter extends IBukkitAdapter {
Set getSupportedSideEffects();
default OptionalInt getInternalBlockStateId(BlockData data) {
- // FAWE start
+ //FAWE start
// return OptionalInt.empty();
return getInternalBlockStateId(BukkitAdapter.adapt(data));
- // FAWE end
+ //FAWE end
}
/**
@@ -253,7 +253,7 @@ public interface BukkitImplAdapter extends IBukkitAdapter {
throw new UnsupportedOperationException("This adapter does not support regeneration.");
}
- // FAWE start
+ //FAWE start
default BlockMaterial getMaterial(BlockType blockType) {
return getMaterial(blockType.getDefaultState());
}
@@ -306,5 +306,5 @@ public interface BukkitImplAdapter extends IBukkitAdapter {
default RelighterFactory getRelighterFactory() {
return new NMSRelighterFactory(); // TODO implement in adapters instead
}
- // FAWE end
+ //FAWE end
}
diff --git a/worldedit-bukkit/src/main/resources/worldedit-adapters.jar b/worldedit-bukkit/src/main/resources/worldedit-adapters.jar
index 4869bbdd6..c06d25efa 100644
Binary files a/worldedit-bukkit/src/main/resources/worldedit-adapters.jar and b/worldedit-bukkit/src/main/resources/worldedit-adapters.jar differ
diff --git a/worldedit-cli/src/main/java/com/sk89q/worldedit/cli/CLIPlatform.java b/worldedit-cli/src/main/java/com/sk89q/worldedit/cli/CLIPlatform.java
index d343530ef..ca0f9efed 100644
--- a/worldedit-cli/src/main/java/com/sk89q/worldedit/cli/CLIPlatform.java
+++ b/worldedit-cli/src/main/java/com/sk89q/worldedit/cli/CLIPlatform.java
@@ -19,8 +19,8 @@
package com.sk89q.worldedit.cli;
-import com.fastasyncworldedit.core.beta.implementation.lighting.NullRelighter;
-import com.fastasyncworldedit.core.beta.implementation.lighting.RelighterFactory;
+import com.fastasyncworldedit.core.extent.processor.lighting.NullRelighter;
+import com.fastasyncworldedit.core.extent.processor.lighting.RelighterFactory;
import com.google.common.collect.ImmutableSet;
import com.sk89q.worldedit.entity.Player;
import com.sk89q.worldedit.extension.platform.AbstractPlatform;
diff --git a/worldedit-cli/src/main/java/com/sk89q/worldedit/cli/schematic/ClipboardWorld.java b/worldedit-cli/src/main/java/com/sk89q/worldedit/cli/schematic/ClipboardWorld.java
index f751e377b..4b602102e 100644
--- a/worldedit-cli/src/main/java/com/sk89q/worldedit/cli/schematic/ClipboardWorld.java
+++ b/worldedit-cli/src/main/java/com/sk89q/worldedit/cli/schematic/ClipboardWorld.java
@@ -19,8 +19,8 @@
package com.sk89q.worldedit.cli.schematic;
-import com.fastasyncworldedit.core.beta.IChunkGet;
-import com.fastasyncworldedit.core.beta.implementation.packet.ChunkPacket;
+import com.fastasyncworldedit.core.queue.IChunkGet;
+import com.fastasyncworldedit.core.queue.implementation.packet.ChunkPacket;
import com.google.common.collect.ImmutableSet;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.worldedit.EditSession;
diff --git a/worldedit-core/build.gradle.kts b/worldedit-core/build.gradle.kts
index b746b5724..23bff3acb 100644
--- a/worldedit-core/build.gradle.kts
+++ b/worldedit-core/build.gradle.kts
@@ -51,6 +51,8 @@ dependencies {
api("com.intellectualsites.paster:Paster:1.0.1-SNAPSHOT")
compileOnly("net.jpountz:lz4-java-stream:1.0.0") { isTransitive = false }
compileOnly("org.lz4:lz4-java:1.8.0")
+ compileOnly("com.zaxxer:SparseBitSet:1.2")
+ compileOnly("org.anarres:parallelgzip:1.0.5")
}
tasks.named("test") {
diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/MobSpawnerBlock.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/MobSpawnerBlock.java
index 82db080fe..d4084ccfd 100644
--- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/MobSpawnerBlock.java
+++ b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/MobSpawnerBlock.java
@@ -40,7 +40,7 @@ import java.util.Map;
* @deprecated WorldEdit does not handle interpreting NBT,
* deprecated for removal without replacement
*/
-@Deprecated
+@Deprecated(forRemoval = true)
public class MobSpawnerBlock extends BaseBlock {
private String mobType;
diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/SignBlock.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/SignBlock.java
index 184a673a6..3b54302fc 100644
--- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/SignBlock.java
+++ b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/SignBlock.java
@@ -35,7 +35,7 @@ import java.util.Map;
* @deprecated WorldEdit does not handle interpreting NBT,
* deprecated for removal without replacement
*/
-@Deprecated
+@Deprecated(forRemoval = true)
public class SignBlock extends BaseBlock {
private String[] text;
diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/SkullBlock.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/SkullBlock.java
index 88d0fe593..e5ea3da6f 100644
--- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/SkullBlock.java
+++ b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/SkullBlock.java
@@ -35,7 +35,7 @@ import java.util.Map;
* @deprecated WorldEdit does not handle interpreting NBT,
* deprecated for removal without replacement
*/
-@Deprecated
+@Deprecated(forRemoval = true)
public class SkullBlock extends BaseBlock {
private String owner = ""; // notchian
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/FAWEPlatformAdapterImpl.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/FAWEPlatformAdapterImpl.java
index b1f09f1c4..9f9e175e7 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/FAWEPlatformAdapterImpl.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/FAWEPlatformAdapterImpl.java
@@ -1,6 +1,6 @@
package com.fastasyncworldedit.core;
-import com.fastasyncworldedit.core.beta.IChunkGet;
+import com.fastasyncworldedit.core.queue.IChunkGet;
public interface FAWEPlatformAdapterImpl {
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/Fawe.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/Fawe.java
index 04a30772b..eff0ac4a4 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/Fawe.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/Fawe.java
@@ -1,6 +1,6 @@
package com.fastasyncworldedit.core;
-import com.fastasyncworldedit.core.beta.implementation.queue.QueueHandler;
+import com.fastasyncworldedit.core.queue.implementation.QueueHandler;
import com.fastasyncworldedit.core.configuration.Settings;
import com.fastasyncworldedit.core.util.CachedTextureUtil;
import com.fastasyncworldedit.core.util.CleanTextureUtil;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/FaweAPI.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/FaweAPI.java
index cc9bdc76b..463f024f1 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/FaweAPI.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/FaweAPI.java
@@ -1,15 +1,15 @@
package com.fastasyncworldedit.core;
-import com.fastasyncworldedit.core.beta.IQueueChunk;
-import com.fastasyncworldedit.core.beta.IQueueExtent;
-import com.fastasyncworldedit.core.beta.implementation.lighting.Relighter;
-import com.fastasyncworldedit.core.beta.implementation.queue.ParallelQueueExtent;
+import com.fastasyncworldedit.core.queue.IQueueChunk;
+import com.fastasyncworldedit.core.queue.IQueueExtent;
+import com.fastasyncworldedit.core.extent.processor.lighting.Relighter;
+import com.fastasyncworldedit.core.queue.implementation.ParallelQueueExtent;
import com.fastasyncworldedit.core.configuration.Settings;
-import com.fastasyncworldedit.core.object.RegionWrapper;
-import com.fastasyncworldedit.core.object.RelightMode;
-import com.fastasyncworldedit.core.object.changeset.DiskStorageHistory;
-import com.fastasyncworldedit.core.object.changeset.SimpleChangeSetSummary;
-import com.fastasyncworldedit.core.object.exception.FaweException;
+import com.fastasyncworldedit.core.regions.RegionWrapper;
+import com.fastasyncworldedit.core.extent.processor.lighting.RelightMode;
+import com.fastasyncworldedit.core.history.DiskStorageHistory;
+import com.fastasyncworldedit.core.history.changeset.SimpleChangeSetSummary;
+import com.fastasyncworldedit.core.internal.exception.FaweException;
import com.fastasyncworldedit.core.regions.FaweMaskManager;
import com.fastasyncworldedit.core.util.EditSessionBuilder;
import com.fastasyncworldedit.core.util.MainUtil;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/FaweCache.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/FaweCache.java
index 507519dff..67089b862 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/FaweCache.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/FaweCache.java
@@ -1,17 +1,17 @@
package com.fastasyncworldedit.core;
-import com.fastasyncworldedit.core.beta.IChunkSet;
-import com.fastasyncworldedit.core.beta.Trimable;
-import com.fastasyncworldedit.core.beta.implementation.queue.Pool;
-import com.fastasyncworldedit.core.beta.implementation.queue.QueuePool;
+import com.fastasyncworldedit.core.queue.IChunkSet;
+import com.fastasyncworldedit.core.queue.Trimable;
+import com.fastasyncworldedit.core.queue.Pool;
+import com.fastasyncworldedit.core.queue.implementation.QueuePool;
import com.fastasyncworldedit.core.configuration.Caption;
import com.fastasyncworldedit.core.configuration.Settings;
-import com.fastasyncworldedit.core.object.collection.BitArray;
-import com.fastasyncworldedit.core.object.collection.BitArrayUnstretched;
-import com.fastasyncworldedit.core.object.collection.CleanableThreadLocal;
-import com.fastasyncworldedit.core.object.exception.FaweBlockBagException;
-import com.fastasyncworldedit.core.object.exception.FaweChunkLoadException;
-import com.fastasyncworldedit.core.object.exception.FaweException;
+import com.fastasyncworldedit.core.math.BitArray;
+import com.fastasyncworldedit.core.math.BitArrayUnstretched;
+import com.fastasyncworldedit.core.util.collection.CleanableThreadLocal;
+import com.fastasyncworldedit.core.internal.exception.FaweBlockBagException;
+import com.fastasyncworldedit.core.internal.exception.FaweChunkLoadException;
+import com.fastasyncworldedit.core.internal.exception.FaweException;
import com.fastasyncworldedit.core.util.MathMan;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
@@ -31,8 +31,8 @@ import com.sk89q.jnbt.ShortTag;
import com.sk89q.jnbt.StringTag;
import com.sk89q.jnbt.Tag;
import com.sk89q.worldedit.internal.util.LogManagerCompat;
-import com.sk89q.worldedit.math.MutableBlockVector3;
-import com.sk89q.worldedit.math.MutableVector3;
+import com.fastasyncworldedit.core.math.MutableBlockVector3;
+import com.fastasyncworldedit.core.math.MutableVector3;
import com.sk89q.worldedit.world.block.BlockTypesCache;
import org.apache.logging.log4j.Logger;
import org.jetbrains.annotations.NotNull;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/IFawe.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/IFawe.java
index b1f8d084c..345009367 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/IFawe.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/IFawe.java
@@ -1,7 +1,7 @@
package com.fastasyncworldedit.core;
-import com.fastasyncworldedit.core.beta.implementation.preloader.Preloader;
-import com.fastasyncworldedit.core.beta.implementation.queue.QueueHandler;
+import com.fastasyncworldedit.core.queue.implementation.preloader.Preloader;
+import com.fastasyncworldedit.core.queue.implementation.QueueHandler;
import com.fastasyncworldedit.core.regions.FaweMaskManager;
import com.fastasyncworldedit.core.util.TaskManager;
import com.fastasyncworldedit.core.util.image.ImageViewer;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/FilterBlockMask.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/FilterBlockMask.java
deleted file mode 100644
index ba5d84478..000000000
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/FilterBlockMask.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package com.fastasyncworldedit.core.beta;
-
-import com.fastasyncworldedit.core.beta.implementation.filter.block.FilterBlock;
-
-public interface FilterBlockMask {
-
- boolean applyBlock(FilterBlock block);
-}
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ListFilters.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/ListFilters.java
similarity index 98%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/command/ListFilters.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/command/ListFilters.java
index 27c292987..61fd874c5 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ListFilters.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/ListFilters.java
@@ -1,4 +1,4 @@
-package com.sk89q.worldedit.command;
+package com.fastasyncworldedit.core.command;
import com.fastasyncworldedit.core.Fawe;
import com.fastasyncworldedit.core.util.StringMan;
@@ -13,7 +13,6 @@ import java.util.UUID;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
-//TODO This class breaks compilation
//@CommandContainer
public class ListFilters {
public class Filter {
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/MaskCommands.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/MaskCommands.java
similarity index 99%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/command/MaskCommands.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/command/MaskCommands.java
index f4424f1dd..019e309ff 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/MaskCommands.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/MaskCommands.java
@@ -1,5 +1,5 @@
// TODO: Ping @MattBDev to reimplement (or remove because this class is stupid) 2020-02-04
-//package com.sk89q.worldedit.command;
+//package com.fastasyncworldedit.core.command;
//
//import com.boydti.fawe.object.mask.AdjacentAnyMask;
//import com.boydti.fawe.object.mask.AdjacentMask;
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/MethodCommands.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/MethodCommands.java
similarity index 91%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/command/MethodCommands.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/command/MethodCommands.java
index 8e781b075..ca0c5ee9c 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/MethodCommands.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/MethodCommands.java
@@ -1,4 +1,4 @@
-package com.sk89q.worldedit.command;
+package com.fastasyncworldedit.core.command;
import com.sk89q.worldedit.command.argument.Arguments;
import org.enginehub.piston.inject.InjectedValueAccess;
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/PatternCommands.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/PatternCommands.java
similarity index 100%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/command/PatternCommands.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/command/PatternCommands.java
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/TransformCommands.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/TransformCommands.java
similarity index 100%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/command/TransformCommands.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/command/TransformCommands.java
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/MovableTool.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/MovableTool.java
similarity index 68%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/MovableTool.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/MovableTool.java
index 2e7eed451..8e4d8904b 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/MovableTool.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/MovableTool.java
@@ -1,4 +1,4 @@
-package com.fastasyncworldedit.core.object.brush;
+package com.fastasyncworldedit.core.command.tool;
import com.sk89q.worldedit.entity.Player;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/ResettableTool.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/ResettableTool.java
similarity index 53%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/ResettableTool.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/ResettableTool.java
index b8f7655b5..f2a431f27 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/ResettableTool.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/ResettableTool.java
@@ -1,4 +1,4 @@
-package com.fastasyncworldedit.core.object.brush;
+package com.fastasyncworldedit.core.command.tool;
public interface ResettableTool {
boolean reset();
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/TargetMode.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/TargetMode.java
similarity index 71%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/TargetMode.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/TargetMode.java
index 43318187e..22287894b 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/TargetMode.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/TargetMode.java
@@ -1,4 +1,4 @@
-package com.fastasyncworldedit.core.object.brush;
+package com.fastasyncworldedit.core.command.tool;
public enum TargetMode {
TARGET_BLOCK_RANGE,
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/AngleBrush.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/AngleBrush.java
similarity index 82%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/AngleBrush.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/AngleBrush.java
index a93027316..6a033afa2 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/AngleBrush.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/AngleBrush.java
@@ -1,7 +1,7 @@
-package com.fastasyncworldedit.core.object.brush;
+package com.fastasyncworldedit.core.command.tool.brush;
-import com.fastasyncworldedit.core.object.mask.RadiusMask;
-import com.fastasyncworldedit.core.object.mask.SurfaceMask;
+import com.fastasyncworldedit.core.function.mask.RadiusMask;
+import com.fastasyncworldedit.core.function.mask.SurfaceMask;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.MaxChangedBlocksException;
import com.sk89q.worldedit.command.tool.brush.Brush;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/BlendBall.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/BlendBall.java
similarity index 98%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/BlendBall.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/BlendBall.java
index a09066a58..4e5fa9acb 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/BlendBall.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/BlendBall.java
@@ -1,4 +1,4 @@
-package com.fastasyncworldedit.core.object.brush;
+package com.fastasyncworldedit.core.command.tool.brush;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.MaxChangedBlocksException;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/BlobBrush.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/BlobBrush.java
similarity index 96%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/BlobBrush.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/BlobBrush.java
index c0b93707f..260047483 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/BlobBrush.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/BlobBrush.java
@@ -1,13 +1,13 @@
-package com.fastasyncworldedit.core.object.brush;
+package com.fastasyncworldedit.core.command.tool.brush;
-import com.fastasyncworldedit.core.object.random.SimplexNoise;
+import com.fastasyncworldedit.core.math.random.SimplexNoise;
import com.fastasyncworldedit.core.util.MathMan;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.MaxChangedBlocksException;
import com.sk89q.worldedit.command.tool.brush.Brush;
import com.sk89q.worldedit.function.pattern.Pattern;
import com.sk89q.worldedit.math.BlockVector3;
-import com.sk89q.worldedit.math.MutableVector3;
+import com.fastasyncworldedit.core.math.MutableVector3;
import com.sk89q.worldedit.math.Vector3;
import com.sk89q.worldedit.math.transform.AffineTransform;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/BrushSettings.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/BrushSettings.java
similarity index 97%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/BrushSettings.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/BrushSettings.java
index e30642f87..d77d1f3e8 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/BrushSettings.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/BrushSettings.java
@@ -1,7 +1,7 @@
-package com.fastasyncworldedit.core.object.brush;
+package com.fastasyncworldedit.core.command.tool.brush;
-import com.fastasyncworldedit.core.object.brush.scroll.Scroll;
-import com.fastasyncworldedit.core.object.extent.ResettableExtent;
+import com.fastasyncworldedit.core.command.tool.scroll.Scroll;
+import com.fastasyncworldedit.core.extent.ResettableExtent;
import com.sk89q.worldedit.command.tool.brush.Brush;
import com.sk89q.worldedit.extension.platform.Actor;
import com.sk89q.worldedit.function.mask.Mask;
@@ -15,7 +15,7 @@ import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
-import static com.fastasyncworldedit.core.object.brush.BrushSettings.SettingType.BRUSH;
+import static com.fastasyncworldedit.core.command.tool.brush.BrushSettings.SettingType.BRUSH;
import static com.google.common.base.Preconditions.checkNotNull;
public class BrushSettings {
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/CatenaryBrush.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/CatenaryBrush.java
similarity index 96%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/CatenaryBrush.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/CatenaryBrush.java
index 343cd4bad..11b81be66 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/CatenaryBrush.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/CatenaryBrush.java
@@ -1,5 +1,6 @@
-package com.fastasyncworldedit.core.object.brush;
+package com.fastasyncworldedit.core.command.tool.brush;
+import com.fastasyncworldedit.core.command.tool.ResettableTool;
import com.fastasyncworldedit.core.configuration.Caption;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.MaxChangedBlocksException;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/CircleBrush.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/CircleBrush.java
similarity index 96%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/CircleBrush.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/CircleBrush.java
index 718a12785..7a547b059 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/CircleBrush.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/CircleBrush.java
@@ -1,4 +1,4 @@
-package com.fastasyncworldedit.core.object.brush;
+package com.fastasyncworldedit.core.command.tool.brush;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.MaxChangedBlocksException;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/CommandBrush.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/CommandBrush.java
similarity index 97%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/CommandBrush.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/CommandBrush.java
index d2002b941..ffad2cdee 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/CommandBrush.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/CommandBrush.java
@@ -1,4 +1,4 @@
-package com.fastasyncworldedit.core.object.brush;
+package com.fastasyncworldedit.core.command.tool.brush;
import com.fastasyncworldedit.core.util.StringMan;
import com.fastasyncworldedit.core.wrappers.AsyncPlayer;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/CopyPastaBrush.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/CopyPastaBrush.java
similarity index 93%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/CopyPastaBrush.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/CopyPastaBrush.java
index 7ed301f49..4a9e93957 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/CopyPastaBrush.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/CopyPastaBrush.java
@@ -1,9 +1,10 @@
-package com.fastasyncworldedit.core.object.brush;
+package com.fastasyncworldedit.core.command.tool.brush;
+import com.fastasyncworldedit.core.command.tool.ResettableTool;
import com.fastasyncworldedit.core.configuration.Caption;
-import com.fastasyncworldedit.core.object.clipboard.ResizableClipboardBuilder;
-import com.fastasyncworldedit.core.object.function.NullRegionFunction;
-import com.fastasyncworldedit.core.object.function.mask.AbstractDelegateMask;
+import com.fastasyncworldedit.core.extent.clipboard.ResizableClipboardBuilder;
+import com.fastasyncworldedit.core.function.NullRegionFunction;
+import com.fastasyncworldedit.core.function.mask.AbstractDelegateMask;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.LocalSession;
import com.sk89q.worldedit.MaxChangedBlocksException;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/ErodeBrush.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/ErodeBrush.java
similarity index 98%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/ErodeBrush.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/ErodeBrush.java
index 31929f721..03cd09d6d 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/ErodeBrush.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/ErodeBrush.java
@@ -1,6 +1,6 @@
-package com.fastasyncworldedit.core.object.brush;
+package com.fastasyncworldedit.core.command.tool.brush;
-import com.fastasyncworldedit.core.object.clipboard.CPUOptimizedClipboard;
+import com.fastasyncworldedit.core.extent.clipboard.CPUOptimizedClipboard;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.MaxChangedBlocksException;
import com.sk89q.worldedit.command.tool.brush.Brush;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/FallingSphere.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/FallingSphere.java
similarity index 97%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/FallingSphere.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/FallingSphere.java
index 6bea6a95f..e4796cd3c 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/FallingSphere.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/FallingSphere.java
@@ -1,4 +1,4 @@
-package com.fastasyncworldedit.core.object.brush;
+package com.fastasyncworldedit.core.command.tool.brush;
import com.fastasyncworldedit.core.util.MathMan;
import com.sk89q.worldedit.EditSession;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/FlattenBrush.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/FlattenBrush.java
similarity index 84%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/FlattenBrush.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/FlattenBrush.java
index 3740137dc..4eacf1e2e 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/FlattenBrush.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/FlattenBrush.java
@@ -1,7 +1,7 @@
-package com.fastasyncworldedit.core.object.brush;
+package com.fastasyncworldedit.core.command.tool.brush;
-import com.fastasyncworldedit.core.object.brush.heightmap.HeightMap;
-import com.fastasyncworldedit.core.object.brush.heightmap.ScalableHeightMap;
+import com.fastasyncworldedit.core.extent.processor.heightmap.HeightMap;
+import com.fastasyncworldedit.core.extent.processor.heightmap.ScalableHeightMap;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.MaxChangedBlocksException;
import com.sk89q.worldedit.extent.clipboard.Clipboard;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/HeightBrush.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/HeightBrush.java
similarity index 88%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/HeightBrush.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/HeightBrush.java
index 8400e0f7d..b5a2c8c5a 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/HeightBrush.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/HeightBrush.java
@@ -1,10 +1,10 @@
-package com.fastasyncworldedit.core.object.brush;
+package com.fastasyncworldedit.core.command.tool.brush;
import com.fastasyncworldedit.core.configuration.Caption;
-import com.fastasyncworldedit.core.object.brush.heightmap.HeightMap;
-import com.fastasyncworldedit.core.object.brush.heightmap.RotatableHeightMap;
-import com.fastasyncworldedit.core.object.brush.heightmap.ScalableHeightMap;
-import com.fastasyncworldedit.core.object.exception.FaweException;
+import com.fastasyncworldedit.core.extent.processor.heightmap.HeightMap;
+import com.fastasyncworldedit.core.extent.processor.heightmap.RotatableHeightMap;
+import com.fastasyncworldedit.core.extent.processor.heightmap.ScalableHeightMap;
+import com.fastasyncworldedit.core.internal.exception.FaweException;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.MaxChangedBlocksException;
import com.sk89q.worldedit.command.tool.brush.Brush;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/ImageBrush.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/ImageBrush.java
similarity index 93%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/ImageBrush.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/ImageBrush.java
index 5216f04a7..37003ba68 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/ImageBrush.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/ImageBrush.java
@@ -1,8 +1,8 @@
-package com.fastasyncworldedit.core.object.brush;
+package com.fastasyncworldedit.core.command.tool.brush;
-import com.fastasyncworldedit.core.object.brush.mask.ImageBrushMask;
-import com.fastasyncworldedit.core.object.collection.SummedColorTable;
-import com.fastasyncworldedit.core.object.mask.SurfaceMask;
+import com.fastasyncworldedit.core.function.mask.ImageBrushMask;
+import com.fastasyncworldedit.core.util.collection.SummedColorTable;
+import com.fastasyncworldedit.core.function.mask.SurfaceMask;
import com.fastasyncworldedit.core.util.TextureUtil;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.LocalSession;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/InspectBrush.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/InspectBrush.java
similarity index 96%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/InspectBrush.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/InspectBrush.java
index ac6b74bcb..6d2cc4d4b 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/InspectBrush.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/InspectBrush.java
@@ -1,12 +1,12 @@
-package com.fastasyncworldedit.core.object.brush;
+package com.fastasyncworldedit.core.command.tool.brush;
import com.fastasyncworldedit.core.Fawe;
import com.fastasyncworldedit.core.configuration.Caption;
import com.fastasyncworldedit.core.configuration.Settings;
import com.fastasyncworldedit.core.database.DBHandler;
import com.fastasyncworldedit.core.database.RollbackDatabase;
-import com.fastasyncworldedit.core.logging.RollbackOptimizedHistory;
-import com.fastasyncworldedit.core.object.change.MutableFullBlockChange;
+import com.fastasyncworldedit.core.history.RollbackOptimizedHistory;
+import com.fastasyncworldedit.core.history.change.MutableFullBlockChange;
import com.fastasyncworldedit.core.util.MainUtil;
import com.sk89q.worldedit.LocalConfiguration;
import com.sk89q.worldedit.LocalSession;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/LayerBrush.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/LayerBrush.java
similarity index 87%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/LayerBrush.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/LayerBrush.java
index f71d93941..64d82f5b7 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/LayerBrush.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/LayerBrush.java
@@ -1,9 +1,9 @@
-package com.fastasyncworldedit.core.object.brush;
+package com.fastasyncworldedit.core.command.tool.brush;
-import com.fastasyncworldedit.core.object.brush.mask.LayerBrushMask;
-import com.fastasyncworldedit.core.object.collection.BlockVectorSet;
-import com.fastasyncworldedit.core.object.mask.AdjacentAnyMask;
-import com.fastasyncworldedit.core.object.mask.RadiusMask;
+import com.fastasyncworldedit.core.function.mask.LayerBrushMask;
+import com.fastasyncworldedit.core.math.BlockVectorSet;
+import com.fastasyncworldedit.core.function.mask.AdjacentAnyMask;
+import com.fastasyncworldedit.core.function.mask.RadiusMask;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.MaxChangedBlocksException;
import com.sk89q.worldedit.command.tool.brush.Brush;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/LineBrush.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/LineBrush.java
similarity index 91%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/LineBrush.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/LineBrush.java
index 6e2658b76..fc6606044 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/LineBrush.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/LineBrush.java
@@ -1,5 +1,6 @@
-package com.fastasyncworldedit.core.object.brush;
+package com.fastasyncworldedit.core.command.tool.brush;
+import com.fastasyncworldedit.core.command.tool.ResettableTool;
import com.fastasyncworldedit.core.configuration.Caption;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.MaxChangedBlocksException;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/PopulateSchem.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/PopulateSchem.java
similarity index 96%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/PopulateSchem.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/PopulateSchem.java
index 766dbb91d..c6254a404 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/PopulateSchem.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/PopulateSchem.java
@@ -1,4 +1,4 @@
-package com.fastasyncworldedit.core.object.brush;
+package com.fastasyncworldedit.core.command.tool.brush;
import com.fastasyncworldedit.core.util.MaskTraverser;
import com.fastasyncworldedit.core.util.MathMan;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/RaiseBrush.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/RaiseBrush.java
similarity index 81%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/RaiseBrush.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/RaiseBrush.java
index 0852e76ab..f4f5ac6e3 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/RaiseBrush.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/RaiseBrush.java
@@ -1,4 +1,4 @@
-package com.fastasyncworldedit.core.object.brush;
+package com.fastasyncworldedit.core.command.tool.brush;
public class RaiseBrush extends ErodeBrush {
public RaiseBrush() {
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/RecurseBrush.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/RecurseBrush.java
similarity index 92%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/RecurseBrush.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/RecurseBrush.java
index f046321a7..0019833ac 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/RecurseBrush.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/RecurseBrush.java
@@ -1,7 +1,7 @@
-package com.fastasyncworldedit.core.object.brush;
+package com.fastasyncworldedit.core.command.tool.brush;
-import com.fastasyncworldedit.core.object.mask.RadiusMask;
-import com.fastasyncworldedit.core.object.visitor.DFSRecursiveVisitor;
+import com.fastasyncworldedit.core.function.mask.RadiusMask;
+import com.fastasyncworldedit.core.function.visitor.DFSRecursiveVisitor;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.MaxChangedBlocksException;
import com.sk89q.worldedit.command.tool.brush.Brush;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/RockBrush.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/RockBrush.java
similarity index 94%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/RockBrush.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/RockBrush.java
index 6c8ac2ac7..52704d1bb 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/RockBrush.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/RockBrush.java
@@ -1,6 +1,6 @@
-package com.fastasyncworldedit.core.object.brush;
+package com.fastasyncworldedit.core.command.tool.brush;
-import com.fastasyncworldedit.core.object.random.SimplexNoise;
+import com.fastasyncworldedit.core.math.random.SimplexNoise;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.MaxChangedBlocksException;
import com.sk89q.worldedit.command.tool.brush.Brush;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/ScatterBrush.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/ScatterBrush.java
similarity index 89%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/ScatterBrush.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/ScatterBrush.java
index 54e8ca37f..78183387d 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/ScatterBrush.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/ScatterBrush.java
@@ -1,10 +1,10 @@
-package com.fastasyncworldedit.core.object.brush;
+package com.fastasyncworldedit.core.command.tool.brush;
-import com.fastasyncworldedit.core.object.collection.BlockVectorSet;
-import com.fastasyncworldedit.core.object.collection.LocalBlockVectorSet;
-import com.fastasyncworldedit.core.object.mask.AdjacentAnyMask;
-import com.fastasyncworldedit.core.object.mask.RadiusMask;
-import com.fastasyncworldedit.core.object.mask.SurfaceMask;
+import com.fastasyncworldedit.core.math.BlockVectorSet;
+import com.fastasyncworldedit.core.math.LocalBlockVectorSet;
+import com.fastasyncworldedit.core.function.mask.AdjacentAnyMask;
+import com.fastasyncworldedit.core.function.mask.RadiusMask;
+import com.fastasyncworldedit.core.function.mask.SurfaceMask;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.MaxChangedBlocksException;
import com.sk89q.worldedit.command.tool.brush.Brush;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/ScatterCommand.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/ScatterCommand.java
similarity index 93%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/ScatterCommand.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/ScatterCommand.java
index 623f8604d..de8c94e79 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/ScatterCommand.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/ScatterCommand.java
@@ -1,6 +1,6 @@
-package com.fastasyncworldedit.core.object.brush;
+package com.fastasyncworldedit.core.command.tool.brush;
-import com.fastasyncworldedit.core.object.collection.LocalBlockVectorSet;
+import com.fastasyncworldedit.core.math.LocalBlockVectorSet;
import com.fastasyncworldedit.core.util.StringMan;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.MaxChangedBlocksException;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/ScatterOverlayBrush.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/ScatterOverlayBrush.java
similarity index 85%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/ScatterOverlayBrush.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/ScatterOverlayBrush.java
index bbed13b2e..d9efc25f6 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/ScatterOverlayBrush.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/ScatterOverlayBrush.java
@@ -1,6 +1,6 @@
-package com.fastasyncworldedit.core.object.brush;
+package com.fastasyncworldedit.core.command.tool.brush;
-import com.fastasyncworldedit.core.object.collection.LocalBlockVectorSet;
+import com.fastasyncworldedit.core.math.LocalBlockVectorSet;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.MaxChangedBlocksException;
import com.sk89q.worldedit.function.pattern.Pattern;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/ShatterBrush.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/ShatterBrush.java
similarity index 94%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/ShatterBrush.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/ShatterBrush.java
index dee338dc6..7a8629933 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/ShatterBrush.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/ShatterBrush.java
@@ -1,7 +1,7 @@
-package com.fastasyncworldedit.core.object.brush;
+package com.fastasyncworldedit.core.command.tool.brush;
-import com.fastasyncworldedit.core.object.collection.LocalBlockVectorSet;
-import com.fastasyncworldedit.core.object.mask.SurfaceMask;
+import com.fastasyncworldedit.core.math.LocalBlockVectorSet;
+import com.fastasyncworldedit.core.function.mask.SurfaceMask;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.MaxChangedBlocksException;
import com.sk89q.worldedit.function.mask.Mask;
@@ -9,7 +9,7 @@ import com.sk89q.worldedit.function.mask.Masks;
import com.sk89q.worldedit.function.pattern.Pattern;
import com.sk89q.worldedit.function.visitor.BreadthFirstSearch;
import com.sk89q.worldedit.math.BlockVector3;
-import com.sk89q.worldedit.math.MutableBlockVector3;
+import com.fastasyncworldedit.core.math.MutableBlockVector3;
import java.util.concurrent.ThreadLocalRandom;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/SplatterBrush.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/SplatterBrush.java
similarity index 85%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/SplatterBrush.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/SplatterBrush.java
index b4c7337e4..d5d63fbfd 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/SplatterBrush.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/SplatterBrush.java
@@ -1,8 +1,8 @@
-package com.fastasyncworldedit.core.object.brush;
+package com.fastasyncworldedit.core.command.tool.brush;
-import com.fastasyncworldedit.core.object.brush.mask.SplatterBrushMask;
-import com.fastasyncworldedit.core.object.collection.LocalBlockVectorSet;
-import com.fastasyncworldedit.core.object.mask.SurfaceMask;
+import com.fastasyncworldedit.core.function.mask.SplatterBrushMask;
+import com.fastasyncworldedit.core.math.LocalBlockVectorSet;
+import com.fastasyncworldedit.core.function.mask.SurfaceMask;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.MaxChangedBlocksException;
import com.sk89q.worldedit.function.operation.Operations;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/SplineBrush.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/SplineBrush.java
similarity index 95%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/SplineBrush.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/SplineBrush.java
index 54292ab51..f1ff105ac 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/SplineBrush.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/SplineBrush.java
@@ -1,9 +1,10 @@
-package com.fastasyncworldedit.core.object.brush;
+package com.fastasyncworldedit.core.command.tool.brush;
import com.fastasyncworldedit.core.FaweCache;
+import com.fastasyncworldedit.core.command.tool.ResettableTool;
import com.fastasyncworldedit.core.configuration.Caption;
-import com.fastasyncworldedit.core.object.mask.IdMask;
-import com.fastasyncworldedit.core.object.visitor.DFSRecursiveVisitor;
+import com.fastasyncworldedit.core.function.mask.IdMask;
+import com.fastasyncworldedit.core.function.visitor.DFSRecursiveVisitor;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.command.tool.brush.Brush;
@@ -13,7 +14,7 @@ import com.sk89q.worldedit.function.mask.MaskIntersection;
import com.sk89q.worldedit.function.operation.Operations;
import com.sk89q.worldedit.function.pattern.Pattern;
import com.sk89q.worldedit.math.BlockVector3;
-import com.sk89q.worldedit.math.MutableVector3;
+import com.fastasyncworldedit.core.math.MutableVector3;
import com.sk89q.worldedit.math.Vector3;
import com.sk89q.worldedit.math.interpolation.Node;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/StencilBrush.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/StencilBrush.java
similarity index 91%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/StencilBrush.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/StencilBrush.java
index 62dc8e970..b2d185653 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/StencilBrush.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/StencilBrush.java
@@ -1,7 +1,7 @@
-package com.fastasyncworldedit.core.object.brush;
+package com.fastasyncworldedit.core.command.tool.brush;
-import com.fastasyncworldedit.core.object.brush.heightmap.HeightMap;
-import com.fastasyncworldedit.core.object.brush.mask.StencilBrushMask;
+import com.fastasyncworldedit.core.extent.processor.heightmap.HeightMap;
+import com.fastasyncworldedit.core.function.mask.StencilBrushMask;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.MaxChangedBlocksException;
import com.sk89q.worldedit.extent.clipboard.Clipboard;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/SurfaceSphereBrush.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/SurfaceSphereBrush.java
similarity index 87%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/SurfaceSphereBrush.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/SurfaceSphereBrush.java
index 99c7776ed..9de687268 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/SurfaceSphereBrush.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/SurfaceSphereBrush.java
@@ -1,7 +1,7 @@
-package com.fastasyncworldedit.core.object.brush;
+package com.fastasyncworldedit.core.command.tool.brush;
-import com.fastasyncworldedit.core.object.mask.RadiusMask;
-import com.fastasyncworldedit.core.object.mask.SurfaceMask;
+import com.fastasyncworldedit.core.function.mask.RadiusMask;
+import com.fastasyncworldedit.core.function.mask.SurfaceMask;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.MaxChangedBlocksException;
import com.sk89q.worldedit.command.tool.brush.Brush;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/SurfaceSpline.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/SurfaceSpline.java
similarity index 96%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/SurfaceSpline.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/SurfaceSpline.java
index c3c3d660b..9b9c0350a 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/SurfaceSpline.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/SurfaceSpline.java
@@ -1,7 +1,7 @@
-package com.fastasyncworldedit.core.object.brush;
+package com.fastasyncworldedit.core.command.tool.brush;
import com.fastasyncworldedit.core.configuration.Caption;
-import com.fastasyncworldedit.core.object.collection.LocalBlockVectorSet;
+import com.fastasyncworldedit.core.math.LocalBlockVectorSet;
import com.fastasyncworldedit.core.util.MathMan;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.MaxChangedBlocksException;
@@ -9,7 +9,7 @@ import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.command.tool.brush.Brush;
import com.sk89q.worldedit.function.pattern.Pattern;
import com.sk89q.worldedit.math.BlockVector3;
-import com.sk89q.worldedit.math.MutableBlockVector3;
+import com.fastasyncworldedit.core.math.MutableBlockVector3;
import com.sk89q.worldedit.math.Vector3;
import com.sk89q.worldedit.math.interpolation.KochanekBartelsInterpolation;
import com.sk89q.worldedit.math.interpolation.Node;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/scroll/Scroll.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/scroll/Scroll.java
similarity index 97%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/scroll/Scroll.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/scroll/Scroll.java
index baeb3e6bb..9de9615a8 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/scroll/Scroll.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/scroll/Scroll.java
@@ -1,7 +1,7 @@
-package com.fastasyncworldedit.core.object.brush.scroll;
+package com.fastasyncworldedit.core.command.tool.scroll;
import com.fastasyncworldedit.core.configuration.Caption;
-import com.fastasyncworldedit.core.object.clipboard.MultiClipboardHolder;
+import com.fastasyncworldedit.core.extent.clipboard.MultiClipboardHolder;
import com.sk89q.worldedit.LocalSession;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.command.tool.BrushTool;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/scroll/ScrollClipboard.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/scroll/ScrollClipboard.java
similarity index 94%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/scroll/ScrollClipboard.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/scroll/ScrollClipboard.java
index e5e1cd6d1..4699611e1 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/scroll/ScrollClipboard.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/scroll/ScrollClipboard.java
@@ -1,4 +1,4 @@
-package com.fastasyncworldedit.core.object.brush.scroll;
+package com.fastasyncworldedit.core.command.tool.scroll;
import com.fastasyncworldedit.core.util.MathMan;
import com.sk89q.worldedit.LocalSession;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/scroll/ScrollMask.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/scroll/ScrollMask.java
similarity index 91%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/scroll/ScrollMask.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/scroll/ScrollMask.java
index a35cc4f2c..037fb7ef7 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/scroll/ScrollMask.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/scroll/ScrollMask.java
@@ -1,4 +1,4 @@
-package com.fastasyncworldedit.core.object.brush.scroll;
+package com.fastasyncworldedit.core.command.tool.scroll;
import com.fastasyncworldedit.core.util.MathMan;
import com.sk89q.worldedit.command.tool.BrushTool;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/scroll/ScrollPattern.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/scroll/ScrollPattern.java
similarity index 92%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/scroll/ScrollPattern.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/scroll/ScrollPattern.java
index d7ba467a3..4aca2ff21 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/scroll/ScrollPattern.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/scroll/ScrollPattern.java
@@ -1,4 +1,4 @@
-package com.fastasyncworldedit.core.object.brush.scroll;
+package com.fastasyncworldedit.core.command.tool.scroll;
import com.fastasyncworldedit.core.util.MathMan;
import com.sk89q.worldedit.command.tool.BrushTool;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/scroll/ScrollRange.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/scroll/ScrollRange.java
similarity index 91%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/scroll/ScrollRange.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/scroll/ScrollRange.java
index 31d9cbb07..9afaf84c4 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/scroll/ScrollRange.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/scroll/ScrollRange.java
@@ -1,4 +1,4 @@
-package com.fastasyncworldedit.core.object.brush.scroll;
+package com.fastasyncworldedit.core.command.tool.scroll;
import com.fastasyncworldedit.core.util.MathMan;
import com.sk89q.worldedit.WorldEdit;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/scroll/ScrollSize.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/scroll/ScrollSize.java
similarity index 90%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/scroll/ScrollSize.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/scroll/ScrollSize.java
index 0c191e99c..448a72271 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/scroll/ScrollSize.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/scroll/ScrollSize.java
@@ -1,4 +1,4 @@
-package com.fastasyncworldedit.core.object.brush.scroll;
+package com.fastasyncworldedit.core.command.tool.scroll;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.command.tool.BrushTool;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/scroll/ScrollTarget.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/scroll/ScrollTarget.java
similarity index 84%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/scroll/ScrollTarget.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/scroll/ScrollTarget.java
index 6c8dbf6a1..475e162e0 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/scroll/ScrollTarget.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/scroll/ScrollTarget.java
@@ -1,6 +1,6 @@
-package com.fastasyncworldedit.core.object.brush.scroll;
+package com.fastasyncworldedit.core.command.tool.scroll;
-import com.fastasyncworldedit.core.object.brush.TargetMode;
+import com.fastasyncworldedit.core.command.tool.TargetMode;
import com.fastasyncworldedit.core.util.MathMan;
import com.sk89q.worldedit.command.tool.BrushTool;
import com.sk89q.worldedit.entity.Player;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/scroll/ScrollTargetOffset.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/scroll/ScrollTargetOffset.java
similarity index 88%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/scroll/ScrollTargetOffset.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/scroll/ScrollTargetOffset.java
index ef959e7b3..f6612b68f 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/scroll/ScrollTargetOffset.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/scroll/ScrollTargetOffset.java
@@ -1,4 +1,4 @@
-package com.fastasyncworldedit.core.object.brush.scroll;
+package com.fastasyncworldedit.core.command.tool.scroll;
import com.sk89q.worldedit.command.tool.BrushTool;
import com.sk89q.worldedit.entity.Player;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/scroll/ScrollTool.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/scroll/ScrollTool.java
new file mode 100644
index 000000000..7300a2846
--- /dev/null
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/scroll/ScrollTool.java
@@ -0,0 +1,7 @@
+package com.fastasyncworldedit.core.command.tool.scroll;
+
+import com.sk89q.worldedit.entity.Player;
+
+public interface ScrollTool {
+ boolean increment(Player player, int amount);
+}
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/sweep/ClipboardSpline.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/sweep/ClipboardSpline.java
similarity index 96%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/sweep/ClipboardSpline.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/sweep/ClipboardSpline.java
index 090af0a43..acd41f34e 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/sweep/ClipboardSpline.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/sweep/ClipboardSpline.java
@@ -1,6 +1,6 @@
-package com.fastasyncworldedit.core.object.brush.sweep;
+package com.fastasyncworldedit.core.command.tool.sweep;
-import com.fastasyncworldedit.core.object.collection.LocalBlockVectorSet;
+import com.fastasyncworldedit.core.math.LocalBlockVectorSet;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.MaxChangedBlocksException;
import com.sk89q.worldedit.extent.clipboard.Clipboard;
@@ -11,7 +11,7 @@ import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.math.Vector3;
import com.sk89q.worldedit.math.interpolation.Interpolation;
import com.sk89q.worldedit.math.transform.AffineTransform;
-import com.sk89q.worldedit.math.transform.RoundedTransform;
+import com.fastasyncworldedit.core.math.transform.RoundedTransform;
import com.sk89q.worldedit.math.transform.Transform;
import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.session.ClipboardHolder;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/sweep/Spline.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/sweep/Spline.java
similarity index 99%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/sweep/Spline.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/sweep/Spline.java
index 65ac995e2..27566d6c0 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/sweep/Spline.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/sweep/Spline.java
@@ -1,4 +1,4 @@
-package com.fastasyncworldedit.core.object.brush.sweep;
+package com.fastasyncworldedit.core.command.tool.sweep;
import com.google.common.base.Preconditions;
import com.sk89q.worldedit.EditSession;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/sweep/SweepBrush.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/sweep/SweepBrush.java
similarity index 97%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/sweep/SweepBrush.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/sweep/SweepBrush.java
index 87d5689f7..87287e639 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/sweep/SweepBrush.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/sweep/SweepBrush.java
@@ -1,7 +1,7 @@
-package com.fastasyncworldedit.core.object.brush.sweep;
+package com.fastasyncworldedit.core.command.tool.sweep;
+import com.fastasyncworldedit.core.command.tool.ResettableTool;
import com.fastasyncworldedit.core.configuration.Caption;
-import com.fastasyncworldedit.core.object.brush.ResettableTool;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.EmptyClipboardException;
import com.sk89q.worldedit.LocalSession;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/database/DBHandler.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/database/DBHandler.java
index bbb39bfba..d160c24c8 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/database/DBHandler.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/database/DBHandler.java
@@ -13,7 +13,7 @@ public class DBHandler {
public static final DBHandler IMP = new DBHandler();
- private Map databases = new ConcurrentHashMap<>(8, 0.9f, 1);
+ private final Map databases = new ConcurrentHashMap<>(8, 0.9f, 1);
public RollbackDatabase getDatabase(World world) {
RollbackDatabase database = databases.get(world);
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/database/RollbackDatabase.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/database/RollbackDatabase.java
index ed0b680f6..f0f142171 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/database/RollbackDatabase.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/database/RollbackDatabase.java
@@ -2,9 +2,9 @@ package com.fastasyncworldedit.core.database;
import com.fastasyncworldedit.core.Fawe;
import com.fastasyncworldedit.core.configuration.Settings;
-import com.fastasyncworldedit.core.logging.RollbackOptimizedHistory;
-import com.fastasyncworldedit.core.object.collection.YieldIterable;
-import com.fastasyncworldedit.core.object.task.AsyncNotifyQueue;
+import com.fastasyncworldedit.core.history.RollbackOptimizedHistory;
+import com.fastasyncworldedit.core.util.collection.YieldIterable;
+import com.fastasyncworldedit.core.util.task.AsyncNotifyQueue;
import com.fastasyncworldedit.core.util.MainUtil;
import com.sk89q.worldedit.internal.util.LogManagerCompat;
import com.sk89q.worldedit.math.BlockVector3;
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/entity/LazyBaseEntity.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/entity/LazyBaseEntity.java
similarity index 90%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/entity/LazyBaseEntity.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/entity/LazyBaseEntity.java
index 768b3fa77..4d510b713 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/entity/LazyBaseEntity.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/entity/LazyBaseEntity.java
@@ -1,8 +1,9 @@
-package com.sk89q.worldedit.entity;
+package com.fastasyncworldedit.core.entity;
import com.fastasyncworldedit.core.Fawe;
import com.fastasyncworldedit.core.util.TaskManager;
import com.sk89q.jnbt.CompoundTag;
+import com.sk89q.worldedit.entity.BaseEntity;
import com.sk89q.worldedit.world.entity.EntityType;
import java.util.function.Supplier;
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/entity/MapMetadatable.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/entity/MapMetadatable.java
similarity index 96%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/entity/MapMetadatable.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/entity/MapMetadatable.java
index 6cedcb415..adbd68cf5 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/entity/MapMetadatable.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/entity/MapMetadatable.java
@@ -1,4 +1,4 @@
-package com.sk89q.worldedit.entity;
+package com.fastasyncworldedit.core.entity;
import org.jetbrains.annotations.NotNull;
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/entity/Metadatable.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/entity/Metadatable.java
similarity index 97%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/entity/Metadatable.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/entity/Metadatable.java
index 1062a3f39..9903b43cd 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/entity/Metadatable.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/entity/Metadatable.java
@@ -1,4 +1,4 @@
-package com.sk89q.worldedit.entity;
+package com.fastasyncworldedit.core.entity;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/event/extent/ActorSaveClipboardEvent.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/event/extent/ActorSaveClipboardEvent.java
similarity index 95%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/event/extent/ActorSaveClipboardEvent.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/event/extent/ActorSaveClipboardEvent.java
index fdc84e369..4507d9c75 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/event/extent/ActorSaveClipboardEvent.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/event/extent/ActorSaveClipboardEvent.java
@@ -1,4 +1,4 @@
-package com.sk89q.worldedit.event.extent;
+package com.fastasyncworldedit.core.event.extent;
import com.sk89q.worldedit.event.Cancellable;
import com.sk89q.worldedit.event.Event;
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/event/extent/PasteEvent.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/event/extent/PasteEvent.java
similarity index 66%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/event/extent/PasteEvent.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/event/extent/PasteEvent.java
index 00fa8b829..c4928b587 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/event/extent/PasteEvent.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/event/extent/PasteEvent.java
@@ -1,23 +1,4 @@
-/*
- * WorldEdit, a Minecraft world manipulation toolkit
- * Copyright (C) sk89q
- * Copyright (C) WorldEdit team and contributors
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.sk89q.worldedit.event.extent;
+package com.fastasyncworldedit.core.event.extent;
import com.sk89q.worldedit.event.Cancellable;
import com.sk89q.worldedit.event.Event;
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultTransformParser.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/DefaultTransformParser.java
similarity index 100%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultTransformParser.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/DefaultTransformParser.java
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/RichParser.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/RichParser.java
similarity index 98%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/RichParser.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/RichParser.java
index 9d281e87c..1ceefd959 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/RichParser.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/RichParser.java
@@ -1,4 +1,4 @@
-package com.sk89q.worldedit.extension.factory.parser;
+package com.fastasyncworldedit.core.extension.factory.parser;
import com.fastasyncworldedit.core.configuration.Caption;
import com.google.common.base.Preconditions;
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/AdjacentMaskParser.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/AdjacentMaskParser.java
similarity index 85%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/AdjacentMaskParser.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/AdjacentMaskParser.java
index 71fc4b628..c20b0c78f 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/AdjacentMaskParser.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/AdjacentMaskParser.java
@@ -1,10 +1,10 @@
-package com.sk89q.worldedit.extension.factory.parser.mask;
+package com.fastasyncworldedit.core.extension.factory.parser.mask;
-import com.fastasyncworldedit.core.object.mask.AdjacentAnyMask;
-import com.fastasyncworldedit.core.object.mask.AdjacentMask;
+import com.fastasyncworldedit.core.function.mask.AdjacentAnyMask;
+import com.fastasyncworldedit.core.function.mask.AdjacentMask;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.command.util.SuggestionHelper;
-import com.sk89q.worldedit.extension.factory.parser.RichParser;
+import com.fastasyncworldedit.core.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;
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/AngleMaskParser.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/AngleMaskParser.java
similarity index 92%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/AngleMaskParser.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/AngleMaskParser.java
index 0b144e5f0..7bca15398 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/AngleMaskParser.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/AngleMaskParser.java
@@ -1,10 +1,10 @@
-package com.sk89q.worldedit.extension.factory.parser.mask;
+package com.fastasyncworldedit.core.extension.factory.parser.mask;
import com.fastasyncworldedit.core.configuration.Caption;
-import com.fastasyncworldedit.core.object.mask.AngleMask;
+import com.fastasyncworldedit.core.function.mask.AngleMask;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.command.util.SuggestionHelper;
-import com.sk89q.worldedit.extension.factory.parser.RichParser;
+import com.fastasyncworldedit.core.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;
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/DefaultMaskParser.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/DefaultMaskParser.java
similarity index 91%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/DefaultMaskParser.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/DefaultMaskParser.java
index 82685458f..17075b403 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/DefaultMaskParser.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/DefaultMaskParser.java
@@ -1,24 +1,6 @@
// TODO: Ping @MattBDev to reimplement 2020-02-04
-///*
-// * WorldEdit, a Minecraft world manipulation toolkit
-// * Copyright (C) sk89q
-// * Copyright (C) WorldEdit team and contributors
-// *
-// * This program is free software: you can redistribute it and/or modify it
-// * under the terms of the GNU Lesser General Public License as published by the
-// * Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful, but WITHOUT
-// * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-// * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
-// * for more details.
-// *
-// * You should have received a copy of the GNU Lesser General Public License
-// * along with this program. If not, see .
-// */
-//
-//package com.sk89q.worldedit.extension.factory.parser.mask;
+//*
+//package com.fastasyncworldedit.core.extension.factory.parser.mask;
//
//import com.boydti.fawe.command.FaweParser;
//import com.boydti.fawe.command.SuggestInputParseException;
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/ExtremaMaskParser.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/ExtremaMaskParser.java
similarity index 92%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/ExtremaMaskParser.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/ExtremaMaskParser.java
index 3b04e5ff0..2b1371fe5 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/ExtremaMaskParser.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/ExtremaMaskParser.java
@@ -1,10 +1,10 @@
-package com.sk89q.worldedit.extension.factory.parser.mask;
+package com.fastasyncworldedit.core.extension.factory.parser.mask;
import com.fastasyncworldedit.core.configuration.Caption;
-import com.fastasyncworldedit.core.object.mask.ExtremaMask;
+import com.fastasyncworldedit.core.function.mask.ExtremaMask;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.command.util.SuggestionHelper;
-import com.sk89q.worldedit.extension.factory.parser.RichParser;
+import com.fastasyncworldedit.core.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;
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/FalseMaskParser.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/FalseMaskParser.java
similarity index 92%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/FalseMaskParser.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/FalseMaskParser.java
index 50b93fcb7..64e8780d9 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/FalseMaskParser.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/FalseMaskParser.java
@@ -1,4 +1,4 @@
-package com.sk89q.worldedit.extension.factory.parser.mask;
+package com.fastasyncworldedit.core.extension.factory.parser.mask;
import com.google.common.collect.ImmutableList;
import com.sk89q.worldedit.WorldEdit;
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/LiquidMaskParser.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/LiquidMaskParser.java
similarity index 85%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/LiquidMaskParser.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/LiquidMaskParser.java
index 77fe732fb..fcf54ae93 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/LiquidMaskParser.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/LiquidMaskParser.java
@@ -1,6 +1,6 @@
-package com.sk89q.worldedit.extension.factory.parser.mask;
+package com.fastasyncworldedit.core.extension.factory.parser.mask;
-import com.fastasyncworldedit.core.object.mask.LiquidMask;
+import com.fastasyncworldedit.core.function.mask.LiquidMask;
import com.google.common.collect.ImmutableList;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.extension.input.ParserContext;
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/ROCAngleMaskParser.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/ROCAngleMaskParser.java
similarity index 92%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/ROCAngleMaskParser.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/ROCAngleMaskParser.java
index e2af7862f..8bf85f178 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/ROCAngleMaskParser.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/ROCAngleMaskParser.java
@@ -1,10 +1,10 @@
-package com.sk89q.worldedit.extension.factory.parser.mask;
+package com.fastasyncworldedit.core.extension.factory.parser.mask;
import com.fastasyncworldedit.core.configuration.Caption;
-import com.fastasyncworldedit.core.object.mask.ROCAngleMask;
+import com.fastasyncworldedit.core.function.mask.ROCAngleMask;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.command.util.SuggestionHelper;
-import com.sk89q.worldedit.extension.factory.parser.RichParser;
+import com.fastasyncworldedit.core.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;
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/RadiusMaskParser.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/RadiusMaskParser.java
similarity index 84%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/RadiusMaskParser.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/RadiusMaskParser.java
index 4c3f8e274..609663629 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/RadiusMaskParser.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/RadiusMaskParser.java
@@ -1,9 +1,9 @@
-package com.sk89q.worldedit.extension.factory.parser.mask;
+package com.fastasyncworldedit.core.extension.factory.parser.mask;
-import com.fastasyncworldedit.core.object.mask.RadiusMask;
+import com.fastasyncworldedit.core.function.mask.RadiusMask;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.command.util.SuggestionHelper;
-import com.sk89q.worldedit.extension.factory.parser.RichParser;
+import com.fastasyncworldedit.core.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;
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/RichOffsetMaskParser.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/RichOffsetMaskParser.java
similarity index 92%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/RichOffsetMaskParser.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/RichOffsetMaskParser.java
index 0139dd224..52f501519 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/RichOffsetMaskParser.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/RichOffsetMaskParser.java
@@ -1,8 +1,8 @@
-package com.sk89q.worldedit.extension.factory.parser.mask;
+package com.fastasyncworldedit.core.extension.factory.parser.mask;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.command.util.SuggestionHelper;
-import com.sk89q.worldedit.extension.factory.parser.RichParser;
+import com.fastasyncworldedit.core.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;
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/SimplexMaskParser.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/SimplexMaskParser.java
similarity index 86%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/SimplexMaskParser.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/SimplexMaskParser.java
index 17bce6c2f..f5941fb07 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/SimplexMaskParser.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/SimplexMaskParser.java
@@ -1,9 +1,9 @@
-package com.sk89q.worldedit.extension.factory.parser.mask;
+package com.fastasyncworldedit.core.extension.factory.parser.mask;
-import com.fastasyncworldedit.core.object.mask.SimplexMask;
+import com.fastasyncworldedit.core.function.mask.SimplexMask;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.command.util.SuggestionHelper;
-import com.sk89q.worldedit.extension.factory.parser.RichParser;
+import com.fastasyncworldedit.core.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;
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/SurfaceMaskParser.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/SurfaceMaskParser.java
similarity index 86%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/SurfaceMaskParser.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/SurfaceMaskParser.java
index 8407b650e..ad8a2b9d1 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/SurfaceMaskParser.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/SurfaceMaskParser.java
@@ -1,6 +1,6 @@
-package com.sk89q.worldedit.extension.factory.parser.mask;
+package com.fastasyncworldedit.core.extension.factory.parser.mask;
-import com.fastasyncworldedit.core.object.mask.SurfaceMask;
+import com.fastasyncworldedit.core.function.mask.SurfaceMask;
import com.google.common.collect.ImmutableList;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.extension.input.InputParseException;
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/TrueMaskParser.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/TrueMaskParser.java
similarity index 91%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/TrueMaskParser.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/TrueMaskParser.java
index 90a51315c..17a5da720 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/TrueMaskParser.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/TrueMaskParser.java
@@ -1,4 +1,4 @@
-package com.sk89q.worldedit.extension.factory.parser.mask;
+package com.fastasyncworldedit.core.extension.factory.parser.mask;
import com.google.common.collect.ImmutableList;
import com.sk89q.worldedit.WorldEdit;
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/WallMaskParser.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/WallMaskParser.java
similarity index 90%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/WallMaskParser.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/WallMaskParser.java
index e9000b212..7c81b996f 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/WallMaskParser.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/WallMaskParser.java
@@ -1,6 +1,6 @@
-package com.sk89q.worldedit.extension.factory.parser.mask;
+package com.fastasyncworldedit.core.extension.factory.parser.mask;
-import com.fastasyncworldedit.core.object.mask.WallMask;
+import com.fastasyncworldedit.core.function.mask.WallMask;
import com.google.common.collect.ImmutableList;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.extension.input.InputParseException;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/XAxisMaskParser.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/XAxisMaskParser.java
new file mode 100644
index 000000000..a2a9b04d8
--- /dev/null
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/XAxisMaskParser.java
@@ -0,0 +1,29 @@
+package com.fastasyncworldedit.core.extension.factory.parser.mask;
+
+import com.fastasyncworldedit.core.function.mask.XAxisMask;
+import com.google.common.collect.ImmutableList;
+import com.sk89q.worldedit.WorldEdit;
+import com.sk89q.worldedit.extension.input.ParserContext;
+import com.sk89q.worldedit.function.mask.Mask;
+import com.sk89q.worldedit.internal.registry.SimpleInputParser;
+
+import java.util.List;
+
+public class XAxisMaskParser extends SimpleInputParser {
+
+ private final List aliases = ImmutableList.of("#xaxis");
+
+ public XAxisMaskParser(WorldEdit worldEdit) {
+ super(worldEdit);
+ }
+
+ @Override
+ public List getMatchedAliases() {
+ return aliases;
+ }
+
+ @Override
+ public Mask parseFromSimpleInput(String input, ParserContext context) {
+ return new XAxisMask(context.getExtent());
+ }
+}
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/YAxisMaskParser.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/YAxisMaskParser.java
new file mode 100644
index 000000000..d37fbbe4a
--- /dev/null
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/YAxisMaskParser.java
@@ -0,0 +1,29 @@
+package com.fastasyncworldedit.core.extension.factory.parser.mask;
+
+import com.fastasyncworldedit.core.function.mask.YAxisMask;
+import com.google.common.collect.ImmutableList;
+import com.sk89q.worldedit.WorldEdit;
+import com.sk89q.worldedit.extension.input.ParserContext;
+import com.sk89q.worldedit.function.mask.Mask;
+import com.sk89q.worldedit.internal.registry.SimpleInputParser;
+
+import java.util.List;
+
+public class YAxisMaskParser extends SimpleInputParser {
+
+ private final List aliases = ImmutableList.of("#yaxis");
+
+ public YAxisMaskParser(WorldEdit worldEdit) {
+ super(worldEdit);
+ }
+
+ @Override
+ public List getMatchedAliases() {
+ return aliases;
+ }
+
+ @Override
+ public Mask parseFromSimpleInput(String input, ParserContext context) {
+ return new YAxisMask(context.getExtent());
+ }
+}
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/ZAxisMaskParser.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/ZAxisMaskParser.java
new file mode 100644
index 000000000..015a5ff9d
--- /dev/null
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/ZAxisMaskParser.java
@@ -0,0 +1,29 @@
+package com.fastasyncworldedit.core.extension.factory.parser.mask;
+
+import com.fastasyncworldedit.core.function.mask.ZAxisMask;
+import com.google.common.collect.ImmutableList;
+import com.sk89q.worldedit.WorldEdit;
+import com.sk89q.worldedit.extension.input.ParserContext;
+import com.sk89q.worldedit.function.mask.Mask;
+import com.sk89q.worldedit.internal.registry.SimpleInputParser;
+
+import java.util.List;
+
+public class ZAxisMaskParser extends SimpleInputParser {
+
+ private final List aliases = ImmutableList.of("#zaxis");
+
+ public ZAxisMaskParser(WorldEdit worldEdit) {
+ super(worldEdit);
+ }
+
+ @Override
+ public List getMatchedAliases() {
+ return aliases;
+ }
+
+ @Override
+ public Mask parseFromSimpleInput(String input, ParserContext context) {
+ return new ZAxisMask();
+ }
+}
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/BiomePatternParser.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/pattern/BiomePatternParser.java
similarity index 92%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/BiomePatternParser.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/pattern/BiomePatternParser.java
index 9c36f4a04..85eb3d8f4 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/BiomePatternParser.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/pattern/BiomePatternParser.java
@@ -1,9 +1,9 @@
-package com.sk89q.worldedit.extension.factory.parser.pattern;
+package com.fastasyncworldedit.core.extension.factory.parser.pattern;
import com.fastasyncworldedit.core.configuration.Caption;
-import com.fastasyncworldedit.core.object.pattern.BiomeApplyingPattern;
+import com.fastasyncworldedit.core.function.pattern.BiomeApplyingPattern;
import com.sk89q.worldedit.WorldEdit;
-import com.sk89q.worldedit.extension.factory.parser.RichParser;
+import com.fastasyncworldedit.core.extension.factory.parser.RichParser;
import com.sk89q.worldedit.extension.input.InputParseException;
import com.sk89q.worldedit.extension.input.NoMatchException;
import com.sk89q.worldedit.extension.input.ParserContext;
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/BufferedPatternParser.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/pattern/BufferedPatternParser.java
similarity index 87%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/BufferedPatternParser.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/pattern/BufferedPatternParser.java
index 5e1c6e3a3..3d1b3a735 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/BufferedPatternParser.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/pattern/BufferedPatternParser.java
@@ -1,9 +1,9 @@
-package com.sk89q.worldedit.extension.factory.parser.pattern;
+package com.fastasyncworldedit.core.extension.factory.parser.pattern;
import com.fastasyncworldedit.core.configuration.Caption;
-import com.fastasyncworldedit.core.object.pattern.BufferedPattern;
+import com.fastasyncworldedit.core.function.pattern.BufferedPattern;
import com.sk89q.worldedit.WorldEdit;
-import com.sk89q.worldedit.extension.factory.parser.RichParser;
+import com.fastasyncworldedit.core.extension.factory.parser.RichParser;
import com.sk89q.worldedit.extension.input.InputParseException;
import com.sk89q.worldedit.extension.input.ParserContext;
import com.sk89q.worldedit.function.pattern.Pattern;
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/DefaultPatternParser.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/pattern/DefaultPatternParser.java
similarity index 90%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/DefaultPatternParser.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/pattern/DefaultPatternParser.java
index fb67973b1..60f8cc94d 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/DefaultPatternParser.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/pattern/DefaultPatternParser.java
@@ -1,24 +1,6 @@
// TODO: Ping @MattBDev to reimplement (or remove because this class is stupid) 2020-02-04
///*
-// * WorldEdit, a Minecraft world manipulation toolkit
-// * Copyright (C) sk89q
-// * Copyright (C) WorldEdit team and contributors
-// *
-// * This program is free software: you can redistribute it and/or modify it
-// * under the terms of the GNU Lesser General Public License as published by the
-// * Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful, but WITHOUT
-// * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-// * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
-// * for more details.
-// *
-// * You should have received a copy of the GNU Lesser General Public License
-// * along with this program. If not, see .
-// */
-//
-//package com.sk89q.worldedit.extension.factory.parser.pattern;
+//package com.fastasyncworldedit.core.extension.factory.parser.pattern;
//
//import com.boydti.fawe.command.FaweParser;
//import com.boydti.fawe.command.SuggestInputParseException;
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/ExistingPatternParser.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/pattern/ExistingPatternParser.java
similarity index 86%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/ExistingPatternParser.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/pattern/ExistingPatternParser.java
index 838bf3819..c1c6d618b 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/ExistingPatternParser.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/pattern/ExistingPatternParser.java
@@ -1,6 +1,6 @@
-package com.sk89q.worldedit.extension.factory.parser.pattern;
+package com.fastasyncworldedit.core.extension.factory.parser.pattern;
-import com.fastasyncworldedit.core.object.pattern.ExistingPattern;
+import com.fastasyncworldedit.core.function.pattern.ExistingPattern;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.extension.input.InputParseException;
import com.sk89q.worldedit.extension.input.ParserContext;
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/Linear2DPatternParser.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/pattern/Linear2DPatternParser.java
similarity index 92%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/Linear2DPatternParser.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/pattern/Linear2DPatternParser.java
index 0d9d58eb1..14c082a9c 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/Linear2DPatternParser.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/pattern/Linear2DPatternParser.java
@@ -1,11 +1,11 @@
-package com.sk89q.worldedit.extension.factory.parser.pattern;
+package com.fastasyncworldedit.core.extension.factory.parser.pattern;
import com.fastasyncworldedit.core.configuration.Caption;
-import com.fastasyncworldedit.core.object.pattern.Linear2DBlockPattern;
+import com.fastasyncworldedit.core.function.pattern.Linear2DBlockPattern;
import com.google.common.base.Preconditions;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.command.util.SuggestionHelper;
-import com.sk89q.worldedit.extension.factory.parser.RichParser;
+import com.fastasyncworldedit.core.extension.factory.parser.RichParser;
import com.sk89q.worldedit.extension.input.InputParseException;
import com.sk89q.worldedit.extension.input.ParserContext;
import com.sk89q.worldedit.function.pattern.Pattern;
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/Linear3DPatternParser.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/pattern/Linear3DPatternParser.java
similarity index 93%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/Linear3DPatternParser.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/pattern/Linear3DPatternParser.java
index 51eef6f57..8db342b7a 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/Linear3DPatternParser.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/pattern/Linear3DPatternParser.java
@@ -1,11 +1,11 @@
-package com.sk89q.worldedit.extension.factory.parser.pattern;
+package com.fastasyncworldedit.core.extension.factory.parser.pattern;
import com.fastasyncworldedit.core.configuration.Caption;
-import com.fastasyncworldedit.core.object.pattern.Linear3DBlockPattern;
+import com.fastasyncworldedit.core.function.pattern.Linear3DBlockPattern;
import com.google.common.base.Preconditions;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.command.util.SuggestionHelper;
-import com.sk89q.worldedit.extension.factory.parser.RichParser;
+import com.fastasyncworldedit.core.extension.factory.parser.RichParser;
import com.sk89q.worldedit.extension.input.InputParseException;
import com.sk89q.worldedit.extension.input.ParserContext;
import com.sk89q.worldedit.function.pattern.Pattern;
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/NoisePatternParser.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/pattern/NoisePatternParser.java
similarity index 93%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/NoisePatternParser.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/pattern/NoisePatternParser.java
index 40c3bbb46..d90df8a32 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/NoisePatternParser.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/pattern/NoisePatternParser.java
@@ -1,10 +1,10 @@
-package com.sk89q.worldedit.extension.factory.parser.pattern;
+package com.fastasyncworldedit.core.extension.factory.parser.pattern;
import com.fastasyncworldedit.core.configuration.Caption;
-import com.fastasyncworldedit.core.object.random.NoiseRandom;
+import com.fastasyncworldedit.core.math.random.NoiseRandom;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.command.util.SuggestionHelper;
-import com.sk89q.worldedit.extension.factory.parser.RichParser;
+import com.fastasyncworldedit.core.extension.factory.parser.RichParser;
import com.sk89q.worldedit.extension.input.InputParseException;
import com.sk89q.worldedit.extension.input.ParserContext;
import com.sk89q.worldedit.function.pattern.Pattern;
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/PerlinPatternParser.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/pattern/PerlinPatternParser.java
similarity index 86%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/PerlinPatternParser.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/pattern/PerlinPatternParser.java
index 1d968c8b7..8bd9e2987 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/PerlinPatternParser.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/pattern/PerlinPatternParser.java
@@ -1,4 +1,4 @@
-package com.sk89q.worldedit.extension.factory.parser.pattern;
+package com.fastasyncworldedit.core.extension.factory.parser.pattern;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.math.noise.PerlinNoise;
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/RandomPatternParser.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/pattern/RandomPatternParser.java
similarity index 77%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/RandomPatternParser.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/pattern/RandomPatternParser.java
index 76045e1be..16ace2476 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/RandomPatternParser.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/pattern/RandomPatternParser.java
@@ -1,23 +1,4 @@
-/*
- * WorldEdit, a Minecraft world manipulation toolkit
- * Copyright (C) sk89q
- * Copyright (C) WorldEdit team and contributors
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.sk89q.worldedit.extension.factory.parser.pattern;
+package com.fastasyncworldedit.core.extension.factory.parser.pattern;
import com.fastasyncworldedit.core.configuration.Caption;
import com.sk89q.util.StringUtil;
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/RidgedMultiFractalPatternParser.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/pattern/RidgedMultiFractalPatternParser.java
similarity index 88%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/RidgedMultiFractalPatternParser.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/pattern/RidgedMultiFractalPatternParser.java
index 969acc1e6..1ac5fa62e 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/RidgedMultiFractalPatternParser.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/pattern/RidgedMultiFractalPatternParser.java
@@ -1,4 +1,4 @@
-package com.sk89q.worldedit.extension.factory.parser.pattern;
+package com.fastasyncworldedit.core.extension.factory.parser.pattern;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.math.noise.RidgedMultiFractalNoise;
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/SimplexPatternParser.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/pattern/SimplexPatternParser.java
similarity index 67%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/SimplexPatternParser.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/pattern/SimplexPatternParser.java
index d408c031f..1f5fe17c1 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/SimplexPatternParser.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/pattern/SimplexPatternParser.java
@@ -1,7 +1,7 @@
-package com.sk89q.worldedit.extension.factory.parser.pattern;
+package com.fastasyncworldedit.core.extension.factory.parser.pattern;
import com.sk89q.worldedit.WorldEdit;
-import com.sk89q.worldedit.math.noise.SimplexNoiseGenerator;
+import com.fastasyncworldedit.core.math.random.SimplexNoiseGenerator;
public class SimplexPatternParser extends NoisePatternParser {
private static final String SIMPLEX_NAME = "simplex";
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/VoronoiPatternParser.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/pattern/VoronoiPatternParser.java
similarity index 86%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/VoronoiPatternParser.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/pattern/VoronoiPatternParser.java
index 5afbf53fd..9cc3b185d 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/VoronoiPatternParser.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/pattern/VoronoiPatternParser.java
@@ -1,4 +1,4 @@
-package com.sk89q.worldedit.extension.factory.parser.pattern;
+package com.fastasyncworldedit.core.extension.factory.parser.pattern;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.math.noise.VoronoiNoise;
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/binding/Binding.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/platform/binding/Binding.java
similarity index 74%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/binding/Binding.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/platform/binding/Binding.java
index f6a27e276..c40c6aabe 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/binding/Binding.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/platform/binding/Binding.java
@@ -1,4 +1,4 @@
-package com.sk89q.worldedit.extension.platform.binding;
+package com.fastasyncworldedit.core.extension.platform.binding;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/binding/Bindings.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/platform/binding/Bindings.java
similarity index 98%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/binding/Bindings.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/platform/binding/Bindings.java
index bf18cc3c6..c383cc82d 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/binding/Bindings.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/platform/binding/Bindings.java
@@ -1,4 +1,4 @@
-package com.sk89q.worldedit.extension.platform.binding;
+package com.fastasyncworldedit.core.extension.platform.binding;
import com.fastasyncworldedit.core.util.StringMan;
import com.sk89q.worldedit.WorldEdit;
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/binding/CommandBindings.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/platform/binding/CommandBindings.java
similarity index 72%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/binding/CommandBindings.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/platform/binding/CommandBindings.java
index 54dfbc5d5..fa359fb48 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/binding/CommandBindings.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/platform/binding/CommandBindings.java
@@ -1,4 +1,4 @@
-package com.sk89q.worldedit.extension.platform.binding;
+package com.fastasyncworldedit.core.extension.platform.binding;
import com.sk89q.worldedit.WorldEdit;
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/binding/ConsumeBindings.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/platform/binding/ConsumeBindings.java
similarity index 98%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/binding/ConsumeBindings.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/platform/binding/ConsumeBindings.java
index 4150967b0..bf13f657b 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/binding/ConsumeBindings.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/platform/binding/ConsumeBindings.java
@@ -1,4 +1,4 @@
-package com.sk89q.worldedit.extension.platform.binding;
+package com.fastasyncworldedit.core.extension.platform.binding;
import com.fastasyncworldedit.core.Fawe;
import com.fastasyncworldedit.core.configuration.Caption;
@@ -14,7 +14,7 @@ import com.sk89q.worldedit.extension.platform.Actor;
import com.sk89q.worldedit.extension.platform.PlatformCommandManager;
import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.internal.annotation.Selection;
-import com.sk89q.worldedit.internal.annotation.Time;
+import com.sk89q.worldedit.command.util.annotation.Time;
import com.sk89q.worldedit.internal.expression.Expression;
import com.sk89q.worldedit.math.BlockVector2;
import com.sk89q.worldedit.math.BlockVector3;
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/binding/PrimitiveBindings.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/platform/binding/PrimitiveBindings.java
similarity index 99%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/binding/PrimitiveBindings.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/platform/binding/PrimitiveBindings.java
index 6110cdd30..8d4859bbc 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/binding/PrimitiveBindings.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/platform/binding/PrimitiveBindings.java
@@ -1,4 +1,4 @@
-package com.sk89q.worldedit.extension.platform.binding;
+package com.fastasyncworldedit.core.extension.platform.binding;
import com.fastasyncworldedit.core.configuration.Caption;
import com.sk89q.worldedit.WorldEdit;
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/binding/ProvideBindings.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/platform/binding/ProvideBindings.java
similarity index 97%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/binding/ProvideBindings.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/platform/binding/ProvideBindings.java
index 933ba7883..009658dbd 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/binding/ProvideBindings.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/platform/binding/ProvideBindings.java
@@ -1,4 +1,4 @@
-package com.sk89q.worldedit.extension.platform.binding;
+package com.fastasyncworldedit.core.extension.platform.binding;
import com.fastasyncworldedit.core.configuration.Caption;
import com.fastasyncworldedit.core.database.DBHandler;
@@ -14,7 +14,7 @@ import com.sk89q.worldedit.entity.Player;
import com.sk89q.worldedit.extension.input.InputParseException;
import com.sk89q.worldedit.extension.platform.Actor;
import com.sk89q.worldedit.extent.Extent;
-import com.sk89q.worldedit.internal.annotation.AllowedRegion;
+import com.sk89q.worldedit.command.util.annotation.AllowedRegion;
import com.sk89q.worldedit.internal.annotation.Selection;
import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.session.request.Request;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/BlockTranslateExtent.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/BlockTranslateExtent.java
similarity index 95%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/BlockTranslateExtent.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/BlockTranslateExtent.java
index 609c90461..977d8c19e 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/BlockTranslateExtent.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/BlockTranslateExtent.java
@@ -1,10 +1,10 @@
-package com.fastasyncworldedit.core.object.extent;
+package com.fastasyncworldedit.core.extent;
import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.extent.AbstractDelegateExtent;
import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.math.BlockVector3;
-import com.sk89q.worldedit.math.MutableBlockVector3;
+import com.fastasyncworldedit.core.math.MutableBlockVector3;
import com.sk89q.worldedit.world.biome.BiomeType;
import com.sk89q.worldedit.world.block.BaseBlock;
import com.sk89q.worldedit.world.block.BlockState;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/ExtentHeightCacher.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/ExtentHeightCacher.java
similarity index 93%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/ExtentHeightCacher.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/ExtentHeightCacher.java
index 135a31a11..a2b98d4be 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/ExtentHeightCacher.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/ExtentHeightCacher.java
@@ -1,7 +1,6 @@
-package com.fastasyncworldedit.core.object.extent;
+package com.fastasyncworldedit.core.extent;
import com.sk89q.worldedit.extent.Extent;
-import com.sk89q.worldedit.extent.PassthroughExtent;
import java.util.Arrays;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/FaweRegionExtent.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/FaweRegionExtent.java
similarity index 96%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/FaweRegionExtent.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/FaweRegionExtent.java
index 088d8a854..4382f7d37 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/FaweRegionExtent.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/FaweRegionExtent.java
@@ -1,8 +1,8 @@
-package com.fastasyncworldedit.core.object.extent;
+package com.fastasyncworldedit.core.extent;
import com.fastasyncworldedit.core.FaweCache;
-import com.fastasyncworldedit.core.beta.IBatchProcessor;
-import com.fastasyncworldedit.core.beta.implementation.processors.ProcessorScope;
+import com.fastasyncworldedit.core.queue.IBatchProcessor;
+import com.fastasyncworldedit.core.extent.processor.ProcessorScope;
import com.fastasyncworldedit.core.object.FaweLimit;
import com.fastasyncworldedit.core.util.ExtentTraverser;
import com.fastasyncworldedit.core.util.WEManager;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/HeightBoundExtent.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/HeightBoundExtent.java
similarity index 85%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/HeightBoundExtent.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/HeightBoundExtent.java
index 6cae172c6..1e13912c3 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/HeightBoundExtent.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/HeightBoundExtent.java
@@ -1,10 +1,10 @@
-package com.fastasyncworldedit.core.object.extent;
+package com.fastasyncworldedit.core.extent;
-import com.fastasyncworldedit.core.beta.IChunk;
-import com.fastasyncworldedit.core.beta.IChunkGet;
-import com.fastasyncworldedit.core.beta.IChunkSet;
+import com.fastasyncworldedit.core.queue.IChunk;
+import com.fastasyncworldedit.core.queue.IChunkGet;
+import com.fastasyncworldedit.core.queue.IChunkSet;
import com.fastasyncworldedit.core.object.FaweLimit;
-import com.fastasyncworldedit.core.object.RegionWrapper;
+import com.fastasyncworldedit.core.regions.RegionWrapper;
import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.regions.Region;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/HistoryExtent.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/HistoryExtent.java
similarity index 97%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/HistoryExtent.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/HistoryExtent.java
index 87402445f..ce6f7265b 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/HistoryExtent.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/HistoryExtent.java
@@ -1,6 +1,6 @@
-package com.fastasyncworldedit.core.object;
+package com.fastasyncworldedit.core.extent;
-import com.fastasyncworldedit.core.object.changeset.AbstractChangeSet;
+import com.fastasyncworldedit.core.history.changeset.AbstractChangeSet;
import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.entity.BaseEntity;
import com.sk89q.worldedit.entity.Entity;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/MemoryCheckingExtent.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/MemoryCheckingExtent.java
similarity index 91%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/MemoryCheckingExtent.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/MemoryCheckingExtent.java
index 8191cca1f..1114a67d7 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/MemoryCheckingExtent.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/MemoryCheckingExtent.java
@@ -1,4 +1,4 @@
-package com.fastasyncworldedit.core.object.extent;
+package com.fastasyncworldedit.core.extent;
import com.fastasyncworldedit.core.FaweCache;
import com.fastasyncworldedit.core.configuration.Caption;
@@ -7,7 +7,6 @@ import com.fastasyncworldedit.core.util.Permission;
import com.fastasyncworldedit.core.util.WEManager;
import com.sk89q.worldedit.entity.Player;
import com.sk89q.worldedit.extent.Extent;
-import com.sk89q.worldedit.extent.PassthroughExtent;
public class MemoryCheckingExtent extends PassthroughExtent {
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/MultiRegionExtent.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/MultiRegionExtent.java
similarity index 92%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/MultiRegionExtent.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/MultiRegionExtent.java
index 6a3fa5cf5..f74af24d9 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/MultiRegionExtent.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/MultiRegionExtent.java
@@ -1,8 +1,8 @@
-package com.fastasyncworldedit.core.object.extent;
+package com.fastasyncworldedit.core.extent;
-import com.fastasyncworldedit.core.beta.IChunk;
-import com.fastasyncworldedit.core.beta.IChunkGet;
-import com.fastasyncworldedit.core.beta.IChunkSet;
+import com.fastasyncworldedit.core.queue.IChunk;
+import com.fastasyncworldedit.core.queue.IChunkGet;
+import com.fastasyncworldedit.core.queue.IChunkSet;
import com.fastasyncworldedit.core.object.FaweLimit;
import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.regions.Region;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/NullExtent.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/NullExtent.java
similarity index 94%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/NullExtent.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/NullExtent.java
index 9981eccb9..98b1384a9 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/NullExtent.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/NullExtent.java
@@ -1,13 +1,13 @@
-package com.fastasyncworldedit.core.object.extent;
+package com.fastasyncworldedit.core.extent;
import com.fastasyncworldedit.core.FaweCache;
-import com.fastasyncworldedit.core.beta.IBatchProcessor;
-import com.fastasyncworldedit.core.beta.IChunk;
-import com.fastasyncworldedit.core.beta.IChunkGet;
-import com.fastasyncworldedit.core.beta.IChunkSet;
-import com.fastasyncworldedit.core.beta.implementation.processors.ProcessorScope;
+import com.fastasyncworldedit.core.queue.IBatchProcessor;
+import com.fastasyncworldedit.core.queue.IChunk;
+import com.fastasyncworldedit.core.queue.IChunkGet;
+import com.fastasyncworldedit.core.queue.IChunkSet;
+import com.fastasyncworldedit.core.extent.processor.ProcessorScope;
import com.fastasyncworldedit.core.object.FaweLimit;
-import com.fastasyncworldedit.core.object.exception.FaweException;
+import com.fastasyncworldedit.core.internal.exception.FaweException;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.worldedit.MaxChangedBlocksException;
import com.sk89q.worldedit.WorldEditException;
@@ -15,8 +15,8 @@ import com.sk89q.worldedit.entity.BaseEntity;
import com.sk89q.worldedit.entity.Entity;
import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard;
-import com.sk89q.worldedit.function.generator.GenBase;
-import com.sk89q.worldedit.function.generator.Resource;
+import com.fastasyncworldedit.core.function.generator.GenBase;
+import com.fastasyncworldedit.core.function.generator.Resource;
import com.sk89q.worldedit.function.mask.Mask;
import com.sk89q.worldedit.function.operation.Operation;
import com.sk89q.worldedit.function.pattern.Pattern;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/OffsetExtent.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/OffsetExtent.java
similarity index 96%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/OffsetExtent.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/OffsetExtent.java
index 95a76f2ef..165c783b4 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/OffsetExtent.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/OffsetExtent.java
@@ -1,4 +1,4 @@
-package com.fastasyncworldedit.core.object.extent;
+package com.fastasyncworldedit.core.extent;
import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.extent.Extent;
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/PassthroughExtent.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/PassthroughExtent.java
similarity index 96%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/extent/PassthroughExtent.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/PassthroughExtent.java
index 7f3155997..b088710ca 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/PassthroughExtent.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/PassthroughExtent.java
@@ -1,12 +1,14 @@
-package com.sk89q.worldedit.extent;
+package com.fastasyncworldedit.core.extent;
-import com.fastasyncworldedit.core.beta.Filter;
+import com.fastasyncworldedit.core.queue.Filter;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.worldedit.MaxChangedBlocksException;
import com.sk89q.worldedit.WorldEditException;
+import com.sk89q.worldedit.extent.AbstractDelegateExtent;
+import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.extent.clipboard.Clipboard;
-import com.sk89q.worldedit.function.generator.GenBase;
-import com.sk89q.worldedit.function.generator.Resource;
+import com.fastasyncworldedit.core.function.generator.GenBase;
+import com.fastasyncworldedit.core.function.generator.Resource;
import com.sk89q.worldedit.function.mask.Mask;
import com.sk89q.worldedit.function.operation.Operation;
import com.sk89q.worldedit.function.pattern.Pattern;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/PositionTransformExtent.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/PositionTransformExtent.java
similarity index 94%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/PositionTransformExtent.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/PositionTransformExtent.java
index 6ec74f6ad..77c50db98 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/PositionTransformExtent.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/PositionTransformExtent.java
@@ -1,10 +1,10 @@
-package com.fastasyncworldedit.core.object.extent;
+package com.fastasyncworldedit.core.extent;
import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.math.BlockVector3;
-import com.sk89q.worldedit.math.MutableBlockVector3;
-import com.sk89q.worldedit.math.MutableVector3;
+import com.fastasyncworldedit.core.math.MutableBlockVector3;
+import com.fastasyncworldedit.core.math.MutableVector3;
import com.sk89q.worldedit.math.transform.Transform;
import com.sk89q.worldedit.world.biome.BiomeType;
import com.sk89q.worldedit.world.block.BaseBlock;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/ProcessedWEExtent.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/ProcessedWEExtent.java
similarity index 98%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/ProcessedWEExtent.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/ProcessedWEExtent.java
index aa144a437..95617a5ee 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/ProcessedWEExtent.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/ProcessedWEExtent.java
@@ -1,4 +1,4 @@
-package com.fastasyncworldedit.core.object.extent;
+package com.fastasyncworldedit.core.extent;
import com.fastasyncworldedit.core.FaweCache;
import com.fastasyncworldedit.core.object.FaweLimit;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/RandomOffsetTransform.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/RandomOffsetTransform.java
similarity index 97%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/RandomOffsetTransform.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/RandomOffsetTransform.java
index 3b0c27caa..f13c8f2eb 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/RandomOffsetTransform.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/RandomOffsetTransform.java
@@ -1,4 +1,4 @@
-package com.fastasyncworldedit.core.object.extent;
+package com.fastasyncworldedit.core.extent;
import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.extent.Extent;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/ResettableExtent.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/ResettableExtent.java
similarity index 97%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/ResettableExtent.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/ResettableExtent.java
index dd2b1b141..50f19a99a 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/ResettableExtent.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/ResettableExtent.java
@@ -1,4 +1,4 @@
-package com.fastasyncworldedit.core.object.extent;
+package com.fastasyncworldedit.core.extent;
import com.fastasyncworldedit.core.util.ExtentTraverser;
import com.fastasyncworldedit.core.util.ReflectionUtils;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/SingleRegionExtent.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/SingleRegionExtent.java
similarity index 86%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/SingleRegionExtent.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/SingleRegionExtent.java
index cd763c3a8..2a848305c 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/SingleRegionExtent.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/SingleRegionExtent.java
@@ -1,8 +1,8 @@
-package com.fastasyncworldedit.core.object.extent;
+package com.fastasyncworldedit.core.extent;
-import com.fastasyncworldedit.core.beta.IChunk;
-import com.fastasyncworldedit.core.beta.IChunkGet;
-import com.fastasyncworldedit.core.beta.IChunkSet;
+import com.fastasyncworldedit.core.queue.IChunk;
+import com.fastasyncworldedit.core.queue.IChunkGet;
+import com.fastasyncworldedit.core.queue.IChunkSet;
import com.fastasyncworldedit.core.object.FaweLimit;
import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.regions.Region;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/SlowExtent.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/SlowExtent.java
similarity index 95%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/SlowExtent.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/SlowExtent.java
index dec8429e5..4e83befd0 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/SlowExtent.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/SlowExtent.java
@@ -1,4 +1,4 @@
-package com.fastasyncworldedit.core.object.extent;
+package com.fastasyncworldedit.core.extent;
import com.fastasyncworldedit.core.Fawe;
import com.sk89q.worldedit.WorldEditException;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/SourceMaskExtent.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/SourceMaskExtent.java
similarity index 93%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/SourceMaskExtent.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/SourceMaskExtent.java
index 5ff3e7fb9..53589b5f6 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/SourceMaskExtent.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/SourceMaskExtent.java
@@ -1,10 +1,10 @@
-package com.fastasyncworldedit.core.object.extent;
+package com.fastasyncworldedit.core.extent;
import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.function.mask.Mask;
import com.sk89q.worldedit.math.BlockVector3;
-import com.sk89q.worldedit.math.MutableBlockVector3;
+import com.fastasyncworldedit.core.math.MutableBlockVector3;
import com.sk89q.worldedit.world.block.BlockStateHolder;
import static com.google.common.base.Preconditions.checkNotNull;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/StripNBTExtent.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/StripNBTExtent.java
similarity index 97%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/StripNBTExtent.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/StripNBTExtent.java
index c48cc469b..e01ee063c 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/StripNBTExtent.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/StripNBTExtent.java
@@ -1,4 +1,4 @@
-package com.fastasyncworldedit.core.object.extent;
+package com.fastasyncworldedit.core.extent;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.jnbt.Tag;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/SupplyingExtent.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/SupplyingExtent.java
similarity index 83%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/SupplyingExtent.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/SupplyingExtent.java
index c944b5300..3be2937ee 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/SupplyingExtent.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/SupplyingExtent.java
@@ -1,7 +1,6 @@
-package com.fastasyncworldedit.core.object.extent;
+package com.fastasyncworldedit.core.extent;
import com.sk89q.worldedit.extent.Extent;
-import com.sk89q.worldedit.extent.PassthroughExtent;
import java.util.function.Supplier;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/TemporalExtent.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/TemporalExtent.java
similarity index 95%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/TemporalExtent.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/TemporalExtent.java
index c0aff255e..41953d966 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/TemporalExtent.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/TemporalExtent.java
@@ -1,7 +1,6 @@
-package com.fastasyncworldedit.core.object.extent;
+package com.fastasyncworldedit.core.extent;
import com.sk89q.worldedit.extent.Extent;
-import com.sk89q.worldedit.extent.PassthroughExtent;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.world.biome.BiomeType;
import com.sk89q.worldedit.world.block.BaseBlock;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/TransformExtent.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/TransformExtent.java
similarity index 95%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/TransformExtent.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/TransformExtent.java
index 42ca894b9..057c6ce27 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/extent/TransformExtent.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/TransformExtent.java
@@ -1,11 +1,11 @@
-package com.fastasyncworldedit.core.object.extent;
+package com.fastasyncworldedit.core.extent;
import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.extent.transform.BlockTransformExtent;
import com.sk89q.worldedit.math.BlockVector3;
-import com.sk89q.worldedit.math.MutableBlockVector3;
-import com.sk89q.worldedit.math.MutableVector3;
+import com.fastasyncworldedit.core.math.MutableBlockVector3;
+import com.fastasyncworldedit.core.math.MutableVector3;
import com.sk89q.worldedit.math.Vector3;
import com.sk89q.worldedit.world.biome.BiomeType;
import com.sk89q.worldedit.world.block.BaseBlock;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/clipboard/CPUOptimizedClipboard.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/CPUOptimizedClipboard.java
similarity index 98%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/clipboard/CPUOptimizedClipboard.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/CPUOptimizedClipboard.java
index dd5770c3e..ccfba4f6e 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/clipboard/CPUOptimizedClipboard.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/CPUOptimizedClipboard.java
@@ -1,7 +1,7 @@
-package com.fastasyncworldedit.core.object.clipboard;
+package com.fastasyncworldedit.core.extent.clipboard;
import com.fastasyncworldedit.core.jnbt.streamer.IntValueReader;
-import com.fastasyncworldedit.core.object.IntTriple;
+import com.fastasyncworldedit.core.math.IntTriple;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.jnbt.IntTag;
import com.sk89q.jnbt.Tag;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/clipboard/DiskOptimizedClipboard.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/DiskOptimizedClipboard.java
similarity index 99%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/clipboard/DiskOptimizedClipboard.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/DiskOptimizedClipboard.java
index 012b8def8..5c282af12 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/clipboard/DiskOptimizedClipboard.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/DiskOptimizedClipboard.java
@@ -1,9 +1,9 @@
-package com.fastasyncworldedit.core.object.clipboard;
+package com.fastasyncworldedit.core.extent.clipboard;
import com.fastasyncworldedit.core.Fawe;
import com.fastasyncworldedit.core.configuration.Settings;
import com.fastasyncworldedit.core.jnbt.streamer.IntValueReader;
-import com.fastasyncworldedit.core.object.IntTriple;
+import com.fastasyncworldedit.core.math.IntTriple;
import com.fastasyncworldedit.core.util.MainUtil;
import com.fastasyncworldedit.core.util.UnsafeUtility;
import com.sk89q.jnbt.CompoundTag;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/clipboard/EmptyClipboard.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/EmptyClipboard.java
similarity index 95%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/clipboard/EmptyClipboard.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/EmptyClipboard.java
index 6c4917dec..26e57b414 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/clipboard/EmptyClipboard.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/EmptyClipboard.java
@@ -1,6 +1,6 @@
-package com.fastasyncworldedit.core.object.clipboard;
+package com.fastasyncworldedit.core.extent.clipboard;
-import com.fastasyncworldedit.core.beta.implementation.lighting.HeightMapType;
+import com.fastasyncworldedit.core.extent.processor.heightmap.HeightMapType;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.entity.Entity;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/clipboard/LazyClipboardHolder.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/LazyClipboardHolder.java
similarity index 97%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/clipboard/LazyClipboardHolder.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/LazyClipboardHolder.java
index 7c2ed2af3..508af1efd 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/clipboard/LazyClipboardHolder.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/LazyClipboardHolder.java
@@ -1,4 +1,4 @@
-package com.fastasyncworldedit.core.object.clipboard;
+package com.fastasyncworldedit.core.extent.clipboard;
import com.google.common.io.ByteSource;
import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/clipboard/LinearClipboard.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/LinearClipboard.java
similarity index 95%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/clipboard/LinearClipboard.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/LinearClipboard.java
index 8ee9e8c90..d0854837a 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/clipboard/LinearClipboard.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/LinearClipboard.java
@@ -1,12 +1,12 @@
-package com.fastasyncworldedit.core.object.clipboard;
+package com.fastasyncworldedit.core.extent.clipboard;
-import com.fastasyncworldedit.core.beta.implementation.filter.block.AbstractFilterBlock;
+import com.fastasyncworldedit.core.extent.filter.block.AbstractFilterBlock;
import com.fastasyncworldedit.core.jnbt.streamer.IntValueReader;
import com.google.common.collect.ForwardingIterator;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard.ClipboardEntity;
-import com.sk89q.worldedit.function.visitor.Order;
+import com.fastasyncworldedit.core.function.visitor.Order;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.regions.CuboidRegion;
import com.sk89q.worldedit.regions.Region;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/clipboard/MemoryOptimizedClipboard.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/MemoryOptimizedClipboard.java
similarity index 98%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/clipboard/MemoryOptimizedClipboard.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/MemoryOptimizedClipboard.java
index c7d061a0e..6836c9790 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/clipboard/MemoryOptimizedClipboard.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/MemoryOptimizedClipboard.java
@@ -1,8 +1,8 @@
-package com.fastasyncworldedit.core.object.clipboard;
+package com.fastasyncworldedit.core.extent.clipboard;
import com.fastasyncworldedit.core.configuration.Settings;
import com.fastasyncworldedit.core.jnbt.streamer.IntValueReader;
-import com.fastasyncworldedit.core.object.IntTriple;
+import com.fastasyncworldedit.core.math.IntTriple;
import com.fastasyncworldedit.core.util.MainUtil;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.jnbt.IntTag;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/clipboard/MultiClipboardHolder.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/MultiClipboardHolder.java
similarity index 98%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/clipboard/MultiClipboardHolder.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/MultiClipboardHolder.java
index 598d3a974..9f83a4a89 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/clipboard/MultiClipboardHolder.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/MultiClipboardHolder.java
@@ -1,4 +1,4 @@
-package com.fastasyncworldedit.core.object.clipboard;
+package com.fastasyncworldedit.core.extent.clipboard;
import com.sk89q.worldedit.extent.clipboard.Clipboard;
import com.sk89q.worldedit.session.ClipboardHolder;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/clipboard/ReadOnlyClipboard.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/ReadOnlyClipboard.java
similarity index 98%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/clipboard/ReadOnlyClipboard.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/ReadOnlyClipboard.java
index af29eecd6..801cae39c 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/clipboard/ReadOnlyClipboard.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/ReadOnlyClipboard.java
@@ -1,4 +1,4 @@
-package com.fastasyncworldedit.core.object.clipboard;
+package com.fastasyncworldedit.core.extent.clipboard;
import com.fastasyncworldedit.core.Fawe;
import com.sk89q.jnbt.CompoundTag;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/clipboard/ResizableClipboardBuilder.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/ResizableClipboardBuilder.java
similarity index 91%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/clipboard/ResizableClipboardBuilder.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/ResizableClipboardBuilder.java
index 0510d6ed4..b32216070 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/clipboard/ResizableClipboardBuilder.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/ResizableClipboardBuilder.java
@@ -1,8 +1,8 @@
-package com.fastasyncworldedit.core.object.clipboard;
+package com.fastasyncworldedit.core.extent.clipboard;
-import com.fastasyncworldedit.core.object.change.MutableBlockChange;
-import com.fastasyncworldedit.core.object.change.MutableTileChange;
-import com.fastasyncworldedit.core.object.changeset.MemoryOptimizedHistory;
+import com.fastasyncworldedit.core.history.change.MutableBlockChange;
+import com.fastasyncworldedit.core.history.change.MutableTileChange;
+import com.fastasyncworldedit.core.history.MemoryOptimizedHistory;
import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard;
import com.sk89q.worldedit.extent.clipboard.Clipboard;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/clipboard/SimpleClipboard.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/SimpleClipboard.java
similarity index 97%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/clipboard/SimpleClipboard.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/SimpleClipboard.java
index 0410743c4..94956c161 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/clipboard/SimpleClipboard.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/SimpleClipboard.java
@@ -1,4 +1,4 @@
-package com.fastasyncworldedit.core.object.clipboard;
+package com.fastasyncworldedit.core.extent.clipboard;
import com.sk89q.worldedit.extent.clipboard.Clipboard;
import com.sk89q.worldedit.math.BlockVector3;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/clipboard/URIClipboardHolder.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/URIClipboardHolder.java
similarity index 95%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/clipboard/URIClipboardHolder.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/URIClipboardHolder.java
index 1f6486b37..a3bd02bb0 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/clipboard/URIClipboardHolder.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/URIClipboardHolder.java
@@ -1,4 +1,4 @@
-package com.fastasyncworldedit.core.object.clipboard;
+package com.fastasyncworldedit.core.extent.clipboard;
import com.sk89q.worldedit.extent.clipboard.Clipboard;
import com.sk89q.worldedit.session.ClipboardHolder;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/clipboard/WorldCopyClipboard.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/WorldCopyClipboard.java
similarity index 97%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/clipboard/WorldCopyClipboard.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/WorldCopyClipboard.java
index 3610dfc13..cdd4ae8df 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/clipboard/WorldCopyClipboard.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/WorldCopyClipboard.java
@@ -1,4 +1,4 @@
-package com.fastasyncworldedit.core.object.clipboard;
+package com.fastasyncworldedit.core.extent.clipboard;
import com.sk89q.worldedit.entity.Entity;
import com.sk89q.worldedit.extent.Extent;
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/FastSchematicReader.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/io/FastSchematicReader.java
similarity index 93%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/FastSchematicReader.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/io/FastSchematicReader.java
index 9f10aa19e..f637f8cbb 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/FastSchematicReader.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/io/FastSchematicReader.java
@@ -1,32 +1,13 @@
-/*
- * WorldEdit, a Minecraft world manipulation toolkit
- * Copyright (C) sk89q
- * Copyright (C) WorldEdit team and contributors
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.sk89q.worldedit.extent.clipboard.io;
+package com.fastasyncworldedit.core.extent.clipboard.io;
import com.fastasyncworldedit.core.FaweCache;
import com.fastasyncworldedit.core.jnbt.streamer.StreamDelegate;
import com.fastasyncworldedit.core.jnbt.streamer.ValueReader;
-import com.fastasyncworldedit.core.object.FaweInputStream;
-import com.fastasyncworldedit.core.object.FaweOutputStream;
-import com.fastasyncworldedit.core.object.clipboard.LinearClipboard;
-import com.fastasyncworldedit.core.object.io.FastByteArrayOutputStream;
-import com.fastasyncworldedit.core.object.io.FastByteArraysInputStream;
+import com.fastasyncworldedit.core.internal.io.FaweInputStream;
+import com.fastasyncworldedit.core.internal.io.FaweOutputStream;
+import com.fastasyncworldedit.core.extent.clipboard.LinearClipboard;
+import com.fastasyncworldedit.core.internal.io.FastByteArrayOutputStream;
+import com.fastasyncworldedit.core.internal.io.FastByteArraysInputStream;
import com.sk89q.jnbt.AdventureNBTConverter;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.jnbt.IntTag;
@@ -40,6 +21,7 @@ import com.sk89q.worldedit.extension.input.InputParseException;
import com.sk89q.worldedit.extension.platform.Capability;
import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard;
import com.sk89q.worldedit.extent.clipboard.Clipboard;
+import com.sk89q.worldedit.extent.clipboard.io.NBTSchematicReader;
import com.sk89q.worldedit.internal.Constants;
import com.sk89q.worldedit.internal.util.LogManagerCompat;
import com.sk89q.worldedit.math.BlockVector3;
@@ -75,7 +57,7 @@ public class FastSchematicReader extends NBTSchematicReader {
private static final Logger LOGGER = LogManagerCompat.getLogger();
private final NBTInputStream inputStream;
- private DataFixer fixer;
+ private final DataFixer fixer;
private int dataVersion = -1;
private int version = -1;
private int faweWritten = -1;
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/FastSchematicWriter.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/io/FastSchematicWriter.java
similarity index 92%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/FastSchematicWriter.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/io/FastSchematicWriter.java
index 322b620f5..b8c02d12a 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/FastSchematicWriter.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/io/FastSchematicWriter.java
@@ -1,27 +1,8 @@
-/*
- * WorldEdit, a Minecraft world manipulation toolkit
- * Copyright (C) sk89q
- * Copyright (C) WorldEdit team and contributors
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.sk89q.worldedit.extent.clipboard.io;
+package com.fastasyncworldedit.core.extent.clipboard.io;
import com.fastasyncworldedit.core.Fawe;
import com.fastasyncworldedit.core.jnbt.streamer.IntValueReader;
-import com.fastasyncworldedit.core.object.FaweOutputStream;
+import com.fastasyncworldedit.core.internal.io.FaweOutputStream;
import com.fastasyncworldedit.core.util.IOUtil;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.jnbt.IntArrayTag;
@@ -36,7 +17,8 @@ import com.sk89q.worldedit.entity.Entity;
import com.sk89q.worldedit.extension.platform.Capability;
import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard;
import com.sk89q.worldedit.extent.clipboard.Clipboard;
-import com.sk89q.worldedit.function.visitor.Order;
+import com.sk89q.worldedit.extent.clipboard.io.ClipboardWriter;
+import com.fastasyncworldedit.core.function.visitor.Order;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.util.Location;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/schematic/MinecraftStructure.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/io/schematic/MinecraftStructure.java
similarity index 98%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/schematic/MinecraftStructure.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/io/schematic/MinecraftStructure.java
index dd859eaa6..403c8399d 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/schematic/MinecraftStructure.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/io/schematic/MinecraftStructure.java
@@ -1,4 +1,4 @@
-package com.fastasyncworldedit.core.object.schematic;
+package com.fastasyncworldedit.core.extent.clipboard.io.schematic;
import com.fastasyncworldedit.core.FaweCache;
import com.sk89q.jnbt.CompoundTag;
@@ -17,7 +17,7 @@ import com.sk89q.worldedit.extent.clipboard.io.ClipboardReader;
import com.sk89q.worldedit.extent.clipboard.io.ClipboardWriter;
import com.sk89q.worldedit.internal.util.LogManagerCompat;
import com.sk89q.worldedit.math.BlockVector3;
-import com.sk89q.worldedit.math.MutableBlockVector3;
+import com.fastasyncworldedit.core.math.MutableBlockVector3;
import com.sk89q.worldedit.regions.CuboidRegion;
import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.registry.state.AbstractProperty;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/schematic/PNGWriter.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/io/schematic/PNGWriter.java
similarity index 98%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/schematic/PNGWriter.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/io/schematic/PNGWriter.java
index 6a21c578e..d14b14353 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/schematic/PNGWriter.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/io/schematic/PNGWriter.java
@@ -1,11 +1,11 @@
-package com.fastasyncworldedit.core.object.schematic;
+package com.fastasyncworldedit.core.extent.clipboard.io.schematic;
import com.fastasyncworldedit.core.Fawe;
import com.fastasyncworldedit.core.util.TextureUtil;
import com.sk89q.worldedit.extent.clipboard.Clipboard;
import com.sk89q.worldedit.extent.clipboard.io.ClipboardWriter;
import com.sk89q.worldedit.math.BlockVector3;
-import com.sk89q.worldedit.math.MutableBlockVector3;
+import com.fastasyncworldedit.core.math.MutableBlockVector3;
import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.world.block.BlockState;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/schematic/visualizer/SchemVis.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/io/schematic/visualizer/SchemVis.java
similarity index 99%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/schematic/visualizer/SchemVis.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/io/schematic/visualizer/SchemVis.java
index 93295efae..76674758e 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/schematic/visualizer/SchemVis.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/io/schematic/visualizer/SchemVis.java
@@ -1,4 +1,4 @@
-//package com.boydti.fawe.object.schematic.visualizer;
+//package com.fastasyncworldedit.core.extent.clipboard.io.schematic.visualizer;
//
//import com.boydti.fawe.FaweCache;
//import com.boydti.fawe.beta.IBlocks;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/filter/ArrayImageMask.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/ArrayImageMask.java
similarity index 76%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/filter/ArrayImageMask.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/ArrayImageMask.java
index bb1a01092..a9e46a792 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/filter/ArrayImageMask.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/ArrayImageMask.java
@@ -1,7 +1,7 @@
-package com.fastasyncworldedit.core.beta.implementation.filter;
+package com.fastasyncworldedit.core.extent.filter;
-import com.fastasyncworldedit.core.beta.FilterBlockMask;
-import com.fastasyncworldedit.core.beta.implementation.filter.block.FilterBlock;
+import com.fastasyncworldedit.core.queue.FilterBlockMask;
+import com.fastasyncworldedit.core.extent.filter.block.FilterBlock;
import java.awt.image.BufferedImage;
import java.util.concurrent.ThreadLocalRandom;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/filter/CountFilter.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/CountFilter.java
similarity index 79%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/filter/CountFilter.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/CountFilter.java
index a0ee6f8a2..375cdb8e3 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/filter/CountFilter.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/CountFilter.java
@@ -1,6 +1,6 @@
-package com.fastasyncworldedit.core.beta.implementation.filter;
+package com.fastasyncworldedit.core.extent.filter;
-import com.fastasyncworldedit.core.beta.implementation.filter.block.FilterBlock;
+import com.fastasyncworldedit.core.extent.filter.block.FilterBlock;
public class CountFilter extends ForkedFilter {
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/filter/DistrFilter.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/DistrFilter.java
similarity index 94%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/filter/DistrFilter.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/DistrFilter.java
index 6e4429eb2..681c9b23d 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/filter/DistrFilter.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/DistrFilter.java
@@ -1,8 +1,8 @@
-package com.fastasyncworldedit.core.beta.implementation.filter;
+package com.fastasyncworldedit.core.extent.filter;
-import com.fastasyncworldedit.core.beta.implementation.filter.block.FilterBlock;
+import com.fastasyncworldedit.core.extent.filter.block.FilterBlock;
import com.sk89q.worldedit.extension.platform.Actor;
-import com.sk89q.worldedit.function.mask.ABlockMask;
+import com.fastasyncworldedit.core.function.mask.ABlockMask;
import com.sk89q.worldedit.util.Countable;
import com.sk89q.worldedit.util.formatting.text.TextComponent;
import com.sk89q.worldedit.world.block.BlockState;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/filter/ForkedFilter.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/ForkedFilter.java
similarity index 89%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/filter/ForkedFilter.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/ForkedFilter.java
index acc00b8d9..9bff8deab 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/filter/ForkedFilter.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/ForkedFilter.java
@@ -1,6 +1,6 @@
-package com.fastasyncworldedit.core.beta.implementation.filter;
+package com.fastasyncworldedit.core.extent.filter;
-import com.fastasyncworldedit.core.beta.Filter;
+import com.fastasyncworldedit.core.queue.Filter;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/filter/LinkedFilter.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/LinkedFilter.java
similarity index 73%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/filter/LinkedFilter.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/LinkedFilter.java
index 8db003a6c..776b74da7 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/filter/LinkedFilter.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/LinkedFilter.java
@@ -1,8 +1,8 @@
-package com.fastasyncworldedit.core.beta.implementation.filter;
+package com.fastasyncworldedit.core.extent.filter;
-import com.fastasyncworldedit.core.beta.Filter;
-import com.fastasyncworldedit.core.beta.implementation.filter.block.DelegateFilter;
-import com.fastasyncworldedit.core.beta.implementation.filter.block.FilterBlock;
+import com.fastasyncworldedit.core.queue.Filter;
+import com.fastasyncworldedit.core.extent.filter.block.DelegateFilter;
+import com.fastasyncworldedit.core.extent.filter.block.FilterBlock;
/**
* Filter which links two Filters together for single-filter-input operations.
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/filter/MaskFilter.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/MaskFilter.java
similarity index 87%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/filter/MaskFilter.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/MaskFilter.java
index ea5eac268..bccd3e07f 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/filter/MaskFilter.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/MaskFilter.java
@@ -1,8 +1,8 @@
-package com.fastasyncworldedit.core.beta.implementation.filter;
+package com.fastasyncworldedit.core.extent.filter;
-import com.fastasyncworldedit.core.beta.Filter;
-import com.fastasyncworldedit.core.beta.implementation.filter.block.DelegateFilter;
-import com.fastasyncworldedit.core.beta.implementation.filter.block.FilterBlock;
+import com.fastasyncworldedit.core.queue.Filter;
+import com.fastasyncworldedit.core.extent.filter.block.DelegateFilter;
+import com.fastasyncworldedit.core.extent.filter.block.FilterBlock;
import com.sk89q.worldedit.function.mask.AbstractExtentMask;
import com.sk89q.worldedit.function.mask.Mask;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/filter/block/AbstractExtentFilterBlock.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/block/AbstractExtentFilterBlock.java
similarity index 83%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/filter/block/AbstractExtentFilterBlock.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/block/AbstractExtentFilterBlock.java
index 813888dc8..00110fbdd 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/filter/block/AbstractExtentFilterBlock.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/block/AbstractExtentFilterBlock.java
@@ -1,4 +1,4 @@
-package com.fastasyncworldedit.core.beta.implementation.filter.block;
+package com.fastasyncworldedit.core.extent.filter.block;
import com.sk89q.worldedit.extent.Extent;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/filter/block/AbstractFilterBlock.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/block/AbstractFilterBlock.java
similarity index 97%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/filter/block/AbstractFilterBlock.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/block/AbstractFilterBlock.java
index b6aa81ffb..0c08aa0bc 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/filter/block/AbstractFilterBlock.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/block/AbstractFilterBlock.java
@@ -1,4 +1,4 @@
-package com.fastasyncworldedit.core.beta.implementation.filter.block;
+package com.fastasyncworldedit.core.extent.filter.block;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.worldedit.WorldEditException;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/filter/block/AbstractSingleFilterBlock.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/block/AbstractSingleFilterBlock.java
similarity index 96%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/filter/block/AbstractSingleFilterBlock.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/block/AbstractSingleFilterBlock.java
index 01a6c259e..6e8cf181c 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/filter/block/AbstractSingleFilterBlock.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/block/AbstractSingleFilterBlock.java
@@ -1,4 +1,4 @@
-package com.fastasyncworldedit.core.beta.implementation.filter.block;
+package com.fastasyncworldedit.core.extent.filter.block;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.worldedit.WorldEditException;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/filter/block/ArrayFilterBlock.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/block/ArrayFilterBlock.java
similarity index 97%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/filter/block/ArrayFilterBlock.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/block/ArrayFilterBlock.java
index 9758c8bde..ea117f69a 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/filter/block/ArrayFilterBlock.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/block/ArrayFilterBlock.java
@@ -1,4 +1,4 @@
-package com.fastasyncworldedit.core.beta.implementation.filter.block;
+package com.fastasyncworldedit.core.extent.filter.block;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.worldedit.WorldEditException;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/filter/block/CharFilterBlock.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/block/CharFilterBlock.java
similarity index 96%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/filter/block/CharFilterBlock.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/block/CharFilterBlock.java
index 1e873cec6..919cb32aa 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/filter/block/CharFilterBlock.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/block/CharFilterBlock.java
@@ -1,13 +1,13 @@
-package com.fastasyncworldedit.core.beta.implementation.filter.block;
+package com.fastasyncworldedit.core.extent.filter.block;
import com.fastasyncworldedit.core.FaweCache;
-import com.fastasyncworldedit.core.beta.Filter;
-import com.fastasyncworldedit.core.beta.FilterBlockMask;
-import com.fastasyncworldedit.core.beta.Flood;
-import com.fastasyncworldedit.core.beta.IBlocks;
-import com.fastasyncworldedit.core.beta.IChunkGet;
-import com.fastasyncworldedit.core.beta.IChunkSet;
-import com.fastasyncworldedit.core.beta.implementation.blocks.CharGetBlocks;
+import com.fastasyncworldedit.core.queue.Filter;
+import com.fastasyncworldedit.core.queue.FilterBlockMask;
+import com.fastasyncworldedit.core.queue.implementation.Flood;
+import com.fastasyncworldedit.core.queue.IBlocks;
+import com.fastasyncworldedit.core.queue.IChunkGet;
+import com.fastasyncworldedit.core.queue.IChunkSet;
+import com.fastasyncworldedit.core.queue.implementation.blocks.CharGetBlocks;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.extent.Extent;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/filter/block/ChunkFilterBlock.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/block/ChunkFilterBlock.java
similarity index 85%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/filter/block/ChunkFilterBlock.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/block/ChunkFilterBlock.java
index 6a059d960..121bad7f4 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/filter/block/ChunkFilterBlock.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/block/ChunkFilterBlock.java
@@ -1,12 +1,12 @@
-package com.fastasyncworldedit.core.beta.implementation.filter.block;
+package com.fastasyncworldedit.core.extent.filter.block;
-import com.fastasyncworldedit.core.beta.Filter;
-import com.fastasyncworldedit.core.beta.FilterBlockMask;
-import com.fastasyncworldedit.core.beta.Flood;
-import com.fastasyncworldedit.core.beta.IBlocks;
-import com.fastasyncworldedit.core.beta.IChunk;
-import com.fastasyncworldedit.core.beta.IChunkGet;
-import com.fastasyncworldedit.core.beta.IChunkSet;
+import com.fastasyncworldedit.core.queue.Filter;
+import com.fastasyncworldedit.core.queue.FilterBlockMask;
+import com.fastasyncworldedit.core.queue.implementation.Flood;
+import com.fastasyncworldedit.core.queue.IBlocks;
+import com.fastasyncworldedit.core.queue.IChunk;
+import com.fastasyncworldedit.core.queue.IChunkGet;
+import com.fastasyncworldedit.core.queue.IChunkSet;
import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.regions.Region;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/filter/block/DelegateFilter.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/block/DelegateFilter.java
similarity index 61%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/filter/block/DelegateFilter.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/block/DelegateFilter.java
index f9e033d38..88d10753c 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/filter/block/DelegateFilter.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/block/DelegateFilter.java
@@ -1,7 +1,7 @@
-package com.fastasyncworldedit.core.beta.implementation.filter.block;
+package com.fastasyncworldedit.core.extent.filter.block;
-import com.fastasyncworldedit.core.beta.Filter;
-import com.fastasyncworldedit.core.beta.IDelegateFilter;
+import com.fastasyncworldedit.core.queue.Filter;
+import com.fastasyncworldedit.core.queue.IDelegateFilter;
public abstract class DelegateFilter implements IDelegateFilter {
@@ -15,4 +15,4 @@ public abstract class DelegateFilter implements IDelegateFilte
public final T getParent() {
return (T) parent;
}
-}
\ No newline at end of file
+}
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/filter/block/ExtentFilterBlock.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/block/ExtentFilterBlock.java
similarity index 92%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/filter/block/ExtentFilterBlock.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/block/ExtentFilterBlock.java
index 326ac742b..c94119a6d 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/filter/block/ExtentFilterBlock.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/block/ExtentFilterBlock.java
@@ -1,4 +1,4 @@
-package com.fastasyncworldedit.core.beta.implementation.filter.block;
+package com.fastasyncworldedit.core.extent.filter.block;
import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.math.BlockVector3;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/filter/block/FilterBlock.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/block/FilterBlock.java
similarity index 98%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/filter/block/FilterBlock.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/block/FilterBlock.java
index 83f254432..3b3e89ebb 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/filter/block/FilterBlock.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/block/FilterBlock.java
@@ -1,4 +1,4 @@
-package com.fastasyncworldedit.core.beta.implementation.filter.block;
+package com.fastasyncworldedit.core.extent.filter.block;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.worldedit.WorldEditException;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/filter/block/SingleFilterBlock.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/block/SingleFilterBlock.java
similarity index 88%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/filter/block/SingleFilterBlock.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/block/SingleFilterBlock.java
index 65e8e764c..899fd3d66 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/filter/block/SingleFilterBlock.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/block/SingleFilterBlock.java
@@ -1,4 +1,4 @@
-package com.fastasyncworldedit.core.beta.implementation.filter.block;
+package com.fastasyncworldedit.core.extent.filter.block;
import com.sk89q.worldedit.world.block.BaseBlock;
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/SlottableBlockBag.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/inventory/SlottableBlockBag.java
similarity index 83%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/SlottableBlockBag.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/inventory/SlottableBlockBag.java
index 410adf328..f3f8940de 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/SlottableBlockBag.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/inventory/SlottableBlockBag.java
@@ -1,4 +1,4 @@
-package com.sk89q.worldedit.extent.inventory;
+package com.fastasyncworldedit.core.extent.inventory;
import com.sk89q.worldedit.blocks.BaseItem;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/processors/BatchProcessorHolder.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/BatchProcessorHolder.java
similarity index 83%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/processors/BatchProcessorHolder.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/BatchProcessorHolder.java
index 12d018d0c..55be0618a 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/processors/BatchProcessorHolder.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/BatchProcessorHolder.java
@@ -1,9 +1,9 @@
-package com.fastasyncworldedit.core.beta.implementation.processors;
+package com.fastasyncworldedit.core.extent.processor;
-import com.fastasyncworldedit.core.beta.IBatchProcessor;
-import com.fastasyncworldedit.core.beta.IChunk;
-import com.fastasyncworldedit.core.beta.IChunkGet;
-import com.fastasyncworldedit.core.beta.IChunkSet;
+import com.fastasyncworldedit.core.queue.IBatchProcessor;
+import com.fastasyncworldedit.core.queue.IChunk;
+import com.fastasyncworldedit.core.queue.IChunkGet;
+import com.fastasyncworldedit.core.queue.IChunkSet;
import java.util.concurrent.Future;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/processors/EmptyBatchProcessor.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/EmptyBatchProcessor.java
similarity index 82%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/processors/EmptyBatchProcessor.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/EmptyBatchProcessor.java
index dae055df1..42bb8cd13 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/processors/EmptyBatchProcessor.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/EmptyBatchProcessor.java
@@ -1,9 +1,9 @@
-package com.fastasyncworldedit.core.beta.implementation.processors;
+package com.fastasyncworldedit.core.extent.processor;
-import com.fastasyncworldedit.core.beta.IBatchProcessor;
-import com.fastasyncworldedit.core.beta.IChunk;
-import com.fastasyncworldedit.core.beta.IChunkGet;
-import com.fastasyncworldedit.core.beta.IChunkSet;
+import com.fastasyncworldedit.core.queue.IBatchProcessor;
+import com.fastasyncworldedit.core.queue.IChunk;
+import com.fastasyncworldedit.core.queue.IChunkGet;
+import com.fastasyncworldedit.core.queue.IChunkSet;
import com.sk89q.worldedit.extent.Extent;
import org.jetbrains.annotations.NotNull;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/processors/ExtentBatchProcessorHolder.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/ExtentBatchProcessorHolder.java
similarity index 81%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/processors/ExtentBatchProcessorHolder.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/ExtentBatchProcessorHolder.java
index 77793a4f5..e7938da79 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/processors/ExtentBatchProcessorHolder.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/ExtentBatchProcessorHolder.java
@@ -1,8 +1,8 @@
-package com.fastasyncworldedit.core.beta.implementation.processors;
+package com.fastasyncworldedit.core.extent.processor;
-import com.fastasyncworldedit.core.beta.IBatchProcessor;
+import com.fastasyncworldedit.core.queue.IBatchProcessor;
import com.fastasyncworldedit.core.configuration.Settings;
-import com.fastasyncworldedit.core.object.changeset.AbstractChangeSet;
+import com.fastasyncworldedit.core.history.changeset.AbstractChangeSet;
import com.sk89q.worldedit.extent.Extent;
public abstract class ExtentBatchProcessorHolder extends BatchProcessorHolder implements Extent {
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/processors/HeightmapProcessor.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/HeightmapProcessor.java
similarity index 91%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/processors/HeightmapProcessor.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/HeightmapProcessor.java
index bac8f1a12..e4956343c 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/processors/HeightmapProcessor.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/HeightmapProcessor.java
@@ -1,10 +1,10 @@
-package com.fastasyncworldedit.core.beta.implementation.processors;
+package com.fastasyncworldedit.core.extent.processor;
-import com.fastasyncworldedit.core.beta.IBatchProcessor;
-import com.fastasyncworldedit.core.beta.IChunk;
-import com.fastasyncworldedit.core.beta.IChunkGet;
-import com.fastasyncworldedit.core.beta.IChunkSet;
-import com.fastasyncworldedit.core.beta.implementation.lighting.HeightMapType;
+import com.fastasyncworldedit.core.queue.IBatchProcessor;
+import com.fastasyncworldedit.core.queue.IChunk;
+import com.fastasyncworldedit.core.queue.IChunkGet;
+import com.fastasyncworldedit.core.queue.IChunkSet;
+import com.fastasyncworldedit.core.extent.processor.heightmap.HeightMapType;
import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.world.World;
import com.sk89q.worldedit.world.block.BlockState;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/processors/IBatchProcessorHolder.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/IBatchProcessorHolder.java
similarity index 84%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/processors/IBatchProcessorHolder.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/IBatchProcessorHolder.java
index 026027187..0dd75f8b4 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/processors/IBatchProcessorHolder.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/IBatchProcessorHolder.java
@@ -1,9 +1,9 @@
-package com.fastasyncworldedit.core.beta.implementation.processors;
+package com.fastasyncworldedit.core.extent.processor;
-import com.fastasyncworldedit.core.beta.IBatchProcessor;
-import com.fastasyncworldedit.core.beta.IChunk;
-import com.fastasyncworldedit.core.beta.IChunkGet;
-import com.fastasyncworldedit.core.beta.IChunkSet;
+import com.fastasyncworldedit.core.queue.IBatchProcessor;
+import com.fastasyncworldedit.core.queue.IChunk;
+import com.fastasyncworldedit.core.queue.IChunkGet;
+import com.fastasyncworldedit.core.queue.IChunkSet;
import com.sk89q.worldedit.extent.Extent;
import java.util.concurrent.Future;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/processors/LimitExtent.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/LimitExtent.java
similarity index 97%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/processors/LimitExtent.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/LimitExtent.java
index d4d90bc4b..ff98949f4 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/processors/LimitExtent.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/LimitExtent.java
@@ -1,10 +1,10 @@
-package com.fastasyncworldedit.core.beta.implementation.processors;
+package com.fastasyncworldedit.core.extent.processor;
import com.fastasyncworldedit.core.FaweCache;
-import com.fastasyncworldedit.core.beta.Filter;
-import com.fastasyncworldedit.core.beta.implementation.filter.block.ExtentFilterBlock;
+import com.fastasyncworldedit.core.queue.Filter;
+import com.fastasyncworldedit.core.extent.filter.block.ExtentFilterBlock;
import com.fastasyncworldedit.core.object.FaweLimit;
-import com.fastasyncworldedit.core.object.exception.FaweException;
+import com.fastasyncworldedit.core.internal.exception.FaweException;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.worldedit.MaxChangedBlocksException;
import com.sk89q.worldedit.WorldEditException;
@@ -12,8 +12,8 @@ import com.sk89q.worldedit.entity.BaseEntity;
import com.sk89q.worldedit.entity.Entity;
import com.sk89q.worldedit.extent.AbstractDelegateExtent;
import com.sk89q.worldedit.extent.Extent;
-import com.sk89q.worldedit.function.generator.GenBase;
-import com.sk89q.worldedit.function.generator.Resource;
+import com.fastasyncworldedit.core.function.generator.GenBase;
+import com.fastasyncworldedit.core.function.generator.Resource;
import com.sk89q.worldedit.function.mask.Mask;
import com.sk89q.worldedit.function.pattern.Pattern;
import com.sk89q.worldedit.math.BlockVector3;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/processors/MultiBatchProcessor.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/MultiBatchProcessor.java
similarity index 95%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/processors/MultiBatchProcessor.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/MultiBatchProcessor.java
index 793f246d7..84ecc7c28 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/processors/MultiBatchProcessor.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/MultiBatchProcessor.java
@@ -1,11 +1,11 @@
-package com.fastasyncworldedit.core.beta.implementation.processors;
+package com.fastasyncworldedit.core.extent.processor;
import com.fastasyncworldedit.core.FaweCache;
-import com.fastasyncworldedit.core.beta.Filter;
-import com.fastasyncworldedit.core.beta.IBatchProcessor;
-import com.fastasyncworldedit.core.beta.IChunk;
-import com.fastasyncworldedit.core.beta.IChunkGet;
-import com.fastasyncworldedit.core.beta.IChunkSet;
+import com.fastasyncworldedit.core.queue.Filter;
+import com.fastasyncworldedit.core.queue.IBatchProcessor;
+import com.fastasyncworldedit.core.queue.IChunk;
+import com.fastasyncworldedit.core.queue.IChunkGet;
+import com.fastasyncworldedit.core.queue.IChunkSet;
import com.fastasyncworldedit.core.util.StringMan;
import com.google.common.cache.LoadingCache;
import com.sk89q.worldedit.extent.Extent;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/processors/NullProcessor.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/NullProcessor.java
similarity index 78%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/processors/NullProcessor.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/NullProcessor.java
index 776e482e5..9dd296460 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/processors/NullProcessor.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/NullProcessor.java
@@ -1,9 +1,9 @@
-package com.fastasyncworldedit.core.beta.implementation.processors;
+package com.fastasyncworldedit.core.extent.processor;
-import com.fastasyncworldedit.core.beta.IBatchProcessor;
-import com.fastasyncworldedit.core.beta.IChunk;
-import com.fastasyncworldedit.core.beta.IChunkGet;
-import com.fastasyncworldedit.core.beta.IChunkSet;
+import com.fastasyncworldedit.core.queue.IBatchProcessor;
+import com.fastasyncworldedit.core.queue.IChunk;
+import com.fastasyncworldedit.core.queue.IChunkGet;
+import com.fastasyncworldedit.core.queue.IChunkSet;
import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.extent.NullExtent;
import org.jetbrains.annotations.NotNull;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/processors/ProcessorScope.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/ProcessorScope.java
similarity index 95%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/processors/ProcessorScope.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/ProcessorScope.java
index 93c97e91b..4314a0be7 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/processors/ProcessorScope.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/ProcessorScope.java
@@ -1,4 +1,4 @@
-package com.fastasyncworldedit.core.beta.implementation.processors;
+package com.fastasyncworldedit.core.extent.processor;
/**
* The scope of a processor.
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/heightmap/AbstractDelegateHeightMap.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/heightmap/AbstractDelegateHeightMap.java
similarity index 85%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/heightmap/AbstractDelegateHeightMap.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/heightmap/AbstractDelegateHeightMap.java
index c174bf4bb..9c3d86b4b 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/heightmap/AbstractDelegateHeightMap.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/heightmap/AbstractDelegateHeightMap.java
@@ -1,4 +1,4 @@
-package com.fastasyncworldedit.core.object.brush.heightmap;
+package com.fastasyncworldedit.core.extent.processor.heightmap;
public class AbstractDelegateHeightMap implements HeightMap {
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/heightmap/ArrayHeightMap.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/heightmap/ArrayHeightMap.java
similarity index 93%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/heightmap/ArrayHeightMap.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/heightmap/ArrayHeightMap.java
index 16ae614d7..292aff20c 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/heightmap/ArrayHeightMap.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/heightmap/ArrayHeightMap.java
@@ -1,4 +1,4 @@
-package com.fastasyncworldedit.core.object.brush.heightmap;
+package com.fastasyncworldedit.core.extent.processor.heightmap;
public class ArrayHeightMap extends ScalableHeightMap {
// The heights
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/heightmap/AverageHeightMapFilter.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/heightmap/AverageHeightMapFilter.java
similarity index 95%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/heightmap/AverageHeightMapFilter.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/heightmap/AverageHeightMapFilter.java
index 34e7af512..d1e891115 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/heightmap/AverageHeightMapFilter.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/heightmap/AverageHeightMapFilter.java
@@ -1,4 +1,4 @@
-package com.fastasyncworldedit.core.object.brush.heightmap;
+package com.fastasyncworldedit.core.extent.processor.heightmap;
public class AverageHeightMapFilter {
private int[] inData;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/heightmap/FlatScalableHeightMap.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/heightmap/FlatScalableHeightMap.java
similarity index 85%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/heightmap/FlatScalableHeightMap.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/heightmap/FlatScalableHeightMap.java
index 39014cf7a..b1839acff 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/heightmap/FlatScalableHeightMap.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/heightmap/FlatScalableHeightMap.java
@@ -1,4 +1,4 @@
-package com.fastasyncworldedit.core.object.brush.heightmap;
+package com.fastasyncworldedit.core.extent.processor.heightmap;
public class FlatScalableHeightMap extends ScalableHeightMap {
public FlatScalableHeightMap() {
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/heightmap/HeightMap.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/heightmap/HeightMap.java
similarity index 99%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/heightmap/HeightMap.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/heightmap/HeightMap.java
index c344700d0..1f6d28bc2 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/heightmap/HeightMap.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/heightmap/HeightMap.java
@@ -1,4 +1,4 @@
-package com.fastasyncworldedit.core.object.brush.heightmap;
+package com.fastasyncworldedit.core.extent.processor.heightmap;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.MaxChangedBlocksException;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/lighting/HeightMapType.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/heightmap/HeightMapType.java
similarity index 95%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/lighting/HeightMapType.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/heightmap/HeightMapType.java
index 75de71f59..ce458a6f5 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/lighting/HeightMapType.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/heightmap/HeightMapType.java
@@ -1,7 +1,7 @@
-package com.fastasyncworldedit.core.beta.implementation.lighting;
+package com.fastasyncworldedit.core.extent.processor.heightmap;
import com.sk89q.worldedit.registry.state.Property;
-import com.sk89q.worldedit.registry.state.PropertyKey;
+import com.fastasyncworldedit.core.registry.state.PropertyKey;
import com.sk89q.worldedit.world.block.BlockCategories;
import com.sk89q.worldedit.world.block.BlockState;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/heightmap/RotatableHeightMap.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/heightmap/RotatableHeightMap.java
similarity index 86%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/heightmap/RotatableHeightMap.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/heightmap/RotatableHeightMap.java
index 0087db2a0..633b02507 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/heightmap/RotatableHeightMap.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/heightmap/RotatableHeightMap.java
@@ -1,7 +1,7 @@
-package com.fastasyncworldedit.core.object.brush.heightmap;
+package com.fastasyncworldedit.core.extent.processor.heightmap;
import com.sk89q.worldedit.math.BlockVector3;
-import com.sk89q.worldedit.math.MutableVector3;
+import com.fastasyncworldedit.core.math.MutableVector3;
import com.sk89q.worldedit.math.transform.AffineTransform;
public class RotatableHeightMap extends AbstractDelegateHeightMap {
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/heightmap/ScalableHeightMap.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/heightmap/ScalableHeightMap.java
similarity index 95%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/heightmap/ScalableHeightMap.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/heightmap/ScalableHeightMap.java
index 1b999487e..f795a8eb7 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/heightmap/ScalableHeightMap.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/heightmap/ScalableHeightMap.java
@@ -1,11 +1,11 @@
-package com.fastasyncworldedit.core.object.brush.heightmap;
+package com.fastasyncworldedit.core.extent.processor.heightmap;
-import com.fastasyncworldedit.core.object.IntPair;
+import com.fastasyncworldedit.core.math.IntPair;
import com.fastasyncworldedit.core.util.MainUtil;
import com.fastasyncworldedit.core.util.MathMan;
import com.sk89q.worldedit.extent.clipboard.Clipboard;
import com.sk89q.worldedit.math.BlockVector3;
-import com.sk89q.worldedit.math.MutableBlockVector3;
+import com.fastasyncworldedit.core.math.MutableBlockVector3;
import com.sk89q.worldedit.world.block.BlockState;
import java.awt.image.BufferedImage;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/lighting/NMSRelighter.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/lighting/NMSRelighter.java
similarity index 97%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/lighting/NMSRelighter.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/lighting/NMSRelighter.java
index a98fde58e..21e8dfe2c 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/beta/implementation/lighting/NMSRelighter.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/lighting/NMSRelighter.java
@@ -1,17 +1,15 @@
-package com.fastasyncworldedit.core.beta.implementation.lighting;
+package com.fastasyncworldedit.core.extent.processor.lighting;
import com.fastasyncworldedit.core.Fawe;
-import com.fastasyncworldedit.core.beta.IQueueChunk;
-import com.fastasyncworldedit.core.beta.IQueueExtent;
-import com.fastasyncworldedit.core.beta.implementation.chunk.ChunkHolder;
+import com.fastasyncworldedit.core.queue.IQueueChunk;
+import com.fastasyncworldedit.core.queue.IQueueExtent;
+import com.fastasyncworldedit.core.queue.implementation.chunk.ChunkHolder;
import com.fastasyncworldedit.core.configuration.Settings;
-import com.fastasyncworldedit.core.object.RelightMode;
-import com.fastasyncworldedit.core.object.RunnableVal;
-import com.fastasyncworldedit.core.object.collection.BlockVectorSet;
+import com.fastasyncworldedit.core.util.task.RunnableVal;
+import com.fastasyncworldedit.core.math.BlockVectorSet;
import com.fastasyncworldedit.core.util.MathMan;
import com.fastasyncworldedit.core.util.TaskManager;
-import com.sk89q.worldedit.internal.util.LogManagerCompat;
-import com.sk89q.worldedit.math.MutableBlockVector3;
+import com.fastasyncworldedit.core.math.MutableBlockVector3;
import com.sk89q.worldedit.registry.state.DirectionalProperty;
import com.sk89q.worldedit.registry.state.EnumProperty;
import com.sk89q.worldedit.registry.state.Property;
@@ -20,7 +18,6 @@ import com.sk89q.worldedit.world.block.BlockState;
import com.sk89q.worldedit.world.block.BlockTypes;
import com.sk89q.worldedit.world.registry.BlockMaterial;
import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap;
-import org.apache.logging.log4j.Logger;
import java.util.ArrayDeque;
import java.util.ArrayList;
@@ -39,7 +36,6 @@ import java.util.concurrent.locks.ReentrantLock;
public class NMSRelighter implements Relighter {
- private static final Logger LOGGER = LogManagerCompat.getLogger();
private static final int DISPATCH_SIZE = 64;
private static final DirectionalProperty stairDirection;
private static final EnumProperty stairHalf;
@@ -58,7 +54,7 @@ public class NMSRelighter implements Relighter {
private final Map skyToRelight;
private final Object present = new Object();
private final Map chunksToSend;
- private final ConcurrentLinkedQueue extentdSkyToRelight = new ConcurrentLinkedQueue<>();
+ private final ConcurrentLinkedQueue extendSkyToRelight = new ConcurrentLinkedQueue<>();
private final Map lightQueue;
private final AtomicBoolean lightLock = new AtomicBoolean(false);
private final ConcurrentHashMap concurrentLightQueue;
@@ -84,7 +80,7 @@ public class NMSRelighter implements Relighter {
}
@Override public boolean isEmpty() {
- return skyToRelight.isEmpty() && lightQueue.isEmpty() && extentdSkyToRelight.isEmpty() && concurrentLightQueue.isEmpty();
+ return skyToRelight.isEmpty() && lightQueue.isEmpty() && extendSkyToRelight.isEmpty() && concurrentLightQueue.isEmpty();
}
@Override
@@ -149,7 +145,7 @@ public class NMSRelighter implements Relighter {
}
public synchronized void clear() {
- extentdSkyToRelight.clear();
+ extendSkyToRelight.clear();
skyToRelight.clear();
chunksToSend.clear();
lightQueue.clear();
@@ -157,13 +153,13 @@ public class NMSRelighter implements Relighter {
public boolean addChunk(int cx, int cz, byte[] fix, int bitmask) {
RelightSkyEntry toPut = new RelightSkyEntry(cx, cz, fix, bitmask);
- extentdSkyToRelight.add(toPut);
+ extendSkyToRelight.add(toPut);
return true;
}
private synchronized Map getSkyMap() {
RelightSkyEntry entry;
- while ((entry = extentdSkyToRelight.poll()) != null) {
+ while ((entry = extendSkyToRelight.poll()) != null) {
long pair = MathMan.pairInt(entry.x, entry.z);
RelightSkyEntry existing = skyToRelight.put(pair, entry);
if (existing != null) {
@@ -242,7 +238,7 @@ public class NMSRelighter implements Relighter {
int x = lx + bx;
int y = yStart + j;
int z = lz + bz;
- int oldLevel = iChunk.getEmmittedLight(lx, y, lz);
+ int oldLevel = iChunk.getEmittedLight(lx, y, lz);
int newLevel = iChunk.getBrightness(lx, y, lz);
if (oldLevel != newLevel) {
iChunk.setBlockLight(lx, y, lz, newLevel);
@@ -293,7 +289,7 @@ public class NMSRelighter implements Relighter {
if (!iChunk.isInit()) {
iChunk.init(queue, node.getX() >> 4, node.getZ() >> 4);
}
- int lightLevel = iChunk.getEmmittedLight(node.getX() & 15, node.getY(), node.getZ() & 15);
+ int lightLevel = iChunk.getEmittedLight(node.getX() & 15, node.getY(), node.getZ() & 15);
BlockState state = this.queue.getBlock(node.getX(), node.getY(), node.getZ());
String id = state.getBlockType().getId().toLowerCase(Locale.ROOT);
if (lightLevel <= 1) {
@@ -724,7 +720,7 @@ public class NMSRelighter implements Relighter {
if (!iChunk.isInit()) {
iChunk.init(this.queue, x >> 4, z >> 4);
}
- int current = iChunk.getEmmittedLight(x & 15, y, z & 15);
+ int current = iChunk.getEmittedLight(x & 15, y, z & 15);
if (current != 0 && current < currentLight) {
iChunk.setBlockLight(x, y, z, 0);
if (current > 1) {
@@ -758,7 +754,7 @@ public class NMSRelighter implements Relighter {
if (!iChunk.isInit()) {
iChunk.init(this.queue, x >> 4, z >> 4);
}
- int current = iChunk.getEmmittedLight(x & 15, y, z & 15);
+ int current = iChunk.getEmittedLight(x & 15, y, z & 15);
if (currentLight > current) {
iChunk.setBlockLight(x & 15, y, z & 15, currentLight);
mutableBlockPos.setComponents(x, y, z);
@@ -831,8 +827,9 @@ public class NMSRelighter implements Relighter {
queue.flush();
finished.set(true);
} else {
- TaskManager.IMP.sync(new RunnableVal
*/
public class BlockVectorSet extends AbstractCollection implements Set {
- private Int2ObjectMap localSets = new Int2ObjectOpenHashMap<>();
+ private final Int2ObjectMap localSets = new Int2ObjectOpenHashMap<>();
@Override
public int size() {
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/math/DelegateBlockVector3.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/math/DelegateBlockVector3.java
similarity index 98%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/math/DelegateBlockVector3.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/math/DelegateBlockVector3.java
index 538f38220..a4dd259e8 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/math/DelegateBlockVector3.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/math/DelegateBlockVector3.java
@@ -1,7 +1,10 @@
-package com.sk89q.worldedit.math;
+package com.fastasyncworldedit.core.math;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.worldedit.extent.Extent;
+import com.sk89q.worldedit.math.BlockVector2;
+import com.sk89q.worldedit.math.BlockVector3;
+import com.sk89q.worldedit.math.Vector3;
import com.sk89q.worldedit.world.block.BaseBlock;
import com.sk89q.worldedit.world.block.BlockState;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/collection/FastBitSet.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/math/FastBitSet.java
similarity index 99%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/collection/FastBitSet.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/math/FastBitSet.java
index ab6a14356..97d539416 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/collection/FastBitSet.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/math/FastBitSet.java
@@ -1,4 +1,4 @@
-package com.fastasyncworldedit.core.object.collection;
+package com.fastasyncworldedit.core.math;
import java.util.Arrays;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/IntPair.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/math/IntPair.java
similarity index 93%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/IntPair.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/math/IntPair.java
index 5cfdf135a..dbb92a118 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/IntPair.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/math/IntPair.java
@@ -1,4 +1,4 @@
-package com.fastasyncworldedit.core.object;
+package com.fastasyncworldedit.core.math;
public final class IntPair {
public int x;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/IntTriple.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/math/IntTriple.java
similarity index 94%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/IntTriple.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/math/IntTriple.java
index d41ab9502..9cbe86f6c 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/IntTriple.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/math/IntTriple.java
@@ -1,4 +1,4 @@
-package com.fastasyncworldedit.core.object;
+package com.fastasyncworldedit.core.math;
public final class IntTriple {
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/collection/LocalBlockVectorSet.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/math/LocalBlockVectorSet.java
similarity index 98%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/collection/LocalBlockVectorSet.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/math/LocalBlockVectorSet.java
index ea8b0d6b0..6bc37ce38 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/collection/LocalBlockVectorSet.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/math/LocalBlockVectorSet.java
@@ -1,8 +1,8 @@
-package com.fastasyncworldedit.core.object.collection;
+package com.fastasyncworldedit.core.math;
import com.fastasyncworldedit.core.util.MathMan;
import com.sk89q.worldedit.math.BlockVector3;
-import com.sk89q.worldedit.math.MutableBlockVector3;
+import com.zaxxer.sparsebits.SparseBitSet;
import org.jetbrains.annotations.NotNull;
import java.util.Collection;
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/math/MutableBlockVector2.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/math/MutableBlockVector2.java
similarity index 91%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/math/MutableBlockVector2.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/math/MutableBlockVector2.java
index 1f9b71bc9..42a090682 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/math/MutableBlockVector2.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/math/MutableBlockVector2.java
@@ -1,4 +1,6 @@
-package com.sk89q.worldedit.math;
+package com.fastasyncworldedit.core.math;
+
+import com.sk89q.worldedit.math.BlockVector2;
public class MutableBlockVector2 extends BlockVector2 {
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/math/MutableBlockVector3.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/math/MutableBlockVector3.java
similarity index 95%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/math/MutableBlockVector3.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/math/MutableBlockVector3.java
index c2f68f4fb..1b00fe38e 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/math/MutableBlockVector3.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/math/MutableBlockVector3.java
@@ -1,6 +1,7 @@
-package com.sk89q.worldedit.math;
+package com.fastasyncworldedit.core.math;
import com.fastasyncworldedit.core.FaweCache;
+import com.sk89q.worldedit.math.BlockVector3;
public class MutableBlockVector3 extends BlockVector3 {
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/math/MutableVector3.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/math/MutableVector3.java
similarity index 96%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/math/MutableVector3.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/math/MutableVector3.java
index 878906258..4342150b9 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/math/MutableVector3.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/math/MutableVector3.java
@@ -1,6 +1,7 @@
-package com.sk89q.worldedit.math;
+package com.fastasyncworldedit.core.math;
import com.fastasyncworldedit.core.FaweCache;
+import com.sk89q.worldedit.math.Vector3;
public class MutableVector3 extends Vector3 {
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/math/OffsetBlockVector3.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/math/OffsetBlockVector3.java
similarity index 83%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/math/OffsetBlockVector3.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/math/OffsetBlockVector3.java
index ea8253632..6c73273a4 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/math/OffsetBlockVector3.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/math/OffsetBlockVector3.java
@@ -1,4 +1,6 @@
-package com.sk89q.worldedit.math;
+package com.fastasyncworldedit.core.math;
+
+import com.sk89q.worldedit.math.BlockVector3;
public class OffsetBlockVector3 extends DelegateBlockVector3 {
private final BlockVector3 offset;
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/math/Vector3Impl.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/math/Vector3Impl.java
similarity index 87%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/math/Vector3Impl.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/math/Vector3Impl.java
index 7c1068417..9a5cf7b2f 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/math/Vector3Impl.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/math/Vector3Impl.java
@@ -1,4 +1,6 @@
-package com.sk89q.worldedit.math;
+package com.fastasyncworldedit.core.math;
+
+import com.sk89q.worldedit.math.Vector3;
public class Vector3Impl extends Vector3 {
private final double x;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/random/NoiseRandom.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/math/random/NoiseRandom.java
similarity index 94%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/random/NoiseRandom.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/math/random/NoiseRandom.java
index 400ce1b77..0c5b86c2a 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/random/NoiseRandom.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/math/random/NoiseRandom.java
@@ -1,4 +1,4 @@
-package com.fastasyncworldedit.core.object.random;
+package com.fastasyncworldedit.core.math.random;
import com.sk89q.worldedit.math.Vector3;
import com.sk89q.worldedit.math.noise.NoiseGenerator;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/random/SimpleRandom.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/math/random/SimpleRandom.java
similarity index 94%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/random/SimpleRandom.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/math/random/SimpleRandom.java
index 31e0c33fa..f8004eb41 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/random/SimpleRandom.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/math/random/SimpleRandom.java
@@ -1,4 +1,4 @@
-package com.fastasyncworldedit.core.object.random;
+package com.fastasyncworldedit.core.math.random;
public interface SimpleRandom {
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/random/SimplexNoise.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/math/random/SimplexNoise.java
similarity index 99%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/random/SimplexNoise.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/math/random/SimplexNoise.java
index ef917d673..fd14b036f 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/random/SimplexNoise.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/math/random/SimplexNoise.java
@@ -1,4 +1,4 @@
-package com.fastasyncworldedit.core.object.random;
+package com.fastasyncworldedit.core.math.random;
/*
* A speed-improved simplex noise algorithm for 2D, 3D and 4D in Java.
*
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/math/noise/SimplexNoiseGenerator.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/math/random/SimplexNoiseGenerator.java
similarity index 85%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/math/noise/SimplexNoiseGenerator.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/math/random/SimplexNoiseGenerator.java
index a5e19b6a3..8c937836e 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/math/noise/SimplexNoiseGenerator.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/math/random/SimplexNoiseGenerator.java
@@ -1,8 +1,8 @@
-package com.sk89q.worldedit.math.noise;
+package com.fastasyncworldedit.core.math.random;
-import com.fastasyncworldedit.core.object.random.SimplexNoise;
import com.sk89q.worldedit.math.Vector2;
import com.sk89q.worldedit.math.Vector3;
+import com.sk89q.worldedit.math.noise.NoiseGenerator;
public class SimplexNoiseGenerator implements NoiseGenerator {
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/random/TrueRandom.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/math/random/TrueRandom.java
similarity index 88%
rename from worldedit-core/src/main/java/com/fastasyncworldedit/core/object/random/TrueRandom.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/math/random/TrueRandom.java
index 99adaec28..f4d7d9df6 100644
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/random/TrueRandom.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/math/random/TrueRandom.java
@@ -1,4 +1,4 @@
-package com.fastasyncworldedit.core.object.random;
+package com.fastasyncworldedit.core.math.random;
import java.util.SplittableRandom;
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/math/transform/RoundedTransform.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/math/transform/RoundedTransform.java
similarity index 88%
rename from worldedit-core/src/main/java/com/sk89q/worldedit/math/transform/RoundedTransform.java
rename to worldedit-core/src/main/java/com/fastasyncworldedit/core/math/transform/RoundedTransform.java
index 8bdca82e8..aefc2997a 100644
--- a/worldedit-core/src/main/java/com/sk89q/worldedit/math/transform/RoundedTransform.java
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/math/transform/RoundedTransform.java
@@ -1,6 +1,7 @@
-package com.sk89q.worldedit.math.transform;
+package com.fastasyncworldedit.core.math.transform;
import com.sk89q.worldedit.math.Vector3;
+import com.sk89q.worldedit.math.transform.Transform;
public class RoundedTransform implements Transform {
private final Transform transform;
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/Metadatable.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/Metadatable.java
deleted file mode 100644
index a38da1435..000000000
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/Metadatable.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package com.fastasyncworldedit.core.object;
-
-import com.sk89q.worldedit.entity.MapMetadatable;
-
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-public class Metadatable implements MapMetadatable {
- private final ConcurrentMap meta = new ConcurrentHashMap<>();
-
- @Override
- public Map getRawMeta() {
- return meta;
- }
-}
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/scroll/ScrollTool.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/scroll/ScrollTool.java
deleted file mode 100644
index b9ea8de93..000000000
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/brush/scroll/ScrollTool.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package com.fastasyncworldedit.core.object.brush.scroll;
-
-import com.sk89q.worldedit.entity.Player;
-
-public interface ScrollTool {
- public boolean increment(Player player, int amount);
-}
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/collection/DifferentialArray.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/collection/DifferentialArray.java
deleted file mode 100644
index b9b227cb8..000000000
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/collection/DifferentialArray.java
+++ /dev/null
@@ -1,312 +0,0 @@
-package com.fastasyncworldedit.core.object.collection;
-
-import com.fastasyncworldedit.core.object.FaweInputStream;
-import com.fastasyncworldedit.core.object.FaweOutputStream;
-import com.fastasyncworldedit.core.object.io.serialize.Serialize;
-import com.fastasyncworldedit.core.util.MainUtil;
-
-import java.io.IOException;
-import java.lang.reflect.Array;
-import java.util.Arrays;
-
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-/**
- * Records changes made through the {@link #setByte(int, byte)} or {@link #setInt(int, int)} method
- * If you are editing the raw data, use {@link #record(Runnable)}
- * @param
- */
-public final class DifferentialArray implements DifferentialCollection {
- private final byte[] dataBytes;
- private byte[] changesBytes;
-
- private final int[] dataInts;
- private int[] changesInts;
-
- private final char[] dataChars;
- private char[] changesChars;
-
- @Serialize
- private final T data;
-
- private T changes;
-
- private boolean changed;
- private int length;
-
- public DifferentialArray(T array) {
- checkNotNull(array);
- Class extends Object> clazz = array.getClass();
- checkArgument(clazz.isArray(), "Data must be an array");
- checkArgument(clazz.getComponentType().isPrimitive(), "Data must be a primitive array");
- this.data = array;
-
- if (array instanceof byte[]) {
- dataBytes = (byte[]) array;
- length = dataBytes.length;
- } else {
- dataBytes = null;
- }
- if (array instanceof int[]) {
- dataInts = (int[]) array;
- length = dataInts.length;
- } else {
- dataInts = null;
- }
- if (array instanceof char[]) {
- dataChars = (char[]) array;
- length = dataChars.length;
- } else {
- dataChars = null;
- }
- }
-
- public void record(Runnable task) {
- if (changes == null) {
- if (data instanceof byte[]) {
- changes = (T) (changesBytes = new byte[length]);
- } else if (data instanceof int[]) {
- changes = (T) (changesInts = new int[length]);
- } else if (data instanceof char[]) {
- changes = (T) (changesChars = new char[length]);
- }
- }
- T tmp;
- boolean changed = this.changed;
- if (changed) {
- tmp = (T) MainUtil.copyNd(data);
- } else {
- tmp = changes;
- System.arraycopy(data, 0, tmp, 0, Array.getLength(data));
- }
- Throwable caught = null;
- try {
- task.run();
- } catch (Throwable e) {
- caught = e;
- task.run();
- }
- if (tmp instanceof int[]) {
- int[] tmpInts = (int[]) tmp;
- for (int i = 0; i < tmpInts.length; i++) {
- int tmpInt = tmpInts[i];
- int dataInt = dataInts[i];
- if (tmpInt != dataInt) {
- this.changed = true;
- tmpInts[i] -= dataInt;
- } else {
- tmpInts[i] = 0;
- }
- }
- if (changed) {
- for (int i = 0; i < tmpInts.length; i++) {
- changesInts[i] += tmpInts[i];
- }
- }
- } else if (tmp instanceof char[]) {
- char[] tmpChars = (char[]) tmp;
- for (int i = 0; i < tmpChars.length; i++) {
- char tmpChar = tmpChars[i];
- char dataChar = dataChars[i];
- if (tmpChar != dataChar) {
- this.changed = true;
- tmpChars[i] -= dataChar;
- } else {
- tmpChars[i] = 0;
- }
- }
- if (changed) {
- for (int i = 0; i < tmpChars.length; i++) {
- changesChars[i] += tmpChars[i];
- }
- }
- } else if (tmp instanceof byte[]) {
- byte[] tmpBytes = (byte[]) tmp;
- for (int i = 0; i < tmpBytes.length; i++) {
- byte tmpByte = tmpBytes[i];
- byte dataByte = dataBytes[i];
- if (tmpByte != dataByte) {
- this.changed = true;
- tmpBytes[i] -= dataByte;
- } else {
- tmpBytes[i] = 0;
- }
- }
- if (changed) {
- for (int i = 0; i < tmpBytes.length; i++) {
- changesBytes[i] += tmpBytes[i];
- }
- }
- }
- if (caught != null) {
- if (caught instanceof RuntimeException) {
- throw (RuntimeException) caught;
- } else {
- throw new RuntimeException(caught);
- }
- }
- }
-
- @Override
- public void flushChanges(FaweOutputStream out) throws IOException {
- boolean modified = isModified();
- out.writeBoolean(modified);
- if (modified) {
- if (dataBytes != null) {
- out.write(changesBytes);
- } else if (dataInts != null) {
- for (int c : changesInts) {
- out.writeVarInt(c);
- }
- } else if (dataChars != null) {
- for (char c : changesChars) {
- out.writeChar(c);
- }
- }
- }
- clearChanges();
- }
-
- @Override
- public void undoChanges(FaweInputStream in) throws IOException {
- boolean modified = in.readBoolean();
- if (modified) {
- if (dataBytes != null) {
- if (changesBytes != null) {
- for (int i = 0; i < dataBytes.length; i++) {
- dataBytes[i] += changesBytes[i];
- }
- }
- for (int i = 0; i < dataBytes.length; i++) {
- int read = in.read();
- dataBytes[i] += read;
- }
- } else if (dataInts != null) {
- if (changesInts != null) {
- for (int i = 0; i < dataInts.length; i++) {
- dataInts[i] += changesInts[i];
- }
- }
- for (int i = 0; i < changesInts.length; i++) {
- dataInts[i] += in.readVarInt();
- }
- } else if (dataChars != null) {
- if (changesChars != null) {
- for (int i = 0; i < dataChars.length; i++) {
- dataChars[i] += changesChars[i];
- }
- }
- for (int i = 0; i < dataChars.length; i++) {
- dataChars[i] += in.readChar();
- }
- }
- }
- clearChanges();
- }
-
- @Override
- public void redoChanges(FaweInputStream in) throws IOException {
- boolean modified = in.readBoolean();
- if (modified) {
- if (dataBytes != null) {
- for (int i = 0; i < dataBytes.length; i++) {
- int read = in.read();
- dataBytes[i] -= read;
- }
- } else if (dataInts != null) {
- for (int i = 0; i < dataChars.length; i++) {
- dataInts[i] -= in.readVarInt();
- }
- } else if (dataChars != null) {
- for (int i = 0; i < dataChars.length; i++) {
- dataChars[i] -= in.readChar();
- }
- }
- }
- clearChanges();
- }
-
- public void clearChanges() {
- if (changed) {
- changed = false;
- if (changes != null) {
- if (changesBytes != null) {
- Arrays.fill(changesBytes, (byte) 0);
- }
- if (changesChars != null) {
- Arrays.fill(changesChars, (char) 0);
- }
- if (changesInts != null) {
- Arrays.fill(changesInts, 0);
- }
- }
- }
- }
-
- public byte[] getByteArray() {
- return dataBytes;
- }
-
- public char[] getCharArray() {
- return dataChars;
- }
-
- public int[] getIntArray() {
- return dataInts;
- }
-
- public boolean isModified() {
- return changed;
- }
-
- @Override
- public T get() {
- return data;
- }
-
- public byte getByte(int index) {
- return dataBytes[index];
- }
-
- public char getChar(int index) {
- return dataChars[index];
- }
-
- public int getInt(int index) {
- return dataInts[index];
- }
-
- public void setByte(int index, byte value) {
- changed = true;
- try {
- changesBytes[index] += (dataBytes[index] - value);
- } catch (NullPointerException ignored) {
- changes = (T) (changesBytes = new byte[dataBytes.length]);
- changesBytes[index] += (dataBytes[index] - value);
- }
- dataBytes[index] = value;
- }
-
- public void setInt(int index, int value) {
- changed = true;
- try {
- changesInts[index] += dataInts[index] - value;
- } catch (NullPointerException ignored) {
- changes = (T) (changesInts = new int[dataInts.length]);
- changesInts[index] += dataInts[index] - value;
- }
- dataInts[index] = value;
- }
-
- public void setChar(int index, char value) {
- changed = true;
- try {
- changesChars[index] += dataChars[index] - value;
- } catch (NullPointerException ignored) {
- changes = (T) (changesChars = new char[dataChars.length]);
- changesChars[index] += dataChars[index] - value;
- }
- dataChars[index] = value;
- }
-}
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/collection/DifferentialBlockBuffer.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/collection/DifferentialBlockBuffer.java
deleted file mode 100644
index 233962161..000000000
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/collection/DifferentialBlockBuffer.java
+++ /dev/null
@@ -1,229 +0,0 @@
-package com.fastasyncworldedit.core.object.collection;
-
-import com.fastasyncworldedit.core.object.FaweInputStream;
-import com.fastasyncworldedit.core.object.FaweOutputStream;
-
-import java.io.IOException;
-import java.lang.reflect.Array;
-
-/**
- * Records changes made through the {@link #set(int, int, int, char)} method
- * Changes are not recorded if you edit the raw data
- */
-public final class DifferentialBlockBuffer implements DifferentialCollection {
-
- private final int width;
- private final int length;
- private final int t1;
- private final int t2;
- private char[][][][][] data;
- private char[][][][][] changes;
-
- public DifferentialBlockBuffer(int width, int length) {
- this.width = width;
- this.length = length;
- this.t1 = (length + 15) >> 4;
- this.t2 = (width + 15) >> 4;
- }
-
- @Override
- public char[][][][][] get() {
- return data;
- }
-
- @Override
- public void flushChanges(FaweOutputStream out) throws IOException {
- boolean modified = isModified();
- out.writeBoolean(modified);
-
- if (modified) {
- writeArray(changes, 0, 0, out);
- }
- clearChanges();
- }
-
- private void writeArray(Object arr, int level, int index, FaweOutputStream out) throws IOException {
- if (level == 4) {
- if (arr != null) {
- int[] level4 = (int[]) arr;
- out.writeVarInt(level4.length);
- for (int c : level4) {
- out.writeVarInt(c);
- }
- } else {
- out.writeVarInt(0);
- }
- } else {
- int len = arr == null ? 0 : Array.getLength(arr);
- out.writeVarInt(len);
- for (int i = 0; i < len; i++) {
- Object elem = Array.get(arr, i);
- writeArray(elem, level + 1, i, out);
- }
- }
- }
-
- @Override
- public void undoChanges(FaweInputStream in) throws IOException {
- if (changes != null && changes.length != 0) {
- throw new IllegalStateException("There are uncommitted changes, please flush first");
- }
- boolean modified = in.readBoolean();
- if (modified) {
- int len = in.readVarInt();
- if (len == 0) {
- data = null;
- } else {
- for (int i = 0; i < len; i++) {
- readArray(data, i, 1, in);
- }
- }
- }
-
- clearChanges();
- }
-
- @Override
- public void redoChanges(FaweInputStream in) throws IOException {
- clearChanges();
- throw new UnsupportedOperationException("Not implemented");
- }
-
- private void readArray(Object dataElem, int index, int level, FaweInputStream in) throws IOException {
- int len = in.readVarInt();
- if (level == 4) {
- int[][] castedElem = (int[][]) dataElem;
- if (len == 0) {
- castedElem[index] = null;
- } else {
- int[] current = castedElem[index];
- for (int i = 0; i < len; i++) {
- current[i] = in.readVarInt();
- }
- }
- } else {
- if (len == 0) {
- Array.set(dataElem, index, null);
- } else {
- Object nextElem = Array.get(dataElem, index);
- for (int i = 0; i < len; i++) {
- readArray(nextElem, i, level + 1, in);
- }
- }
- }
- }
-
- public boolean isModified() {
- return changes != null;
- }
-
- public void clearChanges() {
- changes = null;
- }
-
- public void set(int x, int y, int z, char combined) {
- if (combined == 0) {
- combined = 1;
- }
- int localX = x & 15;
- int localZ = z & 15;
- int chunkX = x >> 4;
- int chunkZ = z >> 4;
- if (data == null) {
- data = new char[t1][][][][];
- changes = new char[0][][][][];
- }
-
- char[][][][] arr = data[chunkZ];
- if (arr == null) {
- arr = data[chunkZ] = new char[t2][][][];
- }
- char[][][] arr2 = arr[chunkX];
- if (arr2 == null) {
- arr2 = arr[chunkX] = new char[256][][];
- }
-
- char[][] yMap = arr2[y];
- if (yMap == null) {
- arr2[y] = yMap = new char[16][];
- }
- boolean newSection;
- int current;
- char[] zMap = yMap[localZ];
- if (zMap == null) {
- yMap[localZ] = zMap = new char[16];
-
- if (changes == null) {
- changes = new char[t1][][][][];
- } else if (changes != null && changes.length != 0) {
- initialChange(changes, chunkX, chunkZ, localX, localZ, y, (char) -combined);
- }
-
- } else {
- if (changes == null || changes.length == 0) {
- changes = new char[t1][][][][];
- }
- appendChange(changes, chunkX, chunkZ, localX, localZ, y, (char) (zMap[localX] - combined));
- }
-
- zMap[localX] = combined;
- }
-
- private void initialChange(char[][][][][] src, int chunkX, int chunkZ, int localX, int localZ, int y, char combined) {
- char[][][][] arr = src[chunkZ];
- if (arr == null) {
- src[chunkZ] = new char[0][][][];
- return;
- } else if (arr.length == 0) {
- return;
- }
-
- char[][][] arr2 = arr[chunkX];
- if (arr2 == null) {
- arr[chunkX] = new char[0][][];
- return;
- } else if (arr2.length == 0) {
- return;
- }
-
- char[][] yMap = arr2[y];
- if (yMap == null) {
- arr2[y] = new char[0][];
- return;
- } else if (yMap.length == 0) {
- return;
- }
-
- char[] zMap = yMap[localZ];
- if (zMap == null) {
- yMap[localZ] = new char[0];
- return;
- } else if (zMap.length == 0) {
- return;
- }
-
- int current = zMap[localX];
- zMap[localX] = combined;
- }
-
- private void appendChange(char[][][][][] src, int chunkX, int chunkZ, int localX, int localZ, int y, char combined) {
- char[][][][] arr = src[chunkZ];
- if (arr == null || arr.length == 0) {
- arr = src[chunkZ] = new char[t2][][][];
- }
- char[][][] arr2 = arr[chunkX];
- if (arr2 == null || arr2.length == 0) {
- arr2 = arr[chunkX] = new char[256][][];
- }
-
- char[][] yMap = arr2[y];
- if (yMap == null || yMap.length == 0) {
- arr2[y] = yMap = new char[16][];
- }
- char[] zMap = yMap[localZ];
- if (zMap == null || zMap.length == 0) {
- yMap[localZ] = zMap = new char[16];
- }
- zMap[localX] = combined;
- }
-}
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/collection/DifferentialCharBlockBuffer.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/collection/DifferentialCharBlockBuffer.java
deleted file mode 100644
index 61ce7de46..000000000
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/collection/DifferentialCharBlockBuffer.java
+++ /dev/null
@@ -1,229 +0,0 @@
-package com.fastasyncworldedit.core.object.collection;
-
-import com.fastasyncworldedit.core.object.FaweInputStream;
-import com.fastasyncworldedit.core.object.FaweOutputStream;
-
-import java.io.IOException;
-import java.lang.reflect.Array;
-
-/**
- * Records changes made through the {@link #set(int, int, int, char)} method
- * Changes are not recorded if you edit the raw data
- */
-public final class DifferentialCharBlockBuffer implements DifferentialCollection {
-
- private final int width;
- private final int length;
- private final int t1;
- private final int t2;
- private char[][][][][] data;
- private char[][][][][] changes;
-
- public DifferentialCharBlockBuffer(int width, int length) {
- this.width = width;
- this.length = length;
- this.t1 = (length + 15) >> 4;
- this.t2 = (width + 15) >> 4;
- }
-
- @Override
- public char[][][][][] get() {
- return data;
- }
-
- @Override
- public void flushChanges(FaweOutputStream out) throws IOException {
- boolean modified = isModified();
- out.writeBoolean(modified);
-
- if (modified) {
- writeArray(changes, 0, 0, out);
- }
- clearChanges();
- }
-
- private void writeArray(Object arr, int level, int index, FaweOutputStream out) throws IOException {
- if (level == 4) {
- if (arr != null) {
- char[] level4 = (char[]) arr;
- out.writeVarInt(level4.length);
- for (char c : level4) {
- out.writeChar(c);
- }
- } else {
- out.writeVarInt(0);
- }
- } else {
- int len = arr == null ? 0 : Array.getLength(arr);
- out.writeVarInt(len);
- for (int i = 0; i < len; i++) {
- Object elem = Array.get(arr, i);
- writeArray(elem, level + 1, i, out);
- }
- }
- }
-
- @Override
- public void undoChanges(FaweInputStream in) throws IOException {
- if (changes != null && changes.length != 0) {
- throw new IllegalStateException("There are uncommitted changes, please flush first");
- }
- boolean modified = in.readBoolean();
- if (modified) {
- int len = in.readVarInt();
- if (len == 0) {
- data = null;
- } else {
- for (int i = 0; i < len; i++) {
- readArray(data, i, 1, in);
- }
- }
- }
-
- clearChanges();
- }
-
- @Override
- public void redoChanges(FaweInputStream in) throws IOException {
- clearChanges();
- throw new UnsupportedOperationException("Not implemented");
- }
-
- private void readArray(Object dataElem, int index, int level, FaweInputStream in) throws IOException {
- int len = in.readVarInt();
- if (level == 4) {
- char[][] castedElem = (char[][]) dataElem;
- if (len == 0) {
- castedElem[index] = null;
- } else {
- char[] current = castedElem[index];
- for (int i = 0; i < len; i++) {
- current[i] = in.readChar();
- }
- }
- } else {
- if (len == 0) {
- Array.set(dataElem, index, null);
- } else {
- Object nextElem = Array.get(dataElem, index);
- for (int i = 0; i < len; i++) {
- readArray(nextElem, i, level + 1, in);
- }
- }
- }
- }
-
- public boolean isModified() {
- return changes != null;
- }
-
- public void clearChanges() {
- changes = null;
- }
-
- public void set(int x, int y, int z, char combined) {
- if (combined == 0) {
- combined = 1;
- }
- int localX = x & 15;
- int localZ = z & 15;
- int chunkX = x >> 4;
- int chunkZ = z >> 4;
- if (data == null) {
- data = new char[t1][][][][];
- changes = new char[0][][][][];
- }
-
- char[][][][] arr = data[chunkZ];
- if (arr == null) {
- arr = data[chunkZ] = new char[t2][][][];
- }
- char[][][] arr2 = arr[chunkX];
- if (arr2 == null) {
- arr2 = arr[chunkX] = new char[256][][];
- }
-
- char[][] yMap = arr2[y];
- if (yMap == null) {
- arr2[y] = yMap = new char[16][];
- }
- boolean newSection;
- char current;
- char[] zMap = yMap[localZ];
- if (zMap == null) {
- yMap[localZ] = zMap = new char[16];
-
- if (changes == null) {
- changes = new char[t1][][][][];
- } else if (changes != null && changes.length != 0) {
- initialChange(changes, chunkX, chunkZ, localX, localZ, y, (char) -combined);
- }
-
- } else {
- if (changes == null || changes.length == 0) {
- changes = new char[t1][][][][];
- }
- appendChange(changes, chunkX, chunkZ, localX, localZ, y, (char) (zMap[localX] - combined));
- }
-
- zMap[localX] = combined;
- }
-
- private void initialChange(char[][][][][] src, int chunkX, int chunkZ, int localX, int localZ, int y, char combined) {
- char[][][][] arr = src[chunkZ];
- if (arr == null) {
- src[chunkZ] = new char[0][][][];
- return;
- } else if (arr.length == 0) {
- return;
- }
-
- char[][][] arr2 = arr[chunkX];
- if (arr2 == null) {
- arr[chunkX] = new char[0][][];
- return;
- } else if (arr2.length == 0) {
- return;
- }
-
- char[][] yMap = arr2[y];
- if (yMap == null) {
- arr2[y] = new char[0][];
- return;
- } else if (yMap.length == 0) {
- return;
- }
-
- char[] zMap = yMap[localZ];
- if (zMap == null) {
- yMap[localZ] = new char[0];
- return;
- } else if (zMap.length == 0) {
- return;
- }
-
- char current = zMap[localX];
- zMap[localX] = combined;
- }
-
- private void appendChange(char[][][][][] src, int chunkX, int chunkZ, int localX, int localZ, int y, char combined) {
- char[][][][] arr = src[chunkZ];
- if (arr == null || arr.length == 0) {
- arr = src[chunkZ] = new char[t2][][][];
- }
- char[][][] arr2 = arr[chunkX];
- if (arr2 == null || arr2.length == 0) {
- arr2 = arr[chunkX] = new char[256][][];
- }
-
- char[][] yMap = arr2[y];
- if (yMap == null || yMap.length == 0) {
- arr2[y] = yMap = new char[16][];
- }
- char[] zMap = yMap[localZ];
- if (zMap == null || zMap.length == 0) {
- yMap[localZ] = zMap = new char[16];
- }
- zMap[localX] = combined;
- }
-}
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/collection/DifferentialCollection.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/collection/DifferentialCollection.java
deleted file mode 100644
index e3d192e2f..000000000
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/collection/DifferentialCollection.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package com.fastasyncworldedit.core.object.collection;
-
-import com.fastasyncworldedit.core.object.change.StreamChange;
-
-public interface DifferentialCollection extends StreamChange {
- public T get();
-}
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/collection/LocalBlockVector2DSet.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/collection/LocalBlockVector2DSet.java
deleted file mode 100644
index 25dcb1e0c..000000000
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/collection/LocalBlockVector2DSet.java
+++ /dev/null
@@ -1,250 +0,0 @@
-package com.fastasyncworldedit.core.object.collection;
-
-import com.fastasyncworldedit.core.util.MathMan;
-import com.sk89q.worldedit.math.BlockVector2;
-import com.sk89q.worldedit.math.MutableBlockVector2;
-import org.jetbrains.annotations.NotNull;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Set;
-
-/**
- * The LocalPartitionedBlockVector2DSet is a Memory and CPU optimized Set for storing Vector2Ds which are all in a local region
- * - All Vector2Ds must be within x[0,32768), y[0,32768)
- * - This will use 8 bytes for every 64 Vector2Ds (about 800x less than a HashSet)
- */
-public class LocalBlockVector2DSet implements Set {
- private final SparseBitSet set;
- private final MutableBlockVector2 mutable = new MutableBlockVector2();
-
- public LocalBlockVector2DSet() {
- this.set = new SparseBitSet();
- }
-
- public SparseBitSet getBitSet() {
- return set;
- }
-
- @Override
- public int size() {
- return set.cardinality();
- }
-
- @Override
- public boolean isEmpty() {
- return set.isEmpty();
- }
-
- public boolean contains(int x, int y) {
- return set.get(MathMan.pairSearchCoords(x, y));
- }
-
- @Override
- public boolean contains(Object o) {
- if (o instanceof BlockVector2) {
- BlockVector2 v = (BlockVector2) o;
- return contains(v.getBlockX(), v.getBlockZ());
- }
- return false;
- }
-
- public boolean containsRadius(int x, int y, int radius) {
- int size = size();
- if (size == 0) {
- return false;
- }
- if (radius <= 0 || size == 1) {
- return contains(x, y);
- }
-// int centerIndex = MathMan.pairSearchCoords(x, y);
- int length = (radius << 1) + 1;
- if (size() < length * length) {
- int index = -1;
- int count = 0;
- while ((index = set.nextSetBit(index + 1)) != -1) {
-// if (index == centerIndex) continue;
- int curx = MathMan.unpairSearchCoordsX(index);
- int cury = MathMan.unpairSearchCoordsY(index);
- if (Math.abs(curx - x) <= radius && Math.abs(cury - y) <= radius) {
- return true;
- }
- }
- return false;
- }
- int bcx = Math.max(0, (x - radius) >> 4);
- int bcy = Math.max(0, (y - radius) >> 4);
- int tcx = Math.min(2047, (x + radius) >> 4);
- int tcy = Math.min(2047, (y + radius) >> 4);
- for (int cy = bcy; cy <= tcy; cy++) {
- for (int cx = bcx; cx <= tcx; cx++) {
- int index = MathMan.pairSearchCoords(cx << 4, cy << 4) - 1;
- int endIndex = index + 256;
- while ((index = set.nextSetBit(index + 1)) != -1 && index <= endIndex) {
-// if (index == centerIndex) continue;
- int curx = MathMan.unpairSearchCoordsX(index);
- int cury = MathMan.unpairSearchCoordsY(index);
- if (Math.abs(curx - x) <= radius && Math.abs(cury - y) <= radius) {
- return true;
- }
- }
- }
- }
- return false;
- }
-
- public BlockVector2 getIndex(int getIndex) {
- int size = size();
- if (getIndex > size) {
- return null;
- }
- int index = -1;
- for (int i = 0; i <= getIndex; i++) {
- index = set.nextSetBit(index + 1);
- }
- if (index != -1) {
- int x = MathMan.unpairSearchCoordsX(index);
- int y = MathMan.unpairSearchCoordsY(index);
- return mutable.setComponents(x, y);
- }
- return null;
- }
-
- @Override
- public Iterator iterator() {
- return new Iterator() {
- int index = set.nextSetBit(0);
- int previous = -1;
-
- @Override
- public void remove() {
- set.clear(previous);
- }
-
- @Override
- public boolean hasNext() {
- return index != -1;
- }
-
- @Override
- public BlockVector2 next() {
- if (index != -1) {
- int x = MathMan.unpairSearchCoordsX(index);
- int y = MathMan.unpairSearchCoordsY(index);
- mutable.setComponents(x, y);
- previous = index;
- index = set.nextSetBit(index + 1);
- return mutable;
- }
- return null;
- }
- };
- }
-
- @Override
- public Object[] toArray() {
- return toArray((Object[]) null);
- }
-
- @Override
- public T[] toArray(T[] array) {
- int size = size();
- if (array == null || array.length < size) {
- array = (T[]) new BlockVector2[size];
- }
- int index = 0;
- for (int i = 0; i < size; i++) {
- index = set.nextSetBit(index);
- int x = MathMan.unpairSearchCoordsX(index);
- int y = MathMan.unpairSearchCoordsY(index);
- array[i] = (T) BlockVector2.at(x, y);
- index++;
- }
- return array;
- }
-
- public boolean add(int x, int y) {
- if (x < 0 || x > 32766 || y < 0 || y > 32766) {
- throw new UnsupportedOperationException("LocalVector2DSet can only contain Vector2Ds within 1024 blocks (cuboid) of the first entry. ");
- }
- int index = getIndex(x, y);
- if (set.get(index)) {
- return false;
- } else {
- set.set(index);
- return true;
- }
- }
-
- @Override
- public boolean add(BlockVector2 vector) {
- return add(vector.getBlockX(), vector.getBlockZ());
- }
-
- private int getIndex(BlockVector2 vector) {
- return MathMan.pairSearchCoords(vector.getBlockX(), vector.getBlockZ());
- }
-
- private int getIndex(int x, int y) {
- return MathMan.pairSearchCoords(x, y);
- }
-
- public boolean remove(int x, int y) {
- if (x < 0 || x > 32766 || y < 0 || y > 32766) {
- return false;
- }
- int index = MathMan.pairSearchCoords(x, y);
- boolean value = set.get(index);
- if (value) {
- set.clear(index);
- }
- return value;
- }
-
- @Override
- public boolean remove(Object o) {
- if (o instanceof BlockVector2) {
- BlockVector2 v = (BlockVector2) o;
- return remove(v.getBlockX(), v.getBlockZ());
- }
- return false;
- }
-
- @Override
- public boolean containsAll(Collection> c) {
- return c.stream().allMatch(this::contains);
- }
-
- @Override
- public boolean addAll(Collection extends BlockVector2> c) {
- return c.stream().map(this::add).reduce(false, (a, b) -> a || b);
- }
-
- @Override
- public boolean retainAll(@NotNull Collection> c) {
- boolean result = false;
- int size = size();
- int index = -1;
- for (int i = 0; i < size; i++) {
- index = set.nextSetBit(index + 1);
- int x = MathMan.unpairSearchCoordsX(index);
- int y = MathMan.unpairSearchCoordsY(index);
- mutable.setComponents(x, y);
- if (!c.contains(mutable)) {
- result = true;
- set.clear(index);
- }
- }
- return result;
- }
-
- @Override
- public boolean removeAll(Collection> c) {
- return c.stream().map(this::remove).reduce(false, (a, b) -> a || b);
- }
-
- @Override
- public void clear() {
- set.clear();
- }
-}
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/collection/ObjObjMap.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/collection/ObjObjMap.java
deleted file mode 100644
index cddb1b302..000000000
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/collection/ObjObjMap.java
+++ /dev/null
@@ -1,233 +0,0 @@
-package com.fastasyncworldedit.core.object.collection;
-
-import java.util.Arrays;
-import javax.annotation.Nonnull;
-
-import static it.unimi.dsi.fastutil.HashCommon.arraySize;
-
-public class ObjObjMap {
-
- private static final Object FREE_KEY = new Object();
- private static final Object REMOVED_KEY = new Object();
-
- /**
- * Keys and values
- */
- private Object[] m_data;
-
- /**
- * Value for the null key (if inserted into a map)
- */
- private Object m_nullValue;
- private boolean m_hasNull;
-
- /**
- * Fill factor, must be between (0 and 1)
- */
- private final float m_fillFactor;
- /**
- * We will resize a map once it reaches this size
- */
- private int m_threshold;
- /**
- * Current map size
- */
- private int m_size;
- /**
- * Mask to calculate the original position
- */
- private int m_mask;
- /**
- * Mask to wrap the actual array pointer
- */
- private int m_mask2;
-
- public ObjObjMap(int size, float fillFactor) {
- if (fillFactor <= 0 || fillFactor >= 1) {
- throw new IllegalArgumentException("FillFactor must be in (0, 1)");
- }
- if (size <= 0) {
- throw new IllegalArgumentException("Size must be positive!");
- }
- final int capacity = arraySize(size, fillFactor);
- m_mask = capacity - 1;
- m_mask2 = capacity * 2 - 1;
- m_fillFactor = fillFactor;
-
- m_data = new Object[capacity * 2];
- Arrays.fill(m_data, FREE_KEY);
-
- m_threshold = (int) (capacity * fillFactor);
- }
-
- public V get(@Nonnull K key) {
-// if ( key == null )
-// return (V) m_nullValue; //we null it on remove, so safe not to check a flag here
-
- int ptr = (key.hashCode() & m_mask) << 1;
- Object k = m_data[ptr];
-
-// if ( k == FREE_KEY )
-// return null; //end of chain already
- if (k == key) {//we check FREE and REMOVED prior to this call
- return (V) m_data[ptr + 1];
- }
- while (true) {
- ptr = ptr + 2 & m_mask2; //that's next index
- k = m_data[ptr];
-// if ( k == FREE_KEY )
-// return null;
- if (k == key) {
- return (V) m_data[ptr + 1];
- }
- }
- }
-
- public V put(K key, V value) {
- if (key == null) {
- return insertNullKey(value);
- }
-
- int ptr = getStartIndex(key) << 1;
- Object k = m_data[ptr];
-
- if (k == FREE_KEY) {//end of chain already
- m_data[ptr] = key;
- m_data[ptr + 1] = value;
- if (m_size >= m_threshold) {
- rehash(m_data.length * 2); //size is set inside
- } else {
- ++m_size;
- }
- return null;
- } else if (k == key) { //we check FREE and REMOVED prior to this call
- final Object ret = m_data[ptr + 1];
- m_data[ptr + 1] = value;
- return (V) ret;
- }
-
- int firstRemoved = -1;
- if (k == REMOVED_KEY) {
- firstRemoved = ptr; //we may find a key later
- }
-
- while (true) {
- ptr = ptr + 2 & m_mask2; //that's next index calculation
- k = m_data[ptr];
- if (k == FREE_KEY) {
- if (firstRemoved != -1) {
- ptr = firstRemoved;
- }
- m_data[ptr] = key;
- m_data[ptr + 1] = value;
- if (m_size >= m_threshold) {
- rehash(m_data.length * 2); //size is set inside
- } else {
- ++m_size;
- }
- return null;
- } else if (k == key) {
- final Object ret = m_data[ptr + 1];
- m_data[ptr + 1] = value;
- return (V) ret;
- } else if (k == REMOVED_KEY) {
- if (firstRemoved == -1) {
- firstRemoved = ptr;
- }
- }
- }
- }
-
- public V remove(K key) {
- if (key == null) {
- return removeNullKey();
- }
-
- int ptr = getStartIndex(key) << 1;
- Object k = m_data[ptr];
- if (k == FREE_KEY) {
- return null; //end of chain already
- } else if (k == key) { //we check FREE and REMOVED prior to this call
- --m_size;
- if (m_data[ptr + 2 & m_mask2] == FREE_KEY) {
- m_data[ptr] = FREE_KEY;
- } else {
- m_data[ptr] = REMOVED_KEY;
- }
- final V ret = (V) m_data[ptr + 1];
- m_data[ptr + 1] = null;
- return ret;
- }
- while (true) {
- ptr = ptr + 2 & m_mask2; //that's next index calculation
- k = m_data[ptr];
- if (k == FREE_KEY) {
- return null;
- } else if (k == key) {
- --m_size;
- if (m_data[ptr + 2 & m_mask2] == FREE_KEY) {
- m_data[ptr] = FREE_KEY;
- } else {
- m_data[ptr] = REMOVED_KEY;
- }
- final V ret = (V) m_data[ptr + 1];
- m_data[ptr + 1] = null;
- return ret;
- }
- }
- }
-
- private V insertNullKey(V value) {
- if (m_hasNull) {
- final Object ret = m_nullValue;
- m_nullValue = value;
- return (V) ret;
- } else {
- m_nullValue = value;
- ++m_size;
- return null;
- }
- }
-
- private V removeNullKey() {
- if (m_hasNull) {
- final Object ret = m_nullValue;
- m_nullValue = null;
- m_hasNull = false;
- --m_size;
- return (V) ret;
- } else {
- return null;
- }
- }
-
- public int size() {
- return m_size;
- }
-
- private void rehash(int newCapacity) {
- m_threshold = (int) (newCapacity / 2 * m_fillFactor);
- m_mask = newCapacity / 2 - 1;
- m_mask2 = newCapacity - 1;
-
- final int oldCapacity = m_data.length;
- final Object[] oldData = m_data;
-
- m_data = new Object[newCapacity];
- Arrays.fill(m_data, FREE_KEY);
-
- m_size = m_hasNull ? 1 : 0;
-
- for (int i = 0; i < oldCapacity; i += 2) {
- final Object oldKey = oldData[i];
- if (oldKey != FREE_KEY && oldKey != REMOVED_KEY) {
- put((K) oldKey, (V) oldData[i + 1]);
- }
- }
- }
-
- public int getStartIndex(Object key) {
- //key is not null here
- return key.hashCode() & m_mask;
- }
-}
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/collection/SoftHashMap.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/collection/SoftHashMap.java
deleted file mode 100644
index 2e2c0a0c5..000000000
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/collection/SoftHashMap.java
+++ /dev/null
@@ -1,326 +0,0 @@
-package com.fastasyncworldedit.core.object.collection;
-
-import org.jetbrains.annotations.NotNull;
-
-import java.lang.ref.ReferenceQueue;
-import java.lang.ref.SoftReference;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Queue;
-import java.util.Set;
-import java.util.WeakHashMap;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentLinkedQueue;
-import java.util.concurrent.locks.ReentrantLock;
-
-
-/**
- * A SoftHashMap is a memory-constrained map that stores its values in
- * {@link SoftReference SoftReference}s. (Contrast this with the JDK's
- * {@link WeakHashMap WeakHashMap}, which uses weak references for its keys, which is of little value if you
- * want the cache to auto-resize itself based on memory constraints).
- *
- * Having the values wrapped by soft references allows the cache to automatically reduce its size based on memory
- * limitations and garbage collection. This ensures that the cache will not cause memory leaks by holding strong
- * references to all of its values.
- *
- * This class is a generics-enabled Map based on initial ideas from Heinz Kabutz's and Sydney Redelinghuys's
- * publicly posted version (with their approval), with
- * continued modifications. It was copied from the Apache Shiro framework.
- *
- * This implementation is thread-safe and usable in concurrent environments.
- *
- * @see SoftReference
- * @see Apache Shiro
- * @since 0.8
- */
-public class SoftHashMap implements Map {
-
- /**
- * The default value of the RETENTION_SIZE attribute, equal to 100.
- */
- private static final int DEFAULT_RETENTION_SIZE = 100;
-
- /**
- * The internal HashMap that will hold the SoftReference.
- */
- private final Map> map;
-
- /**
- * The number of strong references to hold internally, that is, the number of instances to prevent
- * from being garbage collected automatically (unlike other soft references).
- */
- private final int RETENTION_SIZE;
-
- /**
- * The FIFO list of strong references (not to be garbage collected), order of last access.
- */
- private final Queue strongReferences; //guarded by 'strongReferencesLock'
- private final ReentrantLock strongReferencesLock;
-
- /**
- * Reference queue for cleared SoftReference objects.
- */
- private final ReferenceQueue super V> queue;
-
- /**
- * Creates a new SoftHashMap with a default retention size size of
- * {@link #DEFAULT_RETENTION_SIZE DEFAULT_RETENTION_SIZE} (100 entries).
- *
- * @see #SoftHashMap(int)
- */
- public SoftHashMap() {
- this(DEFAULT_RETENTION_SIZE);
- }
-
- /**
- * Creates a new SoftHashMap with the specified retention size.
- *
- * The retention size (n) is the total number of most recent entries in the map that will be strongly referenced
- * (ie 'retained') to prevent them from being eagerly garbage collected. That is, the point of a SoftHashMap is to
- * allow the garbage collector to remove as many entries from this map as it desires, but there will always be (n)
- * elements retained after a GC due to the strong references.
- *
- * Note that in a highly concurrent environments the exact total number of strong references may differ slightly
- * than the actual {@code retentionSize} value. This number is intended to be a best-effort retention low
- * water mark.
- *
- * @param retentionSize the total number of most recent entries in the map that will be strongly referenced
- * (retained), preventing them from being eagerly garbage collected by the JVM.
- */
- public SoftHashMap(int retentionSize) {
- super();
- RETENTION_SIZE = Math.max(0, retentionSize);
- queue = new ReferenceQueue<>();
- strongReferencesLock = new ReentrantLock();
- map = new ConcurrentHashMap<>();
- strongReferences = new ConcurrentLinkedQueue<>();
- }
-
- /**
- * Creates a {@code SoftHashMap} backed by the specified {@code source}, with a default retention
- * size of {@link #DEFAULT_RETENTION_SIZE DEFAULT_RETENTION_SIZE} (100 entries).
- *
- * @param source the backing map to populate this {@code SoftHashMap}
- * @see #SoftHashMap(Map, int)
- */
- public SoftHashMap(Map source) {
- this(DEFAULT_RETENTION_SIZE);
- putAll(source);
- }
-
- /**
- * Creates a {@code SoftHashMap} backed by the specified {@code source}, with the specified retention size.
- *
- * The retention size (n) is the total number of most recent entries in the map that will be strongly referenced
- * (ie 'retained') to prevent them from being eagerly garbage collected. That is, the point of a SoftHashMap is to
- * allow the garbage collector to remove as many entries from this map as it desires, but there will always be (n)
- * elements retained after a GC due to the strong references.
- *
- * Note that in a highly concurrent environments the exact total number of strong references may differ slightly
- * than the actual {@code retentionSize} value. This number is intended to be a best-effort retention low
- * water mark.
- *
- * @param source the backing map to populate this {@code SoftHashMap}
- * @param retentionSize the total number of most recent entries in the map that will be strongly referenced
- * (retained), preventing them from being eagerly garbage collected by the JVM.
- */
- public SoftHashMap(Map source, int retentionSize) {
- this(retentionSize);
- putAll(source);
- }
-
- @Override
- public V get(Object key) {
- processQueue();
-
- V result = null;
- SoftValue value = map.get(key);
-
- if (value != null) {
- //unwrap the 'real' value from the SoftReference
- result = value.get();
- if (result == null) {
- //The wrapped value was garbage collected, so remove this entry from the backing map:
- //noinspection SuspiciousMethodCalls
- map.remove(key);
- } else {
- //Add this value to the beginning of the strong reference queue (FIFO).
- addToStrongReferences(result);
- }
- }
- return result;
- }
-
- private void addToStrongReferences(V result) {
- strongReferencesLock.lock();
- try {
- strongReferences.add(result);
- trimStrongReferencesIfNecessary();
- } finally {
- strongReferencesLock.unlock();
- }
-
- }
-
- //Guarded by the strongReferencesLock in the addToStrongReferences method
-
- private void trimStrongReferencesIfNecessary() {
- //trim the strong ref queue if necessary:
- while (strongReferences.size() > RETENTION_SIZE) {
- strongReferences.poll();
- }
- }
-
- /**
- * Traverses the ReferenceQueue and removes garbage-collected SoftValue objects from the backing map
- * by looking them up using the SoftValue.key data member.
- */
- private void processQueue() {
- SoftValue sv;
- while ((sv = (SoftValue) queue.poll()) != null) {
- //noinspection SuspiciousMethodCalls
- map.remove(sv.key); // we can access private data!
- }
- }
-
- @Override
- public boolean isEmpty() {
- processQueue();
- return map.isEmpty();
- }
-
- @Override
- public boolean containsKey(Object key) {
- processQueue();
- return map.containsKey(key);
- }
-
- @Override
- public boolean containsValue(Object value) {
- processQueue();
- Collection> values = values();
- return values.contains(value);
- }
-
- @Override
- public void putAll(@NotNull Map extends K, ? extends V> m) {
- if (m.isEmpty()) {
- processQueue();
- return;
- }
- for (Map.Entry extends K, ? extends V> entry : m.entrySet()) {
- put(entry.getKey(), entry.getValue());
- }
- }
-
- @Override
- @NotNull
- public Set keySet() {
- processQueue();
- return map.keySet();
- }
-
- @Override
- @NotNull
- public Collection values() {
- processQueue();
- Collection keys = map.keySet();
- if (keys.isEmpty()) {
- //noinspection unchecked
- return Collections.emptySet();
- }
- Collection values = new ArrayList<>(keys.size());
- for (K key : keys) {
- V v = get(key);
- if (v != null) {
- values.add(v);
- }
- }
- return values;
- }
-
- /**
- * Creates a new entry, but wraps the value in a SoftValue instance to enable auto garbage collection.
- */
- @Override
- public V put(K key, V value) {
- processQueue(); // throw out garbage collected values first
- SoftValue sv = new SoftValue<>(value, key, queue);
- SoftValue previous = map.put(key, sv);
- addToStrongReferences(value);
- return previous != null ? previous.get() : null;
- }
-
- @Override
- public V remove(Object key) {
- processQueue(); // throw out garbage collected values first
- SoftValue raw = map.remove(key);
- return raw != null ? raw.get() : null;
- }
-
- @Override
- public void clear() {
- strongReferencesLock.lock();
- try {
- strongReferences.clear();
- } finally {
- strongReferencesLock.unlock();
- }
- processQueue(); // throw out garbage collected values
- map.clear();
- }
-
- @Override
- public int size() {
- processQueue(); // throw out garbage collected values first
- return map.size();
- }
-
- @Override
- @NotNull
- public Set> entrySet() {
- processQueue(); // throw out garbage collected values first
- Collection keys = map.keySet();
- if (keys.isEmpty()) {
- //noinspection unchecked
- return Collections.emptySet();
- }
-
- Map kvPairs = new HashMap<>(keys.size());
- for (K key : keys) {
- V v = get(key);
- if (v != null) {
- kvPairs.put(key, v);
- }
- }
- return kvPairs.entrySet();
- }
-
- /**
- * We define our own subclass of SoftReference which contains
- * not only the value but also the key to make it easier to find
- * the entry in the HashMap after it's been garbage collected.
- */
- private static class SoftValue extends SoftReference {
-
- private final K key;
-
- /**
- * Constructs a new instance, wrapping the value, key, and queue, as
- * required by the superclass.
- *
- * @param value the map value
- * @param key the map key
- * @param queue the soft reference queue to poll to determine if the entry had been reaped by the GC.
- */
- private SoftValue(V value, K key, ReferenceQueue super V> queue) {
- super(value, queue);
- this.key = key;
- }
-
- }
-}
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/collection/SparseBitSet.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/collection/SparseBitSet.java
deleted file mode 100644
index 43d43ba8f..000000000
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/collection/SparseBitSet.java
+++ /dev/null
@@ -1,3097 +0,0 @@
-package com.fastasyncworldedit.core.object.collection;
-
-/*- This software is the work of Paladin Software International, Incorporated,
- * based upon previous work done for and by Sun Microsystems, Inc. */
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-
-/**
- * This class implements a set of bits that grows as needed. Each bit of the
- * bit set represents a boolean value. The values of a
- * SparseBitSet are indexed by non-negative integers.
- * Individual indexed values may be examined, set, cleared, or modified by
- * logical operations. One SparseBitSet or logical value may be
- * used to modify the contents of (another) SparseBitSet through
- * logical AND, logical inclusive OR, logical exclusive
- * OR, and And NOT operations over all or part of the bit sets.
- *
- * All values in a bit set initially have the value false.
- *
- * Every bit set has a current size, which is the number of bits of space
- * nominally in use by the bit set from the first set bit to just after
- * the last set bit. The length of the bit set effectively tells the position
- * available after the last bit of the SparseBitSet.
- *
- * The maximum cardinality of a SparseBitSet is
- * Integer.MAX_VALUE, which means the bits of a
- * SparseBitSet are labelled
- * 0 .. Integer.MAX_VALUE − 1.
- * After the last set bit of a SparseBitSet, any attempt to find
- * a subsequent bit (nextSetBit()), will return an value of −1.
- * If an attempt is made to use nextClearBit(), and all the bits are
- * set from the starting position of the search to the bit labelled
- * Integer.MAX_VALUE − 1, then similarly −1
- * will be returned.
- *
- * Unless otherwise noted, passing a null parameter to any of the methods in
- * a SparseBitSet will result in a
- * NullPointerException.
- *
- * A SparseBitSet is not safe for multi-threaded use without
- * external synchronization.
- *
- * @author Bruce K. Haddon
- * @author Arthur van Hoff
- * @author Michael McCloskey
- * @author Martin Buchholz
- * @version 1.0, 2009-03-17
- * @since 1.6
- */
-@SuppressWarnings("ALL")
-public class SparseBitSet implements Cloneable, Serializable
-{
- /* My apologies for listing all the additional authors, but concepts, code,
- and even comments have been re-used in this class definition from code in
- the JDK that was written and/or maintained by these people. I owe a debt,
- which I acknowledge. But they are in no way responsible for what ever
- misuse I have made of their work.
- Bruce K. Haddon
-
- The representation of a SparseBitSet is packed into "words", and the words
- are stored in arrays which are here referred to as "blocks." Blocks are
- accessed by two levels of indirection from the master "level 1" (whole)
- set array through second level arrays called "areas" (making the blocks
- "level3"). A "word" is a long, consisting of 64 bits, requiring six address
- bits to select a bit within a word (and this is considered in places to be
- a "level4"). This choice of a long for "word" is determined purely by
- performance concerns, and is built into the implementation in a deep way,
- because the references to blocks are always of the form "long[]." (This
- does not mean that blocks could not be changed to arrays of ints, but it
- would take some extensive work.)
-
- The fact that there are three levels is also deeply involved in the
- scanning algorithms, meaning that the accesses are always nested three
- deep. Again, the change this might be a large amount of work. On the
- other hand, these three levels have proven, so far, to provide adequate
- speed, and an storage efficient way to deal with sparseness.
-
- For simplicity, the level3 blocks and the level2 areas are always "full"
- size, i.e., LENGTH3 and LENGTH2 respectively, and for consistency, the
- fourth level is of length LENGTH4. The level1 structure is of variable
- length (as this may save scanning several thousand null pointers, and
- careful consideration must be taken of this at all times, in particular,
- when choosing to increase the size (see resize()). The only place where
- this array is reduced in size is when a clone is made, in which case it is
- created with the smallest size, and allowed to grow as entries are copied
- to it. That all the arrays are kept to power-of-2 sizes is a programming
- convenience (permitting shifts and masks).
-
- Whenever possible, a level 3 block that contains no bits (all the words are
- zero, is discarded, and its reference is replaced by a null value.
- Similarly, level 2 areas that contain only null pointers (to level 3
- blocks) are discarded, and their references replaced by null values. This
- is the "normalized" condition, but does not have to be nor is strictly
- enforced. The operations still work if the representation is partially or
- totally "denormalized." In particular, the methods that deal with single
- bits (setting, flipping, clearing, etc.) do not attempt to normalize the
- set, in the interests of speed. However, when a set is scanned as the
- resultant set of some operation, then, in most cases, the set will be
- normalized--the exception being level2 areas that are not completely scanned
- in a particular pass.
-
- The sizes of the blocks and areas has been the result of some investigation
- with varying sizes, and the sizes selected appear to represent a reasonable
- "sweet" spot. There is, of course, no guarantee that these are the best
- for all possible situations, but, given that not having these the same
- for all bit sets would be hopelessly complex (bad enough as is), these
- values appear to be a fair compromise. */
-
- /**
- * This value controls for format of the toString() output.
- * @see #toStringCompaction(int)
- */
- protected transient int compactionCount;
-
- /**
- * The compaction count default.
- */
- static int compactionCountDefault = 2; // Note: this is not final!
-
- /**
- * The storage for this SparseBitSet. The ith bit is stored in a word
- * represented by a long value, and is at bit position i % 64
- * within that word (where bit position 0 refers to the least significant bit
- * and 63 refers to the most significant bit).
- *
- * The words are organized into blocks, and the blocks are accessed by two
- * additional levels of array indexing.
- */
- protected transient long[][][] bits;
-
- /**
- * For the current size of the bits array, this is the maximum possible
- * length of the bit set, i.e., the index of the last possible bit, plus one.
- * Note: this not the value returned by length().
- * @see #resize(int)
- * @see #length()
- */
- protected transient int bitsLength;
-
- //==============================================================================
- // The critical parameters. These are set up so that the compiler may
- // pre-compute all the values as compile-time constants.
- //==============================================================================
-
- /**
- * The number of bits in a long value.
- */
- protected static final int LENGTH4 = Long.SIZE;
-
- /**
- * The number of bits in a positive integer, and the size of permitted index
- * of a bit in the bit set.
- */
- protected static final int INDEX_SIZE = Integer.SIZE - 1;
-
- /**
- * The label (index) of a bit in the bit set is essentially broken into
- * 4 "levels". Respectively (from the least significant end), level4, the
- * address within word, the address within a level3 block, the address within
- * a level2 area, and the level1 address of that area within the set.
- *
- * LEVEL4 is the number of bits of the level4 address (number of bits need
- * to address the bits in a long)
- */
- protected static final int LEVEL4 = 6;
-
- /**
- * LEVEL3 is the number of bits of the level3 address.
- */
- protected static final int LEVEL3 = 5; // Do not change!
- /**
- * LEVEL2 is the number of bits of the level2 address.
- */
- protected static final int LEVEL2 = 5; // Do not change!
- /**
- * LEVEL1 is the number of bits of the level1 address.
- */
- protected static final int LEVEL1 = INDEX_SIZE - LEVEL2 - LEVEL3 - LEVEL4;
-
- /**
- * MAX_LENGTH1 is the maximum number of entries in the level1 set array.
- */
- protected static final int MAX_LENGTH1 = 1 << LEVEL1;
-
- /**
- * LENGTH2 is the number of entries in the any level2 area.
- */
- protected static final int LENGTH2 = 1 << LEVEL2;
-
- /**
- * LENGTH3 is the number of entries in the any level3 block.
- */
- protected static final int LENGTH3 = 1 << LEVEL3;
-
- /**
- * The shift to create the word index. (I.e., move it to the right end)
- */
- protected static final int SHIFT3 = LEVEL4;
-
- /**
- * MASK3 is the mask to extract the LEVEL3 address from a word index
- * (after shifting by SHIFT3).
- */
- protected static final int MASK3 = LENGTH3 - 1;
-
- /**
- * SHIFT2 is the shift to bring the level2 address (from the word index) to
- * the right end (i.e., after shifting by SHIFT3).
- */
- protected static final int SHIFT2 = LEVEL3;
-
- /**
- * UNIT is the greatest number of bits that can be held in one level1 entry.
- * That is, bits per word by words per level3 block by blocks per level2 area.
- */
- protected static final int UNIT = LENGTH2 * LENGTH3 * LENGTH4;
-
- /**
- * MASK2 is the mask to extract the LEVEL2 address from a word index
- * (after shifting by SHIFT3 and SHIFT2).
- */
- protected static final int MASK2 = LENGTH2 - 1;
-
- /**
- * SHIFT1 is the shift to bring the level1 address (from the word index) to
- * the right end (i.e., after shifting by SHIFT3).
- */
- protected static final int SHIFT1 = LEVEL2 + LEVEL3;
-
- /**
- * LENGTH2_SIZE is maximum index of a LEVEL2 page.
- */
- protected static final int LENGTH2_SIZE = LENGTH2 - 1;
-
- /**
- * LENGTH3_SIZE is maximum index of a LEVEL3 page.
- */
- protected static final int LENGTH3_SIZE = LENGTH3 - 1;
-
- /**
- * LENGTH4_SIZE is maximum index of a bit in a LEVEL4 word.
- */
- protected static final int LENGTH4_SIZE = LENGTH4 - 1;
-
- /**
- * Holds reference to the cache of statistics values computed by the
- * UpdateStrategy
- * @see SparseBitSet.Cache
- * @see SparseBitSet.UpdateStrategy
- */
- protected transient Cache cache;
-
- //=============================================================================
- // Stack structures used for recycling blocks
- //=============================================================================
-
- /**
- * A spare level 3 block is kept for use when scanning. When a target block
- * is needed, and there is not already one in the bit set, the spare is
- * provided. If non-zero values are placed into this block, it is moved to the
- * resulting set, and a new spare is acquired. Note: a new spare needs to
- * be allocated when the set is cloned (so that the spare is not shared
- * between two sets).
- */
- protected transient long[] spare;
-
- /** An empty level 3 block is kept for use when scanning. When a source block
- * is needed, and there is not already one in the corresponding bit set, the
- * ZERO_BLOCK is used (as a read-only block). It is a source of zero values
- * so that code does not have to test for a null level3 block. This is a
- * static block shared everywhere.
- */
- static final long[] ZERO_BLOCK = new long[LENGTH3];
-
- /* Programming notes:
-
- i, j, and k are used to hold values that are actual bit indices (i.e.,
- the index (label) of the bit within the user's view of the bit set).
-
- u, v, and w, are used to hold values that refer to the indices of the
- words in the set array that are used to hold the bits (with 64 bits per
- word). These variable names, followed by 1, 2, or 3, refer to the component
- "level" parts of the complete word index.
-
- word (where used) is a potential entry to or from a block, containing 64
- bits of the bit set. The prefixes a, b, result, etc., refer to the bit
- sets from which these are coming or going. Without a prefix, or with the
- prefix "a," the set in question is "this" set (see next paragraph).
-
- Operations are conceived to be in the form a.op(b), thus in the discussion
- (not in the public Javadoc documentation) the two sets are referred to a
- "a" and "b", where the set referred to by "this" is usually set a.
- Hence, reference to set a is usually implicit, but set b will usually be
- explicit. Variables beginning with these letters hold values relevant to
- the corresponding set, and, in particular, these letters followed by
- 1, 2, and 3 are used to refer to the corresponding (current) level1,
- level3 area, and level3 block, arrays.
-
- The resizing of the table takes place as necessary. In this regard, it is
- worth noting that the table is grown, but never shrunk (except in a new
- object formed by cloning).
-
- Similarly, care it taken to ensure that any supplied reference to a bit
- set (other than this) has an opportunity to fail for being null before
- any other set (including this) has its state changed. For the most
- part, this is allowed to happen "naturally," but the Strategies incorporate
- an explicit check when necessary.
-
- There is a amount of (almost) repetitive scanning code in many of the
- "singe bit" methods. The intent is that these methods for SparseBitSet be
- as small and as fast as possible.
-
- For the scanning of complete sets, or for ranges within complete sets,
- all of the scanning logic is built into one (somewhat enormous) method,
- setScanner(). This contains all the considerations for matching up
- corresponding level 3 blocks (if they exist), and then uses a Strategy
- object to do the processing on those level3 blocks. This keeps all
- the scanning and optimization logic in one place, and the Strategies are
- reasonably simple (see the definition of AbstractStrategy for a discussion
- of the tasks that must be defined therein).
-
- The test for index i (the first index in all cases) being in range is
- rather perverse, but the idea was to keep the actual number of comparisons
- to a minimum, hence the check is for "(i + 1) < 1". This is almost but not
- quite equivalent to "i < 0", although it is for all values of i except
- i=Integer.MAX_VALUE. In this latter case, (i + 1) "overflows" to
- -(Integer.MAX_VALUE + 1), and thus appears to be less than 1, and thus the
- check picks up the other disallowed case. Let us hope the compiler never
- gets smart enough to try to do the apparent optimisation! */
-
- /**
- * Constructor for a new (sparse) bit set. All bits initially are effectively
- * false. This is a internal constructor that collects all the
- * needed actions to initialise the bit set.
- *
- * The capacity is taken to be a suggestion for a size of the bit set,
- * in bits. An appropriate table size (a power of two) is then determined and
- * used. The size will be grown as needed to accommodate any bits addressed
- * during the use of the bit set.
- *
- * @param capacity a size in terms of bits
- * @param compactionCount the compactionCount to be inherited (for
- * internal generation)
- * @exception NegativeArraySizeException if the specified initial size
- * is negative
- * @since 1.6
- */
- protected SparseBitSet(int capacity, int compactionCount)
- throws NegativeArraySizeException
- {
- /* Array size is computed based on this being a capacity given in bits. */
- if (capacity < 0) // capacity can't be negative -- could only come from
- throw new NegativeArraySizeException( // an erroneous user given
- "(requested capacity=" + capacity + ") < 0"); // nbits value
- resize(capacity - 1); // Resize takes last usable index
- this.compactionCount = compactionCount;
- /* Ensure there is a spare level 3 block for the use of the set scanner.*/
- constructorHelper();
- statisticsUpdate();
- }
-
- /**
- * Constructs an empty bit set with the default initial size.
- * Initially all bits are effectively false.
- *
- * @since 1.6
- */
- public SparseBitSet()
- {
- /* By requesting 1 bit, will actually get UNIT number of bits. */
- this(1, compactionCountDefault);
- }
-
- /**
- * Creates a bit set whose initial size is large enough to efficiently
- * represent bits with indices in the range 0 through
- * at least nbits-1. Initially all bits are effectively
- * false.
- *
- * No guarantees are given for how large or small the actual object will be.
- * The setting of bits above the given range is permitted (and will perhaps
- * eventually cause resizing).
- *
- * @param nbits the initial provisional length of the SparseBitSet
- * @throws java.lang.NegativeArraySizeException if the specified initial
- * length is negative
- * @see #SparseBitSet()
- * @since 1.6
- */
- public SparseBitSet(int nbits) throws NegativeArraySizeException
- {
- this(nbits, compactionCountDefault);
- }
-
- /**
- * Performs a logical AND of the addressed target bit with the argument
- * value. This bit set is modified so that the addressed bit has the value
- * true if and only if it both initially had the value
- * true and the argument value is also true.
- *
- * @param i a bit index
- * @param value a boolean value to AND with that bit
- * @exception IndexOutOfBoundsException if the specified index is negative
- * or equal to Integer.MAX_VALUE
- * @since 1.6
- */
- public void and(int i, boolean value) throws IndexOutOfBoundsException
- {
- if ((i + 1) < 1)
- throw new IndexOutOfBoundsException("i=" + i);
- if (!value)
- clear(i);
- }
-
- /**
- * Performs a logical AND of this target bit set with the argument bit
- * set within the given range of bits. Within the range, this bit set is
- * modified so that each bit in it has the value true if and only
- * if it both initially had the value true and the corresponding
- * bit in the bit set argument also had the value true. Outside
- * the range, this set is not changed.
- *
- * @param i index of the first bit to be included in the operation
- * @param j index after the last bit to included in the operation
- * @param b a SparseBitSet
- * @exception IndexOutOfBoundsException if i is negative or
- * equal to Integer.MAX_VALUE, or j is negative,
- * or i is larger than j
- * @since 1.6
- */
- public void and(int i, int j, SparseBitSet b) throws IndexOutOfBoundsException
- {
- setScanner(i, j, b, andStrategy);
- }
-
- /**
- * Performs a logical AND of this target bit set with the argument bit
- * set. This bit set is modified so that each bit in it has the value
- * true if and only if it both initially had the value
- * true and the corresponding bit in the bit set argument also
- * had the value true.
- *
- * @param b a SparseBitSet
- * @since 1.6
- */
- public void and(SparseBitSet b)
- {
- nullify(Math.min(bits.length, b.bits.length)); // Optimisation
- setScanner(0, Math.min(bitsLength, b.bitsLength), b, andStrategy);
- }
-
- /**
- * Performs a logical AND of the two given SparseBitSets.
- * The returned SparseBitSet is created so that each bit in it
- * has the value true if and only if both the given sets
- * initially had the corresponding bits true, otherwise
- * false.
- *
- * @param a a SparseBitSet
- * @param b another SparseBitSet
- * @return a new SparseBitSet representing the AND of the two sets
- * @since 1.6
- */
- public static SparseBitSet and(SparseBitSet a, SparseBitSet b)
- {
- final SparseBitSet result = a.clone();
- result.and(b);
- return result;
- }
-
- /**
- * Performs a logical AndNOT of the addressed target bit with the
- * argument value. This bit set is modified so that the addressed bit has the
- * value true if and only if it both initially had the value
- * true and the argument value is false.
- *
- * @param i a bit index
- * @param value a boolean value to AndNOT with that bit
- * @exception IndexOutOfBoundsException if the specified index is negative
- * or equal to Integer.MAX_VALUE
- * @since 1.6
- */
- public void andNot(int i, boolean value)
- {
- if ((i + 1) < 1)
- throw new IndexOutOfBoundsException("i=" + i);
- if (value)
- clear(i);
- }
-
- /**
- * Performs a logical AndNOT of this target bit set with the argument
- * bit set within the given range of bits. Within the range, this bit set is
- * modified so that each bit in it has the value true if and only
- * if it both initially had the value true and the corresponding
- * bit in the bit set argument has the value false. Outside
- * the range, this set is not changed.
- *
- * @param i index of the first bit to be included in the operation
- * @param j index after the last bit to included in the operation
- * @param b the SparseBitSet with which to mask this SparseBitSet
- * @exception IndexOutOfBoundsException if i is negative or
- * equal to Integer.MAX_VALUE, or j is negative,
- * or i is larger than j
- * @since 1.6
- */
- public void andNot(int i, int j, SparseBitSet b)
- throws IndexOutOfBoundsException
- {
- setScanner(i, j, b, andNotStrategy);
- }
-
- /**
- * Performs a logical AndNOT of this target bit set with the argument
- * bit set. This bit set is modified so that each bit in it has the value
- * true if and only if it both initially had the value
- * true and the corresponding bit in the bit set argument has
- * the value false.
- *
- * @param b the SparseBitSet with which to mask this SparseBitSet
- * @since 1.6
- */
- public void andNot(SparseBitSet b)
- {
- setScanner(0, Math.min(bitsLength, b.bitsLength), b, andNotStrategy);
- }
-
- /**
- * Creates a bit set from the first SparseBitSet whose
- * corresponding bits are cleared by the set bits of the second
- * SparseBitSet. The resulting bit set is created so that a bit
- * in it has the value true if and only if the corresponding bit
- * in the SparseBitSet of the first is set, and that same
- * corresponding bit is not set in the SparseBitSet of the second
- * argument.
- *
- * @param a a SparseBitSet
- * @param b another SparseBitSet
- * @return a new SparseBitSet representing the AndNOT of the
- * two sets
- * @since 1.6
- */
- public static SparseBitSet andNot(SparseBitSet a, SparseBitSet b)
- {
- final SparseBitSet result = a.clone();
- result.andNot(b);
- return result;
- }
-
- /**
- * Returns the number of bits set to true in this
- * SparseBitSet.
- *
- * @return the number of bits set to true in this SparseBitSet
- * @since 1.6
- */
- public int cardinality()
- {
- statisticsUpdate(); // Update size, cardinality and length values
- return cache.cardinality;
- }
-
- /**
- * Sets the bit at the specified index to false.
- *
- * @param i a bit index.
- * @exception IndexOutOfBoundsException if the specified index is negative
- * or equal to Integer.MAX_VALUE.
- * @since 1.6
- */
- public void clear(int i)
- {
- /* In the interests of speed, no check is made here on whether the
- level3 block goes to all zero. This may be found and corrected
- in some later operation. */
- if ((i + 1) < 1)
- throw new IndexOutOfBoundsException("i=" + i);
- if (i >= bitsLength)
- return;
- final int w = i >> SHIFT3;
- long[][] a2;
- if ((a2 = bits[w >> SHIFT1]) == null)
- return;
- long[] a3;
- if ((a3 = a2[(w >> SHIFT2) & MASK2]) == null)
- return;
- a3[w & MASK3] &= ~(1L << i); // Clear the indicated bit
- cache.hash = 0; // Invalidate size, etc.,
- }
-
- /**
- * Sets the bits from the specified i (inclusive) to the
- * specified j (exclusive) to false.
- *
- * @param i index of the first bit to be cleared
- * @param j index after the last bit to be cleared
- * @exception IndexOutOfBoundsException if i is negative or
- * equal to Integer.MAX_VALUE, or j is negative,
- * or i is larger than j
- * @since 1.6
- */
- public void clear(int i, int j) throws IndexOutOfBoundsException
- {
- setScanner(i, j, null, clearStrategy);
- }
-
- /**
- * Sets all of the bits in this SparseBitSet to
- * false.
- *
- * @since 1.6
- */
- public void clear()
- {
- /* This simply resets to null all the entries in the set. */
- nullify(0);
- }
-
- /**
- * Cloning this SparseBitSet produces a new
- * SparseBitSet that is equal() to it. The clone of the
- * bit set is another bit set that has exactly the same bits set to
- * true as this bit set.
- *
- * Note: the actual space allocated to the clone tries to minimise the actual
- * amount of storage allocated to hold the bits, while still trying to
- * keep access to the bits being a rapid as possible. Since the space
- * allocated to a SparseBitSet is not normally decreased,
- * replacing a bit set by its clone may be a way of both managing memory
- * consumption and improving the rapidity of access.
- *
- * @return a clone of this SparseBitSet
- * @since 1.6
- */
- @Override
- public SparseBitSet clone()
- {
- try
- {
- final SparseBitSet result = (SparseBitSet) super.clone();
- /* Clear out the shallow copy of the set array (which contains just
- copies of the references from this set), and then replace these
- by a deep copy (created by a "copy" from the set being cloned . */
- result.bits = null;
- result.resize(1);
- /* Ensure the clone is not sharing a copy of a spare block with
- the cloned set, nor the cache set, nor any of the visitors (which
- are linked to their parent object) (Not all visitors actually use
- this link to their containing object, but they are reset here just
- in case of future changes). */
- result.constructorHelper();
- result.equalsStrategy = null;
- result.setScanner(0, bitsLength, this, copyStrategy);
- return result;
- }
- catch (CloneNotSupportedException ex)
- {
- /* This code has not been unit tested. Inspection offers hope
- that is will work, but it likely never to be used. */
- throw new InternalError(ex.getMessage());
- }
- }
-
- /**
- * Compares this object against the specified object. The result is
- * true if and only if the argument is not null
- * and is a SparseBitSet object that has exactly the same bits
- * set to true as this bit set. That is, for every nonnegative
- * i indexing a bit in the set,
- *
((SparseBitSet)obj).get(i) == this.get(i)
- * must be true.
- *
- * @param obj the Object with which to compare
- * @return true if the objects are equivalent;
- * false otherwise.
- * @since 1.6
- */
- @Override
- public boolean equals(Object obj)
- {
- /* Sanity and quick checks. */
- if (!(obj instanceof SparseBitSet))
- return false;
- final SparseBitSet b = (SparseBitSet) obj;
- if (this == b)
- return true; // Identity
-
- /* Do the real work. */
- if (equalsStrategy == null)
- equalsStrategy = new EqualsStrategy();
-
- setScanner(0, Math.max(bitsLength, b.bitsLength), b, equalsStrategy);
- return equalsStrategy.result;
- }
-
- /**
- * Sets the bit at the specified index to the complement of its current value.
- *
- * @param i the index of the bit to flip
- * @exception IndexOutOfBoundsException if the specified index is negative
- * or equal to Integer.MAX_VALUE
- * @since 1.6
- */
- public void flip(int i)
- {
- if ((i + 1) < 1)
- throw new IndexOutOfBoundsException("i=" + i);
- final int w = i >> SHIFT3;
- final int w1 = w >> SHIFT1;
- final int w2 = (w >> SHIFT2) & MASK2;
-
- if (i >= bitsLength)
- resize(i);
- long[][] a2;
- if ((a2 = bits[w1]) == null)
- a2 = bits[w1] = new long[LENGTH2][];
- long[] a3;
- if ((a3 = a2[w2]) == null)
- a3 = a2[w2] = new long[LENGTH3];
- a3[w & MASK3] ^= 1L << i; //Flip the designated bit
- cache.hash = 0; // Invalidate size, etc., values
- }
-
- /**
- * Sets each bit from the specified i (inclusive) to the
- * specified j (exclusive) to the complement of its current
- * value.
- *
- * @param i index of the first bit to flip
- * @param j index after the last bit to flip
- * @exception IndexOutOfBoundsException if i is negative or is
- * equal to Integer.MAX_VALUE, or j is negative, or
- * i is larger than j
- * @since 1.6
- */
- public void flip(int i, int j) throws IndexOutOfBoundsException
- {
- setScanner(i, j, null, flipStrategy);
- }
-
- /**
- * Returns the value of the bit with the specified index. The value is
- * true if the bit with the index i is currently set
- * in this SparseBitSet; otherwise, the result is
- * false.
- *
- * @param i the bit index
- * @return the boolean value of the bit with the specified index.
- * @exception IndexOutOfBoundsException if the specified index is negative
- * or equal to Integer.MAX_VALUE
- * @since 1.6
- */
- public boolean get(int i)
- {
- if ((i + 1) < 1)
- throw new IndexOutOfBoundsException("i=" + i);
- final int w = i >> SHIFT3;
-
- long[][] a2;
- long[] a3;
- return i < bitsLength && (a2 = bits[w >> SHIFT1]) != null
- && (a3 = a2[(w >> SHIFT2) & MASK2]) != null
- && ((a3[w & MASK3] & (1L << i)) != 0);
- }
-
- /**
- * Returns a new SparseBitSet composed of bits from this
- * SparseBitSet from i (inclusive) to j
- * (exclusive).
- *
- * @param i index of the first bit to include
- * @param j index after the last bit to include
- * @return a new SparseBitSet from a range of this SparseBitSet
- * @exception IndexOutOfBoundsException if i is negative or is
- * equal to Integer.MAX_VALUE, or j is negative, or
- * i is larger than j
- * @since 1.6
- */
- public SparseBitSet get(int i, int j) throws IndexOutOfBoundsException
- {
- final SparseBitSet result = new SparseBitSet(j, compactionCount);
- result.setScanner(i, j, this, copyStrategy);
- return result;
- }
-
- /**
- * Returns a hash code value for this bit set. The hash code depends only on
- * which bits have been set within this SparseBitSet. The
- * algorithm used to compute it may be described as follows.
- *
- * Suppose the bits in the SparseBitSet were to be stored in an
- * array of long integers called, say, bits, in such
- * a manner that bit i is set in the SparseBitSet
- * (for nonnegative values of i) if and only if the expression
- *
- * is true. Then the following definition of the hashCode method
- * would be a correct implementation of the actual algorithm:
- *
- * public int hashCode()
- * {
- * long hash = 1234L;
- * for ( int i = bits.length; --i >= 0; )
- * hash ^= bits[i] * (i + 1);
- * return (int)((h >> 32) ^ h);
- * }
- * Note that the hash code values change if the set of bits is altered.
- *
- * @return a hash code value for this bit set
- * @since 1.6
- * @see Object#equals(Object)
- * @see java.util.Hashtable
- */
- @Override
- public int hashCode()
- {
- statisticsUpdate();
- return cache.hash;
- }
-
- /**
- * Returns true if the specified SparseBitSet has any bits
- * within the given range i (inclusive) to j
- * (exclusive) set to true that are also set to true
- * in the same range of this SparseBitSet.
- *
- * @param i index of the first bit to include
- * @param j index after the last bit to include
- * @param b the SparseBitSet with which to intersect
- * @return the boolean indicating whether this SparseBitSet intersects the
- * specified SparseBitSet
- * @exception IndexOutOfBoundsException if i is negative or
- * equal to Integer.MAX_VALUE, or j is negative,
- * or i is larger than j
- * @since 1.6
- */
- public boolean intersects(int i, int j, SparseBitSet b)
- throws IndexOutOfBoundsException
- {
- setScanner(i, j, b, intersectsStrategy);
- return intersectsStrategy.result;
- }
-
- /**
- * Returns true if the specified SparseBitSet has any bits set to
- * true that are also set to true in this
- * SparseBitSet.
- *
- * @param b a SparseBitSet with which to intersect
- * @return boolean indicating whether this SparseBitSet intersects the
- * specified SparseBitSet
- * @since 1.6
- */
- public boolean intersects(SparseBitSet b)
- {
- setScanner(0, Math.max(bitsLength, b.bitsLength), b, intersectsStrategy);
- return intersectsStrategy.result;
- }
-
- /**
- * Returns true if this SparseBitSet contains no bits that are
- * set to true.
- *
- * @return the boolean indicating whether this SparseBitSet is empty
- * @since 1.6
- */
- public boolean isEmpty()
- {
- statisticsUpdate();
- return cache.cardinality == 0;
- }
-
- /**
- * Returns the "logical length" of this SparseBitSet: the index
- * of the highest set bit in the SparseBitSet plus one. Returns
- * zero if the SparseBitSet contains no set bits.
- *
- * @return the logical length of this SparseBitSet
- * @since 1.6
- */
- public int length()
- {
- statisticsUpdate();
- return cache.length;
- }
-
- /**
- * Returns the index of the first bit that is set to false that
- * occurs on or after the specified starting index.
- *
- * @param i the index to start checking from (inclusive)
- * @return the index of the next clear bit, or -1 if there is no such bit
- * @exception IndexOutOfBoundsException if the specified index is negative
- * @since 1.6
- */
- public int nextClearBit(int i)
- {
- /* The index of this method is permitted to be Integer.MAX_VALUE, as this
- is needed to make this method work together with the method
- nextSetBit()--as might happen if a search for the next clear bit is
- started after finding a set bit labelled Integer.MAX_VALUE-1. This
- case is not optimised, the code will eventually return -1 (since
- the Integer.MAX_VALUEth bit does "exist," and is 0. */
-
- if (i < 0)
- throw new IndexOutOfBoundsException("i=" + i);
- /* This is the word from which the search begins. */
- int w = i >> SHIFT3;
- int w3 = w & MASK3;
- int w2 = (w >> SHIFT2) & MASK2;
- int w1 = w >> SHIFT1;
-
- long nword = ~0L << i;
- final int aLength = bits.length;
-
- long[][] a2;
- long[] a3;
- /* Is the next clear bit in the same word at the nominated beginning bit
- (including the nominated beginning bit itself). The first check is
- whether the starting bit is within the structure at all. */
- if (w1 < aLength && (a2 = bits[w1]) != null
- && (a3 = a2[w2]) != null
- && ((nword = ~a3[w3] & (~0L << i))) == 0L)
- {
- /* So now start a search though the rest of the entries for
- a null area or block, or a clear bit (a set bit in the
- complemented value). */
- ++w;
- w3 = w & MASK3;
- w2 = (w >> SHIFT2) & MASK2;
- w1 = w >> SHIFT1;
- nword = ~0L;
- loop: for (; w1 != aLength; ++w1)
- {
- if ((a2 = bits[w1]) == null)
- break;
- for (; w2 != LENGTH2; ++w2)
- {
- if ((a3 = a2[w2]) == null)
- break loop;
- for (; w3 != LENGTH3; ++w3)
- if ((nword = ~a3[w3]) != 0)
- break loop;
- w3 = 0;
- }
- w2 = w3 = 0;
- }
- }
- final int result = (((w1 << SHIFT1) + (w2 << SHIFT2) + w3) << SHIFT3)
- + Long.numberOfTrailingZeros(nword);
- return (result == Integer.MAX_VALUE ? -1 : result);
- }
-
- /**
- * Returns the index of the first bit that is set to true that
- * occurs on or after the specified starting index. If no such it exists then
- * -1 is returned.
- *
- * To iterate over the true bits in a SparseBitSet
- * sbs, use the following loop:
- *
- *
- * for ( int i = sbbits.nextSetBit(0); i >= 0; i = sbbits.nextSetBit(i+1) )
- * {
- * // operate on index i here
- * }
- *
- * @param i the index to start checking from (inclusive)
- * @return the index of the next set bit
- * @exception IndexOutOfBoundsException if the specified index is negative
- * @since 1.6
- */
- public int nextSetBit(int i)
- {
- /* The index value (i) of this method is permitted to be Integer.MAX_VALUE,
- as this is needed to make the loop defined above work: just in case the
- bit labelled Integer.MAX_VALUE-1 is set. This case is not optimised:
- but eventually -1 will be returned, as this will be included with
- any search that goes off the end of the level1 array. */
-
- if (i < 0)
- throw new IndexOutOfBoundsException("i=" + i);
- /* This is the word from which the search begins. */
- int w = i >> SHIFT3;
- int w3 = w & MASK3;
- int w2 = (w >> SHIFT2) & MASK2;
- int w1 = w >> SHIFT1;
-
- long word = 0L;
- final int aLength = bits.length;
-
- long[][] a2;
- long[] a3;
- /* Is the next set bit in the same word at the nominated beginning bit
- (including the nominated beginning bit itself). The first check is
- whether the starting bit is within the structure at all. */
- if (w1 < aLength && ((a2 = bits[w1]) == null
- || (a3 = a2[w2]) == null
- || ((word = a3[w3] & (~0L << i)) == 0L)))
- {
- /* So now start a search though the rest of the entries for a bit. */
- ++w;
- w3 = w & MASK3;
- w2 = (w >> SHIFT2) & MASK2;
- w1 = w >> SHIFT1;
- major: for (; w1 != aLength; ++w1)
- {
- if ((a2 = bits[w1]) != null)
- for (; w2 != LENGTH2; ++w2)
- {
- if ((a3 = a2[w2]) != null)
- for (; w3 != LENGTH3; ++w3)
- if ((word = a3[w3]) != 0)
- break major;
- w3 = 0;
- }
- w2 = w3 = 0;
- }
- }
- return (w1 >= aLength ? -1
- : (((w1 << SHIFT1) + (w2 << SHIFT2) + w3) << SHIFT3)
- + Long.numberOfTrailingZeros(word));
- }
-
- /**
- * Returns the index of the nearest bit that is set to {@code false}
- * that occurs on or before the specified starting index.
- * If no such bit exists, or if {@code -1} is given as the
- * starting index, then {@code -1} is returned.
- *
- * @param i the index to start checking from (inclusive)
- * @return the index of the previous clear bit, or {@code -1} if there
- * is no such bit
- * @throws IndexOutOfBoundsException if the specified index is less
- * than {@code -1}
- * @since 1.2
- * @see java.util.BitSet#previousClearBit
- */
- public int previousClearBit(int i)
- {
- if (i < 0)
- {
- if (i == -1)
- return -1;
- throw new IndexOutOfBoundsException("i=" + i);
- }
-
- final long[][][] bits = this.bits;
- final int aSize = bits.length - 1;
-
- int w = i >> SHIFT3;
- int w3 = w & MASK3;
- int w2 = (w >> SHIFT2) & MASK2;
- int w1 = w >> SHIFT1;
- if (w1 > aSize)
- return i;
- w1 = Math.min(w1, aSize);
- int w4 = i % LENGTH4;
-
- long word;
- long[][] a2;
- long[] a3;
-
- for (; w1 >= 0; --w1)
- {
- if ((a2 = bits[w1]) == null)
- return (((w1 << SHIFT1) + (w2 << SHIFT2) + w3) << SHIFT3) + w4;
- for (; w2 >= 0; --w2)
- {
- if ((a3 = a2[w2]) == null)
- return (((w1 << SHIFT1) + (w2 << SHIFT2) + w3) << SHIFT3) + w4;
- for (; w3 >= 0; --w3)
- {
- if ((word = a3[w3]) == 0)
- return (((w1 << SHIFT1) + (w2 << SHIFT2) + w3) << SHIFT3) + w4;
- for (int bitIdx = w4; bitIdx >= 0; --bitIdx)
- {
- if ((word & (1L << bitIdx)) == 0)
- return (((w1 << SHIFT1) + (w2 << SHIFT2) + w3) << SHIFT3) + bitIdx;
- }
- w4 = LENGTH4_SIZE;
- }
- w3 = LENGTH3_SIZE;
- }
- w2 = LENGTH2_SIZE;
- }
- return -1;
- }
-
- /**
- * Returns the index of the nearest bit that is set to {@code true}
- * that occurs on or before the specified starting index.
- * If no such bit exists, or if {@code -1} is given as the
- * starting index, then {@code -1} is returned.
- *
- * @param i the index to start checking from (inclusive)
- * @return the index of the previous set bit, or {@code -1} if there
- * is no such bit
- * @throws IndexOutOfBoundsException if the specified index is less
- * than {@code -1}
- * @since 1.2
- * @see java.util.BitSet#previousSetBit
- */
- public int previousSetBit(int i)
- {
- if (i < 0)
- {
- if (i == -1)
- return -1;
- throw new IndexOutOfBoundsException("i=" + i);
- }
-
- final long[][][] bits = this.bits;
- final int aSize = bits.length - 1;
-
- /* This is the word from which the search begins. */
- final int w = i >> SHIFT3;
- int w1 = w >> SHIFT1;
- int w2, w3, w4;
- /* But if its off the end of the array, start from the very end. */
- if (w1 > aSize)
- {
- w1 = aSize;
- w2 = LENGTH2_SIZE;
- w3 = LENGTH3_SIZE;
- w4 = LENGTH4_SIZE;
- }
- else
- {
- w2 = (w >> SHIFT2) & MASK2;
- w3 = w & MASK3;
- w4 = i % LENGTH4;
- }
- long word;
- long[][] a2;
- long[] a3;
- for (; w1 >= 0; --w1)
- {
- if ((a2 = bits[w1]) != null)
- for (; w2 >= 0; --w2)
- {
- if ((a3 = a2[w2]) != null)
- for (; w3 >= 0; --w3)
- {
- if ((word = a3[w3]) != 0)
- for (int bitIdx = w4; bitIdx >= 0; --bitIdx)
- {
- if ((word & (1L << bitIdx)) != 0)
- return (((w1 << SHIFT1) + (w2 << SHIFT2) + w3) << SHIFT3) + bitIdx;
- }
- w4 = LENGTH4_SIZE;
- }
- w3 = LENGTH3_SIZE;
- w4 = LENGTH4_SIZE;
- }
- w2 = LENGTH2_SIZE;
- w3 = LENGTH3_SIZE;
- w4 = LENGTH4_SIZE;
- }
- return -1;
- }
-
- /**
- * Performs a logical OR of the addressed target bit with the
- * argument value. This bit set is modified so that the addressed bit has the
- * value true if and only if it both initially had the value
- * true or the argument value is true.
- *
- * @param i a bit index
- * @param value a boolean value to OR with that bit
- * @exception IndexOutOfBoundsException if the specified index is negative
- * or equal to Integer.MAX_VALUE
- * @since 1.6
- */
- public void or(int i, boolean value)
- {
- if ((i + 1) < 1)
- throw new IndexOutOfBoundsException("i=" + i);
- if (value)
- set(i);
- }
-
- /**
- * Performs a logical OR of the addressed target bit with the
- * argument value within the given range. This bit set is modified so that
- * within the range a bit in it has the value true if and only if
- * it either already had the value true or the corresponding bit
- * in the bit set argument has the value true. Outside the range
- * this set is not changed.
- *
- * @param i index of the first bit to be included in the operation
- * @param j index after the last bit to included in the operation
- * @param b the SparseBitSet with which to perform the OR
- * operation with this SparseBitSet
- * @exception IndexOutOfBoundsException if i is negative or
- * equal to Integer.MAX_VALUE, or j is negative,
- * or i is larger than j
- * @since 1.6
- */
- public void or(int i, int j, SparseBitSet b) throws IndexOutOfBoundsException
- {
- setScanner(i, j, b, orStrategy);
- }
-
- /**
- * Performs a logical OR of this bit set with the bit set argument.
- * This bit set is modified so that a bit in it has the value true
- * if and only if it either already had the value true or the
- * corresponding bit in the bit set argument has the value true.
- *
- * @param b the SparseBitSet with which to perform the OR
- * operation with this SparseBitSet
- * @since 1.6
- */
- public void or(SparseBitSet b)
- {
- setScanner(0, b.bitsLength, b, orStrategy);
- }
-
- /**
- * Performs a logical OR of the two given SparseBitSets.
- * The returned SparseBitSet is created so that a bit in it has
- * the value true if and only if it either had the value
- * true in the set given by the first arguemetn or had the value
- * true in the second argument, otherwise false.
- *
- * @param a a SparseBitSet
- * @param b another SparseBitSet
- * @return new SparseBitSet representing the OR of the two sets
- * @since 1.6
- */
- public static SparseBitSet or(SparseBitSet a, SparseBitSet b)
- {
- final SparseBitSet result = a.clone();
- result.or(b);
- return result;
- }
-
- /**
- * Sets the bit at the specified index.
- *
- * @param i a bit index
- * @exception IndexOutOfBoundsException if the specified index is negative
- * or equal to Integer.MAX_VALUE
- * @since 1.6
- */
- public void set(int i)
- {
- if ((i + 1) < 1)
- throw new IndexOutOfBoundsException("i=" + i);
- final int w = i >> SHIFT3;
- final int w1 = w >> SHIFT1;
- final int w2 = (w >> SHIFT2) & MASK2;
-
- if (i >= bitsLength)
- resize(i);
- long[][] a2;
- if ((a2 = bits[w1]) == null)
- a2 = bits[w1] = new long[LENGTH2][];
- long[] a3;
- if ((a3 = a2[w2]) == null)
- a3 = a2[w2] = new long[LENGTH3];
- a3[w & MASK3] |= 1L << i;
- cache.hash = 0; //Invalidate size, etc., scan
- }
-
- /**
- * Sets the bit at the specified index to the specified value.
- *
- * @param i a bit index
- * @param value a boolean value to set
- * @exception IndexOutOfBoundsException if the specified index is negative
- * or equal to Integer.MAX_VALUE
- * @since 1.6
- */
- public void set(int i, boolean value)
- {
- if (value)
- set(i);
- else
- clear(i);
- }
-
- /**
- * Sets the bits from the specified i (inclusive) to the specified
- * j (exclusive) to true.
- *
- * @param i index of the first bit to be set
- * @param j index after the last bit to be se
- * @exception IndexOutOfBoundsException if i is negative or is
- * equal to Integer.MAX_INT, or j is negative, or
- * i is larger than j.
- * @since 1.6
- */
- public void set(int i, int j) throws IndexOutOfBoundsException
- {
- setScanner(i, j, null, setStrategy);
- }
-
- /**
- * Sets the bits from the specified i (inclusive) to the specified
- * j (exclusive) to the specified value.
- *
- * @param i index of the first bit to be set
- * @param j index after the last bit to be set
- * @param value to which to set the selected bits
- * @exception IndexOutOfBoundsException if i is negative or is
- * equal to Integer.MAX_VALUE, or j is negative, or
- * i is larger than j
- * @since 1.6
- */
- public void set(int i, int j, boolean value)
- {
- if (value)
- set(i, j);
- else
- clear(i, j);
- }
-
- /**
- * Returns the number of bits of space nominally in use by this
- * SparseBitSet to represent bit values. The count of bits in
- * the set is the (label of the last set bit) + 1 - (the label of the first
- * set bit).
- *
- * @return the number of bits (true and false) nominally in this bit set
- * at this moment
- * @since 1.6
- */
- public int size()
- {
- statisticsUpdate();
- return cache.size;
- }
-
- /**
- * Convenience method for statistics if the individual results are not needed.
- *
- * @return a String detailing the statistics of the bit set
- * @see #statistics(String[])
- * @since 1.6
- */
- public String statistics()
- {
- return statistics(null);
- }
-
- /**
- * Determine, and create a String with the bit set statistics. The statistics
- * include: Size, Length, Cardinality, Total words (i.e., the total
- * number of 64-bit "words"), Set array length (i.e., the number of
- * references that can be held by the top level array, Level2 areas in use,
- * Level3 blocks in use,, Level2 pool size, Level3 pool size, and the
- * Compaction count.
- *
- * This method is intended for diagnostic use (as it is relatively expensive
- * in time), but can be useful in understanding an application's use of a
- * SparseBitSet.
- *
- * @param values an array for the individual results (if not null)
- * @return a String detailing the statistics of the bit set
- * @since 1.6
- */
- public String statistics(String[] values)
- {
- statisticsUpdate(); // Ensure statistics are up-to-date
- String[] v = new String[Statistics.values().length];
-
- /* Assign the statistics values to the appropriate entry. The order
- of the assignments does not matter--the ordinal serves to get the
- values into the matching order with the labels from the enumeration. */
- v[Statistics.Size.ordinal()] = Integer.toString(size());
- v[Statistics.Length.ordinal()] = Integer.toString(length());
- v[Statistics.Cardinality.ordinal()] = Integer.toString(cardinality());
- v[Statistics.Total_words.ordinal()] = Integer.toString(cache.count);
- v[Statistics.Set_array_length.ordinal()] = Integer.toString(bits.length);
- v[Statistics.Set_array_max_length.ordinal()] =
- Integer.toString(MAX_LENGTH1);
- v[Statistics.Level2_areas.ordinal()] = Integer.toString(cache.a2Count);
- v[Statistics.Level2_area_length.ordinal()] = Integer.toString(LENGTH2);
- v[Statistics.Level3_blocks.ordinal()] = Integer.toString(cache.a3Count);
- v[Statistics.Level3_block_length.ordinal()] = Integer.toString(LENGTH3);
- v[Statistics.Compaction_count_value.ordinal()] =
- Integer.toString(compactionCount);
-
- /* Determine the longest label, so that the equal signs may be lined-up. */
- int longestLabel = 0;
- for (Statistics s : Statistics.values())
- longestLabel =
- Math.max(longestLabel, s.name().length());
-
- /* Build a String that has for each statistic, the name of the statistic,
- padding, and equals sign, and the value. The "Load_factor_value",
- "Average_length_value", and "Average_chain_length" are printed as
- floating point values. */
- final StringBuilder result = new StringBuilder();
- for (Statistics s : Statistics.values())
- {
- result.append(s.name()); // The name of the statistic
- for (int i = 0; i != longestLabel - s.name().length(); ++i)
- result.append(' '); // Fill out the field
- result.append(" = "); // Show an equals sign
- result.append(v[s.ordinal()]); // and a value
- result.append('\n');
- }
- /* Remove the underscores. */
- for (int i = 0; i != result.length(); ++i)
- if (result.charAt(i) == '_')
- result.setCharAt(i, ' ');
-
- if (values != null)
- {
- final int len = Math.min(values.length, v.length);
- System.arraycopy(v, 0, values, 0, len);
- }
- return result.toString();
- }
-
- /**
- * Returns a string representation of this bit set. For every index for which
- * this SparseBitSet contains a bit in the set state, the decimal
- * representation of that index is included in the result. Such indices are
- * listed in order from lowest to highest. If there is a subsequence of set
- * bits longer than the value given by toStringCompaction, the subsequence
- * is represented by the value for the first and the last values, with ".."
- * between them. The individual bits, or the representation of sub-sequences
- * are separated by ", " (a comma and a space) and surrounded by braces,
- * resulting in a compact string showing (a variant of) the usual mathematical
- * notation for a set of integers.
- *
- * Example (with the default value of 2 for subsequences):
- *
- * SparseBitSet drPepper = new SparseBitSet();
- *
- * Now drPepper.toString() returns "{}".
- *
- *
- * drPepper.set(2);
- *
- * Now drPepper.toString() returns "{2}".
- *
- *
- * drPepper.set(3, 4);
- * drPepper.set(10);
- *
- * Now drPepper.toString() returns "{2..4, 10}".
- *
- * This method is intended for diagnostic use (as it is relatively expensive
- * in time), but can be useful in interpreting problems in an application's use
- * of a SparseBitSet.
- *
- * @return a String representation of this SparseBitSet
- * @see #toStringCompaction(int length)
- * @since 1.6
- */
- @Override
- public String toString()
- {
- final StringBuilder p = new StringBuilder(200);
- p.append('{');
- int i = nextSetBit(0);
- /* Loop so long as there is another bit to append to the String. */
- while (i >= 0)
- {
- /* Append that next bit */
- p.append(i);
- /* Find the position of the next bit to show. */
- int j = nextSetBit(i + 1);
- if (compactionCount > 0)
- {
- /* Give up if there is no next bit to show. */
- if (j < 0)
- break;
- /* Find the next clear bit is after the current bit, i.e., i */
- int last = nextClearBit(i);
- /* Compute the position of the next clear bit after the current
- subsequence of set bits. */
- last = (last < 0 ? Integer.MAX_VALUE : last);
- /* If the subsequence is more than the specified bits long, then
- collapse the subsequence into one entry in the String. */
- if (i + compactionCount < last)
- {
- p.append("..").append(last - 1);
- /* Having accounted for a subsequence of bits that are all set,
- recompute the label of the next bit to show. */
- j = nextSetBit(last);
- }
- }
- /* If there is another set bit, put a comma and a space after the
- last entry in the String. */
- if (j >= 0)
- p.append(", ");
- /* Transfer to i the index of the next set bit. */
- i = j;
- }
- /* Terminate the representational String, and return it. */
- p.append('}');
- return p.toString();
- }
-
- /** Sequences of set bits longer than this value are shown by
- * {@link #toString()} as a "sub-sequence," in the form a..b.
- * Setting this value to zero causes each set bit to be listed individually.
- * The default default value is 2 (which means sequences of three or more
- * bits set are shown as a subsequence, and all other set bits are listed
- * individually).
- *
- * Note: this value will be passed to SparseBitSets that
- * may be created within or as a result of the operations on this bit set,
- * or, for static methods, from the value belonging to the first parameter.
- *
- * @param count the maximum count of a run of bits that are shown as
- * individual entries in a toString() conversion.
- * If 0, all bits are shown individually.
- * @since 1.6
- * @see #toString()
- */
- public void toStringCompaction(int count)
- {
- compactionCount = count;
- }
-
- /**
- * If change is true, the current value of the
- * toStringCompaction() value is made the default value for all
- * SparseBitSets created from this point onward in this JVM.
- *
- * @param change if true, change the default value
- * @since 1.6
- */
- public void toStringCompaction(boolean change)
- {
- /* This is an assignment to a static value: the integer value assignment
- is atomic, so there will not be a partial store. If multiple
- invocations are made from multiple threads, there is a race
- condition that cannot be resolved by synchronization. */
- if (change)
- compactionCountDefault = compactionCount;
- }
-
- /**
- * Performs a logical XOR of the addressed target bit with the
- * argument value. This bit set is modified so that the addressed bit has the
- * value true if and only one of the following statements holds:
- *
- *
The addressed bit initially had the value true, and the
- * value of the argument is false.
- *
The bit initially had the value false, and the
- * value of the argument is true.
- *
- *
- * @param i a bit index
- * @param value a boolean value to XOR with that bit
- * @exception java.lang.IndexOutOfBoundsException if the specified index
- * is negative
- * or equal to Integer.MAX_VALUE
- * @since 1.6
- */
- public void xor(int i, boolean value)
- {
- if ((i + 1) < 1)
- throw new IndexOutOfBoundsException("i=" + i);
- if (value)
- flip(i);
- }
-
- /**
- * Performs a logical XOR of this bit set with the bit set argument
- * within the given range. This resulting bit set is computed so that a bit
- * within the range in it has the value true if and only if one
- * of the following statements holds:
- *
- *
The bit initially had the value true, and the
- * corresponding bit in the argument set has the value false.
- *
The bit initially had the value false, and the
- * corresponding bit in the argument set has the value true.
- *
- * Outside the range this set is not changed.
- *
- * @param i index of the first bit to be included in the operation
- * @param j index after the last bit to included in the operation
- * @param b the SparseBitSet with which to perform the XOR
- * operation with this SparseBitSet
- * @exception IndexOutOfBoundsException if i is negative or
- * equal to Integer.MAX_VALUE, or j is negative,
- * or i is larger than j
- * @since 1.6
- */
- public void xor(int i, int j, SparseBitSet b) throws IndexOutOfBoundsException
- {
- setScanner(i, j, b, xorStrategy);
- }
-
- /**
- * Performs a logical XOR of this bit set with the bit set argument.
- * This resulting bit set is computed so that a bit in it has the value
- * true if and only if one of the following statements holds:
- *
- *
The bit initially had the value true, and the
- * corresponding bit in the argument set has the value false.
- *
The bit initially had the value false, and the
- * corresponding bit in the argument set has the value true.
- *
- *
- * @param b the SparseBitSet with which to perform the XOR
- * operation with thisSparseBitSet
- * @since 1.6
- */
- public void xor(SparseBitSet b)
- {
- setScanner(0, b.bitsLength, b, xorStrategy);
- }
-
- /**
- * Performs a logical XOR of the two given SparseBitSets.
- * The resulting bit set is created so that a bit in it has the value
- * true if and only if one of the following statements holds:
- *
- *
A bit in the first argument has the value true, and the
- * corresponding bit in the second argument has the value
- * false.
- *
A bit in the first argument has the value false, and the
- * corresponding bit in the second argument has the value
- * true.
- *
- * @param a a SparseBitSet
- * @param b another SparseBitSet
- * @return a new SparseBitSet representing the XOR of the two sets
- * @since 1.6
- */
- public static SparseBitSet xor(SparseBitSet a, SparseBitSet b)
- {
- final SparseBitSet result = a.clone();
- result.xor(b);
- return result;
- }
-
- //==============================================================================
- // Internal methods
- //==============================================================================
-
- /**
- * Throw the exception to indicate a range error. The String
- * constructed reports all the possible errors in one message.
- *
- * @param i lower bound for a operation
- * @param j upper bound for a operation
- * @exception IndexOutOfBoundsException indicating the range is not valid
- * @since 1.6
- */
- protected static void throwIndexOutOfBoundsException(int i, int j)
- throws IndexOutOfBoundsException
- {
- String s = "";
- if (i < 0)
- s += "(i=" + i + ") < 0";
- if (i == Integer.MAX_VALUE)
- s += "(i=" + i + ")";
- if (j < 0)
- s += (s.isEmpty() ? "" : ", ") + "(j=" + j + ") < 0";
- if (i > j)
- s += (s.isEmpty() ? "" : ", ") + "(i=" + i + ") > (j=" + j + ")";
- throw new IndexOutOfBoundsException(s);
- }
-
- /**
- * Initializes all the additional objects required for correct operation.
- *
- * @since 1.6
- */
- protected final void constructorHelper()
- {
- spare = new long[LENGTH3];
- cache = new Cache();
- updateStrategy = new UpdateStrategy();
- }
-
- /**
- * Clear out a part of the set array with nulls, from the given start to the
- * end of the array. If the given parameter is beyond the end of the bits
- * array, nothing is changed.
- *
- * @param start word index at which to start (inclusive)
- * @since 1.6
- */
- protected final void nullify(int start)
- {
- final int aLength = bits.length;
- if (start < aLength)
- {
- for (int w = start; w != aLength; ++w)
- bits[w] = null;
- cache.hash = 0; // Invalidate size, etc., values
- }
- }
-
- /**
- * Resize the bit array. Moves the entries in the the bits array of this
- * SparseBitSet into an array whose size (which may be larger or smaller) is
- * the given bit size (i.e., includes the bit whose index is one less
- * that the given value). If the new array is smaller, the excess entries in
- * the set array are discarded. If the new array is bigger, it is filled with
- * nulls.
- *
- * @param index the desired address to be included in the set
- * @since 1.6
- */
- protected final void resize(int index)
- {
- /* Find an array size that is a power of two that is as least as large
- enough to contain the index requested. */
- final int w1 = (index >> SHIFT3) >> SHIFT1;
- int newSize = Integer.highestOneBit(w1);
- if (newSize == 0)
- newSize = 1;
- if (w1 >= newSize)
- newSize <<= 1;
- if (newSize > MAX_LENGTH1)
- newSize = MAX_LENGTH1;
- final int aLength1 = (bits != null ? bits.length : 0);
-
- if (newSize != aLength1 || bits == null)
- { // only if the size needs to be changed
- final long[][][] temp = new long[newSize][][]; // Get the new array
- if (aLength1 != 0)
- {
- /* If it exists, copy old array to the new array. */
- System.arraycopy(bits, 0, temp, 0, Math.min(aLength1, newSize));
- nullify(0); // Don't leave unused pointers around. */
- }
- bits = temp; // Set new array as the set array
- bitsLength = // Index of last possible bit, plus one.
- (newSize == MAX_LENGTH1 ? Integer.MAX_VALUE : newSize * UNIT);
- }
- }
-
- /**
- * Scans over the bit set (and a second bit set if part of the operation) are
- * all performed by this method. The properties and the operation executed
- * are defined by a given strategy, which must be derived from the
- * AbstractStrategy. The strategy defines how to operate on a
- * single word, and on whole words that may or may not constitute a full
- * block of words.
- *
- * @param i the bit (inclusive) at which to start the scan
- * @param j the bit (exclusive) at which to stop the scan
- * @param b a SparseBitSet, if needed, the second SparseBitSet in the
- * operation
- * @param op the AbstractStrategy class defining the operation to be
- * executed
- * @exception IndexOutOfBoundsException
- * @since 1.6
- * @see AbstractStrategy
- */
- protected final void setScanner(int i, int j, SparseBitSet b,
- AbstractStrategy op) throws IndexOutOfBoundsException
- {
- /* This method has been assessed as having a McCabe cyclomatic
- complexity of 47 (i.e., impossibly high). However, given that this
- method incorporates all the set scanning logic for all methods
- (with the exception of nextSetBit and nextClearBit, which themselves
- have high cyclomatic complexities of 13), and is attempting to minimise
- execution time (hence deals with processing shortcuts), it cannot be
- expected to be simple. In fact, the work of lining up level3 blocks
- proceeds step-wise, and each sub-section piece is reasonably
- straight-forward. Nevertheless, the number of paths is high, and
- caution is advised in attempting to correct anything. */
-
- /* Do whatever the strategy needs to get started, and do whatever initial
- checking is needed--fail here if needed before much else is done. */
- if (op.start(b))
- cache.hash = 0;
-
- if (j < i || (i + 1) < 1)
- throwIndexOutOfBoundsException(i, j);
- if (i == j)
- return;
-
- /* Get the values of all the short-cut options. */
- final int properties = op.properties();
- final boolean f_op_f_eq_f = (properties & AbstractStrategy.F_OP_F_EQ_F) != 0;
- final boolean f_op_x_eq_f = (properties & AbstractStrategy.F_OP_X_EQ_F) != 0;
- final boolean x_op_f_eq_f = (properties & AbstractStrategy.X_OP_F_EQ_F) != 0;
- final boolean x_op_f_eq_x = (properties & AbstractStrategy.X_OP_F_EQ_X) != 0;
-
- /* Index of the current word, and mask for the first word,
- to be processed in the bit set. */
- int u = i >> SHIFT3;
- final long um = ~0L << i;
-
- /* Index of the final word, and mask for the final word,
- to be processed in the bit set. */
- final int v = (j - 1) >> SHIFT3;
- final long vm = ~0L >>> -j;
-
- /* Set up the two bit arrays (if the second exists), and their
- corresponding lengths (if any). */
- long[][][] a1 = bits; // Level1, i.e., the bit arrays
- int aLength1 = bits.length;
- final long[][][] b1 = (b != null ? b.bits : null);
- final int bLength1 = (b1 != null ? b.bits.length : 0);
-
- /* Calculate the initial values of the parts of the words addresses,
- as well as the location of the final block to be processed. */
- int u1 = u >> SHIFT1;
- int u2 = (u >> SHIFT2) & MASK2;
- int u3 = u & MASK3;
- final int v1 = v >> SHIFT1;
- final int v2 = (v >> SHIFT2) & MASK2;
- final int v3 = v & MASK3;
- final int lastA3Block = (v1 << LEVEL2) + v2;
-
- /* Initialize the local copies of the counts of blocks and areas; and
- whether there is a partial first block. */
- int a2CountLocal = 0;
- int a3CountLocal = 0;
- boolean notFirstBlock = u == 0 && um == ~0L;
-
- /* The first level2 is cannot be judged empty if not being scanned from
- the beginning. */
- boolean a2IsEmpty = u2 == 0; // Presumption
- while (i < j)
- {
- /* Determine if there is a level2 area in both the a and the b set,
- and if so, set the references to these areas. */
- long[][] a2 = null;
- boolean haveA2 = u1 < aLength1 && (a2 = a1[u1]) != null;
- long[][] b2 = null;
- final boolean haveB2 = u1 < bLength1
- && b1 != null && (b2 = b1[u1]) != null;
- /* Handling of level 2 empty areas: determined by the
- properties of the strategy. It is necessary to actually visit
- the first and last blocks of a scan, since not all of the block
- might participate in the operation, hence making decision based
- on just the references to the blocks could be wrong. */
- if ((!haveA2 && !haveB2 && f_op_f_eq_f
- || !haveA2 && f_op_x_eq_f || !haveB2 && x_op_f_eq_f)
- && notFirstBlock && u1 != v1)
- {//nested if!
- if (u1 < aLength1)
- a1[u1] = null;
- }
- else
- {
- final int limit2 = (u1 == v1 ? v2 + 1 : LENGTH2);
- while (u2 != limit2)
- {
- /* Similar logic applied here as for the level2 blocks.
- The initial and final block must be examined. In other
- cases, it may be possible to make a decision based on
- the value of the references, as indicated by the
- properties of the strategy. */
- long[] a3 = null;
- final boolean haveA3 = haveA2 && (a3 = a2[u2]) != null;
- long[] b3 = null;
- final boolean haveB3 = haveB2 && (b3 = b2[u2]) != null;
- final int a3Block = (u1 << LEVEL2) + u2;
- final boolean notLastBlock = lastA3Block != a3Block;
- /* Handling of level 3 empty areas: determined by the
- properties of the strategy. */
- if ((!haveA3 && !haveB3 && f_op_f_eq_f
- || !haveA3 && f_op_x_eq_f || !haveB3 && x_op_f_eq_f)
- && notFirstBlock && notLastBlock)
- {
- /* Do not need level3 block, so remove it, and move on. */
- if (haveA2)
- a2[u2] = null;
- }
- else
- {
- /* So what is needed is the level3 block. */
- final int base3 = a3Block << SHIFT2;
- final int limit3 = (notLastBlock ? LENGTH3 : v3);
- if (!haveA3)
- a3 = spare;
- if (!haveB3)
- b3 = ZERO_BLOCK;
- boolean isZero;
- if (notFirstBlock && notLastBlock)
- if (x_op_f_eq_x && !haveB3)
- isZero = op.isZeroBlock(a3);
- // b block is null, just check a block
- else
- isZero = op.block(base3, 0, LENGTH3, a3, b3);
- // Do the operation on the whole block
- else
- { /* Partial block to process. */
- if (notFirstBlock)
- {
- /* By implication, this is the last block */
- isZero = op.block(base3, 0, limit3, a3, b3);
- // Do the whole words
- isZero &= op.word(base3, limit3, a3, b3, vm);
- // And then the final word
- }
- else
- { // u, v are correct if first block
- if (u == v) // Scan starts and ends in one word
- isZero = op.word(base3, u3, a3, b3, um & vm);
- else
- { // Scan starts in this a3 block
- isZero = op.word(base3, u3, a3, b3, um);
- // First word
- isZero &=
- op.block(base3, u3 + 1, limit3, a3, b3);
- // Remainder of full words in block
- if (limit3 != LENGTH3)
- isZero &= op.word(base3, limit3, a3, b3, vm);
- // If there is a partial word left
- }
- notFirstBlock = true; // Only one first block
- }
- if (isZero)
- isZero = op.isZeroBlock(a3);
- // If not known to have a non-zero
- // value, be sure whether all zero.
- }
- if (isZero) // The resulting a3 block has no values
- {// nested if!
- /* If there is an level 2 area make the entry for this
- level3 block be a null (i.e., remove any a3 block ). */
- if (haveA2)
- a2[u2] = null;
- }
- else
- {
- /* If the a3 block used was the spare block, put it
- into current level2 area; get a new spare block. */
- if (a3 == spare)
- {
- if (i >= bitsLength) //Check that the set is large
- { // enough to take the new block
- resize(i); // Make it large enough
- a1 = bits; // Update reference and length
- aLength1 = a1.length;
- }
- if (a2 == null) // Ensure a level 2 area
- {
- a1[u1] = a2 = new long[LENGTH2][];
- haveA2 = true; // Ensure know level2 not empty
- }
- a2[u2] = a3; // Insert the level3 block
- spare = new long[LENGTH3]; // Replace the spare
- }
- ++a3CountLocal; // Count the level 3 block
- }
- a2IsEmpty &= !(haveA2 && a2[u2] != null);
- } // Keep track of level 2 usage
- ++u2;
- u3 = 0;
- } /* end while ( u2 != limit2 ) */
- /* If the loop finishes without completing the level 2, it may
- be left with a reference but still be all null--this is OK. */
- if (u2 == LENGTH2 && a2IsEmpty && u1 < aLength1)
- a1[u1] = null;
- else
- ++a2CountLocal; // Count level 2 areas
- }
- /* Advance the value of u based on what happened. */
- i = (u = (++u1 << SHIFT1)) << SHIFT3;
- u2 = 0; // u3 = 0
- // Compute next word and bit index
- if (i < 0)
- i = Integer.MAX_VALUE; // Don't go over the end
- } /* end while( i < j ) */
-
- /* Do whatever the strategy needs in order to finish. */
- op.finish(a2CountLocal, a3CountLocal);
- }
-
- /**
- * The entirety of the bit set is examined, and the various statistics of
- * the bit set (size, length, cardinality, hashCode, etc.) are computed. Level
- * arrays that are empty (i.e., all zero at level 3, all null at level 2) are
- * replaced by null references, ensuring a normalized representation.
- *
- * @since 1.6
- */
- protected final void statisticsUpdate()
- {
- if (cache.hash != 0)
- return;
- setScanner(0, bitsLength, null, updateStrategy);
- }
-
- //==============================================================================
- // Serialization/Deserialization methods
- //==============================================================================
-
- /**
- * Save the state of the SparseBitSet instance to a stream
- * (i.e., serialize it).
- *
- * @param s the ObjectOutputStream to which to write the serialized object
- * @exception java.io.IOException if an io error occurs
- * @exception java.lang.InternalError if the SparseBitSet representation is
- * inconsistent
- *
- * @serialData The default data is emitted, followed by the current
- * compactionCount for the bit set, and then the
- * length of the set (the position of the last bit),
- * followed by the cache.count value (an int,
- * the number of int->long pairs needed to describe
- * the set), followed by the index (int) and word
- * (long) for each int->long pair.
- * The mappings need not be emitted in any particular order. This
- * is followed by the hashCode for the set that can be used
- * as an integrity check when the bit set is read back.
- *
- * @since 1.6
- */
- private void writeObject(ObjectOutputStream s) throws IOException, InternalError
- {
- statisticsUpdate(); // Update structure and stats if needed.
- /* Write any hidden stuff. */
- s.defaultWriteObject();
- s.writeInt(compactionCount); // Needed to preserve value
- s.writeInt(cache.length); // Needed to know where last bit is
-
- /* This is the number of index/value pairs to be written. */
- int count = cache.count; // Minimum number of words to be written
- s.writeInt(count);
- final long[][][] a1 = bits;
- final int aLength1 = a1.length;
- long[][] a2;
- long[] a3;
- long word;
- for (int w1 = 0; w1 != aLength1; ++w1)
- if ((a2 = a1[w1]) != null)
- for (int w2 = 0; w2 != LENGTH2; ++w2)
- if ((a3 = a2[w2]) != null)
- {
- final int base = (w1 << SHIFT1) + (w2 << SHIFT2);
- for (int w3 = 0; w3 != LENGTH3; ++w3)
- if ((word = a3[w3]) != 0)
- {
- s.writeInt(base + w3);
- s.writeLong(word);
- --count;
- }
- }
- if (count != 0)
- throw new InternalError("count of entries not consistent");
- /* As a consistency check, write the hash code of the set. */
- s.writeInt(cache.hash);
- }
-
- /**
- * serialVersionUID
- */
- private static final long serialVersionUID = -6663013367427929992L;
-
- /**
- * Reconstitute the SparseBitSet instance from a stream
- * (i.e., deserialize it).
- *
- * @param s the ObjectInputStream to use
- * @exception IOException if there is an io error
- * @exception ClassNotFoundException if the stream contains an unidentified
- * class
- * @since 1.6
- */
- private void readObject(ObjectInputStream s) throws IOException,
- ClassNotFoundException
- {
- /* Read in any hidden stuff that is part of the class overhead. */
- s.defaultReadObject();
- compactionCount = s.readInt();
- final int aLength = s.readInt();
- resize(aLength); // Make sure there is enough space
-
- /* Read in number of mappings. */
- final int count = s.readInt();
- /* Read the keys and values, them into the set array, areas, and blocks. */
- long[][] a2;
- long[] a3;
- for (int n = 0; n != count; ++n)
- {
- final int w = s.readInt();
- final int w3 = w & MASK3;
- final int w2 = (w >> SHIFT2) & MASK2;
- final int w1 = w >> SHIFT1;
-
- final long word = s.readLong();
- if ((a2 = bits[w1]) == null)
- a2 = bits[w1] = new long[LENGTH2][];
- if ((a3 = a2[w2]) == null)
- a3 = a2[w2] = new long[LENGTH3];
- a3[w3] = word;
- }
- /* Ensure all the pieces are set up for set scanning. */
- constructorHelper();
- statisticsUpdate();
- if (count != cache.count)
- throw new InternalError("count of entries not consistent");
- final int hash = s.readInt(); // Get the hashcode that was stored
- if (hash != cache.hash) // An error of some kind if not the same
- throw new IOException("deserialized hashCode mis-match");
- }
-
- //=============================================================================
- // Statistics enumeration
- //=============================================================================
-
- /**
- * These enumeration values are used as labels for the values in the String
- * created by the statistics() method. The values of the corresponding
- * statistics are ints, except for the loadFactor and
- * Average_chain_length values, which are floats.
- *
- * An array of Strings may be obtained containing a
- * representation of each of these values. An element of such an array, say,
- * values, may be accessed, for example, by:
- *
- *
- * @see #statistics(String[])
- */
- public enum Statistics
- {
- /**
- * The size of the bit set, as give by the size() method.
- */
- Size, // 0
- /**
- * The length of the bit set, as give by the length() method.
- */
- Length, // 1
- /**
- * The cardinality of the bit set, as give by the cardinality() method.
- */
- Cardinality, // 2
- /**
- * The total number of non-zero 64-bits "words" being used to hold the
- * representation of the bit set.
- */
- Total_words, // 3
- /**
- * The length of the bit set array.
- */
- Set_array_length, // 4
- /**
- * The maximum permitted length of the bit set array.
- */
- Set_array_max_length, // 5
- /**
- * The number of level2 areas.
- */
- Level2_areas, // 6
- /**
- * The length of the level2 areas.
- */
- Level2_area_length, // 7
- /**
- * The total number of level3 blocks in use.
- */
- Level3_blocks, // 8
- /**
- * The length of the level3 blocks.
- */
- Level3_block_length, // 9
- /**
- * Is the value that determines how the toString() conversion is
- * performed.
- * @see #toStringCompaction(int)
- */
- Compaction_count_value // 10
- }
-
- //=============================================================================
- // A set of cached statistics values, recomputed when necessary
- //=============================================================================
-
- /**
- * This class holds the values related to various statistics kept about the
- * bit set. These values are not kept continuously up-to-date. Whenever the
- * values become invalid, the field hash is set to zero, indicating
- * that an update is required.
- *
- * @see #statisticsUpdate()
- */
- protected class Cache
- {
- /**
- * hash is updated by the statisticsUpdate() method.
- * If the hash value is zero, it is assumed that all
- * the cached values are stale, and must be updated.
- */
- protected transient int hash;
-
- /**
- * size is updated by the statisticsUpdate() method.
- * If the hash value is zero, it is assumed the all the cached
- * values are stale, and must be updated.
- */
- protected transient int size;
-
- /**
- * cardinality is updated by the statisticsUpdate() method.
- * If the hash value is zero, it is assumed the all the cached
- * values are stale, and must be updated.
- */
- protected transient int cardinality;
-
- /**
- * length is updated by the statisticsUpdate() method.
- * If the hash value is zero, it is assumed the all the cached
- * values are stale, and must be updated.
- */
- protected transient int length;
-
- /**
- * count is updated by the statisticsUpdate() method.
- * If the hash value is zero, it is assumed the all the cached
- * values are stale, and must be updated.
- */
- protected transient int count;
-
- /**
- * a2Count is updated by the statisticsUpdate()
- * method, and will only be correct immediately after a full update. The
- * hash value is must be zero for all values to be updated.
- */
- protected transient int a2Count;
-
- /**
- * a3Count is updated by the statisticsUpdate() method,
- * and will only be correct immediately after a full update. The
- * hash value is must be zero for all values to be updated.
- */
- protected transient int a3Count;
- }
-
- //=============================================================================
- // Abstract Strategy super-class for Strategies describing logical operations
- //=============================================================================
-
- /**
- * This strategy class is used by the setScanner to carry out the a variety
- * of operations on this set, and usually a second set. The
- * setScanner() method of the main SparseBitSet class
- * essentially finds matching level3 blocks, and then calls the strategy to
- * do the appropriate operation on each of the elements of the block.
- *
- * The symbolic constants control optimisation paths in the
- * setScanner() method of the main SparseBitSet class.
- *
- * @see SparseBitSet#setScanner(int i, int j,
- * SparseBitSet b, AbstractStrategy op)
- */
- protected abstract static class AbstractStrategy
- {
- /** If the operation requires that when matching level2 areas or level3
- * blocks are null, that no action is required, then this property is
- * required. Corresponds to the top-left entry in the logic diagram for the
- * operation being 0. For all the defined actual logic operations ('and',
- * 'andNot', 'or', and 'xor', this will be true, because for all these,
- * "false" op "false" = "false".
- */
- static final int F_OP_F_EQ_F = 0x1;
-
- /** If when level2 areas or level3 areas from the this set are null will
- * require that area or block to remain null, irrespective of the value of
- * the matching structure from the other set, then this property is required.
- * Corresponds to the first row in the logic diagram being all zeros. For
- * example, this is true for 'and' as well as 'andNot', and for 'clear', since
- * false" & "x" = "false", and "false" &! "x" = "false".
- */
- static final int F_OP_X_EQ_F = 0x2;
-
- /** If when level2 areas or level3 areas from the other set are null will
- * require the matching area or block in this set to be set to null,
- * irrespective of the current values in the matching structure from the
- * this, then this property is required. Corresponds to the first column
- * in the logic diagram being all zero. For example, this is true for
- * 'and', since "x" & "false" = "false", as well as for 'clear'.
- */
- static final int X_OP_F_EQ_F = 0x4;
-
- /** If when a level3 area from the other set is null will require the
- * matching area or block in this set to be left as it is, then this property
- * is required. Corresponds to the first column of the logic diagram being
- * equal to the left hand operand column. For example, this is true for 'or',
- * 'xor', and 'andNot', since for all of these "x" op "false" = "x".
- */
- static final int X_OP_F_EQ_X = 0x8;
-
- /**
- * Properties of this strategy.
- *
- * @return the int containing the bits representing the properties of
- * this strategy
- * @since 1.6
- */
- protected abstract int properties();
-
- /**
- * Instances of this class are to be serially reusable. To start a
- * particular use, an instance is (re-)started by calling this method. It is
- * passed the reference to the other bit set (usually to allow a check on
- * whether it is null or not, so as to simplify the implementation of the
- * block() method.
- *
- * @param b the "other" set, for whatever checking is needed.
- * @since 1.6
- * @return true -> if the cache should be set to zero
- */
- protected abstract boolean start(SparseBitSet b);
-
- /**
- * Deal with a scan that include a partial word within a level3 block. All
- * that is required is that the result be stored (if needed) into the
- * given a set block at the correct position, and that the operation only
- * affect those bits selected by 1 bits in the mask.
- *
- * @param base the base index of the block (to be used if needed)
- * @param u3 the index of the word within block
- * @param a3 the level3 block from the a set.
- * @param b3 the (nominal) level3 block from the b set (not null).
- * @param mask for the (partial) word
- * @return true if the resulting word is zero
- * @since 1.6
- */
- protected abstract boolean word(int base, int u3, long[] a3, long[] b3, long mask);
-
- /**
- * Deals with a part of a block that consists of whole words, starting with
- * the given first index, and ending with the word before the last index.
- * For the words processed, the return value should indicate whether all those
- * resulting words were zero, or not.
- *
- * @param base the base index of the block (to be used if needed)
- * @param u3 the index of the first word within block to process
- * @param v3 the index of the last word, which may be within block
- * @param a3 the level3 block from the a set.
- * @param b3 the (nominal) level3 block from the b set (not null).
- * @return true if the words scanned within the level3 block were all zero
- * @since 1.6
- */
- protected abstract boolean block(int base, int u3, int v3, long[] a3, long[] b3);
-
- /**
- * This is called to finish the processing started by the strategy (if there
- * needs to be anything done at all).
- *
- * @param a2Count possible count of level2 areas in use
- * @param a3Count possible count of level3 blocks in use
- * @since 1.6
- */
- protected void finish(int a2Count, int a3Count)
- {
- }
-
- /**
- * Check whether a level3 block is all zero.
- *
- * @param a3 the block from the a set
- * @return true if the values of the level3 block are all zero
- *
- * @since 1.6
- */
- protected final boolean isZeroBlock(long[] a3)
- {
- for (long word : a3)
- if (word != 0L)
- return false;
- return true;
- }
- }
-
- //=============================================================================
- // Strategies based on the Strategy super-class describing logical operations
- //=============================================================================
-
- /**
- * And of two sets. Where the a set is zero, it remains zero (i.e.,
- * without entries or with zero words). Similarly, where the b set is
- * zero, the a becomes zero (i.e., without entries).
- *
- * If level1 of the a set is longer than level1 of the bit set
- * b, then the unmatched virtual "entries" of the b set (beyond
- * the actual length of b) corresponding to these are all false, hence
- * the result of the "and" operation will be to make all these entries in this
- * set to become false--hence just remove them, and then scan only those
- * entries that could match entries in the bit setb. This clearing of
- * the remainder of the a set is accomplished by selecting both
- * F_OP_X_EQ_F and X_OP_F_EQ_F.
- *
- *
- * and| 0 1
- * 0| 0 0
- * 1| 0 1
- */
- protected static class AndStrategy extends AbstractStrategy
- {
- @Override
- // AndStrategy
- protected int properties()
- {
- return F_OP_F_EQ_F + F_OP_X_EQ_F + X_OP_F_EQ_F;
- }
-
- @Override
- // AndStrategy
- protected boolean start(SparseBitSet b)
- {
- if (b == null)
- throw new NullPointerException();
- return true;
- }
-
- @Override
- // AndStrategy
- protected boolean word(int base, int u3, long[] a3, long[] b3, long mask)
- {
- return (a3[u3] &= b3[u3] | ~mask) == 0L;
- }
-
- @Override
- // AndStrategy
- protected boolean block(int base, int u3, int v3, long[] a3, long[] b3)
- {
- boolean isZero = true; // Presumption
- for (int w3 = u3; w3 != v3; ++w3)
- isZero &= ((a3[w3] &= b3[w3]) == 0L);
- return isZero;
- }
- }
-
- //-----------------------------------------------------------------------------
- /**
- * AndNot of two sets. Where the a set is zero, it remains zero
- * (i.e., without entries or with zero words). On the other hand, where the
- * b set is zero, the a remains unchanged.
- *
- * If level1 of the a set is longer than level1 of the bit set
- * b, then the unmatched virtual "entries" of the b set (beyond
- * the actual length of b) corresponding to these are all false, hence
- * the result of the "and" operation will be to make all these entries in this
- * set to become false--hence just remove them, and then scan only those
- * entries that could match entries in the bit setb. This clearing of
- * the remainder of the a set is accomplished by selecting both
- * F_OP_X_EQ_F and X_OP_F_EQ_F.
- *
- *
- */
- protected static class ClearStrategy extends AbstractStrategy
- {
- @Override
- // ClearStrategy
- protected int properties()
- {
- return F_OP_F_EQ_F + F_OP_X_EQ_F;
- }
-
- @Override
- // ClearStrategy
- protected boolean start(SparseBitSet b)
- {
- return true;
- }
-
- @Override
- // ClearStrategy
- protected boolean word(int base, int u3, long[] a3, long[] b3, long mask)
- {
- return (a3[u3] &= ~mask) == 0L;
- }
-
- @Override
- // ClearStrategy
- protected boolean block(int base, int u3, int v3, long[] a3, long[] b3)
- {
- if (u3 != 0 || v3 != LENGTH3) // Optimisation
- for (int w3 = u3; w3 != v3; ++w3)
- a3[w3] = 0L;
- return true;
- }
- }
-
- //-----------------------------------------------------------------------------
- /**
- * Copies the needed parts of the b set to the a set.
- *
- *
- * get| 0 1
- * 0| 0 1
- * 1| 0 1
- */
- protected static class CopyStrategy extends AbstractStrategy
- {
- @Override
- // CopyStrategy
- protected int properties()
- {
- return F_OP_F_EQ_F + X_OP_F_EQ_F;
- }
-
- @Override
- // CopyStrategy
- protected boolean start(SparseBitSet b)
- {
- return true;
- }
-
- @Override
- // CopyStrategy
- protected boolean word(int base, int u3, long[] a3, long[] b3, long mask)
- {
- return (a3[u3] = b3[u3] & mask) == 0L;
- }
-
- @Override
- // CopyStrategy
- protected boolean block(int base, int u3, int v3, long[] a3, long[] b3)
- {
- boolean isZero = true;
- for (int w3 = u3; w3 != v3; ++w3)
- isZero &= (a3[w3] = b3[w3]) == 0L;
- return isZero;
- }
- }
-
- //-----------------------------------------------------------------------------
- /**
- * Equals compares bits in the a set with those in the b set.
- * None of the values in either set are changed, although the a set
- * may have all zero level 3 blocks replaced by null references (and
- * similarly at level 2).
- *
- *
- * equals| 0 1
- * 0| 0 -
- * 1| - -
- */
- protected static class EqualsStrategy extends AbstractStrategy
- {
- boolean result; // Used to hold result of the comparison
-
- @Override
- // EqualsStrategy
- protected int properties()
- {
- return F_OP_F_EQ_F;
- }
-
- @Override
- // EqualsStrategy
- protected boolean start(SparseBitSet b)
- {
- if (b == null)
- throw new NullPointerException();
- result = true;
- return false;
- /* Equals does not change the content of the set, hence hash need
- not be reset. */
- }
-
- @Override
- // EqualsStrategy
- protected boolean word(int base, int u3, long[] a3, long[] b3, long mask)
- {
- final long word = a3[u3];
- result &= (word & mask) == (b3[u3] & mask);
- return word == 0L;
- }
-
- @Override
- // EqualsStrategy
- protected boolean block(int base, int u3, int v3, long[] a3, long[] b3)
- {
-
- boolean isZero = true; // Presumption
- for (int w3 = u3; w3 != v3; ++w3)
- {
- final long word = a3[w3];
- result &= word == b3[w3];
- isZero &= word == 0L;
- }
- return isZero;
- }
- }
-
- //-----------------------------------------------------------------------------
- /**
- * Flip inverts the bits of the a set within the given range.
- *
- *
- * flip| 0 1
- * 0| 1 1
- * 1| 0 0
- */
- protected static class FlipStrategy extends AbstractStrategy
- {
- @Override
- // FlipStrategy
- protected int properties()
- {
- return 0;
- }
-
- @Override
- // FlipStrategy
- protected boolean start(SparseBitSet b)
- {
- return true;
- }
-
- @Override
- // FlipStrategy
- protected boolean word(int base, int u3, long[] a3, long[] b3, long mask)
- {
- return (a3[u3] ^= mask) == 0L;
- }
-
- @Override
- // FlipStrategy
- protected boolean block(int base, int u3, int v3, long[] a3, long[] b3)
- {
- boolean isZero = true; // Presumption
- for (int w3 = u3; w3 != v3; ++w3)
- isZero &= (a3[w3] ^= ~0L) == 0L;
- return isZero;
- }
- }
-
- //-----------------------------------------------------------------------------
- /**
- * Intersect has a true result if any word in the a set has a bit
- * in common with the b set. During the scan of the a set
- * blocks (and areas) that are all zero may be replaced with empty blocks
- * and areas (null references), but the value of the set is not changed
- * (which is why X_OP_F_EQ_F is not selected, since this would cause
- * parts of the a set to be zero-ed out).
- *
- *
- * intersect| 0 1
- * 0| 0 0
- * 1| 1 1
- */
- protected static class IntersectsStrategy extends AbstractStrategy
- {
- /**
- * The boolean result of the intersects scan Strategy is kept here.
- */
- protected boolean result;
-
- @Override
- // IntersectsStrategy
- protected int properties()
- {
- return F_OP_F_EQ_F + F_OP_X_EQ_F;
- }
-
- @Override
- // IntersectsStrategy
- protected boolean start(SparseBitSet b)
- {
- if (b == null)
- throw new NullPointerException();
- result = false;
- return false;
- /* Intersect does not change the content of the set, hence hash
- need not be reset. */
- }
-
- @Override
- // IntersectsStrategy
- protected boolean word(int base, int u3, long[] a3, long[] b3, long mask)
- {
- final long word = a3[u3];
- result |= (word & b3[u3] & mask) != 0L;
- return word == 0L;
- }
-
- @Override
- // IntersectsStrategy
- protected boolean block(int base, int u3, int v3, long[] a3, long[] b3)
- {
- boolean isZero = true; // Presumption
- for (int w3 = u3; w3 != v3; ++w3)
- {
- final long word = a3[w3];
- result |= (word & b3[w3]) != 0L;
- isZero &= word == 0L;
- }
- return isZero;
- }
- }
-
- /**
- * Or of two sets. Where the a set is one, it remains one. Similarly,
- * where the b set is one, the a becomes one. If both sets have
- * zeros in corresponding places, a zero results. Whole blocks or areas that
- * are or become zero are replaced by null arrays.
- *
- * If level1 of the a set is longer than level1 of the bit set
- * b, then the unmatched entries of the a set (beyond
- * the actual length of b) corresponding to these remain unchanged. *
- *
- * or| 0 1
- * 0| 0 1
- * 1| 1 1
- */
- protected static class OrStrategy extends AbstractStrategy
- {
- @Override
- // OrStrategy
- protected int properties()
- {
- return F_OP_F_EQ_F + X_OP_F_EQ_X;
- }
-
- @Override
- // OrStrategy
- protected boolean start(SparseBitSet b)
- {
- if (b == null)
- throw new NullPointerException();
- return true;
- }
-
- @Override
- // OrStrategy
- protected boolean word(int base, int u3, long[] a3, long[] b3, long mask)
- {
- return (a3[u3] |= b3[u3] & mask) == 0L;
- }
-
- @Override
- // OrStrategy
- protected boolean block(int base, int u3, int v3, long[] a3, long[] b3)
- {
- boolean isZero = true; // Presumption
- for (int w3 = u3; w3 != v3; ++w3)
- isZero &= (a3[w3] |= b3[w3]) == 0L;
- return isZero;
- }
- }
-
- //-----------------------------------------------------------------------------
- /**
- * Set creates entries everywhere within the range. Hence no empty level2
- * areas or level3 blocks are ignored, and no empty (all zero) blocks are
- * returned.
- *
- *
- * set| 0 1
- * 0| 1 1
- * 1| 1 1
- */
- protected static class SetStrategy extends AbstractStrategy
- {
- @Override
- // SetStrategy
- protected int properties()
- {
- return 0;
- }
-
- @Override
- // SetStrategy
- protected boolean start(SparseBitSet b)
- {
- return true;
- }
-
- @Override
- // SetStrategy
- protected boolean word(int base, int u3, long[] a3, long[] b3, long mask)
- {
- a3[u3] |= mask;
- return false;
- }
-
- @Override
- // SetStrategy
- protected boolean block(int base, int u3, int v3, long[] a3, long[] b3)
- {
- for (int w3 = u3; w3 != v3; ++w3)
- a3[w3] = ~0L;
- return false; // set always sets bits
- }
- }
-
- //-----------------------------------------------------------------------------
- /**
- * Update the seven statistics that are computed for each set. These are
- * updated by calling statisticsUpdate, which uses this strategy.
- *
- *
- * update| 0 1
- * 0| 0 0
- * 1| 1 1
- *
- * @see SparseBitSet#statisticsUpdate()
- */
- protected class UpdateStrategy extends AbstractStrategy
- {
- /**
- * Working space for find the size and length of the bit set. Holds the
- * index of the first non-empty word in the set.
- */
- protected transient int wMin;
-
- /**
- * Working space for find the size and length of the bit set. Holds copy of
- * the first non-empty word in the set.
- */
- protected transient long wordMin;
-
- /**
- * Working space for find the size and length of the bit set. Holds the
- * index of the last non-empty word in the set.
- */
- protected transient int wMax;
-
- /**
- * Working space for find the size and length of the bit set. Holds a copy
- * of the last non-empty word in the set.
- */
- protected transient long wordMax;
-
- /**
- * Working space for find the hash value of the bit set. Holds the
- * current state of the computation of the hash value. This value is
- * ultimately transferred to the Cache object.
- *
- * @see SparseBitSet.Cache
- */
- protected transient long hash;
-
- /**
- * Working space for keeping count of the number of non-zero words in the
- * bit set. Holds the current state of the computation of the count. This
- * value is ultimately transferred to the Cache object.
- *
- * @see SparseBitSet.Cache
- */
- protected transient int count;
-
- /**
- * Working space for counting the number of non-zero bits in the bit set.
- * Holds the current state of the computation of the cardinality.This
- * value is ultimately transferred to the Cache object.
- *
- * @see SparseBitSet.Cache
- */
- protected transient int cardinality;
-
- @Override
- // UpdateStrategy
- protected int properties()
- {
- return F_OP_F_EQ_F + F_OP_X_EQ_F;
- }
-
- /**
- * This method initializes the computations by suitably resetting cache
- * fields or working fields.
- *
- * @param b the other SparseBitSet, for checking if needed.
- *
- * @since 1.6
- */
- @Override
- protected boolean start(SparseBitSet b)
- {
- hash = 1234L; // Magic number
- wMin = -1; // index of first non-zero word
- wordMin = 0L; // word at that index
- wMax = 0; // index of last non-zero word
- wordMax = 0L; // word at that index
- count = 0; // count of non-zero words in whole set
- cardinality = 0; // count of non-zero bits in the whole set
- return false;
- }
-
- @Override
- protected boolean word(int base, int u3, long[] a3, long[] b3, long mask)
- {
- final long word = a3[u3];
- final long word1 = word & mask;
- if (word1 != 0L)
- compute(base + u3, word1);
- return word == 0L;
- }
-
- @Override
- // UpdateStrategy
- protected boolean block(int base, int u3, int v3, long[] a3, long[] b3)
- {
- boolean isZero = true; // Presumption
- for (int w3 = 0; w3 != v3; ++w3)
- {
- final long word = a3[w3];
- if (word != 0)
- {
- isZero = false;
- compute(base + w3, word);
- }
- }
- return isZero;
- }
-
- @Override
- // UpdateStrategy
- protected void finish(int a2Count, int a3Count)
- {
- cache.a2Count = a2Count;
- cache.a3Count = a3Count;
- cache.count = count;
- cache.cardinality = cardinality;
- cache.length = (wMax + 1) * LENGTH4 - Long.numberOfLeadingZeros(wordMax);
- cache.size = cache.length - wMin * LENGTH4
- - Long.numberOfTrailingZeros(wordMin);
- cache.hash = (int) ((hash >> Integer.SIZE) ^ hash);
- }
-
- /**
- * This method does the accumulation of the statistics. It must be called
- * in sequential order of the words in the set for which the statistics
- * are being accumulated, and only for non-null values of the second
- * parameter.
- *
- * Two of the values (a2Count and a3Count) are not updated here,
- * but are done in the code near where this method is called.
- *
- * @param index the word index of the word supplied
- * @param word the long non-zero word from the set
- * @since 1.6
- */
- private void compute(final int index, final long word)
- {
- /* Count the number of actual words being used. */
- ++count;
- /* Continue to accumulate the hash value of the set. */
- hash ^= word * (long) (index + 1);
- /* The first non-zero word contains the first actual bit of the
- set. The location of this bit is used to compute the set size. */
- if (wMin < 0)
- {
- wMin = index;
- wordMin = word;
- }
- /* The last non-zero word contains the last actual bit of the set.
- The location of this bit is used to compute the set length. */
- wMax = index;
- wordMax = word;
- /* Count the actual bits, so as to get the cardinality of the set. */
- cardinality += Long.bitCount(word);
- }
- }
-
- //-----------------------------------------------------------------------------
- /**
- * The XOR of level3 blocks is computed.
- *
- *
- * xor| 0 1
- * 0| 0 1
- * 1| 1 0
- */
- protected static class XorStrategy extends AbstractStrategy
- {
- @Override
- // XorStrategy
- protected int properties()
- {
- return F_OP_F_EQ_F + X_OP_F_EQ_X;
- }
-
- @Override
- // XorStrategy
- protected boolean start(SparseBitSet b)
- {
- if (b == null)
- throw new NullPointerException();
- return true;
- }
-
- @Override
- protected boolean word(int base, int u3, long[] a3, long[] b3, long mask)
- {
- return (a3[u3] ^= b3[u3] & mask) == 0;
- }
-
- @Override
- // XorStrategy
- protected boolean block(int base, int u3, int v3, long[] a3, long[] b3)
- {
- boolean isZero = true; // Presumption
- for (int w3 = u3; w3 != v3; ++w3)
- isZero &= (a3[w3] ^= b3[w3]) == 0;
- return isZero;
-
- }
- }
-
- //-----------------------------------------------------------------------------
- /**
- * Word and block and strategy.
- */
- protected static final transient AndStrategy andStrategy = new AndStrategy();
- /**
- * Word and block andNot strategy.
- */
- protected static final transient AndNotStrategy andNotStrategy = new AndNotStrategy();
- /**
- * Word and block clear strategy.
- */
- protected static final transient ClearStrategy clearStrategy = new ClearStrategy();
- /**
- * Word and block copy strategy.
- */
- protected static final transient CopyStrategy copyStrategy = new CopyStrategy();
- /**
- * Word and block equals strategy.
- */
- protected transient EqualsStrategy equalsStrategy;
- /**
- * Word and block flip strategy.
- */
- protected static final transient FlipStrategy flipStrategy = new FlipStrategy();
- /**
- * Word and block intersects strategy.
- */
- protected static transient IntersectsStrategy intersectsStrategy = new IntersectsStrategy();
- /**
- * Word and block or strategy.
- */
- protected static final transient OrStrategy orStrategy = new OrStrategy();
- /**
- * Word and block set strategy.
- */
- protected static final transient SetStrategy setStrategy = new SetStrategy();
- /**
- * Word and block update strategy.
- */
- protected transient UpdateStrategy updateStrategy;
- /**
- * Word and block xor strategy.
- */
- protected static final transient XorStrategy xorStrategy = new XorStrategy();
-}
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/collection/SparseBlockSet.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/collection/SparseBlockSet.java
deleted file mode 100644
index 72f86e51a..000000000
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/collection/SparseBlockSet.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package com.fastasyncworldedit.core.object.collection;
-
-import java.io.Serializable;
-
-public class SparseBlockSet implements Serializable {
- private SparseBitSet[] sets;
-
- public SparseBlockSet(int depth) {
- sets = new SparseBitSet[depth];
- for (int i = 0; i < sets.length; i++) {
- sets[i] = new SparseBitSet();
- }
- }
-
- public void setBlock(int index, int id) {
- for (int i = 0; i < sets.length; i++) {
- SparseBitSet set = sets[i];
- if (((id >> i) & 1) == 1) {
- set.set(index);
- } else {
- set.clear(index);
- }
- }
- }
-
- public int getBlock(int index) {
- int id = 0;
- for (int i = 0; i < sets.length; i++) {
- SparseBitSet set = sets[i];
- if (set.get(index)) {
- id += 1 << i;
- }
- }
- return id;
- }
-}
\ No newline at end of file
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/collection/SummedAreaTable.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/collection/SummedAreaTable.java
deleted file mode 100644
index a58108228..000000000
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/collection/SummedAreaTable.java
+++ /dev/null
@@ -1,99 +0,0 @@
-package com.fastasyncworldedit.core.object.collection;
-
-import com.fastasyncworldedit.core.util.MathMan;
-
-public class SummedAreaTable {
-
- private final char[] source;
- private final long[] summed;
- private final int length;
- private final int width;
- private final int area;
- private final int radius;
- private final float areaInverse;
- private final float[] areaInverses;
-
- public SummedAreaTable(long[] buffer, char[] matrix, int width, int radius) {
- this.source = matrix;
- this.summed = buffer;
- this.width = width;
- this.length = buffer.length / width;
- this.radius = radius;
- this.area = MathMan.sqr(radius * 2 + 1);
- this.areaInverse = 1f / area;
- this.areaInverses = new float[area - 2];
- for (int area = 2; area < this.area; area++) {
- this.areaInverses[area - 2] = 1f / area;
- }
- }
-
- public void processSummedAreaTable() {
- int rowSize = source.length / width;
- int index = 0;
- for (int i = 0; i < rowSize; i++) {
- for (int j = 0; j < width; j++, index++) {
- long val = getVal(i, j, index, source[index]);
- summed[index] = val;
- }
- }
- }
-
- private long getSum(int index) {
- if (index < 0) {
- return 0;
- }
- return summed[index];
- }
-
- public int average(int x, int z, int index) {
- int minX = Math.max(0, x - radius) - x;
- int minZ = Math.max(0, z - radius) - z;
- int maxX = Math.min(width - 1, x + radius) - x;
- int maxZ = Math.min(length - 1, z + radius) - z;
- int maxzwi = maxZ * width;
- int XZ = index + maxzwi + maxX;
- int area = (maxX - minX + 1) * (maxZ - minZ + 1);
-
- long total = getSum(XZ);
-
- int minzw = minZ * width;
- int Z = index + minzw + maxX;
- if (x > radius) {
- int X = index + minX + maxzwi;
- int M = index + minzw + minX;
- total -= summed[X - 1];
- total += getSum(M - width - 1);
- }
- total -= getSum(Z - width);
- if (area == this.area) {
- return (int) (total * areaInverse);
- } else {
- return Math.round(total * areaInverses[area - 2]);
- }
- }
-
- private long getVal(int row, int col, int index, long curr) {
- long leftSum; // sub matrix sum of left matrix
- long topSum; // sub matrix sum of top matrix
- long topLeftSum; // sub matrix sum of top left matrix
- /* top left value is itself */
- if (index == 0) {
- return curr;
- }
- /* top row */
- else if (row == 0 && col != 0) {
- leftSum = summed[index - 1];
- return curr + leftSum;
- }
- /* left-most column */
- else if (row != 0 && col == 0) {
- topSum = summed[index - width];
- return curr + topSum;
- } else {
- leftSum = summed[index - 1];
- topSum = summed[index - width];
- topLeftSum = summed[index - width - 1]; // overlap between leftSum and topSum
- return curr + leftSum + topSum - topLeftSum;
- }
- }
-}
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/io/AsyncBufferedOutputStream.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/io/AsyncBufferedOutputStream.java
deleted file mode 100644
index 598cc0447..000000000
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/io/AsyncBufferedOutputStream.java
+++ /dev/null
@@ -1,183 +0,0 @@
-package com.fastasyncworldedit.core.object.io;
-
-import java.io.FilterOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.concurrent.ConcurrentLinkedDeque;
-
-/**
- * BufferedOutputStream that asynchronously flushes to disk, so callers don't
- * have to wait until the flush happens. Buffers are put into a queue that is
- * written asynchronously to disk once it is really available.
- *
- *
- * The error handling (as all stream ops are done asynchronously) is done during
- * write and close. Exceptions on the asynchronous thread will be thrown to the
- * caller either while writing or closing this stream.
- *
- *
- * @apiNote This class is thread-safe.
- * @author thomas.jungblut
- */
-public final class AsyncBufferedOutputStream extends FilterOutputStream {
-
- private final FlushThread flusher = new FlushThread();
- private final Thread flusherThread = new Thread(flusher, "FlushThread");
- private final ConcurrentLinkedDeque buffers;
-
- private final byte[] buf;
- private int count = 0;
-
- /**
- * Creates an asynchronous buffered output stream with 8K buffer and 5 maximal
- * buffers.
- */
- public AsyncBufferedOutputStream(OutputStream out) {
- this(out, 8 * 1024, 5);
- }
-
- /**
- * Creates an asynchronous buffered output stream with defined bufferSize and
- * 5 maximal buffers.
- */
- public AsyncBufferedOutputStream(OutputStream out, int bufSize) {
- this(out, bufSize, 5);
- }
-
- /**
- * Creates an asynchronous buffered output stream.
- *
- * @param out the outputStream to layer on.
- * @param bufSize the buffer size.
- * @param maxBuffers the number of buffers to keep in parallel.
- */
- public AsyncBufferedOutputStream(OutputStream out, int bufSize, int maxBuffers) {
- super(out);
- buffers = new ConcurrentLinkedDeque<>();
- buf = new byte[bufSize];
- flusherThread.start();
- }
-
- /**
- * Writes the specified byte to this buffered output stream.
- *
- * @param b the byte to be written.
- * @throws IOException if an I/O error occurs.
- */
- @Override
- public synchronized void write(int b) throws IOException {
- flushBufferIfSizeLimitReached();
- throwOnFlusherError();
- buf[count++] = (byte) b;
- }
-
- @Override
- public void write(byte[] b) throws IOException {
- write(b, 0, b.length);
- }
-
- /**
- * Writes len bytes from the specified byte array starting at
- * offset off to this buffered output stream.
- *
- * @param b the data.
- * @param off the start offset in the data.
- * @param len the number of bytes to write.
- * @throws IOException if an I/O error occurs.
- */
- @Override
- public synchronized void write(byte[] b, int off, int len) throws IOException {
- if ((off | len | (b.length - (len + off)) | (off + len)) < 0) {
- throw new IndexOutOfBoundsException();
- }
-
- int bytesWritten = 0;
- while (bytesWritten < len) {
- throwOnFlusherError();
- flushBufferIfSizeLimitReached();
-
- int bytesToWrite = Math.min(len - bytesWritten, buf.length - count);
- System.arraycopy(b, off + bytesWritten, buf, count, bytesToWrite);
- count += bytesToWrite;
- bytesWritten += bytesToWrite;
- }
- }
-
- /**
- * Flushes this buffered output stream. It will enforce that the current
- * buffer will be queue for asynchronous flushing no matter what size it has.
- *
- * @throws IOException if an I/O error occurs.
- */
- @Override
- public synchronized void flush() throws IOException {
- forceFlush();
- }
-
- private void flushBufferIfSizeLimitReached() throws IOException {
- if (count >= buf.length) {
- forceFlush();
- }
- }
-
- private void forceFlush() throws IOException {
- if (count > 0) {
- final byte[] copy = new byte[count];
- System.arraycopy(buf, 0, copy, 0, copy.length);
- buffers.add(copy);
- count = 0;
- }
- }
-
- @Override
- public synchronized void close() throws IOException {
- throwOnFlusherError();
-
- forceFlush();
- flusher.closed = true;
-
- try {
- flusherThread.interrupt();
- flusherThread.join();
-
- throwOnFlusherError();
- } catch (InterruptedException e) {
- // this is expected to happen
- } finally {
- out.close();
- }
- }
-
- private void throwOnFlusherError() throws IOException {
- if (flusher != null && flusher.errorHappened) {
- throw new IOException("caught flusher to fail writing asynchronously!",
- flusher.caughtException);
- }
- }
-
- class FlushThread implements Runnable {
-
- volatile boolean closed = false;
- volatile boolean errorHappened = false;
- volatile Exception caughtException;
-
- @Override
- public void run() {
- // run the real flushing action to the underlying stream
- try {
- while (!closed) {
- byte[] take = buffers.poll();
- if (take != null) {
- out.write(take);
- }
- }
- } catch (Exception e) {
- caughtException = e;
- errorHappened = true;
- // yield this thread, an error happened
- return;
- }
- }
- }
-
-}
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/io/BufferedRandomAccessFile.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/io/BufferedRandomAccessFile.java
deleted file mode 100644
index 7d6ea9690..000000000
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/io/BufferedRandomAccessFile.java
+++ /dev/null
@@ -1,424 +0,0 @@
-package com.fastasyncworldedit.core.object.io;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.RandomAccessFile;
-import java.util.Arrays;
-
-
-/**
- * A {@code BufferedRandomAccessFile} is like a
- * {@code RandomAccessFile}, but it uses a private buffer so that most
- * operations do not require a disk access.
- *
- * @author Avinash Lakshman ( alakshman@facebook.com) & Prashant Malik ( pmalik@facebook.com )
- * @apiNote The operations on this class are unmonitored. Also, the correct
- * functioning of the {@code RandomAccessFile} methods that are not
- * overridden here relies on the implementation of those methods in the superclass.
- */
-
-public class BufferedRandomAccessFile extends RandomAccessFile {
- static final int LogBuffSz_ = 16; // 64K buffer
- public static final int BuffSz_ = (1 << LogBuffSz_);
- static final long BuffMask_ = ~(((long) BuffSz_) - 1L);
-
- /*
- * This implementation is based on the buffer implementation in Modula-3's
- * "Rd", "Wr", "RdClass", and "WrClass" interfaces.
- */
- private boolean dirty_; // true iff unflushed bytes exist
- private boolean closed_; // true iff the file is closed
- private long curr_; // current position in file
- private long lo_; // bounds on characters in "buff"
- private long hi_; // bounds on characters in "buff"
- private byte[] buff_; // local buffer
- private long maxHi_; // this.lo + this.buff.length
- private boolean hitEOF_; // buffer contains last file block?
- private long diskPos_; // disk position
-
- /*
- * To describe the above fields, we introduce the following abstractions for
- * the file "f":
- *
- * len(f) the length of the file curr(f) the current position in the file
- * c(f) the abstract contents of the file disk(f) the contents of f's
- * backing disk file closed(f) true iff the file is closed
- *
- * "curr(f)" is an index in the closed interval [0, len(f)]. "c(f)" is a
- * character sequence of length "len(f)". "c(f)" and "disk(f)" may differ if
- * "c(f)" contains unflushed writes not reflected in "disk(f)". The flush
- * operation has the effect of making "disk(f)" identical to "c(f)".
- *
- * A file is said to be *valid* if the following conditions hold:
- *
- * V1. The "closed" and "curr" fields are correct:
- *
- * f.closed == closed(f) f.curr == curr(f)
- *
- * V2. The current position is either contained in the buffer, or just past
- * the buffer:
- *
- * f.lo <= f.curr <= f.hi
- *
- * V3. Any (possibly) unflushed characters are stored in "f.buff":
- *
- * (forall i in [f.lo, f.curr): c(f)[i] == f.buff[i - f.lo])
- *
- * V4. For all characters not covered by V3, c(f) and disk(f) agree:
- *
- * (forall i in [f.lo, len(f)): i not in [f.lo, f.curr) => c(f)[i] ==
- * disk(f)[i])
- *
- * V5. "f.dirty" is true iff the buffer contains bytes that should be
- * flushed to the file; by V3 and V4, only part of the buffer can be dirty.
- *
- * f.dirty == (exists i in [f.lo, f.curr): c(f)[i] != f.buff[i - f.lo])
- *
- * V6. this.maxHi == this.lo + this.buff.length
- *
- * Note that "f.buff" can be "null" in a valid file, since the range of
- * characters in V3 is empty when "f.lo == f.curr".
- *
- * A file is said to be *ready* if the buffer contains the current position,
- * i.e., when:
- *
- * R1. !f.closed && f.buff != null && f.lo <= f.curr && f.curr < f.hi
- *
- * When a file is ready, reading or writing a single byte can be performed
- * by reading or writing the in-memory buffer without performing a disk
- * operation.
- */
-
- /**
- * Open a new {@code BufferedRandomAccessFile} on {@code file}
- * in mode {@code mode}, which should be "r" for reading only, or
- * "rw" for reading and writing.
- */
- public BufferedRandomAccessFile(File file, String mode) throws IOException {
- super(file, mode);
- this.init(0);
- }
-
- public BufferedRandomAccessFile(File file, String mode, int size) throws IOException {
- super(file, mode);
- this.init(size);
- }
-
- /**
- * Open a new {@code BufferedRandomAccessFile} on the file named
- * {@code name} in mode {@code mode}, which should be "r" for
- * reading only, or "rw" for reading and writing.
- */
- public BufferedRandomAccessFile(String name, String mode) throws IOException {
- super(name, mode);
- this.init(0);
- }
-
- public BufferedRandomAccessFile(String name, String mode, int size) throws FileNotFoundException {
- super(name, mode);
- this.init(size);
- }
-
- public BufferedRandomAccessFile(File file, String mode, byte[] buf) throws FileNotFoundException {
- super(file, mode);
- this.dirty_ = this.closed_ = false;
- this.lo_ = this.curr_ = this.hi_ = 0;
- this.buff_ = buf;
- this.maxHi_ = (long) BuffSz_;
- this.hitEOF_ = false;
- this.diskPos_ = 0L;
- }
-
- private void init(int size) {
- this.dirty_ = this.closed_ = false;
- this.lo_ = this.curr_ = this.hi_ = 0;
- this.buff_ = (size > BuffSz_) ? new byte[size] : new byte[BuffSz_];
- this.maxHi_ = (long) BuffSz_;
- this.hitEOF_ = false;
- this.diskPos_ = 0L;
- }
-
- @Override
- public void close() throws IOException {
- this.flush();
- this.closed_ = true;
- super.close();
- }
-
- /**
- * Flush any bytes in the file's buffer that have not yet been written to
- * disk. If the file was created read-only, this method is a no-op.
- */
- public void flush() throws IOException {
- this.flushBuffer();
- }
-
- /* Flush any dirty bytes in the buffer to disk. */
- private void flushBuffer() throws IOException {
- if (this.dirty_) {
- if (this.diskPos_ != this.lo_) {
- super.seek(this.lo_);
- }
- int len = (int) (this.curr_ - this.lo_);
- super.write(this.buff_, 0, len);
- this.diskPos_ = this.curr_;
- this.dirty_ = false;
- }
- }
-
- /*
- * Read at most "this.buff.length" bytes into "this.buff", returning the
- * number of bytes read. If the return result is less than
- * "this.buff.length", then EOF was read.
- */
- private int fillBuffer() throws IOException {
- int cnt = 0;
- int rem = this.buff_.length;
- while (rem > 0) {
- int n = super.read(this.buff_, cnt, rem);
- if (n < 0) {
- break;
- }
- cnt += n;
- rem -= n;
- }
- if ((cnt < 0) && (this.hitEOF_ = (cnt < this.buff_.length))) {
- // make sure buffer that wasn't read is initialized with -1
- Arrays.fill(this.buff_, cnt, this.buff_.length, (byte) 0xff);
- }
- this.diskPos_ += cnt;
- return cnt;
- }
-
- /*
- * This method positions this.curr at position pos.
- * If pos does not fall in the current buffer, it flushes the
- * current buffer and loads the correct one.
- *
- * On exit from this routine this.curr == this.hi iff pos
- * is at or past the end-of-file, which can only happen if the file was
- * opened in read-only mode.
- */
- @Override
- public void seek(long pos) throws IOException {
- if (pos >= this.hi_ || pos < this.lo_) {
- // seeking outside of current buffer -- flush and read
- this.flushBuffer();
- this.lo_ = pos & BuffMask_; // start at BuffSz boundary
- this.maxHi_ = this.lo_ + (long) this.buff_.length;
- if (this.diskPos_ != this.lo_) {
- super.seek(this.lo_);
- this.diskPos_ = this.lo_;
- }
- int n = this.fillBuffer();
- this.hi_ = this.lo_ + (long) n;
- } else {
- // seeking inside current buffer -- no read required
- if (pos < this.curr_) {
- // if seeking backwards, we must flush to maintain V4
- this.flushBuffer();
- }
- }
- this.curr_ = pos;
- }
-
- /*
- * Does not maintain V4 (i.e. buffer differs from disk contents if previously written to)
- * - Assumes no writes were made
- * @param pos
- * @throws IOException
- */
- public void seekUnsafe(long pos) throws IOException {
- if (pos >= this.hi_ || pos < this.lo_) {
- // seeking outside of current buffer -- flush and read
- this.flushBuffer();
- this.lo_ = pos & BuffMask_; // start at BuffSz boundary
- this.maxHi_ = this.lo_ + (long) this.buff_.length;
- if (this.diskPos_ != this.lo_) {
- super.seek(this.lo_);
- this.diskPos_ = this.lo_;
- }
- int n = this.fillBuffer();
- this.hi_ = this.lo_ + (long) n;
- }
- this.curr_ = pos;
- }
-
- @Override
- public long getFilePointer() {
- return this.curr_;
- }
-
- @Override
- public long length() throws IOException {
- return Math.max(this.curr_, super.length());
- }
-
- @Override
- public int read() throws IOException {
- if (this.curr_ >= this.hi_) {
- // test for EOF
- // if (this.hi < this.maxHi) return -1;
- if (this.hitEOF_) {
- return -1;
- }
-
- // slow path -- read another buffer
- this.seek(this.curr_);
- if (this.curr_ == this.hi_) {
- return -1;
- }
- }
- byte res = this.buff_[(int) (this.curr_ - this.lo_)];
- this.curr_++;
- return ((int) res) & 0xFF; // convert byte -> int
- }
-
- public byte read1() throws IOException {
- if (this.curr_ >= this.hi_) {
- // test for EOF
- // if (this.hi < this.maxHi) return -1;
- if (this.hitEOF_) {
- return -1;
- }
-
- // slow path -- read another buffer
- this.seek(this.curr_);
- if (this.curr_ == this.hi_) {
- return -1;
- }
- }
- byte res = this.buff_[(int) (this.curr_ - this.lo_)];
- this.curr_++;
- return res;
- }
-
- @Override
- public int read(byte[] b) throws IOException {
- return this.read(b, 0, b.length);
- }
-
- @Override
- public int read(byte[] b, int off, int len) throws IOException {
- if (this.curr_ >= this.hi_) {
- // test for EOF
- // if (this.hi < this.maxHi) return -1;
- if (this.hitEOF_) {
- return -1;
- }
-
- // slow path -- read another buffer
- this.seek(this.curr_);
- if (this.curr_ == this.hi_) {
- return -1;
- }
- }
- len = Math.min(len, (int) (this.hi_ - this.curr_));
- int buffOff = (int) (this.curr_ - this.lo_);
- System.arraycopy(this.buff_, buffOff, b, off, len);
- this.curr_ += len;
- return len;
- }
-
- public byte readCurrent() throws IOException {
- if (this.curr_ >= this.hi_) {
- // test for EOF
- // if (this.hi < this.maxHi) return -1;
- if (this.hitEOF_) {
- return -1;
- }
-
- // slow path -- read another buffer
- this.seek(this.curr_);
- if (this.curr_ == this.hi_) {
- return -1;
- }
- }
- return this.buff_[(int) (this.curr_ - this.lo_)];
- }
-
- public void writeCurrent(byte b) throws IOException {
- if (this.curr_ >= this.hi_) {
- if (this.hitEOF_ && this.hi_ < this.maxHi_) {
- // at EOF -- bump "hi"
- this.hi_++;
- } else {
- // slow path -- write current buffer; read next one
- this.seek(this.curr_);
- if (this.curr_ == this.hi_) {
- // appending to EOF -- bump "hi"
- this.hi_++;
- }
- }
- }
- this.buff_[(int) (this.curr_ - this.lo_)] = (byte) b;
- this.dirty_ = true;
- }
-
- public void writeUnsafe(int b) throws IOException {
- this.buff_[(int) (this.curr_ - this.lo_)] = (byte) b;
- this.curr_++;
- this.dirty_ = true;
- }
-
- @Override
- public void write(int b) throws IOException {
- if (this.curr_ >= this.hi_) {
- if (this.hitEOF_ && this.hi_ < this.maxHi_) {
- // at EOF -- bump "hi"
- this.hi_++;
- } else {
- // slow path -- write current buffer; read next one
- this.seek(this.curr_);
- if (this.curr_ == this.hi_) {
- // appending to EOF -- bump "hi"
- this.hi_++;
- }
- }
- }
- this.buff_[(int) (this.curr_ - this.lo_)] = (byte) b;
- this.curr_++;
- this.dirty_ = true;
- }
-
- @Override
- public void write(byte[] b) throws IOException {
- this.write(b, 0, b.length);
- }
-
- @Override
- public void write(byte[] b, int off, int len) throws IOException {
- while (len > 0) {
- int n = this.writeAtMost(b, off, len);
- off += n;
- len -= n;
- this.dirty_ = true;
- }
- }
-
- /*
- * Write at most "len" bytes to "b" starting at position "off", and return
- * the number of bytes written.
- */
- private int writeAtMost(byte[] b, int off, int len) throws IOException {
- if (this.curr_ >= this.hi_) {
- if (this.hitEOF_ && this.hi_ < this.maxHi_) {
- // at EOF -- bump "hi"
- this.hi_ = this.maxHi_;
- } else {
- // slow path -- write current buffer; read next one
- this.seek(this.curr_);
- if (this.curr_ == this.hi_) {
- // appending to EOF -- bump "hi"
- this.hi_ = this.maxHi_;
- }
- }
- }
- len = Math.min(len, (int) (this.hi_ - this.curr_));
- int buffOff = (int) (this.curr_ - this.lo_);
- System.arraycopy(b, off, this.buff_, buffOff, len);
- this.curr_ += len;
- return len;
- }
-}
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/io/FastByteArrayInputStream.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/io/FastByteArrayInputStream.java
deleted file mode 100644
index 65b5bdfb2..000000000
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/io/FastByteArrayInputStream.java
+++ /dev/null
@@ -1,79 +0,0 @@
-package com.fastasyncworldedit.core.object.io;
-
-import java.io.InputStream;
-
-public class FastByteArrayInputStream extends InputStream {
- public byte[] array;
- public int offset;
- public int length;
- private int position;
- private int mark;
-
- public FastByteArrayInputStream(byte[] array, int offset, int length) {
- this.array = array;
- this.offset = offset;
- this.length = length;
- }
-
- public FastByteArrayInputStream(byte[] array) {
- this(array, 0, array.length);
- }
-
- public boolean markSupported() {
- return true;
- }
-
- public void reset() {
- this.position = this.mark;
- }
-
- public void close() {
- }
-
- public void mark(int dummy) {
- this.mark = this.position;
- }
-
- public int available() {
- return this.length - this.position;
- }
-
- public long skip(long n) {
- if (n <= this.length - this.position) {
- this.position += (int) n;
- return n;
- }
- n = this.length - this.position;
- this.position = this.length;
- return n;
- }
-
- public int read() {
- if (this.length == this.position) {
- return -1;
- }
- return this.array[(this.offset + this.position++)] & 0xFF;
- }
-
- public int read(byte[] b, int offset, int length) {
- if (this.length == this.position) {
- return length == 0 ? 0 : -1;
- }
- int n = Math.min(length, this.length - this.position);
- System.arraycopy(this.array, this.offset + this.position, b, offset, n);
- this.position += n;
- return n;
- }
-
- public long position() {
- return this.position;
- }
-
- public void position(long newPosition) {
- this.position = ((int) Math.min(newPosition, this.length));
- }
-
- public long length() {
- return this.length;
- }
-}
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/io/NonClosableOutputStream.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/io/NonClosableOutputStream.java
deleted file mode 100644
index 5cd937088..000000000
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/io/NonClosableOutputStream.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package com.fastasyncworldedit.core.object.io;
-
-import java.io.IOException;
-import java.io.OutputStream;
-
-public class NonClosableOutputStream extends AbstractDelegateOutputStream {
-
- public NonClosableOutputStream(OutputStream os) {
- super(os);
- }
-
- @Override
- public void close() throws IOException {
- // Do nothing
- }
-}
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/io/PGZIPBlock.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/io/PGZIPBlock.java
deleted file mode 100644
index 87cb915a5..000000000
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/io/PGZIPBlock.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package com.fastasyncworldedit.core.object.io;
-
-import java.util.concurrent.Callable;
-
-public class PGZIPBlock implements Callable {
- public PGZIPBlock(final PGZIPOutputStream parent) {
- STATE = new PGZIPThreadLocal(parent);
- }
-
- /**
- * This ThreadLocal avoids the recycling of a lot of memory, causing lumpy performance.
- */
- protected final ThreadLocal STATE;
- public static final int SIZE = 64 * 1024;
- // private final int index;
- protected final byte[] in = new byte[SIZE];
- protected int in_length = 0;
-
- /*
- public Block(@Nonnegative int index) {
- this.index = index;
- }
- */
- // Only on worker thread
- @Override
- public byte[] call() throws Exception {
- // LOG.info("Processing " + this + " on " + Thread.currentThread());
-
- PGZIPState state = STATE.get();
- // ByteArrayOutputStream buf = new ByteArrayOutputStream(in.length); // Overestimate output size required.
- // DeflaterOutputStream def = newDeflaterOutputStream(buf);
- state.def.reset();
- state.buf.reset();
- state.str.write(in, 0, in_length);
- state.str.flush();
-
- // return Arrays.copyOf(in, in_length);
- return state.buf.toByteArray();
- }
-
- @Override
- public String toString() {
- return "Block" /* + index */ + "(" + in_length + "/" + in.length + " bytes)";
- }
-}
\ No newline at end of file
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/io/PGZIPOutputStream.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/io/PGZIPOutputStream.java
deleted file mode 100644
index 0bb398e97..000000000
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/io/PGZIPOutputStream.java
+++ /dev/null
@@ -1,252 +0,0 @@
-package com.fastasyncworldedit.core.object.io;
-
-import java.io.FilterOutputStream;
-import java.io.IOException;
-import java.io.InterruptedIOException;
-import java.io.OutputStream;
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import java.util.ArrayList;
-import java.util.concurrent.ArrayBlockingQueue;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.Future;
-import java.util.zip.CRC32;
-import java.util.zip.Deflater;
-import java.util.zip.DeflaterOutputStream;
-import java.util.zip.GZIPOutputStream;
-import javax.annotation.Nonnegative;
-import javax.annotation.Nonnull;
-
-/**
- * A multi-threaded version of {@link GZIPOutputStream}.
- *
- * @author shevek
- */
-public class PGZIPOutputStream extends FilterOutputStream {
-
- private static final ExecutorService EXECUTOR = Executors.newCachedThreadPool();
-
- public static ExecutorService getSharedThreadPool() {
- return EXECUTOR;
- }
-
-
- // private static final Logger LOG = LoggerFactory.getLogger(PGZIPOutputStream.class);
- private static final int GZIP_MAGIC = 0x8b1f;
-
- // todo: remove after block guessing is implemented
- // array list that contains the block sizes
- ArrayList blockSizes = new ArrayList<>();
-
- private int level = Deflater.DEFAULT_COMPRESSION;
- private int strategy = Deflater.DEFAULT_STRATEGY;
-
- @Nonnull
- protected Deflater newDeflater() {
- Deflater def = new Deflater(level, true);
- def.setStrategy(strategy);
- return def;
- }
-
- public void setStrategy(int strategy) {
- this.strategy = strategy;
- }
-
- public void setLevel(int level) {
- this.level = level;
- }
-
- @Nonnull
- protected static DeflaterOutputStream newDeflaterOutputStream(@Nonnull OutputStream out, @Nonnull Deflater deflater) {
- return new DeflaterOutputStream(out, deflater, 512, true);
- }
-
- // TODO: Share, daemonize.
- private final ExecutorService executor;
- private final int nthreads;
- private final CRC32 crc = new CRC32();
- private final BlockingQueue> emitQueue;
- private PGZIPBlock block = new PGZIPBlock(this/* 0 */);
- /**
- * Used as a sentinel for 'closed'.
- */
- private int bytesWritten = 0;
-
- // Master thread only
- public PGZIPOutputStream(@Nonnull OutputStream out, @Nonnull ExecutorService executor, @Nonnegative int nthreads) throws IOException {
- super(out);
- this.executor = executor;
- this.nthreads = nthreads;
- this.emitQueue = new ArrayBlockingQueue<>(nthreads);
- writeHeader();
- }
-
- /**
- * Creates a PGZIPOutputStream
- * using {@link PGZIPOutputStream#getSharedThreadPool()}.
- *
- * @param out the eventual output stream for the compressed data.
- * @throws IOException if it all goes wrong.
- */
- public PGZIPOutputStream(@Nonnull OutputStream out, @Nonnegative int nthreads) throws IOException {
- this(out, PGZIPOutputStream.getSharedThreadPool(), nthreads);
- }
-
- /**
- * Creates a PGZIPOutputStream
- * using {@link PGZIPOutputStream#getSharedThreadPool()}
- * and {@link Runtime#availableProcessors()}.
- *
- * @param out the eventual output stream for the compressed data.
- * @throws IOException if it all goes wrong.
- */
- public PGZIPOutputStream(@Nonnull OutputStream out) throws IOException {
- this(out, Runtime.getRuntime().availableProcessors());
- }
-
- /*
- * @see http://www.gzip.org/zlib/rfc-gzip.html#file-format
- */
- private void writeHeader() throws IOException {
- out.write(new byte[]{
- (byte) GZIP_MAGIC, // ID1: Magic number (little-endian short)
- (byte) (GZIP_MAGIC >> 8), // ID2: Magic number (little-endian short)
- Deflater.DEFLATED, // CM: Compression method
- 0, // FLG: Flags (byte)
- 0, 0, 0, 0, // MTIME: Modification time (int)
- 0, // XFL: Extra flags
- 3 // OS: Operating system (3 = Linux)
- });
- }
-
- // Master thread only
- @Override
- public void write(int b) throws IOException {
- byte[] single = new byte[1];
- single[0] = (byte) (b & 0xFF);
- write(single);
- }
-
- // Master thread only
- @Override
- public void write(@Nonnull byte[] b) throws IOException {
- write(b, 0, b.length);
- }
-
- // Master thread only
- @Override
- public void write(@Nonnull byte[] b, int off, int len) throws IOException {
- crc.update(b, off, len);
- bytesWritten += len;
- while (len > 0) {
- // assert block.in_length < block.in.length
- int capacity = block.in.length - block.in_length;
- if (len >= capacity) {
- System.arraycopy(b, off, block.in, block.in_length, capacity);
- block.in_length += capacity; // == block.in.length
- off += capacity;
- len -= capacity;
- submit();
- } else {
- System.arraycopy(b, off, block.in, block.in_length, len);
- block.in_length += len;
- // off += len;
- // len = 0;
- break;
- }
- }
- }
-
- // Master thread only
- private void submit() throws IOException {
- emitUntil(nthreads - 1);
- emitQueue.add(executor.submit(block));
- block = new PGZIPBlock(this/* block.index + 1 */);
- }
-
- // Emit If Available - submit always
- // Emit At Least one - submit when executor is full
- // Emit All Remaining - flush(), close()
- // Master thread only
- private void tryEmit() throws IOException, InterruptedException, ExecutionException {
- for (; ; ) {
- Future future = emitQueue.peek();
- // LOG.info("Peeked future " + future);
- if (future == null) {
- return;
- }
- if (!future.isDone()) {
- return;
- }
- // It's an ordered queue. This MUST be the same element as above.
- emitQueue.remove();
- byte[] toWrite = future.get();
- blockSizes.add(toWrite.length); // todo: remove after block guessing is implemented
- out.write(toWrite);
- }
- }
-
- // Master thread only
-
- /**
- * Emits any opportunistically available blocks. Furthermore, emits blocks until the number of executing tasks is less than taskCountAllowed.
- */
- private void emitUntil(@Nonnegative int taskCountAllowed) throws IOException {
- try {
- while (emitQueue.size() > taskCountAllowed) {
- // LOG.info("Waiting for taskCount=" + emitQueue.size() + " -> " + taskCountAllowed);
- Future future = emitQueue.remove(); // Valid because emitQueue.size() > 0
- byte[] toWrite = future.get(); // Blocks until this task is done.
- blockSizes.add(toWrite.length); // todo: remove after block guessing is implemented
- out.write(toWrite);
- }
- // We may have achieved more opportunistically available blocks
- // while waiting for a block above. Let's emit them here.
- tryEmit();
- } catch (ExecutionException e) {
- throw new IOException(e);
- } catch (InterruptedException e) {
- throw new InterruptedIOException();
- }
- }
-
- // Master thread only
- @Override
- public void flush() throws IOException {
- // LOG.info("Flush: " + block);
- if (block.in_length > 0) {
- submit();
- }
- emitUntil(0);
- super.flush();
- }
-
- // Master thread only
- @Override
- public void close() throws IOException {
- // LOG.info("Closing: bytesWritten=" + bytesWritten);
- if (bytesWritten >= 0) {
- flush();
-
- newDeflaterOutputStream(out, newDeflater()).finish();
-
- ByteBuffer buf = ByteBuffer.allocate(8);
- buf.order(ByteOrder.LITTLE_ENDIAN);
- // LOG.info("CRC is " + crc.getValue());
- buf.putInt((int) crc.getValue());
- buf.putInt(bytesWritten);
- out.write(buf.array()); // allocate() guarantees a backing array.
- // LOG.info("trailer is " + Arrays.toString(buf.array()));
-
- out.flush();
- out.close();
-
- bytesWritten = Integer.MIN_VALUE;
- // } else {
- // LOG.warn("Already closed.");
- }
- }
-}
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/io/PGZIPState.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/io/PGZIPState.java
deleted file mode 100644
index eef34628d..000000000
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/io/PGZIPState.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package com.fastasyncworldedit.core.object.io;
-
-import java.io.ByteArrayOutputStream;
-import java.util.zip.Deflater;
-import java.util.zip.DeflaterOutputStream;
-
-public class PGZIPState {
- protected final DeflaterOutputStream str;
- protected final ByteArrayOutputStream buf;
- protected final Deflater def;
-
- public PGZIPState(PGZIPOutputStream parent) {
- this.def = parent.newDeflater();
- this.buf = new ByteArrayOutputStream(PGZIPBlock.SIZE);
- this.str = parent.newDeflaterOutputStream(buf, def);
- }
-
-
-}
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/io/PGZIPThreadLocal.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/io/PGZIPThreadLocal.java
deleted file mode 100644
index 20937cdb3..000000000
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/io/PGZIPThreadLocal.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package com.fastasyncworldedit.core.object.io;
-
-public class PGZIPThreadLocal extends ThreadLocal {
-
- private final PGZIPOutputStream parent;
-
- public PGZIPThreadLocal(PGZIPOutputStream parent) {
- this.parent = parent;
- }
-
- @Override
- protected PGZIPState initialValue() {
- return new PGZIPState(parent);
- }
-}
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/io/RandomAccessInputStream.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/io/RandomAccessInputStream.java
deleted file mode 100644
index 8dd7586a4..000000000
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/io/RandomAccessInputStream.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package com.fastasyncworldedit.core.object.io;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.RandomAccessFile;
-
-public class RandomAccessInputStream extends InputStream {
- private final RandomAccessFile raf;
-
- public RandomAccessInputStream(RandomAccessFile raf) {
- this.raf = raf;
- }
-
- @Override
- public int read() throws IOException {
- return raf.read();
- }
-
- @Override
- public int read(byte[] b, int off, int len) throws IOException {
- return raf.read(b, off, len);
- }
-
- @Override
- public int read(byte[] b) throws IOException {
- return raf.read(b);
- }
-
- @Override
- public int available() throws IOException {
- return (int) (raf.length() - raf.getFilePointer());
- }
-
- @Override
- public void close() throws IOException {
- raf.close();
- }
-}
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/io/RandomFileOutputStream.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/io/RandomFileOutputStream.java
deleted file mode 100644
index db7d24369..000000000
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/object/io/RandomFileOutputStream.java
+++ /dev/null
@@ -1,128 +0,0 @@
-package com.fastasyncworldedit.core.object.io;
-
-import java.io.File;
-import java.io.FileDescriptor;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.RandomAccessFile;
-
-/**
- * A positionable file output stream.
- *