geforkt von Mirrors/FastAsyncWorldEdit
Dieser Commit ist enthalten in:
Ursprung
7967ef4db4
Commit
cdb9abc117
@ -41,8 +41,8 @@ import java.util.concurrent.Future;
|
|||||||
|
|
||||||
public class BukkitChunkHolder<T extends Future<T>> extends ChunkHolder {
|
public class BukkitChunkHolder<T extends Future<T>> extends ChunkHolder {
|
||||||
@Override
|
@Override
|
||||||
public void init(final IQueueExtent extent, final int x, final int z) {
|
public void init(final IQueueExtent extent, final int chunkX, final int chunkZ) {
|
||||||
super.init(extent, x, z);
|
super.init(extent, chunkX, chunkZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -8,7 +8,7 @@ public abstract class ChunkFilterBlock extends SimpleFilterBlock {
|
|||||||
super(extent);
|
super(extent);
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract ChunkFilterBlock init(int x, int z, IChunkGet chunk);
|
public abstract ChunkFilterBlock init(int chunkX, int chunkZ, IChunkGet chunk);
|
||||||
|
|
||||||
public abstract ChunkFilterBlock init(final IChunkGet iget, final IChunkSet iset, final int layer);
|
public abstract ChunkFilterBlock init(final IChunkGet iget, final IChunkSet iset, final int layer);
|
||||||
|
|
||||||
|
@ -20,9 +20,9 @@ public class Flood {
|
|||||||
private int[][] queues;
|
private int[][] queues;
|
||||||
private long[][] visits;
|
private long[][] visits;
|
||||||
|
|
||||||
private int x;
|
private int chunkX;
|
||||||
private int y;
|
private int chunkYLayer;
|
||||||
private int z;
|
private int chunkZ;
|
||||||
|
|
||||||
private ConcurrentLinkedQueue<int[]> queuePool = new ConcurrentLinkedQueue<>();
|
private ConcurrentLinkedQueue<int[]> queuePool = new ConcurrentLinkedQueue<>();
|
||||||
private final Long2ObjectLinkedOpenHashMap<long[][]> chunkVisits;
|
private final Long2ObjectLinkedOpenHashMap<long[][]> chunkVisits;
|
||||||
@ -52,10 +52,10 @@ public class Flood {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void init(int x, int y, int z) {
|
private void init(int chunkX, int chunkYLayer, int chunkZ) {
|
||||||
this.x = x;
|
this.chunkX = chunkX;
|
||||||
this.y = y;
|
this.chunkYLayer = chunkYLayer;
|
||||||
this.z = z;
|
this.chunkZ = chunkZ;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void start(int x, int y, int z) {
|
public void start(int x, int y, int z) {
|
||||||
@ -154,8 +154,8 @@ public class Flood {
|
|||||||
visit = visits[sectionIndex];
|
visit = visits[sectionIndex];
|
||||||
queue = queues[sectionIndex];
|
queue = queues[sectionIndex];
|
||||||
if (visit == null || queue == null) {
|
if (visit == null || queue == null) {
|
||||||
long pair = MathMan.pairInt(this.x + nextX, this.z + nextZ);
|
long pair = MathMan.pairInt(this.chunkX + nextX, this.chunkZ + nextZ);
|
||||||
int layer = this.y + nextY;
|
int layer = this.chunkYLayer + nextY;
|
||||||
if (layer < 0 || layer > 15) {
|
if (layer < 0 || layer > 15) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -28,8 +28,8 @@ public abstract class ChunkHolder implements IChunk, Supplier<IChunkGet> {
|
|||||||
private IChunkSet set;
|
private IChunkSet set;
|
||||||
private IBlockDelegate delegate;
|
private IBlockDelegate delegate;
|
||||||
private IQueueExtent extent;
|
private IQueueExtent extent;
|
||||||
private int x;
|
private int chunkX;
|
||||||
private int z;
|
private int chunkZ;
|
||||||
|
|
||||||
public ChunkHolder() {
|
public ChunkHolder() {
|
||||||
this.delegate = NULL;
|
this.delegate = NULL;
|
||||||
@ -62,7 +62,7 @@ public abstract class ChunkHolder implements IChunk, Supplier<IChunkGet> {
|
|||||||
if (region != null) {
|
if (region != null) {
|
||||||
region.filter(this, filter, block, get, set);
|
region.filter(this, filter, block, get, set);
|
||||||
} else {
|
} else {
|
||||||
block = block.init(x, z, get);
|
block = block.init(chunkX, chunkZ, get);
|
||||||
for (int layer = 0; layer < 16; layer++) {
|
for (int layer = 0; layer < 16; layer++) {
|
||||||
if (!get.hasSection(layer) || !filter.appliesLayer(this, layer)) continue;
|
if (!get.hasSection(layer) || !filter.appliesLayer(this, layer)) continue;
|
||||||
block.init(get, set, layer);
|
block.init(get, set, layer);
|
||||||
@ -119,7 +119,7 @@ public abstract class ChunkHolder implements IChunk, Supplier<IChunkGet> {
|
|||||||
|
|
||||||
private IChunkGet newGet() {
|
private IChunkGet newGet() {
|
||||||
if (extent instanceof SingleThreadQueueExtent) {
|
if (extent instanceof SingleThreadQueueExtent) {
|
||||||
IChunkGet newGet = extent.getCachedGet(x, z, this);
|
IChunkGet newGet = extent.getCachedGet(chunkX, chunkZ, this);
|
||||||
if (newGet != null) {
|
if (newGet != null) {
|
||||||
return newGet;
|
return newGet;
|
||||||
}
|
}
|
||||||
@ -128,10 +128,10 @@ public abstract class ChunkHolder implements IChunk, Supplier<IChunkGet> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(final IQueueExtent extent, final int x, final int z) {
|
public void init(final IQueueExtent extent, final int chunkX, final int chunkZ) {
|
||||||
this.extent = extent;
|
this.extent = extent;
|
||||||
this.x = x;
|
this.chunkX = chunkX;
|
||||||
this.z = z;
|
this.chunkZ = chunkZ;
|
||||||
if (set != null) {
|
if (set != null) {
|
||||||
set.reset();
|
set.reset();
|
||||||
delegate = SET;
|
delegate = SET;
|
||||||
@ -147,12 +147,12 @@ public abstract class ChunkHolder implements IChunk, Supplier<IChunkGet> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getX() {
|
public int getX() {
|
||||||
return x;
|
return chunkX;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getZ() {
|
public int getZ() {
|
||||||
return z;
|
return chunkZ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren