mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-06-11 20:13:55 +00:00
set blocks
This commit is contained in:
@ -78,6 +78,10 @@ public abstract class SingleThreadQueueExtent implements IQueueExtent {
|
||||
// Pool discarded chunks for reuse (can safely be cleared by another thread)
|
||||
private static final ConcurrentLinkedQueue<IChunk> CHUNK_POOL = new ConcurrentLinkedQueue<>();
|
||||
|
||||
public void returnToPool(IChunk chunk) {
|
||||
CHUNK_POOL.add(chunk);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends Future<T>> T submit(final IChunk<T> chunk) {
|
||||
if (chunk.isEmpty()) {
|
||||
@ -123,7 +127,6 @@ public abstract class SingleThreadQueueExtent implements IQueueExtent {
|
||||
private IChunk poolOrCreate(final int X, final int Z) {
|
||||
IChunk next = CHUNK_POOL.poll();
|
||||
if (next == null) {
|
||||
System.out.println("Create");
|
||||
next = create(false);
|
||||
}
|
||||
next.init(this, X, Z);
|
||||
|
@ -30,6 +30,10 @@ public class CharBlocks implements IBlocks {
|
||||
for (int i = 0; i < 16; i++) sections[i] = NULL;
|
||||
}
|
||||
|
||||
public void reset(int layer) {
|
||||
sections[layer] = NULL;
|
||||
}
|
||||
|
||||
protected char[] load(int layer) {
|
||||
return new char[4096];
|
||||
}
|
||||
|
@ -144,4 +144,8 @@ public enum UnsafeUtils {
|
||||
public static void writeShort(short[] dest, int destOff, int value) {
|
||||
UNSAFE.putShort(dest, SHORT_ARRAY_OFFSET + SHORT_ARRAY_SCALE * destOff, (short) value);
|
||||
}
|
||||
|
||||
public static Unsafe getUNSAFE() {
|
||||
return UNSAFE;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user