add 1.14 depend (non functional)

This commit is contained in:
Jesse Boyd 2019-06-29 14:06:19 +10:00
parent 2b0a310e0e
commit a4344fb2df
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F
12 changed files with 161 additions and 158 deletions

View File

@ -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'

View File

@ -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:

View File

@ -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;

View File

@ -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<NBTBase>{
public final class Spigot_v1_14_R1 extends CachedBukkitAdapter implements BukkitImplAdapter<NBTBase>{
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);

View File

@ -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<T extends Future<T>> 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;

View File

@ -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);
}
}

View File

@ -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) {

View File

@ -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<Chunk, BukkitQueue_1_13> {
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<Chunk, BukkitQueue_1_13> {
@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<Chunk, BukkitQueue_1_13> {
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<Entity>[] entities = nmsChunk.getEntitySlices();
final Map<BlockPosition, TileEntity> tiles = nmsChunk.getTileEntities();

View File

@ -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<net.minecraft.server.v1_13_R2.Chunk, ChunkSection[], ChunkSection> {
public class BukkitQueue_1_13 extends BukkitQueue_0<net.minecraft.server.v1_14_R1.Chunk, ChunkSection[], ChunkSection> {
public final static Field fieldBits;
public final static Field fieldPalette;
@ -150,7 +150,7 @@ public class BukkitQueue_1_13 extends BukkitQueue_0<net.minecraft.server.v1_13_R
fieldGenLayer1.setAccessible(true);
fieldGenLayer2.setAccessible(true);
fieldSave = ReflectionUtils.setAccessible(net.minecraft.server.v1_13_R2.Chunk.class.getDeclaredField("s")); //*
fieldSave = ReflectionUtils.setAccessible(net.minecraft.server.v1_14_R1.Chunk.class.getDeclaredField("s")); //*
fieldHashBlocks = DataPaletteHash.class.getDeclaredField("b");
fieldHashBlocks.setAccessible(true);
@ -211,19 +211,19 @@ public class BukkitQueue_1_13 extends BukkitQueue_0<net.minecraft.server.v1_13_R
getImpWorld();
}
private boolean save(final net.minecraft.server.v1_13_R2.Chunk chunk, final ChunkProviderServer cps) {
private boolean save(final net.minecraft.server.v1_14_R1.Chunk chunk, final ChunkProviderServer cps) {
cps.saveChunk(chunk, false);
chunk.a(false);
return true;
}
@Override
public ChunkSection[] getSections(final net.minecraft.server.v1_13_R2.Chunk chunk) {
public ChunkSection[] getSections(final net.minecraft.server.v1_14_R1.Chunk chunk) {
return chunk.getSections();
}
@Override
public net.minecraft.server.v1_13_R2.Chunk loadChunk(final World world, final int x, final int z, final boolean generate) {
public net.minecraft.server.v1_14_R1.Chunk loadChunk(final World world, final int x, final int z, final boolean generate) {
final ChunkProviderServer provider = ((CraftWorld) world).getHandle().getChunkProvider();
if (generate) {
return provider.getChunkAt(x, z, true, true);
@ -234,7 +234,7 @@ public class BukkitQueue_1_13 extends BukkitQueue_0<net.minecraft.server.v1_13_R
@Override
public ChunkSection[] getCachedSections(final World world, final int cx, final int cz) {
final net.minecraft.server.v1_13_R2.Chunk chunk = ((CraftWorld) world).getHandle().getChunkProvider().getChunkAt(cx, cz, false, false);
final net.minecraft.server.v1_14_R1.Chunk chunk = ((CraftWorld) world).getHandle().getChunkProvider().getChunkAt(cx, cz, false, false);
if (chunk != null) {
return chunk.getSections();
}
@ -242,7 +242,7 @@ public class BukkitQueue_1_13 extends BukkitQueue_0<net.minecraft.server.v1_13_R
}
@Override
public net.minecraft.server.v1_13_R2.Chunk getCachedChunk(final World world, final int cx, final int cz) {
public net.minecraft.server.v1_14_R1.Chunk getCachedChunk(final World world, final int cx, final int cz) {
return ((CraftWorld) world).getHandle().getChunkProvider().getChunkAt(cx, cz, false, false);
}
@ -252,7 +252,7 @@ public class BukkitQueue_1_13 extends BukkitQueue_0<net.minecraft.server.v1_13_R
}
@Override
public void saveChunk(final net.minecraft.server.v1_13_R2.Chunk chunk) {
public void saveChunk(final net.minecraft.server.v1_14_R1.Chunk chunk) {
chunk.f(true); // Set Modified
chunk.mustSave = true;
}
@ -271,7 +271,7 @@ public class BukkitQueue_1_13 extends BukkitQueue_0<net.minecraft.server.v1_13_R
// BiomeBase base = BiomeBase.getBiome(biome.getId());
// fieldBiomes.set(generator, new BiomeBase[]{base});
// boolean cold = base.getTemperature() <= 1;
// net.minecraft.server.v1_13_R2.ChunkGenerator existingGenerator = nmsWorld.getChunkProvider().chunkGenerator;
// net.minecraft.server.v1_14_R1.ChunkGenerator existingGenerator = nmsWorld.getChunkProvider().chunkGenerator;
// long existingSeed = world.getSeed();
// {
// if (genLayer == null) genLayer = new MutableGenLayer(seed);
@ -289,7 +289,7 @@ public class BukkitQueue_1_13 extends BukkitQueue_0<net.minecraft.server.v1_13_R
//
// keepLoaded.remove(MathMan.pairInt(x, z));
// result = getWorld().regenerateChunk(x, z);
// net.minecraft.server.v1_13_R2.Chunk nmsChunk = getCachedChunk(world, x, z);
// net.minecraft.server.v1_14_R1.Chunk nmsChunk = getCachedChunk(world, x, z);
// if (nmsChunk != null) {
// nmsChunk.f(true); // Set Modified
// nmsChunk.mustSave = true;
@ -326,9 +326,9 @@ public class BukkitQueue_1_13 extends BukkitQueue_0<net.minecraft.server.v1_13_R
// boolean mustSave = false;
// boolean[][] chunksUnloaded = null;
// { // Unload chunks
// Iterator<net.minecraft.server.v1_13_R2.Chunk> iter = provider.a().iterator();
// Iterator<net.minecraft.server.v1_14_R1.Chunk> 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<net.minecraft.server.v1_13_R
// SetQueue.IMP.addTask(new Runnable() {
// @Override
// public void run() {
// net.minecraft.server.v1_13_R2.Chunk chunk = provider.getChunkAt(cx, cz, null, false);
// net.minecraft.server.v1_14_R1.Chunk chunk = provider.getChunkAt(cx, cz, null, false);
// if (chunk != null) {
// PlayerChunk pc = getPlayerChunk(nmsWorld, cx, cz);
// if (pc != null) {
@ -526,12 +526,12 @@ public class BukkitQueue_1_13 extends BukkitQueue_0<net.minecraft.server.v1_13_R
public int getCombinedId4Data(final ChunkSection lastSection, final int x, final int y, final int z) {
final DataPaletteBlock<IBlockData> 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<net.minecraft.server.v1_13_R
@Override
public void sendChunk(final int x, final int z, final int bitMask) {
final net.minecraft.server.v1_13_R2.Chunk chunk = getCachedChunk(getWorld(), x, z);
final net.minecraft.server.v1_14_R1.Chunk chunk = getCachedChunk(getWorld(), x, z);
if (chunk != null) {
sendChunk(getPlayerChunk((WorldServer) chunk.getWorld(), chunk.locX, chunk.locZ), chunk, bitMask);
}
@ -680,7 +680,7 @@ public class BukkitQueue_1_13 extends BukkitQueue_0<net.minecraft.server.v1_13_R
return playerChunk;
}
public boolean sendChunk(final PlayerChunk playerChunk, final net.minecraft.server.v1_13_R2.Chunk nmsChunk, final int mask) {
public boolean sendChunk(final PlayerChunk playerChunk, final net.minecraft.server.v1_14_R1.Chunk nmsChunk, final int mask) {
if (playerChunk == null) {
return false;
}
@ -751,7 +751,7 @@ public class BukkitQueue_1_13 extends BukkitQueue_0<net.minecraft.server.v1_13_R
return true;
}
public boolean hasEntities(final net.minecraft.server.v1_13_R2.Chunk nmsChunk) {
public boolean hasEntities(final net.minecraft.server.v1_14_R1.Chunk nmsChunk) {
try {
final Collection<Entity>[] entities = nmsChunk.entitySlices;
for (int i = 0; i < entities.length; i++) {
@ -931,7 +931,7 @@ public class BukkitQueue_1_13 extends BukkitQueue_0<net.minecraft.server.v1_13_R
protected BlockPosition.MutableBlockPosition pos = new BlockPosition.MutableBlockPosition(0, 0, 0);
@Override
public CompoundTag getTileEntity(final net.minecraft.server.v1_13_R2.Chunk chunk, final int x, final int y, final int z) {
public CompoundTag getTileEntity(final net.minecraft.server.v1_14_R1.Chunk chunk, final int x, final int y, final int z) {
final Map<BlockPosition, TileEntity> 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<net.minecraft.server.v1_13_R
@Deprecated
public boolean unloadChunk(final String world, final Chunk chunk) {
final net.minecraft.server.v1_13_R2.Chunk c = ((CraftChunk) chunk).getHandle();
final net.minecraft.server.v1_14_R1.Chunk c = ((CraftChunk) chunk).getHandle();
c.mustSave = false;
if (chunk.isLoaded()) {
chunk.unload(false, false);

View File

@ -29,6 +29,7 @@ import org.bukkit.*;
import org.bukkit.block.Biome;
import org.bukkit.block.Block;
import org.bukkit.block.data.BlockData;
import org.bukkit.entity.AbstractArrow;
import org.bukkit.entity.Arrow;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
@ -426,17 +427,11 @@ public class AsyncWorld extends DelegateFaweQueue implements World, HasFaweQueue
@Override
public boolean unloadChunk(int x, int z, boolean save) {
return unloadChunk(x, z, save, false);
}
@Deprecated
@Override
public boolean unloadChunk(final int x, final int z, final boolean save, final boolean safe) {
if (isChunkLoaded(x, z)) {
return TaskManager.IMP.sync(new RunnableVal<Boolean>() {
@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<Boolean>() {
@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 extends Arrow> T spawnArrow(Location location, Vector vector, float v, float v1, Class<T> aClass) {
return parent.spawnArrow(location, vector, v, v1, aClass);
public <T extends AbstractArrow> T spawnArrow(Location location, Vector direction, float speed, float spread, Class<T> clazz) {
return parent.spawnArrow(location, direction, speed, spread, clazz);
}
@Override

View File

@ -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();
}

View File

@ -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));
}
}