3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-12-24 18:10:08 +01:00

Fixed all but one remaining API changes in 1.16.1

No testing has been performed yet.
Dieser Commit ist enthalten in:
MattBDev 2020-06-25 20:57:06 -04:00
Ursprung 9cb24bc37d
Commit aab10adb79
2 geänderte Dateien mit 5 neuen und 12 gelöschten Zeilen

Datei anzeigen

@ -47,8 +47,6 @@ public final class BukkitAdapter_1_16_1 extends NMSAdapter {
private final static MethodHandle methodGetVisibleChunk; private final static MethodHandle methodGetVisibleChunk;
public final static MethodHandle methodSetLightNibbleArray;
private static final int CHUNKSECTION_BASE; private static final int CHUNKSECTION_BASE;
private static final int CHUNKSECTION_SHIFT; private static final int CHUNKSECTION_SHIFT;
@ -79,10 +77,6 @@ public final class BukkitAdapter_1_16_1 extends NMSAdapter {
declaredGetVisibleChunk.setAccessible(true); declaredGetVisibleChunk.setAccessible(true);
methodGetVisibleChunk = MethodHandles.lookup().unreflect(declaredGetVisibleChunk); methodGetVisibleChunk = MethodHandles.lookup().unreflect(declaredGetVisibleChunk);
Method declaredSetLightNibbleArray = LightEngineStorage.class.getDeclaredMethod("a", long.class, NibbleArray.class);
declaredSetLightNibbleArray.setAccessible(true);
methodSetLightNibbleArray = MethodHandles.lookup().unreflect(declaredSetLightNibbleArray);
Field tmp = DataPaletteBlock.class.getDeclaredField("j"); Field tmp = DataPaletteBlock.class.getDeclaredField("j");
ReflectionUtils.setAccessibleNonFinal(tmp); ReflectionUtils.setAccessibleNonFinal(tmp);
fieldLock = tmp; fieldLock = tmp;
@ -130,7 +124,7 @@ public final class BukkitAdapter_1_16_1 extends NMSAdapter {
} }
public static Chunk ensureLoaded(World nmsWorld, int X, int Z) { public static Chunk ensureLoaded(World nmsWorld, int X, int Z) {
Chunk nmsChunk = nmsWorld.getChunkIfLoaded(X, Z); Chunk nmsChunk = nmsWorld.getChunkProvider().getChunkAt(X, Z, false);
if (nmsChunk != null) { if (nmsChunk != null) {
return nmsChunk; return nmsChunk;
} }
@ -183,7 +177,8 @@ public final class BukkitAdapter_1_16_1 extends NMSAdapter {
if (lighting) { if (lighting) {
ChunkCoordIntPair chunkCoordIntPair = new ChunkCoordIntPair(X, Z); ChunkCoordIntPair chunkCoordIntPair = new ChunkCoordIntPair(X, Z);
PacketPlayOutLightUpdate packet = new PacketPlayOutLightUpdate(chunkCoordIntPair, nmsWorld.getChunkProvider().getLightEngine()); boolean trustEdges = false; //Added in 1.16.1 Not sure what it does.
PacketPlayOutLightUpdate packet = new PacketPlayOutLightUpdate(chunkCoordIntPair, nmsWorld.getChunkProvider().getLightEngine(), trustEdges);
playerChunk.players.a(chunkCoordIntPair, false).forEach(p -> { playerChunk.players.a(chunkCoordIntPair, false).forEach(p -> {
p.playerConnection.sendPacket(packet); p.playerConnection.sendPacket(packet);
}); });
@ -194,9 +189,7 @@ public final class BukkitAdapter_1_16_1 extends NMSAdapter {
} }
return null; return null;
}); });
return;
} }
return;
} }
/* /*

Datei anzeigen

@ -229,7 +229,7 @@ public class BukkitGetBlocks_1_16_1 extends CharGetBlocks {
entity.valid = false; entity.valid = false;
} }
public Chunk ensureLoaded(net.minecraft.server.v1_15_R1.World nmsWorld, int X, int Z) { public Chunk ensureLoaded(net.minecraft.server.v1_16_R1.World nmsWorld, int X, int Z) {
return BukkitAdapter_1_16_1.ensureLoaded(nmsWorld, X, Z); return BukkitAdapter_1_16_1.ensureLoaded(nmsWorld, X, Z);
} }
@ -428,7 +428,7 @@ public class BukkitGetBlocks_1_16_1 extends CharGetBlocks {
for (final String name : Constants.NO_COPY_ENTITY_NBT_FIELDS) { for (final String name : Constants.NO_COPY_ENTITY_NBT_FIELDS) {
tag.remove(name); tag.remove(name);
} }
entity.f(tag); entity.save(tag);
} }
entity.setLocation(x, y, z, yaw, pitch); entity.setLocation(x, y, z, yaw, pitch);
nmsWorld.addEntity(entity, CreatureSpawnEvent.SpawnReason.CUSTOM); nmsWorld.addEntity(entity, CreatureSpawnEvent.SpawnReason.CUSTOM);