mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-06-12 04:23:54 +00:00
Fixes #1098
This commit is contained in:
@ -100,6 +100,8 @@ dependencies {
|
||||
testImplementation("org.checkerframework:checker-qual:3.13.0")
|
||||
testImplementation("org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT") { isTransitive = true }
|
||||
api("com.intellectualsites.paster:Paster:1.0.1-SNAPSHOT")
|
||||
api("org.lz4:lz4-java:1.7.1")
|
||||
api("net.jpountz:lz4-java-stream:1.0.0") { isTransitive = false }
|
||||
// Third party
|
||||
implementation("org.bstats:bstats-bukkit:2.2.1")
|
||||
implementation("org.bstats:bstats-base:2.2.1")
|
||||
@ -165,6 +167,12 @@ tasks.named<ShadowJar>("shadowJar") {
|
||||
relocate("com.github.luben", "com.boydti.fawe.zstd") {
|
||||
include(dependency("com.github.luben:zstd-jni:1.4.9-5"))
|
||||
}
|
||||
relocate("net.jpountz", "com.boydti.fawe.jpountz") {
|
||||
include(dependency("net.jpountz:lz4-java-stream:1.0.0"))
|
||||
}
|
||||
relocate("org.lz4", "com.boydti.fawe.lz4") {
|
||||
include(dependency("org.lz4:lz4-java:1.7.1"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8,12 +8,12 @@ import com.boydti.fawe.config.Settings;
|
||||
import com.boydti.fawe.object.collection.BitArray;
|
||||
import com.boydti.fawe.util.MathMan;
|
||||
import com.boydti.fawe.util.TaskManager;
|
||||
import com.boydti.fawe.util.UnsafeUtility;
|
||||
import com.mojang.datafixers.util.Either;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
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_15_R1.BiomeBase;
|
||||
import net.minecraft.server.v1_15_R1.BiomeStorage;
|
||||
import net.minecraft.server.v1_15_R1.Block;
|
||||
@ -101,7 +101,7 @@ public final class BukkitAdapter_1_15_2 extends NMSAdapter {
|
||||
declaredSetLightNibbleArray.setAccessible(true);
|
||||
methodSetLightNibbleArray = MethodHandles.lookup().unreflect(declaredSetLightNibbleArray);
|
||||
|
||||
Unsafe unsafe = UnsafeUtils.getUNSAFE();
|
||||
Unsafe unsafe = UnsafeUtility.getUNSAFE();
|
||||
fieldLock = DataPaletteBlock.class.getDeclaredField("j");
|
||||
fieldLockOffset = unsafe.objectFieldOffset(fieldLock);
|
||||
|
||||
@ -122,7 +122,7 @@ public final class BukkitAdapter_1_15_2 extends NMSAdapter {
|
||||
protected static boolean setSectionAtomic(ChunkSection[] sections, ChunkSection expected, ChunkSection value, int layer) {
|
||||
long offset = ((long) layer << CHUNKSECTION_SHIFT) + CHUNKSECTION_BASE;
|
||||
if (layer >= 0 && layer < sections.length) {
|
||||
return UnsafeUtils.getUNSAFE().compareAndSwapObject(sections, offset, expected, value);
|
||||
return UnsafeUtility.getUNSAFE().compareAndSwapObject(sections, offset, expected, value);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -131,7 +131,7 @@ public final class BukkitAdapter_1_15_2 extends NMSAdapter {
|
||||
//todo there has to be a better way to do this. Maybe using a() in DataPaletteBlock which acquires the lock in NMS?
|
||||
try {
|
||||
synchronized (section) {
|
||||
Unsafe unsafe = UnsafeUtils.getUNSAFE();
|
||||
Unsafe unsafe = UnsafeUtility.getUNSAFE();
|
||||
DataPaletteBlock<IBlockData> blocks = section.getBlocks();
|
||||
ReentrantLock currentLock = (ReentrantLock) unsafe.getObject(blocks, fieldLockOffset);
|
||||
if (currentLock instanceof DelegateLock) {
|
||||
|
@ -8,12 +8,12 @@ import com.boydti.fawe.config.Settings;
|
||||
import com.boydti.fawe.object.collection.BitArrayUnstretched;
|
||||
import com.boydti.fawe.util.MathMan;
|
||||
import com.boydti.fawe.util.TaskManager;
|
||||
import com.boydti.fawe.util.UnsafeUtility;
|
||||
import com.mojang.datafixers.util.Either;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
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.BiomeBase;
|
||||
import net.minecraft.server.v1_16_R1.BiomeStorage;
|
||||
import net.minecraft.server.v1_16_R1.Block;
|
||||
@ -98,7 +98,7 @@ public final class BukkitAdapter_1_16_1 extends NMSAdapter {
|
||||
declaredGetVisibleChunk.setAccessible(true);
|
||||
methodGetVisibleChunk = MethodHandles.lookup().unreflect(declaredGetVisibleChunk);
|
||||
|
||||
Unsafe unsafe = UnsafeUtils.getUNSAFE();
|
||||
Unsafe unsafe = UnsafeUtility.getUNSAFE();
|
||||
fieldLock = DataPaletteBlock.class.getDeclaredField("j");
|
||||
fieldLockOffset = unsafe.objectFieldOffset(fieldLock);
|
||||
|
||||
@ -119,7 +119,7 @@ public final class BukkitAdapter_1_16_1 extends NMSAdapter {
|
||||
protected static boolean setSectionAtomic(ChunkSection[] sections, ChunkSection expected, ChunkSection value, int layer) {
|
||||
long offset = ((long) layer << CHUNKSECTION_SHIFT) + CHUNKSECTION_BASE;
|
||||
if (layer >= 0 && layer < sections.length) {
|
||||
return UnsafeUtils.getUNSAFE().compareAndSwapObject(sections, offset, expected, value);
|
||||
return UnsafeUtility.getUNSAFE().compareAndSwapObject(sections, offset, expected, value);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -128,7 +128,7 @@ public final class BukkitAdapter_1_16_1 extends NMSAdapter {
|
||||
//todo there has to be a better way to do this. Maybe using a() in DataPaletteBlock which acquires the lock in NMS?
|
||||
try {
|
||||
synchronized (section) {
|
||||
Unsafe unsafe = UnsafeUtils.getUNSAFE();
|
||||
Unsafe unsafe = UnsafeUtility.getUNSAFE();
|
||||
DataPaletteBlock<IBlockData> blocks = section.getBlocks();
|
||||
ReentrantLock currentLock = (ReentrantLock) unsafe.getObject(blocks, fieldLockOffset);
|
||||
if (currentLock instanceof DelegateLock) {
|
||||
|
@ -8,12 +8,12 @@ import com.boydti.fawe.config.Settings;
|
||||
import com.boydti.fawe.object.collection.BitArrayUnstretched;
|
||||
import com.boydti.fawe.util.MathMan;
|
||||
import com.boydti.fawe.util.TaskManager;
|
||||
import com.boydti.fawe.util.UnsafeUtility;
|
||||
import com.mojang.datafixers.util.Either;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
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_R2.BiomeBase;
|
||||
import net.minecraft.server.v1_16_R2.BiomeStorage;
|
||||
import net.minecraft.server.v1_16_R2.Block;
|
||||
@ -98,7 +98,7 @@ public final class BukkitAdapter_1_16_2 extends NMSAdapter {
|
||||
declaredGetVisibleChunk.setAccessible(true);
|
||||
methodGetVisibleChunk = MethodHandles.lookup().unreflect(declaredGetVisibleChunk);
|
||||
|
||||
Unsafe unsafe = UnsafeUtils.getUNSAFE();
|
||||
Unsafe unsafe = UnsafeUtility.getUNSAFE();
|
||||
fieldLock = DataPaletteBlock.class.getDeclaredField("j");
|
||||
fieldLockOffset = unsafe.objectFieldOffset(fieldLock);
|
||||
|
||||
@ -119,7 +119,7 @@ public final class BukkitAdapter_1_16_2 extends NMSAdapter {
|
||||
protected static boolean setSectionAtomic(ChunkSection[] sections, ChunkSection expected, ChunkSection value, int layer) {
|
||||
long offset = ((long) layer << CHUNKSECTION_SHIFT) + CHUNKSECTION_BASE;
|
||||
if (layer >= 0 && layer < sections.length) {
|
||||
return UnsafeUtils.getUNSAFE().compareAndSwapObject(sections, offset, expected, value);
|
||||
return UnsafeUtility.getUNSAFE().compareAndSwapObject(sections, offset, expected, value);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -128,7 +128,7 @@ public final class BukkitAdapter_1_16_2 extends NMSAdapter {
|
||||
//todo there has to be a better way to do this. Maybe using a() in DataPaletteBlock which acquires the lock in NMS?
|
||||
try {
|
||||
synchronized (section) {
|
||||
Unsafe unsafe = UnsafeUtils.getUNSAFE();
|
||||
Unsafe unsafe = UnsafeUtility.getUNSAFE();
|
||||
DataPaletteBlock<IBlockData> blocks = section.getBlocks();
|
||||
ReentrantLock currentLock = (ReentrantLock) unsafe.getObject(blocks, fieldLockOffset);
|
||||
if (currentLock instanceof DelegateLock) {
|
||||
|
@ -8,12 +8,12 @@ import com.boydti.fawe.config.Settings;
|
||||
import com.boydti.fawe.object.collection.BitArrayUnstretched;
|
||||
import com.boydti.fawe.util.MathMan;
|
||||
import com.boydti.fawe.util.TaskManager;
|
||||
import com.boydti.fawe.util.UnsafeUtility;
|
||||
import com.mojang.datafixers.util.Either;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
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_R3.BiomeBase;
|
||||
import net.minecraft.server.v1_16_R3.BiomeStorage;
|
||||
import net.minecraft.server.v1_16_R3.Block;
|
||||
@ -98,7 +98,7 @@ public final class BukkitAdapter_1_16_5 extends NMSAdapter {
|
||||
declaredGetVisibleChunk.setAccessible(true);
|
||||
methodGetVisibleChunk = MethodHandles.lookup().unreflect(declaredGetVisibleChunk);
|
||||
|
||||
Unsafe unsafe = UnsafeUtils.getUNSAFE();
|
||||
Unsafe unsafe = UnsafeUtility.getUNSAFE();
|
||||
fieldLock = DataPaletteBlock.class.getDeclaredField("j");
|
||||
fieldLockOffset = unsafe.objectFieldOffset(fieldLock);
|
||||
|
||||
@ -119,7 +119,7 @@ public final class BukkitAdapter_1_16_5 extends NMSAdapter {
|
||||
protected static boolean setSectionAtomic(ChunkSection[] sections, ChunkSection expected, ChunkSection value, int layer) {
|
||||
long offset = ((long) layer << CHUNKSECTION_SHIFT) + CHUNKSECTION_BASE;
|
||||
if (layer >= 0 && layer < sections.length) {
|
||||
return UnsafeUtils.getUNSAFE().compareAndSwapObject(sections, offset, expected, value);
|
||||
return UnsafeUtility.getUNSAFE().compareAndSwapObject(sections, offset, expected, value);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -128,7 +128,7 @@ public final class BukkitAdapter_1_16_5 extends NMSAdapter {
|
||||
//todo there has to be a better way to do this. Maybe using a() in DataPaletteBlock which acquires the lock in NMS?
|
||||
try {
|
||||
synchronized (section) {
|
||||
Unsafe unsafe = UnsafeUtils.getUNSAFE();
|
||||
Unsafe unsafe = UnsafeUtility.getUNSAFE();
|
||||
DataPaletteBlock<IBlockData> blocks = section.getBlocks();
|
||||
ReentrantLock currentLock = (ReentrantLock) unsafe.getObject(blocks, fieldLockOffset);
|
||||
if (currentLock instanceof DelegateLock) {
|
||||
|
Reference in New Issue
Block a user