mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 10:12:53 +00:00
Zero write detection?
This commit is contained in:
parent
5dae1ee34f
commit
d06657e2ff
@ -32,6 +32,7 @@ import static com.volmit.iris.engine.data.mca.LoadFlags.*;
|
||||
|
||||
public class Chunk {
|
||||
|
||||
public transient int writes = 0;
|
||||
public static final int DEFAULT_DATA_VERSION = 1628;
|
||||
|
||||
private boolean partial;
|
||||
@ -327,6 +328,7 @@ public class Chunk {
|
||||
sections.set(sectionIndex, section);
|
||||
}
|
||||
section.setBlockStateAt(blockX, blockY, blockZ, state, cleanup);
|
||||
writes++;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -689,4 +691,16 @@ public class Chunk {
|
||||
public int sectionCount() {
|
||||
return sections.length();
|
||||
}
|
||||
|
||||
public void runLighting() {
|
||||
for(int s = 15; s >= 0; s--)
|
||||
{
|
||||
Section section = getSection(s);
|
||||
|
||||
if(section != null)
|
||||
{
|
||||
section.runLighting();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -107,6 +107,19 @@ public class Section {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void runLighting() {
|
||||
for(int x = 1; x < 14; x++)
|
||||
{
|
||||
for(int z = 1; z < 14; z++)
|
||||
{
|
||||
for(int y = 0; y < 16; y++)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("ClassCanBeRecord")
|
||||
private static class PaletteIndex {
|
||||
|
||||
|
@ -34,6 +34,7 @@ import com.volmit.iris.engine.data.mca.NBTWorld;
|
||||
import com.volmit.iris.engine.data.nbt.tag.CompoundTag;
|
||||
import com.volmit.iris.engine.headless.HeadlessGenerator;
|
||||
import com.volmit.iris.engine.hunk.Hunk;
|
||||
import com.volmit.iris.engine.lighting.LightingChunk;
|
||||
import com.volmit.iris.engine.object.IrisBiome;
|
||||
import com.volmit.iris.engine.object.IrisDimension;
|
||||
import com.volmit.iris.engine.object.IrisPosition;
|
||||
@ -546,6 +547,11 @@ public class EngineCompositeGenerator extends ChunkGenerator implements IrisAcce
|
||||
.injector((xx, yy, zz, biomeBase) -> chunk.setBiomeAt(ox + xx, yy, oz + zz,
|
||||
INMS.get().getTrueBiomeBaseId(biomeBase)))
|
||||
.build()).run();
|
||||
|
||||
if(chunk.writes == 0)
|
||||
{
|
||||
Iris.error("Chunk " + x + " " + z + " has 0 writes?");
|
||||
}
|
||||
}
|
||||
|
||||
catch(Throwable e)
|
||||
|
@ -24,6 +24,7 @@ import com.bergerkiller.bukkit.common.wrappers.BlockData;
|
||||
import com.bergerkiller.bukkit.common.wrappers.ChunkSection;
|
||||
import com.bergerkiller.generated.net.minecraft.server.NibbleArrayHandle;
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.util.data.NibbleArray;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
|
@ -100,21 +100,22 @@ public class NibbleArray implements Writable {
|
||||
}
|
||||
}
|
||||
|
||||
public byte getAsync(int index) {
|
||||
int bitIndex = index * depth;
|
||||
int byteIndex = bitIndex >> 3;
|
||||
int bitInByte = bitIndex & 7;
|
||||
int value = data[byteIndex] >> bitInByte;
|
||||
public byte get(int x, int y, int z)
|
||||
{
|
||||
return get(index(x,y,z));
|
||||
}
|
||||
|
||||
if (bitInByte + depth > 8) {
|
||||
value |= data[byteIndex + 1] << bitInByte;
|
||||
}
|
||||
|
||||
return (byte) (value & mask);
|
||||
public int index(int x, int y, int z) {
|
||||
return y << 8 | z << 4 | x;
|
||||
}
|
||||
|
||||
private transient int bitIndex, byteIndex, bitInByte;
|
||||
|
||||
public void set(int x, int y, int z, int nibble)
|
||||
{
|
||||
set(index(x,y,z), nibble);
|
||||
}
|
||||
|
||||
public void set(int index, int nibble) {
|
||||
set(index, (byte) nibble);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user