From a4344fb2dfb3b429cd69eee9c5b22c4878a37158 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Sat, 29 Jun 2019 14:06:19 +1000 Subject: [PATCH] add 1.14 depend (non functional) --- worldedit-bukkit/build.gradle | 11 +- .../com/boydti/fawe/bukkit/FaweBukkit.java | 6 +- .../adapter/v1_13_1/BlockMaterial_1_13.java | 4 +- .../adapter/v1_13_1/Spigot_v1_13_R2.java | 18 ++-- .../fawe/bukkit/beta/BukkitChunkHolder.java | 24 ++--- .../fawe/bukkit/beta/BukkitGetBlocks.java | 28 ++--- .../boydti/fawe/bukkit/beta/BukkitQueue.java | 34 +++--- .../fawe/bukkit/v1_13/BukkitChunk_1_13.java | 56 +++++----- .../fawe/bukkit/v1_13/BukkitQueue_1_13.java | 102 +++++++++--------- .../fawe/bukkit/wrapper/AsyncWorld.java | 28 +++-- .../worldedit/bukkit/WorldEditPlugin.java | 4 +- .../sk89q/worldedit/extent/InputExtent.java | 4 +- 12 files changed, 161 insertions(+), 158 deletions(-) diff --git a/worldedit-bukkit/build.gradle b/worldedit-bukkit/build.gradle index 205c447d8..863012ff6 100644 --- a/worldedit-bukkit/build.gradle +++ b/worldedit-bukkit/build.gradle @@ -6,15 +6,20 @@ repositories { maven { url "https://hub.spigotmc.org/nexus/content/groups/public" } maven { url "https://repo.codemc.org/repository/maven-public" } maven { url 'https://papermc.io/repo/repository/maven-public/' } + flatDir { + dirs 'lib' + } } dependencies { compile project(':worldedit-core') -// compile 'org.bukkit:craftbukkit-1.14:pre5' compile 'net.milkbowl.vault:VaultAPI:1.7' compile 'com.sk89q:dummypermscompat:1.10' - compile 'com.destroystokyo.paper:paper-api:1.13.2-R0.1-SNAPSHOT' - compile 'org.spigotmc:spigot:1.13.2-R0.1-SNAPSHOT' + compile 'com.destroystokyo.paper:paper-api:1.14.3-R0.1-SNAPSHOT' + +// compile 'org.spigotmc:spigot:1.14.3-R0.1-SNAPSHOT' + compile name: 'spigot-1.14.3' + compile 'org.slf4j:slf4j-jdk14:1.7.26' testCompile 'org.mockito:mockito-core:1.9.0-rc1' compile 'com.massivecraft:factions:2.8.0' diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/FaweBukkit.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/FaweBukkit.java index 913d0f0bb..cbbb2b5ce 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/FaweBukkit.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/FaweBukkit.java @@ -614,13 +614,13 @@ public class FaweBukkit implements IFawe, Listener { } public enum Version { - v1_13_R2, + v1_14_R1, NONE, } private FaweQueue getQueue(World world) { switch (getVersion()) { - case v1_13_R2: + case v1_14_R1: return new BukkitQueue_1_13(world); default: case NONE: @@ -630,7 +630,7 @@ public class FaweBukkit implements IFawe, Listener { private FaweQueue getQueue(String world) { switch (getVersion()) { - case v1_13_R2: + case v1_14_R1: return new BukkitQueue_1_13(world); default: case NONE: diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/v1_13_1/BlockMaterial_1_13.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/v1_13_1/BlockMaterial_1_13.java index 53a59d24d..0cc6bf7da 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/v1_13_1/BlockMaterial_1_13.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/v1_13_1/BlockMaterial_1_13.java @@ -3,8 +3,8 @@ package com.boydti.fawe.bukkit.adapter.v1_13_1; import com.sk89q.util.ReflectionUtil; import com.sk89q.worldedit.world.registry.BlockMaterial; -import net.minecraft.server.v1_13_R2.*; -import org.bukkit.craftbukkit.v1_13_R2.block.data.CraftBlockData; +import net.minecraft.server.v1_14_R1.*; +import org.bukkit.craftbukkit.v1_14_R1.block.data.CraftBlockData; public class BlockMaterial_1_13 implements BlockMaterial { private final Block block; diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/v1_13_1/Spigot_v1_13_R2.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/v1_13_1/Spigot_v1_13_R2.java index 2adc9d3ad..b4aca6eb8 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/v1_13_1/Spigot_v1_13_R2.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/v1_13_1/Spigot_v1_13_R2.java @@ -40,17 +40,17 @@ import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.*; import com.sk89q.worldedit.world.entity.EntityType; import com.sk89q.worldedit.world.registry.BlockMaterial; -import net.minecraft.server.v1_13_R2.*; +import net.minecraft.server.v1_14_R1.*; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.block.Biome; import org.bukkit.block.data.BlockData; -import org.bukkit.craftbukkit.v1_13_R2.CraftChunk; -import org.bukkit.craftbukkit.v1_13_R2.CraftServer; -import org.bukkit.craftbukkit.v1_13_R2.CraftWorld; -import org.bukkit.craftbukkit.v1_13_R2.block.CraftBlock; -import org.bukkit.craftbukkit.v1_13_R2.block.data.CraftBlockData; -import org.bukkit.craftbukkit.v1_13_R2.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_14_R1.CraftChunk; +import org.bukkit.craftbukkit.v1_14_R1.CraftServer; +import org.bukkit.craftbukkit.v1_14_R1.CraftWorld; +import org.bukkit.craftbukkit.v1_14_R1.block.CraftBlock; +import org.bukkit.craftbukkit.v1_14_R1.block.data.CraftBlockData; +import org.bukkit.craftbukkit.v1_14_R1.entity.CraftEntity; import org.bukkit.entity.Player; import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; import org.slf4j.Logger; @@ -66,7 +66,7 @@ import java.util.stream.Collectors; import static com.google.common.base.Preconditions.checkNotNull; -public final class Spigot_v1_13_R2 extends CachedBukkitAdapter implements BukkitImplAdapter{ +public final class Spigot_v1_14_R1 extends CachedBukkitAdapter implements BukkitImplAdapter{ private final Logger logger = LoggerFactory.getLogger(getClass()); @@ -82,7 +82,7 @@ public final class Spigot_v1_13_R2 extends CachedBukkitAdapter implements Bukkit // Code that may break between versions of Minecraft // ------------------------------------------------------------------------ - public Spigot_v1_13_R2() throws NoSuchFieldException, NoSuchMethodException { + public Spigot_v1_14_R1() throws NoSuchFieldException, NoSuchMethodException { // The list of tags on an NBTTagList nbtListTagListField = NBTTagList.class.getDeclaredField("list"); nbtListTagListField.setAccessible(true); diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/beta/BukkitChunkHolder.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/beta/BukkitChunkHolder.java index 605f18d8b..fea4c3813 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/beta/BukkitChunkHolder.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/beta/BukkitChunkHolder.java @@ -17,19 +17,19 @@ import com.sk89q.jnbt.Tag; import com.sk89q.worldedit.bukkit.BukkitAdapter; import com.sk89q.worldedit.internal.Constants; import com.sk89q.worldedit.world.biome.BiomeType; -import net.minecraft.server.v1_13_R2.BiomeBase; -import net.minecraft.server.v1_13_R2.BlockPosition; -import net.minecraft.server.v1_13_R2.Chunk; -import net.minecraft.server.v1_13_R2.ChunkSection; -import net.minecraft.server.v1_13_R2.Entity; -import net.minecraft.server.v1_13_R2.EntityTypes; -import net.minecraft.server.v1_13_R2.MinecraftKey; -import net.minecraft.server.v1_13_R2.NBTTagCompound; -import net.minecraft.server.v1_13_R2.NBTTagInt; -import net.minecraft.server.v1_13_R2.TileEntity; +import net.minecraft.server.v1_14_R1.BiomeBase; +import net.minecraft.server.v1_14_R1.BlockPosition; +import net.minecraft.server.v1_14_R1.Chunk; +import net.minecraft.server.v1_14_R1.ChunkSection; +import net.minecraft.server.v1_14_R1.Entity; +import net.minecraft.server.v1_14_R1.EntityTypes; +import net.minecraft.server.v1_14_R1.MinecraftKey; +import net.minecraft.server.v1_14_R1.NBTTagCompound; +import net.minecraft.server.v1_14_R1.NBTTagInt; +import net.minecraft.server.v1_14_R1.TileEntity; import org.bukkit.World; import org.bukkit.block.Biome; -import org.bukkit.craftbukkit.v1_13_R2.block.CraftBlock; +import org.bukkit.craftbukkit.v1_14_R1.block.CraftBlock; import org.bukkit.event.entity.CreatureSpawnEvent; import java.util.Collection; @@ -185,7 +185,7 @@ public class BukkitChunkHolder> extends ChunkHolder { Runnable[] syncTasks = null; - net.minecraft.server.v1_13_R2.World nmsWorld = nmsChunk.getWorld(); + net.minecraft.server.v1_14_R1.World nmsWorld = nmsChunk.getWorld(); int bx = X << 4; int bz = Z << 4; diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/beta/BukkitGetBlocks.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/beta/BukkitGetBlocks.java index 1fdd4ce85..fd377a758 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/beta/BukkitGetBlocks.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/beta/BukkitGetBlocks.java @@ -2,24 +2,24 @@ package com.boydti.fawe.bukkit.beta; import com.boydti.fawe.FaweCache; import com.boydti.fawe.beta.implementation.blocks.CharGetBlocks; -import com.boydti.fawe.bukkit.adapter.v1_13_1.Spigot_v1_13_R2; +import com.boydti.fawe.bukkit.adapter.v1_13_1.Spigot_v1_14_R1; import com.boydti.fawe.bukkit.v1_13.BukkitQueue_1_13; import com.boydti.fawe.jnbt.anvil.BitArray4096; import com.boydti.fawe.util.TaskManager; import com.sk89q.jnbt.CompoundTag; import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.block.BlockTypes; -import net.minecraft.server.v1_13_R2.Chunk; -import net.minecraft.server.v1_13_R2.ChunkCoordIntPair; -import net.minecraft.server.v1_13_R2.ChunkProviderServer; -import net.minecraft.server.v1_13_R2.ChunkSection; -import net.minecraft.server.v1_13_R2.DataBits; -import net.minecraft.server.v1_13_R2.DataPalette; -import net.minecraft.server.v1_13_R2.DataPaletteBlock; -import net.minecraft.server.v1_13_R2.DataPaletteHash; -import net.minecraft.server.v1_13_R2.DataPaletteLinear; -import net.minecraft.server.v1_13_R2.IBlockData; -import net.minecraft.server.v1_13_R2.World; +import net.minecraft.server.v1_14_R1.Chunk; +import net.minecraft.server.v1_14_R1.ChunkCoordIntPair; +import net.minecraft.server.v1_14_R1.ChunkProviderServer; +import net.minecraft.server.v1_14_R1.ChunkSection; +import net.minecraft.server.v1_14_R1.DataBits; +import net.minecraft.server.v1_14_R1.DataPalette; +import net.minecraft.server.v1_14_R1.DataPaletteBlock; +import net.minecraft.server.v1_14_R1.DataPaletteHash; +import net.minecraft.server.v1_14_R1.DataPaletteLinear; +import net.minecraft.server.v1_14_R1.IBlockData; +import net.minecraft.server.v1_14_R1.World; import java.util.Arrays; @@ -98,7 +98,7 @@ public class BukkitGetBlocks extends CharGetBlocks { if (ibd == null) { ordinal = BlockTypes.AIR.getDefaultState().getOrdinalChar(); } else { - ordinal = ((Spigot_v1_13_R2) getAdapter()).adaptToChar(ibd); + ordinal = ((Spigot_v1_14_R1) getAdapter()).adaptToChar(ibd); } paletteToBlockChars[paletteVal] = ordinal; } @@ -147,7 +147,7 @@ public class BukkitGetBlocks extends CharGetBlocks { if (ibd == null) { return BlockTypes.AIR.getDefaultState().getOrdinalChar(); } else { - return ((Spigot_v1_13_R2) getAdapter()).adaptToChar(ibd); + return ((Spigot_v1_14_R1) getAdapter()).adaptToChar(ibd); } } diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/beta/BukkitQueue.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/beta/BukkitQueue.java index 3d34e3cb9..f0827403c 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/beta/BukkitQueue.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/beta/BukkitQueue.java @@ -20,23 +20,23 @@ import com.sk89q.worldedit.world.block.BlockID; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockTypes; import net.jpountz.util.UnsafeUtils; -import net.minecraft.server.v1_13_R2.Block; -import net.minecraft.server.v1_13_R2.Chunk; -import net.minecraft.server.v1_13_R2.ChunkCoordIntPair; -import net.minecraft.server.v1_13_R2.ChunkProviderServer; -import net.minecraft.server.v1_13_R2.ChunkSection; -import net.minecraft.server.v1_13_R2.DataBits; -import net.minecraft.server.v1_13_R2.DataPalette; -import net.minecraft.server.v1_13_R2.DataPaletteBlock; -import net.minecraft.server.v1_13_R2.DataPaletteLinear; -import net.minecraft.server.v1_13_R2.GameProfileSerializer; -import net.minecraft.server.v1_13_R2.IBlockData; -import net.minecraft.server.v1_13_R2.PlayerChunk; -import net.minecraft.server.v1_13_R2.PlayerChunkMap; -import net.minecraft.server.v1_13_R2.WorldServer; +import net.minecraft.server.v1_14_R1.Block; +import net.minecraft.server.v1_14_R1.Chunk; +import net.minecraft.server.v1_14_R1.ChunkCoordIntPair; +import net.minecraft.server.v1_14_R1.ChunkProviderServer; +import net.minecraft.server.v1_14_R1.ChunkSection; +import net.minecraft.server.v1_14_R1.DataBits; +import net.minecraft.server.v1_14_R1.DataPalette; +import net.minecraft.server.v1_14_R1.DataPaletteBlock; +import net.minecraft.server.v1_14_R1.DataPaletteLinear; +import net.minecraft.server.v1_14_R1.GameProfileSerializer; +import net.minecraft.server.v1_14_R1.IBlockData; +import net.minecraft.server.v1_14_R1.PlayerChunk; +import net.minecraft.server.v1_14_R1.PlayerChunkMap; +import net.minecraft.server.v1_14_R1.WorldServer; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_13_R2.CraftChunk; -import org.bukkit.craftbukkit.v1_13_R2.CraftWorld; +import org.bukkit.craftbukkit.v1_14_R1.CraftChunk; +import org.bukkit.craftbukkit.v1_14_R1.CraftWorld; import java.lang.reflect.Field; import java.lang.reflect.Modifier; @@ -202,7 +202,7 @@ public class BukkitQueue extends SimpleCharQueueExtent { return ensureLoaded(nmsWorld, X, Z); } - public static Chunk ensureLoaded(net.minecraft.server.v1_13_R2.World nmsWorld, int X, int Z) { + public static Chunk ensureLoaded(net.minecraft.server.v1_14_R1.World nmsWorld, int X, int Z) { ChunkProviderServer provider = (ChunkProviderServer) nmsWorld.getChunkProvider(); Chunk nmsChunk = provider.chunks.get(ChunkCoordIntPair.a(X, Z)); if (nmsChunk != null) { diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/v1_13/BukkitChunk_1_13.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/v1_13/BukkitChunk_1_13.java index 4b9146f8c..4d0c6137f 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/v1_13/BukkitChunk_1_13.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/v1_13/BukkitChunk_1_13.java @@ -2,7 +2,7 @@ package com.boydti.fawe.bukkit.v1_13; import com.boydti.fawe.Fawe; import com.boydti.fawe.bukkit.adapter.v1_13_1.BlockMaterial_1_13; -import com.boydti.fawe.bukkit.adapter.v1_13_1.Spigot_v1_13_R2; +import com.boydti.fawe.bukkit.adapter.v1_13_1.Spigot_v1_14_R1; import com.boydti.fawe.bukkit.v0.BukkitQueue_0; import com.boydti.fawe.config.Settings; import com.boydti.fawe.example.IntFaweChunk; @@ -23,32 +23,32 @@ import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.block.BlockID; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockTypes; -import net.minecraft.server.v1_13_R2.BiomeBase; -import net.minecraft.server.v1_13_R2.Block; -import net.minecraft.server.v1_13_R2.BlockPosition; -import net.minecraft.server.v1_13_R2.Blocks; -import net.minecraft.server.v1_13_R2.ChunkSection; -import net.minecraft.server.v1_13_R2.DataBits; -import net.minecraft.server.v1_13_R2.DataPalette; -import net.minecraft.server.v1_13_R2.DataPaletteBlock; -import net.minecraft.server.v1_13_R2.DataPaletteHash; -import net.minecraft.server.v1_13_R2.DataPaletteLinear; -import net.minecraft.server.v1_13_R2.Entity; -import net.minecraft.server.v1_13_R2.EntityPlayer; -import net.minecraft.server.v1_13_R2.EntityTypes; -import net.minecraft.server.v1_13_R2.GameProfileSerializer; -import net.minecraft.server.v1_13_R2.IBlockData; -import net.minecraft.server.v1_13_R2.MinecraftKey; -import net.minecraft.server.v1_13_R2.NBTTagCompound; -import net.minecraft.server.v1_13_R2.NBTTagInt; -import net.minecraft.server.v1_13_R2.NibbleArray; -import net.minecraft.server.v1_13_R2.RegistryID; -import net.minecraft.server.v1_13_R2.TileEntity; +import net.minecraft.server.v1_14_R1.BiomeBase; +import net.minecraft.server.v1_14_R1.Block; +import net.minecraft.server.v1_14_R1.BlockPosition; +import net.minecraft.server.v1_14_R1.Blocks; +import net.minecraft.server.v1_14_R1.ChunkSection; +import net.minecraft.server.v1_14_R1.DataBits; +import net.minecraft.server.v1_14_R1.DataPalette; +import net.minecraft.server.v1_14_R1.DataPaletteBlock; +import net.minecraft.server.v1_14_R1.DataPaletteHash; +import net.minecraft.server.v1_14_R1.DataPaletteLinear; +import net.minecraft.server.v1_14_R1.Entity; +import net.minecraft.server.v1_14_R1.EntityPlayer; +import net.minecraft.server.v1_14_R1.EntityTypes; +import net.minecraft.server.v1_14_R1.GameProfileSerializer; +import net.minecraft.server.v1_14_R1.IBlockData; +import net.minecraft.server.v1_14_R1.MinecraftKey; +import net.minecraft.server.v1_14_R1.NBTTagCompound; +import net.minecraft.server.v1_14_R1.NBTTagInt; +import net.minecraft.server.v1_14_R1.NibbleArray; +import net.minecraft.server.v1_14_R1.RegistryID; +import net.minecraft.server.v1_14_R1.TileEntity; import org.bukkit.Chunk; import org.bukkit.World; import org.bukkit.block.Biome; -import org.bukkit.craftbukkit.v1_13_R2.CraftChunk; -import org.bukkit.craftbukkit.v1_13_R2.block.CraftBlock; +import org.bukkit.craftbukkit.v1_14_R1.CraftChunk; +import org.bukkit.craftbukkit.v1_14_R1.block.CraftBlock; import org.bukkit.event.entity.CreatureSpawnEvent; import java.lang.reflect.InvocationTargetException; @@ -134,7 +134,7 @@ public class BukkitChunk_1_13 extends IntFaweChunk { if (ibd == null) { ibd = defaultBlock; } - final int ordinal = ((Spigot_v1_13_R2) getAdapter()).adaptToInt(ibd); + final int ordinal = ((Spigot_v1_14_R1) getAdapter()).adaptToInt(ibd); idsArray[i] = BlockTypes.states[ordinal].getInternalId(); } } catch (final IllegalAccessException e) { @@ -328,7 +328,7 @@ public class BukkitChunk_1_13 extends IntFaweChunk { @Override public FaweChunk call() { - final Spigot_v1_13_R2 adapter = (Spigot_v1_13_R2) BukkitQueue_0.getAdapter(); + final Spigot_v1_14_R1 adapter = (Spigot_v1_14_R1) BukkitQueue_0.getAdapter(); try { final BukkitChunk_1_13 copy = getParent().getChangeTask() != null ? new BukkitChunk_1_13(getParent(), getX(), getZ()) : null; final Chunk chunk = this.getChunk(); @@ -337,11 +337,11 @@ public class BukkitChunk_1_13 extends IntFaweChunk { final int bx = this.getX() << 4; final int bz = this.getZ() << 4; final boolean flag = world.getEnvironment() == World.Environment.NORMAL; - final net.minecraft.server.v1_13_R2.Chunk nmsChunk = ((CraftChunk) chunk).getHandle(); + final net.minecraft.server.v1_14_R1.Chunk nmsChunk = ((CraftChunk) chunk).getHandle(); nmsChunk.f(true); // Set Modified nmsChunk.mustSave = true; nmsChunk.markDirty(); - final net.minecraft.server.v1_13_R2.World nmsWorld = nmsChunk.world; + final net.minecraft.server.v1_14_R1.World nmsWorld = nmsChunk.world; final ChunkSection[] sections = nmsChunk.getSections(); final List[] entities = nmsChunk.getEntitySlices(); final Map tiles = nmsChunk.getTileEntities(); diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/v1_13/BukkitQueue_1_13.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/v1_13/BukkitQueue_1_13.java index 0f86e37c7..e9b76907f 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/v1_13/BukkitQueue_1_13.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/v1_13/BukkitQueue_1_13.java @@ -4,7 +4,7 @@ import com.boydti.fawe.Fawe; import com.boydti.fawe.FaweCache; import com.boydti.fawe.bukkit.BukkitPlayer; import com.boydti.fawe.bukkit.adapter.v1_13_1.BlockMaterial_1_13; -import com.boydti.fawe.bukkit.adapter.v1_13_1.Spigot_v1_13_R2; +import com.boydti.fawe.bukkit.adapter.v1_13_1.Spigot_v1_14_R1; import com.boydti.fawe.bukkit.v0.BukkitQueue_0; import com.boydti.fawe.config.Settings; import com.boydti.fawe.example.IntFaweChunk; @@ -25,38 +25,38 @@ import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockTypes; import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBufAllocator; -import net.minecraft.server.v1_13_R2.BiomeBase; -import net.minecraft.server.v1_13_R2.Block; -import net.minecraft.server.v1_13_R2.BlockPosition; -import net.minecraft.server.v1_13_R2.ChunkProviderServer; -import net.minecraft.server.v1_13_R2.ChunkSection; -import net.minecraft.server.v1_13_R2.DataBits; -import net.minecraft.server.v1_13_R2.DataPalette; -import net.minecraft.server.v1_13_R2.DataPaletteBlock; -import net.minecraft.server.v1_13_R2.DataPaletteHash; -import net.minecraft.server.v1_13_R2.DataPaletteLinear; -import net.minecraft.server.v1_13_R2.Entity; -import net.minecraft.server.v1_13_R2.EntityPlayer; -import net.minecraft.server.v1_13_R2.EnumSkyBlock; -import net.minecraft.server.v1_13_R2.GameProfileSerializer; -import net.minecraft.server.v1_13_R2.IBlockData; -import net.minecraft.server.v1_13_R2.NBTTagCompound; -import net.minecraft.server.v1_13_R2.Packet; -import net.minecraft.server.v1_13_R2.PacketDataSerializer; -import net.minecraft.server.v1_13_R2.PacketPlayOutMultiBlockChange; -import net.minecraft.server.v1_13_R2.PlayerChunk; -import net.minecraft.server.v1_13_R2.PlayerChunkMap; -import net.minecraft.server.v1_13_R2.RegistryID; -import net.minecraft.server.v1_13_R2.TileEntity; -import net.minecraft.server.v1_13_R2.WorldChunkManager; -import net.minecraft.server.v1_13_R2.WorldData; -import net.minecraft.server.v1_13_R2.WorldServer; +import net.minecraft.server.v1_14_R1.BiomeBase; +import net.minecraft.server.v1_14_R1.Block; +import net.minecraft.server.v1_14_R1.BlockPosition; +import net.minecraft.server.v1_14_R1.ChunkProviderServer; +import net.minecraft.server.v1_14_R1.ChunkSection; +import net.minecraft.server.v1_14_R1.DataBits; +import net.minecraft.server.v1_14_R1.DataPalette; +import net.minecraft.server.v1_14_R1.DataPaletteBlock; +import net.minecraft.server.v1_14_R1.DataPaletteHash; +import net.minecraft.server.v1_14_R1.DataPaletteLinear; +import net.minecraft.server.v1_14_R1.Entity; +import net.minecraft.server.v1_14_R1.EntityPlayer; +import net.minecraft.server.v1_14_R1.EnumSkyBlock; +import net.minecraft.server.v1_14_R1.GameProfileSerializer; +import net.minecraft.server.v1_14_R1.IBlockData; +import net.minecraft.server.v1_14_R1.NBTTagCompound; +import net.minecraft.server.v1_14_R1.Packet; +import net.minecraft.server.v1_14_R1.PacketDataSerializer; +import net.minecraft.server.v1_14_R1.PacketPlayOutMultiBlockChange; +import net.minecraft.server.v1_14_R1.PlayerChunk; +import net.minecraft.server.v1_14_R1.PlayerChunkMap; +import net.minecraft.server.v1_14_R1.RegistryID; +import net.minecraft.server.v1_14_R1.TileEntity; +import net.minecraft.server.v1_14_R1.WorldChunkManager; +import net.minecraft.server.v1_14_R1.WorldData; +import net.minecraft.server.v1_14_R1.WorldServer; import org.bukkit.Chunk; import org.bukkit.World; -import org.bukkit.craftbukkit.v1_13_R2.CraftChunk; -import org.bukkit.craftbukkit.v1_13_R2.CraftWorld; -import org.bukkit.craftbukkit.v1_13_R2.block.CraftBlock; -import org.bukkit.craftbukkit.v1_13_R2.entity.CraftPlayer; +import org.bukkit.craftbukkit.v1_14_R1.CraftChunk; +import org.bukkit.craftbukkit.v1_14_R1.CraftWorld; +import org.bukkit.craftbukkit.v1_14_R1.block.CraftBlock; +import org.bukkit.craftbukkit.v1_14_R1.entity.CraftPlayer; import java.io.IOException; import java.lang.reflect.Field; @@ -66,7 +66,7 @@ import java.util.Map; import java.util.concurrent.atomic.LongAdder; import java.util.function.Supplier; -public class BukkitQueue_1_13 extends BukkitQueue_0 { +public class BukkitQueue_1_13 extends BukkitQueue_0 { public final static Field fieldBits; public final static Field fieldPalette; @@ -150,7 +150,7 @@ public class BukkitQueue_1_13 extends BukkitQueue_0 iter = provider.a().iterator(); +// Iterator iter = provider.a().iterator(); // while (iter.hasNext()) { -// net.minecraft.server.v1_13_R2.Chunk chunk = iter.next(); +// net.minecraft.server.v1_14_R1.Chunk chunk = iter.next(); // if (chunk.locX >> 5 == mcaX && chunk.locZ >> 5 == mcaZ) { // boolean isIn = allowed.isInChunk(chunk.locX, chunk.locZ); // if (isIn) { @@ -402,7 +402,7 @@ public class BukkitQueue_1_13 extends BukkitQueue_0 dataPalette = lastSection.getBlocks(); final IBlockData ibd = dataPalette.a(x & 15, y & 15, z & 15); - final int ordinal = ((Spigot_v1_13_R2) getAdapter()).adaptToInt(ibd); + final int ordinal = ((Spigot_v1_14_R1) getAdapter()).adaptToInt(ibd); return BlockTypes.states[ordinal].getInternalId(); } @Override - public BiomeType getBiome(final net.minecraft.server.v1_13_R2.Chunk chunk, final int x, final int z) { + public BiomeType getBiome(final net.minecraft.server.v1_14_R1.Chunk chunk, final int x, final int z) { final BiomeBase base = chunk.getBiomeIndex()[((z & 15) << 4) + (x & 15)]; return getAdapter().adapt(CraftBlock.biomeBaseToBiome(base)); } @@ -563,7 +563,7 @@ public class BukkitQueue_1_13 extends BukkitQueue_0[] entities = nmsChunk.entitySlices; for (int i = 0; i < entities.length; i++) { @@ -931,7 +931,7 @@ public class BukkitQueue_1_13 extends BukkitQueue_0 tiles = chunk.getTileEntities(); pos.c(x, y, z); final TileEntity tile = tiles.get(pos); @@ -951,7 +951,7 @@ public class BukkitQueue_1_13 extends BukkitQueue_0() { @Override public void run(Boolean value) { - this.value = parent.unloadChunk(x, z, save, safe); + this.value = parent.unloadChunk(x, z, save); } }); } @@ -445,12 +440,15 @@ public class AsyncWorld extends DelegateFaweQueue implements World, HasFaweQueue @Override public boolean unloadChunkRequest(int x, int z) { - return unloadChunk(x, z); - } - - @Override - public boolean unloadChunkRequest(int x, int z, boolean safe) { - return unloadChunk(x, z, safe); + if (isChunkLoaded(x, z)) { + return TaskManager.IMP.sync(new RunnableVal() { + @Override + public void run(Boolean value) { + this.value = parent.unloadChunkRequest(x, z); + } + }); + } + return true; } @Override @@ -501,8 +499,8 @@ public class AsyncWorld extends DelegateFaweQueue implements World, HasFaweQueue } @Override - public T spawnArrow(Location location, Vector vector, float v, float v1, Class aClass) { - return parent.spawnArrow(location, vector, v, v1, aClass); + public T spawnArrow(Location location, Vector direction, float speed, float spread, Class clazz) { + return parent.spawnArrow(location, direction, speed, spread, clazz); } @Override 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 cdcdb6fb5..f4a7c6d3f 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 @@ -22,7 +22,7 @@ package com.sk89q.worldedit.bukkit; import com.bekvon.bukkit.residence.commands.message; import com.boydti.fawe.Fawe; import com.boydti.fawe.bukkit.FaweBukkit; -import com.boydti.fawe.bukkit.adapter.v1_13_1.Spigot_v1_13_R2; +import com.boydti.fawe.bukkit.adapter.v1_13_1.Spigot_v1_14_R1; import com.boydti.fawe.util.MainUtil; import com.google.common.base.Joiner; import com.sk89q.util.yaml.YAMLProcessor; @@ -366,7 +366,7 @@ public class WorldEditPlugin extends JavaPlugin { //implements TabCompleter // Attempt to load a Bukkit adapter BukkitImplLoader adapterLoader = new BukkitImplLoader(); try { - adapterLoader.addClass(Spigot_v1_13_R2.class); + adapterLoader.addClass(Spigot_v1_14_R1.class); } catch (Throwable throwable) { throwable.printStackTrace(); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/InputExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/InputExtent.java index 1f4342518..d8f533407 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/InputExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/InputExtent.java @@ -84,10 +84,10 @@ public interface InputExtent { * @return the biome at the location */ default BiomeType getBiome(BlockVector2 position) { - return getBiome(position.getX(), position.getZ()); + return getBiomeType(position.getX(), position.getZ()); } - default BiomeType getBiome(int x, int z) { + default BiomeType getBiomeType(int x, int z) { return getBiome(MutableBlockVector2.get(x, z)); } }