Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-05 02:50:05 +01:00
use paper writeLock
Dieser Commit ist enthalten in:
Ursprung
adb2c37a02
Commit
18e6c09fdd
@ -125,12 +125,20 @@ public class BukkitQueue extends SimpleCharQueueExtent {
|
|||||||
fieldNonEmptyBlockCount = ChunkSection.class.getDeclaredField("nonEmptyBlockCount");
|
fieldNonEmptyBlockCount = ChunkSection.class.getDeclaredField("nonEmptyBlockCount");
|
||||||
fieldNonEmptyBlockCount.setAccessible(true);
|
fieldNonEmptyBlockCount.setAccessible(true);
|
||||||
|
|
||||||
fieldLock = DataPaletteBlock.class.getDeclaredField("j");
|
{
|
||||||
|
Field tmp = null;
|
||||||
|
try {
|
||||||
|
tmp = DataPaletteBlock.class.getDeclaredField("j");
|
||||||
|
} catch (NoSuchFieldException paper) {
|
||||||
|
tmp = DataPaletteBlock.class.getDeclaredField("writeLock");
|
||||||
|
}
|
||||||
|
fieldLock = tmp;
|
||||||
fieldLock.setAccessible(true);
|
fieldLock.setAccessible(true);
|
||||||
Field modifiersField = Field.class.getDeclaredField("modifiers");
|
Field modifiersField = Field.class.getDeclaredField("modifiers");
|
||||||
int modifiers = modifiersField.getInt(fieldLock);
|
int modifiers = modifiersField.getInt(fieldLock);
|
||||||
modifiers &= ~Modifier.FINAL;
|
int newModifiers = modifiers & (~Modifier.FINAL);
|
||||||
modifiersField.setInt(fieldLock, modifiers);
|
if (newModifiers != modifiers) modifiersField.setInt(fieldLock, newModifiers);
|
||||||
|
}
|
||||||
|
|
||||||
Unsafe unsafe = UnsafeUtils.getUNSAFE();
|
Unsafe unsafe = UnsafeUtils.getUNSAFE();
|
||||||
CHUNKSECTION_BASE = unsafe.arrayBaseOffset(ChunkSection[].class);
|
CHUNKSECTION_BASE = unsafe.arrayBaseOffset(ChunkSection[].class);
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren