- My IJ is broke but this should work. Dunno if I got all nms changes, but we will see.
Dieser Commit ist enthalten in:
N0tMyFaultOG 2020-08-23 17:18:29 +02:00
Ursprung 1e070b3a71
Commit 6cb8352686
31 geänderte Dateien mit 226 neuen und 122 gelöschten Zeilen

Datei anzeigen

@ -1,5 +1,5 @@
---
name: Bug / Issue report for FastAsyncWorldEdit v1.16.1
name: Bug / Issue report for FastAsyncWorldEdit v1.16.2
about: Bug / Issue report about this plugin
title: ''
labels: Requires Testing
@ -7,8 +7,8 @@ assignees: ''
---
# Bug report for FastAsyncWorldEdit 1.16.1
<!--- If you are using 1.13 or 1.14 consider updating to 1.16.1 before raising an issue -->
# Bug report for FastAsyncWorldEdit 1.16.2
<!--- If you are using 1.13 or 1.14 consider updating to 1.16.2 before raising an issue -->
<!--- The priority lays on 1.16 right now, so issues reported for 1.13 or 1.14 will be fixed for the 1.16 versions -->
<!--- In order to create a valid issue report you have to follow this template. -->
<!--- Remove this template if making a suggestion or asking a question. -->
@ -41,5 +41,5 @@ assignees: ''
<!--- Make sure you've completed the following steps (put an "X" between of brackets): -->
- [] I included all information required in the sections above
- [] I made sure there are no duplicates of this report [(Use Search)](https://github.com/IntellectualSites/FastAsyncWorldEdit/issues?q=is%3Aissue)
- [] I made sure I am using an up-to-date version of [FastAsyncWorldEdit for 1.16.1](https://ci.athion.net/job/FastAsyncWorldEdit-1.16/)
- [] I made sure I am using an up-to-date version of [FastAsyncWorldEdit for 1.16.2](https://ci.athion.net/job/FastAsyncWorldEdit-1.16/)
- [] I made sure the bug/error is not caused by any other plugin

Datei anzeigen

@ -1,3 +0,0 @@
javac merge/Merge.java
java -cp merge Merge "$1" "$2" "$3" "$4" "$5"
exit $?

Datei anzeigen

@ -42,14 +42,14 @@ dependencies {
"compile"("org.spigotmcv1_14_r1:spigotmcv1_14_r1:1_14_r1")
"compile"("org.spigotmcv1_15_r1:spigotmcv1_15_r1:1_15_r1")
"implementation"("it.unimi.dsi:fastutil:${Versions.FAST_UTIL}")
"api"("com.destroystokyo.paper:paper-api:1.16.1-R0.1-SNAPSHOT") {
"api"("com.destroystokyo.paper:paper-api:1.16.2-R0.1-SNAPSHOT") {
exclude("junit", "junit")
isTransitive = false
}
"compileOnly"("org.jetbrains:annotations:20.0.0")
"compileOnly"("org.spigotmc:spigot:1.14.4-R0.1-SNAPSHOT")
"compileOnly"("org.spigotmc:spigot:1.15.2-R0.1-SNAPSHOT")
"compileOnly"("org.spigotmc:spigot:1.16.1-R0.1-SNAPSHOT")
"compileOnly"("org.spigotmc:spigot:1.16.2-R0.1-SNAPSHOT")
"implementation"("io.papermc:paperlib:1.0.+")
"compileOnly"("com.sk89q:dummypermscompat:1.10") {
exclude("com.github.MilkBowl", "VaultAPI")

Datei anzeigen

@ -1,11 +1,11 @@
package com.boydti.fawe.bukkit.adapter.mc1_16_1;
package com.boydti.fawe.bukkit.adapter.mc1_16_2;
import com.sk89q.util.ReflectionUtil;
import com.sk89q.worldedit.world.registry.BlockMaterial;
import net.minecraft.server.v1_16_R1.*;
import org.bukkit.craftbukkit.v1_16_R1.block.data.CraftBlockData;
import net.minecraft.server.v1_16_R2.*;
import org.bukkit.craftbukkit.v1_16_R2.block.data.CraftBlockData;
public class BlockMaterial_1_16_1 implements BlockMaterial {
public class BlockMaterial_1_16_2 implements BlockMaterial {
private final Block block;
private final IBlockData defaultState;
private final Material material;
@ -13,11 +13,11 @@ public class BlockMaterial_1_16_1 implements BlockMaterial {
private final CraftBlockData craftBlockData;
private final org.bukkit.Material craftMaterial;
public BlockMaterial_1_16_1(Block block) {
public BlockMaterial_1_16_2(Block block) {
this(block, block.getBlockData());
}
public BlockMaterial_1_16_1(Block block, IBlockData defaultState) {
public BlockMaterial_1_16_2(Block block, IBlockData defaultState) {
this.block = block;
this.defaultState = defaultState;
this.material = defaultState.getMaterial();

Datei anzeigen

@ -1,4 +1,4 @@
package com.boydti.fawe.bukkit.adapter.mc1_16_1;
package com.boydti.fawe.bukkit.adapter.mc1_16_2;
import com.boydti.fawe.Fawe;
import com.boydti.fawe.FaweCache;
@ -14,9 +14,9 @@ import com.sk89q.worldedit.world.block.BlockState;
import com.sk89q.worldedit.world.block.BlockTypesCache;
import io.papermc.lib.PaperLib;
import net.jpountz.util.UnsafeUtils;
import net.minecraft.server.v1_16_R1.*;
import org.bukkit.craftbukkit.v1_16_R1.CraftChunk;
import org.bukkit.craftbukkit.v1_16_R1.CraftWorld;
import net.minecraft.server.v1_16_R2.*;
import org.bukkit.craftbukkit.v1_16_R2.CraftChunk;
import org.bukkit.craftbukkit.v1_16_R2.CraftWorld;
import sun.misc.Unsafe;
import java.lang.invoke.MethodHandle;
@ -30,7 +30,7 @@ import java.util.concurrent.CompletableFuture;
import java.util.concurrent.locks.ReentrantLock;
import java.util.function.Function;
public final class BukkitAdapter_1_16_1 extends NMSAdapter {
public final class BukkitAdapter_1_16_2 extends NMSAdapter {
/*
NMS fields
*/
@ -258,7 +258,7 @@ public final class BukkitAdapter_1_16_1 extends NMSAdapter {
final int ordinal = paletteToBlock[i];
blockToPalette[ordinal] = Integer.MAX_VALUE;
final BlockState state = BlockTypesCache.states[ordinal];
final IBlockData ibd = ((BlockMaterial_1_16_1) state.getMaterial()).getState();
final IBlockData ibd = ((BlockMaterial_1_16_2) state.getMaterial()).getState();
palette.a(ibd);
}
try {

Datei anzeigen

@ -1,4 +1,4 @@
package com.boydti.fawe.bukkit.adapter.mc1_16_1;
package com.boydti.fawe.bukkit.adapter.mc1_16_2;
import com.boydti.fawe.Fawe;
import com.boydti.fawe.FaweCache;
@ -7,7 +7,7 @@ import com.boydti.fawe.beta.implementation.blocks.CharBlocks;
import com.boydti.fawe.beta.implementation.blocks.CharGetBlocks;
import com.boydti.fawe.beta.implementation.queue.QueueHandler;
import com.boydti.fawe.bukkit.adapter.DelegateLock;
import com.boydti.fawe.bukkit.adapter.mc1_16_1.nbt.LazyCompoundTag_1_16_1;
import com.boydti.fawe.bukkit.adapter.mc1_16_2.nbt.LazyCompoundTag_1_16_2;
import com.boydti.fawe.config.Settings;
import com.boydti.fawe.object.collection.AdaptedMap;
import com.boydti.fawe.object.collection.BitArrayUnstretched;
@ -18,16 +18,16 @@ import com.sk89q.jnbt.*;
import com.sk89q.worldedit.bukkit.BukkitAdapter;
import com.sk89q.worldedit.bukkit.WorldEditPlugin;
import com.sk89q.worldedit.bukkit.adapter.BukkitImplAdapter;
import com.sk89q.worldedit.bukkit.adapter.impl.FAWE_Spigot_v1_16_R1;
import com.sk89q.worldedit.bukkit.adapter.impl.FAWE_Spigot_v1_16_R2;
import com.sk89q.worldedit.internal.Constants;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.world.biome.BiomeType;
import com.sk89q.worldedit.world.block.BlockTypes;
import net.minecraft.server.v1_16_R1.*;
import net.minecraft.server.v1_16_R2.*;
import org.bukkit.World;
import org.bukkit.block.Biome;
import org.bukkit.craftbukkit.v1_16_R1.CraftWorld;
import org.bukkit.craftbukkit.v1_16_R1.block.CraftBlock;
import org.bukkit.craftbukkit.v1_16_R2.CraftWorld;
import org.bukkit.craftbukkit.v1_16_R2.block.CraftBlock;
import org.bukkit.event.entity.CreatureSpawnEvent;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
@ -41,12 +41,12 @@ import java.util.function.Function;
import static org.slf4j.LoggerFactory.getLogger;
public class BukkitGetBlocks_1_16_1 extends CharGetBlocks {
public class BukkitGetBlocks_1_16_2 extends CharGetBlocks {
private static final Logger log = LoggerFactory.getLogger(BukkitGetBlocks_1_16_1.class);
private static final Logger log = LoggerFactory.getLogger(BukkitGetBlocks_1_16_2.class);
private static final Function<BlockPosition, BlockVector3> posNms2We = v -> BlockVector3.at(v.getX(), v.getY(), v.getZ());
private final static Function<TileEntity, CompoundTag> nmsTile2We = tileEntity -> new LazyCompoundTag_1_16_1(Suppliers.memoize(() -> tileEntity.save(new NBTTagCompound())));
private final static Function<TileEntity, CompoundTag> nmsTile2We = tileEntity -> new LazyCompoundTag_1_16_2(Suppliers.memoize(() -> tileEntity.save(new NBTTagCompound())));
public ChunkSection[] sections;
public Chunk nmsChunk;
public WorldServer world;
@ -54,11 +54,11 @@ public class BukkitGetBlocks_1_16_1 extends CharGetBlocks {
public NibbleArray[] blockLight = new NibbleArray[16];
public NibbleArray[] skyLight = new NibbleArray[16];
public BukkitGetBlocks_1_16_1(World world, int X, int Z) {
public BukkitGetBlocks_1_16_2(World world, int X, int Z) {
this(((CraftWorld) world).getHandle(), X, Z);
}
public BukkitGetBlocks_1_16_1(WorldServer world, int X, int Z) {
public BukkitGetBlocks_1_16_2(WorldServer world, int X, int Z) {
this.world = world;
this.X = X;
this.Z = Z;
@ -93,7 +93,7 @@ public class BukkitGetBlocks_1_16_1 extends CharGetBlocks {
if (tileEntity == null) {
return null;
}
return new LazyCompoundTag_1_16_1(Suppliers.memoize(() -> tileEntity.save(new NBTTagCompound())));
return new LazyCompoundTag_1_16_2(Suppliers.memoize(() -> tileEntity.save(new NBTTagCompound())));
}
@Override
@ -224,7 +224,7 @@ public class BukkitGetBlocks_1_16_1 extends CharGetBlocks {
};
}
private void updateGet(BukkitGetBlocks_1_16_1 get, Chunk nmsChunk, ChunkSection[] sections, ChunkSection section, char[] arr, int layer) {
private void updateGet(BukkitGetBlocks_1_16_2 get, Chunk nmsChunk, ChunkSection[] sections, ChunkSection section, char[] arr, int layer) {
synchronized (get) {
if (this.nmsChunk != nmsChunk) {
this.nmsChunk = nmsChunk;
@ -245,8 +245,8 @@ public class BukkitGetBlocks_1_16_1 extends CharGetBlocks {
entity.die();
}
public Chunk ensureLoaded(net.minecraft.server.v1_16_R1.World nmsWorld, int X, int Z) {
return BukkitAdapter_1_16_1.ensureLoaded(nmsWorld, X, Z);
public Chunk ensureLoaded(net.minecraft.server.v1_16_R2.World nmsWorld, int X, int Z) {
return BukkitAdapter_1_16_2.ensureLoaded(nmsWorld, X, Z);
}
@Override
@ -295,8 +295,8 @@ public class BukkitGetBlocks_1_16_1 extends CharGetBlocks {
ChunkSection newSection;
ChunkSection existingSection = sections[layer];
if (existingSection == null) {
newSection = BukkitAdapter_1_16_1.newChunkSection(layer, setArr, fastmode);
if (BukkitAdapter_1_16_1.setSectionAtomic(sections, null, newSection, layer)) {
newSection = BukkitAdapter_1_16_2.newChunkSection(layer, setArr, fastmode);
if (BukkitAdapter_1_16_2.setSectionAtomic(sections, null, newSection, layer)) {
updateGet(this, nmsChunk, sections, newSection, setArr, layer);
continue;
} else {
@ -307,10 +307,10 @@ public class BukkitGetBlocks_1_16_1 extends CharGetBlocks {
}
}
}
BukkitAdapter_1_16_1.fieldTickingBlockCount.set(existingSection, (short) 0);
BukkitAdapter_1_16_2.fieldTickingBlockCount.set(existingSection, (short) 0);
//ensure that the server doesn't try to tick the chunksection while we're editing it.
DelegateLock lock = BukkitAdapter_1_16_1.applyLock(existingSection);
DelegateLock lock = BukkitAdapter_1_16_2.applyLock(existingSection);
synchronized (this) {
synchronized (lock) {
@ -327,9 +327,9 @@ public class BukkitGetBlocks_1_16_1 extends CharGetBlocks {
} else if (lock.isModified()) {
this.reset(layer);
}
newSection = BukkitAdapter_1_16_1
newSection = BukkitAdapter_1_16_2
.newChunkSection(layer, this::load, setArr, fastmode);
if (!BukkitAdapter_1_16_1
if (!BukkitAdapter_1_16_2
.setSectionAtomic(sections, existingSection, newSection, layer)) {
log.error("Failed to set chunk section:" + X + "," + Z + " layer: " + layer);
continue;
@ -421,7 +421,7 @@ public class BukkitGetBlocks_1_16_1 extends CharGetBlocks {
final ListTag rotTag = (ListTag) entityTagMap.get("Rotation");
if (idTag == null || posTag == null || rotTag == null) {
getLogger(
BukkitGetBlocks_1_16_1.class).debug("Unknown entity tag: " + nativeTag);
BukkitGetBlocks_1_16_2.class).debug("Unknown entity tag: " + nativeTag);
continue;
}
final double x = posTag.getDouble(0);
@ -495,7 +495,7 @@ public class BukkitGetBlocks_1_16_1 extends CharGetBlocks {
nmsChunk.mustNotSave = false;
nmsChunk.markDirty();
// send to player
BukkitAdapter_1_16_1.sendChunk(nmsWorld, X, Z, finalMask, finalLightUpdate);
BukkitAdapter_1_16_2.sendChunk(nmsWorld, X, Z, finalMask, finalLightUpdate);
if (finalizer != null) finalizer.run();
};
}
@ -552,19 +552,19 @@ public class BukkitGetBlocks_1_16_1 extends CharGetBlocks {
data = new char[4096];
Arrays.fill(data, (char) 1);
}
DelegateLock lock = BukkitAdapter_1_16_1.applyLock(section);
DelegateLock lock = BukkitAdapter_1_16_2.applyLock(section);
synchronized (lock) {
lock.untilFree();
lock.setModified(false);
// Efficiently convert ChunkSection to raw data
try {
FAWE_Spigot_v1_16_R1 adapter = ((FAWE_Spigot_v1_16_R1) WorldEditPlugin.getInstance().getBukkitImplAdapter());
FAWE_Spigot_v1_16_R2 adapter = ((FAWE_Spigot_v1_16_R2) WorldEditPlugin.getInstance().getBukkitImplAdapter());
final DataPaletteBlock<IBlockData> blocks = section.getBlocks();
final DataBits bits = (DataBits) BukkitAdapter_1_16_1.fieldBits.get(blocks);
final DataPalette<IBlockData> palette = (DataPalette<IBlockData>) BukkitAdapter_1_16_1.fieldPalette.get(blocks);
final DataBits bits = (DataBits) BukkitAdapter_1_16_2.fieldBits.get(blocks);
final DataPalette<IBlockData> palette = (DataPalette<IBlockData>) BukkitAdapter_1_16_2.fieldPalette.get(blocks);
final int bitsPerEntry = (int) BukkitAdapter_1_16_1.fieldBitsPerEntry.get(bits);
final int bitsPerEntry = (int) BukkitAdapter_1_16_2.fieldBitsPerEntry.get(bits);
final long[] blockStates = bits.a();
new BitArrayUnstretched(bitsPerEntry, blockStates).toRaw(data);
@ -648,7 +648,7 @@ public class BukkitGetBlocks_1_16_1 extends CharGetBlocks {
}
}
private final char ordinal(IBlockData ibd, FAWE_Spigot_v1_16_R1 adapter) {
private final char ordinal(IBlockData ibd, FAWE_Spigot_v1_16_R2 adapter) {
if (ibd == null) {
return BlockTypes.AIR.getDefaultState().getOrdinalChar();
} else {
@ -728,7 +728,7 @@ public class BukkitGetBlocks_1_16_1 extends CharGetBlocks {
try {
final DataPaletteBlock<IBlockData> blocksExisting = existing.getBlocks();
final DataPalette<IBlockData> palette = (DataPalette<IBlockData>) BukkitAdapter_1_16_1.fieldPalette.get(blocksExisting);
final DataPalette<IBlockData> palette = (DataPalette<IBlockData>) BukkitAdapter_1_16_2.fieldPalette.get(blocksExisting);
int paletteSize;
if (palette instanceof DataPaletteLinear) {

Datei anzeigen

@ -1,9 +1,9 @@
package com.boydti.fawe.bukkit.adapter.mc1_16_1;
package com.boydti.fawe.bukkit.adapter.mc1_16_2;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.bukkit.BukkitAdapter;
import com.sk89q.worldedit.bukkit.adapter.impl.FAWE_Spigot_v1_16_R1;
import com.sk89q.worldedit.bukkit.adapter.impl.FAWE_Spigot_v1_16_R2;
import com.sk89q.worldedit.internal.block.BlockStateIdAccess;
import com.sk89q.worldedit.internal.wna.WorldNativeAccess;
import com.sk89q.worldedit.math.BlockVector3;
@ -11,19 +11,19 @@ import com.sk89q.worldedit.util.SideEffect;
import com.sk89q.worldedit.util.SideEffectSet;
import com.sk89q.worldedit.world.block.BlockState;
import com.sk89q.worldedit.world.block.BlockStateHolder;
import net.minecraft.server.v1_16_R1.Block;
import net.minecraft.server.v1_16_R1.BlockPosition;
import net.minecraft.server.v1_16_R1.Chunk;
import net.minecraft.server.v1_16_R1.ChunkProviderServer;
import net.minecraft.server.v1_16_R1.EnumDirection;
import net.minecraft.server.v1_16_R1.IBlockData;
import net.minecraft.server.v1_16_R1.NBTBase;
import net.minecraft.server.v1_16_R1.NBTTagCompound;
import net.minecraft.server.v1_16_R1.PlayerChunk;
import net.minecraft.server.v1_16_R1.TileEntity;
import net.minecraft.server.v1_16_R1.World;
import org.bukkit.craftbukkit.v1_16_R1.CraftWorld;
import org.bukkit.craftbukkit.v1_16_R1.block.data.CraftBlockData;
import net.minecraft.server.v1_16_R2.Block;
import net.minecraft.server.v1_16_R2.BlockPosition;
import net.minecraft.server.v1_16_R2.Chunk;
import net.minecraft.server.v1_16_R2.ChunkProviderServer;
import net.minecraft.server.v1_16_R2.EnumDirection;
import net.minecraft.server.v1_16_R2.IBlockData;
import net.minecraft.server.v1_16_R2.NBTBase;
import net.minecraft.server.v1_16_R2.NBTTagCompound;
import net.minecraft.server.v1_16_R2.PlayerChunk;
import net.minecraft.server.v1_16_R2.TileEntity;
import net.minecraft.server.v1_16_R2.World;
import org.bukkit.craftbukkit.v1_16_R2.CraftWorld;
import org.bukkit.craftbukkit.v1_16_R2.block.data.CraftBlockData;
import org.bukkit.event.block.BlockPhysicsEvent;
import javax.annotation.Nullable;
@ -33,11 +33,11 @@ import java.util.Objects;
public class FAWEWorldNativeAccess_1_16 implements WorldNativeAccess<Chunk, IBlockData, BlockPosition> {
private static final int UPDATE = 1, NOTIFY = 2;
private final FAWE_Spigot_v1_16_R1 adapter;
private final FAWE_Spigot_v1_16_R2 adapter;
private final WeakReference<World> world;
private SideEffectSet sideEffectSet;
public FAWEWorldNativeAccess_1_16(FAWE_Spigot_v1_16_R1 adapter, WeakReference<World> world) {
public FAWEWorldNativeAccess_1_16(FAWE_Spigot_v1_16_R2 adapter, WeakReference<World> world) {
this.adapter = adapter;
this.world = world;
}

Datei anzeigen

@ -1,10 +1,10 @@
package com.boydti.fawe.bukkit.adapter.mc1_16_1;
package com.boydti.fawe.bukkit.adapter.mc1_16_2;
import com.boydti.fawe.bukkit.adapter.MapChunkUtil;
import net.minecraft.server.v1_16_R1.PacketPlayOutMapChunk;
import net.minecraft.server.v1_16_R2.PacketPlayOutMapChunk;
public class MapChunkUtil_1_16_1 extends MapChunkUtil<PacketPlayOutMapChunk> {
public MapChunkUtil_1_16_1() throws NoSuchFieldException {
public class MapChunkUtil_1_16_2 extends MapChunkUtil<PacketPlayOutMapChunk> {
public MapChunkUtil_1_16_2() throws NoSuchFieldException {
fieldX = PacketPlayOutMapChunk.class.getDeclaredField("a");
fieldZ = PacketPlayOutMapChunk.class.getDeclaredField("b");
fieldBitMask = PacketPlayOutMapChunk.class.getDeclaredField("c");

Datei anzeigen

@ -1,14 +1,14 @@
package com.boydti.fawe.bukkit.adapter.mc1_16_1.nbt;
package com.boydti.fawe.bukkit.adapter.mc1_16_2.nbt;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.jnbt.ListTag;
import com.sk89q.jnbt.StringTag;
import com.sk89q.jnbt.Tag;
import com.sk89q.worldedit.bukkit.WorldEditPlugin;
import net.minecraft.server.v1_16_R1.NBTBase;
import net.minecraft.server.v1_16_R1.NBTNumber;
import net.minecraft.server.v1_16_R1.NBTTagCompound;
import net.minecraft.server.v1_16_R1.NBTTagList;
import net.minecraft.server.v1_16_R2.NBTBase;
import net.minecraft.server.v1_16_R2.NBTNumber;
import net.minecraft.server.v1_16_R2.NBTTagCompound;
import net.minecraft.server.v1_16_R2.NBTTagList;
import java.util.ArrayList;
import java.util.Collections;
@ -16,15 +16,15 @@ import java.util.List;
import java.util.Map;
import java.util.function.Supplier;
public class LazyCompoundTag_1_16_1 extends CompoundTag {
public class LazyCompoundTag_1_16_2 extends CompoundTag {
private final Supplier<NBTTagCompound> nmsTag;
public LazyCompoundTag_1_16_1(Supplier<NBTTagCompound> tag) {
public LazyCompoundTag_1_16_2(Supplier<NBTTagCompound> tag) {
super(null);
this.nmsTag = tag;
}
public LazyCompoundTag_1_16_1(NBTTagCompound tag) {
public LazyCompoundTag_1_16_2(NBTTagCompound tag) {
this(() -> tag);
}
@ -93,7 +93,7 @@ public class LazyCompoundTag_1_16_1 extends CompoundTag {
NBTTagList nbtList = (NBTTagList) tag;
for (NBTBase elem : nbtList) {
if (elem instanceof NBTTagCompound) {
list.add(new LazyCompoundTag_1_16_1((NBTTagCompound) elem));
list.add(new LazyCompoundTag_1_16_2((NBTTagCompound) elem));
} else {
list.add(WorldEditPlugin.getInstance().getBukkitImplAdapter().toNative(elem));
}

Datei anzeigen

@ -35,7 +35,7 @@ import com.sk89q.worldedit.bukkit.adapter.BukkitImplAdapter;
import com.sk89q.worldedit.bukkit.adapter.BukkitImplLoader;
import com.sk89q.worldedit.bukkit.adapter.impl.FAWE_Spigot_v1_14_R4;
import com.sk89q.worldedit.bukkit.adapter.impl.FAWE_Spigot_v1_15_R2;
import com.sk89q.worldedit.bukkit.adapter.impl.FAWE_Spigot_v1_16_R1;
import com.sk89q.worldedit.bukkit.adapter.impl.FAWE_Spigot_v1_16_R2;
import com.sk89q.worldedit.event.platform.CommandEvent;
import com.sk89q.worldedit.event.platform.CommandSuggestionEvent;
import com.sk89q.worldedit.event.platform.PlatformReadyEvent;
@ -391,7 +391,7 @@ public class WorldEditPlugin extends JavaPlugin { //implements TabCompleter
try {
adapterLoader.addClass(FAWE_Spigot_v1_14_R4.class);
adapterLoader.addClass(FAWE_Spigot_v1_15_R2.class);
adapterLoader.addClass(FAWE_Spigot_v1_16_R1.class);
adapterLoader.addClass(FAWE_Spigot_v1_16_R2.class);
} catch (Throwable throwable) {
throwable.printStackTrace();
}

Datei anzeigen

@ -23,8 +23,8 @@ import com.boydti.fawe.Fawe;
import com.boydti.fawe.FaweCache;
import com.boydti.fawe.beta.IChunkGet;
import com.boydti.fawe.beta.implementation.packet.ChunkPacket;
import com.boydti.fawe.bukkit.adapter.mc1_16_1.*;
import com.boydti.fawe.bukkit.adapter.mc1_16_1.nbt.LazyCompoundTag_1_16_1;
import com.boydti.fawe.bukkit.adapter.mc1_16_2.*;
import com.boydti.fawe.bukkit.adapter.mc1_16_2.nbt.LazyCompoundTag_1_16_2;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.jnbt.Tag;
import com.sk89q.worldedit.EditSession;
@ -46,17 +46,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_16_R1.*;
import net.minecraft.server.v1_16_R2.*;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.block.data.BlockData;
import org.bukkit.craftbukkit.v1_16_R1.CraftChunk;
import org.bukkit.craftbukkit.v1_16_R1.CraftWorld;
import org.bukkit.craftbukkit.v1_16_R1.block.CraftBlock;
import org.bukkit.craftbukkit.v1_16_R1.block.data.CraftBlockData;
import org.bukkit.craftbukkit.v1_16_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_16_R1.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_16_R1.inventory.CraftItemStack;
import org.bukkit.craftbukkit.v1_16_R2.CraftChunk;
import org.bukkit.craftbukkit.v1_16_R2.CraftWorld;
import org.bukkit.craftbukkit.v1_16_R2.block.CraftBlock;
import org.bukkit.craftbukkit.v1_16_R2.block.data.CraftBlockData;
import org.bukkit.craftbukkit.v1_16_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_16_R2.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_16_R2.inventory.CraftItemStack;
import org.bukkit.entity.Player;
import javax.annotation.Nullable;
@ -70,16 +70,16 @@ import java.util.stream.Stream;
import static com.google.common.base.Preconditions.checkNotNull;
import com.sk89q.jnbt.StringTag;
public final class FAWE_Spigot_v1_16_R1 extends CachedBukkitAdapter implements IDelegateBukkitImplAdapter<NBTBase> {
private final Spigot_v1_16_R1 parent;
public final class FAWE_Spigot_v1_16_R2 extends CachedBukkitAdapter implements IDelegateBukkitImplAdapter<NBTBase> {
private final Spigot_v1_16_R2 parent;
private char[] ibdToStateOrdinal;
// ------------------------------------------------------------------------
// Code that may break between versions of Minecraft
// ------------------------------------------------------------------------
public FAWE_Spigot_v1_16_R1() throws NoSuchFieldException, NoSuchMethodException {
this.parent = new Spigot_v1_16_R1();
public FAWE_Spigot_v1_16_R2() throws NoSuchFieldException, NoSuchMethodException {
this.parent = new Spigot_v1_16_R2();
}
@Override
@ -92,7 +92,7 @@ public final class FAWE_Spigot_v1_16_R1 extends CachedBukkitAdapter implements I
ibdToStateOrdinal = new char[Block.REGISTRY_ID.a()]; // size
for (int i = 0; i < ibdToStateOrdinal.length; i++) {
BlockState state = BlockTypesCache.states[i];
BlockMaterial_1_16_1 material = (BlockMaterial_1_16_1) state.getMaterial();
BlockMaterial_1_16_2 material = (BlockMaterial_1_16_2) state.getMaterial();
int id = Block.REGISTRY_ID.getId(material.getState());
ibdToStateOrdinal[id] = state.getOrdinalChar();
}
@ -102,13 +102,13 @@ public final class FAWE_Spigot_v1_16_R1 extends CachedBukkitAdapter implements I
@Override
public BlockMaterial getMaterial(BlockType blockType) {
Block block = getBlock(blockType);
return new BlockMaterial_1_16_1(block);
return new BlockMaterial_1_16_2(block);
}
@Override
public BlockMaterial getMaterial(BlockState state) {
IBlockData bs = ((CraftBlockData) Bukkit.createBlockData(state.getAsString())).getState();
return new BlockMaterial_1_16_1(bs.getBlock(), bs);
return new BlockMaterial_1_16_2(bs.getBlock(), bs);
}
@ -157,14 +157,14 @@ public final class FAWE_Spigot_v1_16_R1 extends CachedBukkitAdapter implements I
World nmsWorld = nmsChunk.getWorld();
BlockPosition blockPos = new BlockPosition(x, y, z);
IBlockData blockData = ((BlockMaterial_1_16_1) state.getMaterial()).getState();
IBlockData blockData = ((BlockMaterial_1_16_2) state.getMaterial()).getState();
ChunkSection[] sections = nmsChunk.getSections();
int y4 = y >> 4;
ChunkSection section = sections[y4];
IBlockData existing;
if (section == null) {
existing = ((BlockMaterial_1_16_1) BlockTypes.AIR.getDefaultState().getMaterial()).getState();
existing = ((BlockMaterial_1_16_2) BlockTypes.AIR.getDefaultState().getMaterial()).getState();
} else {
existing = section.getType(x & 15, y & 15, z & 15);
}
@ -246,7 +246,7 @@ public final class FAWE_Spigot_v1_16_R1 extends CachedBukkitAdapter implements I
@Override
public OptionalInt getInternalBlockStateId(BlockState state) {
BlockMaterial_1_16_1 material = (BlockMaterial_1_16_1) state.getMaterial();
BlockMaterial_1_16_2 material = (BlockMaterial_1_16_2) state.getMaterial();
IBlockData mcState = material.getCraftBlockData().getState();
return OptionalInt.of(Block.REGISTRY_ID.getId(mcState));
}
@ -296,16 +296,16 @@ public final class FAWE_Spigot_v1_16_R1 extends CachedBukkitAdapter implements I
@Override
public <B extends BlockStateHolder<B>> BlockData adapt(B state) {
BlockMaterial_1_16_1 material = (BlockMaterial_1_16_1) state.getMaterial();
BlockMaterial_1_16_2 material = (BlockMaterial_1_16_2) state.getMaterial();
return material.getCraftBlockData();
}
private MapChunkUtil_1_16_1 mapUtil = new MapChunkUtil_1_16_1();
private MapChunkUtil_1_16_2 mapUtil = new MapChunkUtil_1_16_2();
@Override
public void sendFakeChunk(org.bukkit.World world, Player player, ChunkPacket packet) {
WorldServer nmsWorld = ((CraftWorld) world).getHandle();
PlayerChunk map = BukkitAdapter_1_16_1.getPlayerChunk(nmsWorld, packet.getChunkX(), packet.getChunkZ());
PlayerChunk map = BukkitAdapter_1_16_2.getPlayerChunk(nmsWorld, packet.getChunkX(), packet.getChunkZ());
if (map != null && map.hasBeenLoaded()) {
boolean flag = false;
PlayerChunk.d players = map.players;
@ -358,8 +358,8 @@ public final class FAWE_Spigot_v1_16_R1 extends CachedBukkitAdapter implements I
@Override
public NBTBase fromNative(Tag foreign) {
if (foreign instanceof LazyCompoundTag_1_16_1) {
return ((LazyCompoundTag_1_16_1) foreign).get();
if (foreign instanceof LazyCompoundTag_1_16_2) {
return ((LazyCompoundTag_1_16_2) foreign).get();
}
return parent.fromNative(foreign);
}
@ -406,7 +406,7 @@ public final class FAWE_Spigot_v1_16_R1 extends CachedBukkitAdapter implements I
// Fawe.get().getQueueHandler().startSet(true);
// try {
// IQueueExtent<IQueueChunk> extent = new SingleThreadQueueExtent();
// extent.init(null, (x, z) -> new BukkitGetBlocks_1_16_1(freshWorld, x, z) {
// extent.init(null, (x, z) -> new BukkitGetBlocks_1_16_2(freshWorld, x, z) {
// @Override
// public Chunk ensureLoaded(World nmsWorld, int X, int Z) {
// Chunk cached = nmsWorld.getChunkIfLoaded(X, Z);
@ -444,7 +444,7 @@ public final class FAWE_Spigot_v1_16_R1 extends CachedBukkitAdapter implements I
@Override
public IChunkGet get(org.bukkit.World world, int chunkX, int chunkZ) {
return new BukkitGetBlocks_1_16_1(world, chunkX, chunkZ);
return new BukkitGetBlocks_1_16_2(world, chunkX, chunkZ);
}
@Override

Datei anzeigen

@ -85,10 +85,9 @@ public class CLIWorldEdit {
}
private void setupPlatform() {
WorldEdit.getInstance().getPlatformManager().register(platform);
this.fileRegistries = new FileRegistries(this);
this.fileRegistries.loadDataFiles();
WorldEdit.getInstance().getPlatformManager().register(platform);
}
public void setupRegistries() {

Datei anzeigen

@ -22,6 +22,7 @@ package com.sk89q.worldedit.blocks;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.jnbt.StringTag;
import com.sk89q.jnbt.Tag;
import com.sk89q.worldedit.internal.util.DeprecationUtil;
import com.sk89q.worldedit.world.block.BaseBlock;
import com.sk89q.worldedit.world.block.BlockState;
@ -94,7 +95,7 @@ public class SkullBlock extends BaseBlock {
Map<String, Tag> values = new HashMap<>();
Map<String, Tag> inner = new HashMap<>();
inner.put("Name", new StringTag(owner));
values.put("Owner", new CompoundTag(inner));
values.put(DeprecationUtil.getHeadOwnerKey(), new CompoundTag(inner));
return new CompoundTag(values);
}
@ -113,7 +114,7 @@ public class SkullBlock extends BaseBlock {
throw new RuntimeException(String.format("'%s' tile entity expected", getNbtId()));
}
t = values.get("Owner");
t = values.get(DeprecationUtil.getHeadOwnerKey());
if (t instanceof CompoundTag) {
setOwner(((CompoundTag) t).getValue().get("Name").getValue().toString());
}

Datei anzeigen

@ -43,6 +43,7 @@ import com.sk89q.worldedit.extension.platform.PlatformManager;
import com.sk89q.worldedit.extent.inventory.BlockBag;
import com.sk89q.worldedit.function.mask.Mask;
import com.sk89q.worldedit.function.pattern.Pattern;
import com.sk89q.worldedit.internal.SchematicsEventListener;
import com.sk89q.worldedit.internal.expression.Expression;
import com.sk89q.worldedit.internal.expression.invoke.ReturnException;
import com.sk89q.worldedit.math.BlockVector3;
@ -130,6 +131,7 @@ public final class WorldEdit {
}
private WorldEdit() {
eventBus.register(new SchematicsEventListener());
}
/**

Datei anzeigen

@ -639,14 +639,22 @@ public class RegionCommands {
List<String> expression,
@Switch(name = 'r', desc = "Use the game's coordinate origin")
boolean useRawCoords,
@Switch(name = 'o', desc = "Use the selection's center as origin")
boolean offset) throws WorldEditException {
@Switch(name = 'o', desc = "Use the placement's coordinate origin")
boolean offset,
@Switch(name = 'c', desc = "Use the selection's center as origin")
boolean offsetCenter) throws WorldEditException {
final Vector3 zero;
Vector3 unit;
if (useRawCoords) {
zero = Vector3.ZERO;
unit = Vector3.ONE;
} else if (offsetCenter) {
final Vector3 min = region.getMinimumPoint().toVector3();
final Vector3 max = region.getMaximumPoint().toVector3();
zero = max.add(min).multiply(0.5);
unit = Vector3.ONE;
} else if (offset) {
zero = session.getPlacementPosition(actor).toVector3();
unit = Vector3.ONE;

Datei anzeigen

@ -42,4 +42,30 @@ public final class Constants {
));
}
/**
* The DataVersion for Minecraft 1.13
*/
public static final int DATA_VERSION_MC_1_13 = 1519;
/**
* The DataVersion for Minecraft 1.13.2
*/
public static final int DATA_VERSION_MC_1_13_2 = 1631;
/**
* The DataVersion for Minecraft 1.16
*/
public static final int DATA_VERSION_MC_1_14 = 1952;
/**
* The DataVersion for Minecraft 1.16
*/
public static final int DATA_VERSION_MC_1_15 = 2225;
/**
* The DataVersion for Minecraft 1.16
*/
public static final int DATA_VERSION_MC_1_16 = 2566;
}

Datei anzeigen

@ -0,0 +1,44 @@
/*
* WorldEdit, a Minecraft world manipulation toolkit
* Copyright (C) sk89q <http://www.sk89q.com>
* 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 <https://www.gnu.org/licenses/>.
*/
package com.sk89q.worldedit.internal;
import com.sk89q.worldedit.event.platform.ConfigurationLoadEvent;
import com.sk89q.worldedit.util.eventbus.Subscribe;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
public class SchematicsEventListener {
private static final Logger LOGGER = LoggerFactory.getLogger(SchematicsEventListener.class);
@Subscribe
public void onConfigLoad(ConfigurationLoadEvent event) {
Path config = event.getConfiguration().getWorkingDirectory().toPath();
try {
Files.createDirectories(config.resolve(event.getConfiguration().saveDir));
} catch (IOException e) {
LOGGER.warn("Failed to create schematics directory", e);
}
}
}

Datei anzeigen

@ -21,6 +21,9 @@ package com.sk89q.worldedit.internal.util;
import com.google.common.base.Joiner;
import com.google.common.base.Throwables;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.extension.platform.Capability;
import com.sk89q.worldedit.internal.Constants;
import com.sk89q.worldedit.world.block.BlockCategories;
import com.sk89q.worldedit.world.block.BlockType;
import com.sk89q.worldedit.world.block.BlockTypes;
@ -106,4 +109,10 @@ public class DeprecationUtil {
|| BlockCategories.SIGNS.contains(blockType);
}
public static String getHeadOwnerKey() {
int dataVersion = WorldEdit.getInstance().getPlatformManager()
.queryCapability(Capability.GAME_HOOKS).getDataVersion();
return dataVersion >= Constants.DATA_VERSION_MC_1_16 ? "SkullOwner" : "Owner";
}
}

Datei anzeigen

@ -74,7 +74,7 @@ public final class BiomeTypes {
@Nullable public static final BiomeType MOUNTAINS = get("minecraft:mountains");
@Nullable public static final BiomeType MUSHROOM_FIELD_SHORE = get("minecraft:mushroom_field_shore");
@Nullable public static final BiomeType MUSHROOM_FIELDS = get("minecraft:mushroom_fields");
@Nullable @Deprecated public static final BiomeType NETHER = get("minecraft:nether");
@Deprecated @Nullable public static final BiomeType NETHER = get("minecraft:nether");
@Nullable public static final BiomeType NETHER_WASTES = get("minecraft:nether_wastes");
@Nullable public static final BiomeType OCEAN = get("minecraft:ocean");
@Nullable public static final BiomeType PLAINS = get("minecraft:plains");

Datei anzeigen

@ -28,6 +28,8 @@ public final class BlockCategories {
public static final BlockCategory ANVIL = get("minecraft:anvil");
public static final BlockCategory BAMBOO_PLANTABLE_ON = get("minecraft:bamboo_plantable_on");
public static final BlockCategory BANNERS = get("minecraft:banners");
public static final BlockCategory BASE_STONE_NETHER = get("minecraft:base_stone_nether");
public static final BlockCategory BASE_STONE_OVERWORLD = get("minecraft:base_stone_overworld");
public static final BlockCategory BEDS = get("minecraft:beds");
public static final BlockCategory BEE_GROWABLES = get("minecraft:bee_growables");
public static final BlockCategory BEEHIVES = get("minecraft:beehives");
@ -51,6 +53,8 @@ public final class BlockCategories {
public static final BlockCategory JUNGLE_LOGS = get("minecraft:jungle_logs");
public static final BlockCategory LEAVES = get("minecraft:leaves");
public static final BlockCategory LOGS = get("minecraft:logs");
public static final BlockCategory LOGS_THAT_BURN = get("minecraft:logs_that_burn");
public static final BlockCategory MUSHROOM_GROW_BLOCK = get("minecraft:mushroom_grow_block");
public static final BlockCategory OAK_LOGS = get("minecraft:oak_logs");
public static final BlockCategory PLANKS = get("minecraft:planks");
public static final BlockCategory PORTALS = get("minecraft:portals");

Datei anzeigen

@ -87,6 +87,7 @@ public class EntityTypes {
@Nullable public static final EntityType PHANTOM = get("minecraft:phantom");
@Nullable public static final EntityType PIG = get("minecraft:pig");
@Nullable public static final EntityType PIGLIN = get("minecraft:piglin");
@Nullable public static final EntityType PIGLIN_BRUTE = get("minecraft:piglin_brute");
@Nullable public static final EntityType PILLAGER = get("minecraft:pillager");
@Nullable public static final EntityType PLAYER = get("minecraft:player");
@Nullable public static final EntityType POLAR_BEAR = get("minecraft:polar_bear");

Datei anzeigen

@ -42,7 +42,7 @@ public final class ItemCategories {
public static final ItemCategory FENCES = get("minecraft:fences");
public static final ItemCategory FISHES = get("minecraft:fishes");
public static final ItemCategory FLOWERS = get("minecraft:flowers");
public static final ItemCategory FURNACE_MATERIALS = get("minecraft:furnace_materials");
@Deprecated public static final ItemCategory FURNACE_MATERIALS = get("minecraft:furnace_materials");
public static final ItemCategory GOLD_ORES = get("minecraft:gold_ores");
public static final ItemCategory JUNGLE_LOGS = get("minecraft:jungle_logs");
public static final ItemCategory LEAVES = get("minecraft:leaves");
@ -65,6 +65,7 @@ public final class ItemCategories {
public static final ItemCategory SPRUCE_LOGS = get("minecraft:spruce_logs");
public static final ItemCategory STAIRS = get("minecraft:stairs");
public static final ItemCategory STONE_BRICKS = get("minecraft:stone_bricks");
public static final ItemCategory STONE_CRAFTING_MATERIALS = get("minecraft:stone_crafting_materials");
public static final ItemCategory STONE_TOOL_MATERIALS = get("minecraft:stone_tool_materials");
public static final ItemCategory TALL_FLOWERS = get("minecraft:tall_flowers");
public static final ItemCategory TRAPDOORS = get("minecraft:trapdoors");

Datei anzeigen

@ -629,6 +629,8 @@ public final class ItemTypes {
@Nullable public static final ItemType PHANTOM_MEMBRANE = init();
@Nullable public static final ItemType PHANTOM_SPAWN_EGG = init();
@Nullable public static final ItemType PIG_SPAWN_EGG = init();
@Nullable public static final ItemType PIGLIN_BRUTE_SPAWN_EGG = init();
@Nullable public static final ItemType PIGLIN_BANNER_PATTERN = init();
@Nullable public static final ItemType PILLAGER_SPAWN_EGG = init();
@Nullable public static final ItemType PINK_BANNER = init();
@Nullable public static final ItemType PINK_BED = init();

Datei anzeigen

@ -90,7 +90,9 @@ public final class BundledBlockData {
Gson gson = gsonBuilder.create();
URL url = null;
final int dataVersion = WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.WORLD_EDITING).getDataVersion();
if (dataVersion > 2224) { // > MC 1.14
if (dataVersion > 2577) { // > MC 1.15
url = ResourceLoader.getResource(BundledBlockData.class, "blocks.116.json");
} else if (dataVersion > 2224) { // > MC 1.14
url = ResourceLoader.getResource(BundledBlockData.class, "blocks.115.json");
} else if (dataVersion > 1900) { // > MC 1.13
url = ResourceLoader.getResource(BundledBlockData.class, "blocks.114.json");

Datei anzeigen

@ -79,7 +79,9 @@ public final class BundledItemData {
Gson gson = gsonBuilder.create();
URL url = null;
final int dataVersion = WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.WORLD_EDITING).getDataVersion();
if (dataVersion > 2224) { // > MC 1.14
if (dataVersion > 2577) { // > MC 1.15
url = ResourceLoader.getResource(BundledBlockData.class, "items.116.json");
} else if (dataVersion > 2224) { // > MC 1.14
url = ResourceLoader.getResource(BundledBlockData.class, "items.115.json");
} else if (dataVersion > 1900) { // > MC 1.13
url = ResourceLoader.getResource(BundledBlockData.class, "items.114.json");

Datei anzeigen

@ -93,7 +93,11 @@ public class FileSystemSnapshotDatabase implements SnapshotDatabase {
public FileSystemSnapshotDatabase(Path root, ArchiveNioSupport archiveNioSupport) {
checkArgument(Files.isDirectory(root), "Database root is not a directory");
this.root = root.toAbsolutePath();
try {
this.root = root.toRealPath();
} catch (IOException e) {
throw new RuntimeException("Failed to resolve snapshot database path", e);
}
this.archiveNioSupport = archiveNioSupport;
}

Dateidiff unterdrückt, weil mindestens eine Zeile zu lang ist

Dateidiff unterdrückt, weil mindestens eine Zeile zu lang ist

Datei anzeigen

@ -12,7 +12,7 @@ plugins {
applyPlatformAndCoreConfiguration()
applyShadowConfiguration()
val minecraftVersion = "1.16.1"
val minecraftVersion = "1.16.2"
val nextMajorMinecraftVersion: String = minecraftVersion.split('.').let { (useless, major) ->
"$useless.${major.toInt() + 1}"
}