diff --git a/pom.xml b/pom.xml
index 32f00459..050b937e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -8,7 +8,7 @@
UTF-8
FastAsyncWorldEdit
- 1.3.2
+ 3.3.1
FastAsyncWorldEdit
jar
@@ -163,7 +163,7 @@
org.bukkit
bukkit
- 1.8.3-R0.1-SNAPSHOT
+ 1.9-R0.1-SNAPSHOT
org.PrimeSoft
diff --git a/src/main/java/com/boydti/fawe/Fawe.java b/src/main/java/com/boydti/fawe/Fawe.java
index 8fd33782..9d66523c 100644
--- a/src/main/java/com/boydti/fawe/Fawe.java
+++ b/src/main/java/com/boydti/fawe/Fawe.java
@@ -133,10 +133,6 @@ public class Fawe {
TaskManager.IMP.repeat(lag, 100);
}
- public boolean checkVersion(final int[] version, final int major, final int minor, final int minor2) {
- return (version[0] > major) || ((version[0] == major) && (version[1] > minor)) || ((version[0] == major) && (version[1] == minor) && (version[2] >= minor2));
- }
-
private void setupEvents() {
WorldEdit.getInstance().getEventBus().register(new WESubscriber());
if (Settings.COMMAND_PROCESSOR) {
diff --git a/src/main/java/com/boydti/fawe/FaweAPI.java b/src/main/java/com/boydti/fawe/FaweAPI.java
index 0b6014c3..ed11ad88 100644
--- a/src/main/java/com/boydti/fawe/FaweAPI.java
+++ b/src/main/java/com/boydti/fawe/FaweAPI.java
@@ -34,6 +34,18 @@ import com.sk89q.worldedit.world.biome.BaseBiome;
*/
public class FaweAPI {
+ /**
+ * Compare two versions
+ * @param version
+ * @param major
+ * @param minor
+ * @param minor2
+ * @return true if version is >= major, minor, minor2
+ */
+ public static boolean checkVersion(final int[] version, final int major, final int minor, final int minor2) {
+ return (version[0] > major) || ((version[0] == major) && (version[1] > minor)) || ((version[0] == major) && (version[1] == minor) && (version[2] >= minor2));
+ }
+
/**
* Set a block at a location asynchronously
* @param loc
diff --git a/src/main/java/com/boydti/fawe/bukkit/FaweBukkit.java b/src/main/java/com/boydti/fawe/bukkit/FaweBukkit.java
index faef3937..50cb817b 100644
--- a/src/main/java/com/boydti/fawe/bukkit/FaweBukkit.java
+++ b/src/main/java/com/boydti/fawe/bukkit/FaweBukkit.java
@@ -12,6 +12,7 @@ import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin;
import com.boydti.fawe.Fawe;
+import com.boydti.fawe.FaweAPI;
import com.boydti.fawe.IFawe;
import com.boydti.fawe.bukkit.regions.FactionsFeature;
import com.boydti.fawe.bukkit.regions.FactionsUUIDFeature;
@@ -134,7 +135,7 @@ public class FaweBukkit extends JavaPlugin implements IFawe {
@Override
public FaweQueue getQueue() {
- if (Fawe.get().checkVersion(getServerVersion(), 1, 9, 0)) {
+ if (FaweAPI.checkVersion(getServerVersion(), 1, 9, 0)) {
try {
return new BukkitQueue_1_9();
} catch (Throwable e) {
diff --git a/src/main/java/com/boydti/fawe/bukkit/v1_8/BukkitQueue_1_8.java b/src/main/java/com/boydti/fawe/bukkit/v1_8/BukkitQueue_1_8.java
index da6a96f2..2abeccc2 100644
--- a/src/main/java/com/boydti/fawe/bukkit/v1_8/BukkitQueue_1_8.java
+++ b/src/main/java/com/boydti/fawe/bukkit/v1_8/BukkitQueue_1_8.java
@@ -73,6 +73,8 @@ public class BukkitQueue_1_8 extends BukkitQueue_0 {
private RefField fieldSections;
private RefField fieldWorld;
private RefMethod methodGetIdArray;
+ private RefMethod methodGetWorld;
+ private RefField tileEntityUnload;
private final HashMap worldMap = new HashMap<>();
@@ -91,6 +93,8 @@ public class BukkitQueue_1_8 extends BukkitQueue_0 {
methodGetIdArray = classChunkSection.getMethod("getIdArray");
methodAreNeighborsLoaded = classChunk.getMethod("areNeighborsLoaded", int.class);
classChunkSectionConstructor = classChunkSection.getConstructor(int.class, boolean.class, char[].class);
+ this.tileEntityUnload = classWorld.getField("c");
+ this.methodGetWorld = classChunk.getMethod("getWorld");
} catch (final NoSuchMethodException e) {
e.printStackTrace();
}
@@ -299,6 +303,7 @@ public class BukkitQueue_1_8 extends BukkitQueue_0 {
// Sections
final Method getHandele = chunk.getClass().getDeclaredMethod("getHandle");
final Object c = getHandele.invoke(chunk);
+ Object w = methodGetWorld.of(c).call();
final Class extends Object> clazz = c.getClass();
final Field sf = clazz.getDeclaredField("sections");
sf.setAccessible(true);
@@ -307,6 +312,7 @@ public class BukkitQueue_1_8 extends BukkitQueue_0 {
final Object[] sections = (Object[]) sf.get(c);
final HashMap, ?> tiles = (HashMap, ?>) tf.get(c);
+ List