3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-11-07 12:00:07 +01:00

Remove chunk notify task

Dieser Commit ist enthalten in:
Jesse Boyd 2019-04-16 01:16:00 +10:00
Ursprung a4de4e1a65
Commit 9207263426
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 59F1DE6293AF6E1F
9 geänderte Dateien mit 1 neuen und 72 gelöschten Zeilen

Datei anzeigen

@ -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;
}
}

Datei anzeigen

@ -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;

Datei anzeigen

@ -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;

Datei anzeigen

@ -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
*

Datei anzeigen

@ -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;
}

Datei anzeigen

@ -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;

Datei anzeigen

@ -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);

Datei anzeigen

@ -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);

Datei anzeigen

@ -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;