mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 09:47:38 +00:00
Remove chunk notify task
This commit is contained in:
parent
a4de4e1a65
commit
9207263426
@ -434,11 +434,9 @@ public class BukkitChunk_1_13 extends IntFaweChunk<Chunk, BukkitQueue_1_13> {
|
||||
}
|
||||
if (this.sectionPalettes != null && this.sectionPalettes[j] != null) {
|
||||
section = sections[j] = this.sectionPalettes[j];
|
||||
// getParent().setCount(0, count - this.getAir(j), section);
|
||||
continue;
|
||||
} else {
|
||||
section = sections[j] = getParent().newChunkSection(j, flag, array);
|
||||
// getParent().setCount(0, count - this.getAir(j), section);
|
||||
continue;
|
||||
}
|
||||
} else if (count >= 4096) {
|
||||
@ -448,11 +446,9 @@ public class BukkitChunk_1_13 extends IntFaweChunk<Chunk, BukkitQueue_1_13> {
|
||||
}
|
||||
if (this.sectionPalettes != null && this.sectionPalettes[j] != null) {
|
||||
section = sections[j] = this.sectionPalettes[j];
|
||||
// getParent().setCount(0, count - this.getAir(j), section);
|
||||
continue;
|
||||
} else {
|
||||
section = sections[j] = getParent().newChunkSection(j, flag, array);
|
||||
// getParent().setCount(0, count - this.getAir(j), section);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@ -144,12 +144,6 @@ public abstract class MappedFaweQueue<WORLD, CHUNK, CHUNKSECTIONS, SECTION> impl
|
||||
return regenerateChunk(getWorld(), x, z, biome, seed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addNotifyTask(int x, int z, Runnable runnable) {
|
||||
FaweChunk chunk = map.getFaweChunk(x, z);
|
||||
chunk.addNotifyTask(runnable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setBlock(int x, int y, int z, int id) {
|
||||
int cx = x >> 4;
|
||||
|
@ -925,11 +925,6 @@ public class HeightMapMCAGenerator extends MCAWriter implements StreamChange, Dr
|
||||
chunkOffset = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addNotifyTask(int x, int z, Runnable runnable) {
|
||||
if (runnable != null) runnable.run();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BiomeType getBiomeType(int x, int z) throws FaweException.FaweChunkLoadException {
|
||||
int index = z * getWidth() + x;
|
||||
|
@ -16,12 +16,10 @@ import java.util.concurrent.Callable;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public abstract class FaweChunk<T> implements Callable<FaweChunk> {
|
||||
public static int HEIGHT = 256;
|
||||
|
||||
private FaweQueue parent;
|
||||
private int x, z;
|
||||
public static int HEIGHT = 256;
|
||||
|
||||
private final ArrayDeque<Runnable> tasks = new ArrayDeque<>(0);
|
||||
|
||||
/**
|
||||
* A FaweSections object represents a chunk and the blocks that you wish to change in it.
|
||||
@ -217,28 +215,6 @@ public abstract class FaweChunk<T> implements Callable<FaweChunk> {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a task to run when this chunk is dispatched
|
||||
*
|
||||
* @param run
|
||||
*/
|
||||
public void addNotifyTask(Runnable run) {
|
||||
if (run != null) {
|
||||
tasks.add(run);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean hasNotifyTasks() {
|
||||
return tasks.size() > 0;
|
||||
}
|
||||
|
||||
public void executeNotifyTasks() {
|
||||
for (Runnable task : tasks) {
|
||||
task.run();
|
||||
}
|
||||
tasks.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the underlying chunk object
|
||||
*
|
||||
|
@ -394,8 +394,6 @@ public interface FaweQueue extends HasFaweQueue, Extent {
|
||||
*/
|
||||
void clear();
|
||||
|
||||
void addNotifyTask(int x, int z, Runnable runnable);
|
||||
|
||||
default boolean hasBlock(int x, int y, int z) throws FaweException.FaweChunkLoadException {
|
||||
return getCombinedId4Data(x, y, z) != 0;
|
||||
}
|
||||
|
@ -56,11 +56,6 @@ public abstract class ImmutableVirtualWorld implements VirtualWorld {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addNotifyTask(int x, int z, Runnable runnable) {
|
||||
if (runnable != null) runnable.run();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BiomeType getBiome(BlockVector2 position) {
|
||||
return BiomeTypes.FOREST;
|
||||
|
@ -332,11 +332,6 @@ public interface IDelegateFaweQueue extends FaweQueue {
|
||||
getQueue().clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
default void addNotifyTask(int x, int z, Runnable runnable) {
|
||||
getQueue().addNotifyTask(x, z, runnable);
|
||||
}
|
||||
|
||||
@Override
|
||||
default boolean hasBlock(int x, int y, int z) throws FaweException.FaweChunkLoadException {
|
||||
return getQueue().hasBlock(x, y, z);
|
||||
|
@ -115,21 +115,6 @@ public abstract class LazyFaweChunk<T extends FaweChunk> extends FaweChunk {
|
||||
internalGetOrCacheChunk().fillCuboid(x1, x2, y1, y2, z1, z2, combinedId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addNotifyTask(Runnable run) {
|
||||
internalGetOrCacheChunk().addNotifyTask(run);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasNotifyTasks() {
|
||||
return internalGetOrCacheChunk().hasNotifyTasks();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void executeNotifyTasks() {
|
||||
internalGetOrCacheChunk().executeNotifyTasks();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTile(int x, int y, int z, CompoundTag tile) {
|
||||
internalGetOrCacheChunk().setTile(x, y, z, tile);
|
||||
|
@ -177,11 +177,6 @@ public class NullFaweQueue implements FaweQueue {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addNotifyTask(int x, int z, Runnable runnable) {
|
||||
runnable.run();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BiomeType getBiomeType(int x, int z) throws FaweException.FaweChunkLoadException {
|
||||
return null;
|
||||
|
Loading…
Reference in New Issue
Block a user