mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
ffs
This commit is contained in:
parent
88a5d33bad
commit
5dae1ee34f
@ -33,7 +33,6 @@ import java.util.Map;
|
|||||||
import java.util.concurrent.atomic.AtomicLongArray;
|
import java.util.concurrent.atomic.AtomicLongArray;
|
||||||
|
|
||||||
public class Section {
|
public class Section {
|
||||||
private static final Field longArrayStealer = getLongArrayValueField();
|
|
||||||
private CompoundTag data;
|
private CompoundTag data;
|
||||||
private Map<String, List<PaletteIndex>> valueIndexedPalette = new KMap<>();
|
private Map<String, List<PaletteIndex>> valueIndexedPalette = new KMap<>();
|
||||||
private ListTag<CompoundTag> palette;
|
private ListTag<CompoundTag> palette;
|
||||||
@ -430,27 +429,18 @@ public class Section {
|
|||||||
data.putByteArray("BlockLight", blockLight);
|
data.putByteArray("BlockLight", blockLight);
|
||||||
}
|
}
|
||||||
if (blockStates != null) {
|
if (blockStates != null) {
|
||||||
try {
|
long[] c = new long[blockStates.length()];
|
||||||
data.putLongArray("BlockStates", (long[]) longArrayStealer.get(blockStates));
|
|
||||||
} catch (IllegalAccessException e) {
|
for(int i = 0; i < c.length; i++)
|
||||||
e.printStackTrace();
|
{
|
||||||
|
c[i] = blockStates.get(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
data.putLongArray("BlockStates", c);
|
||||||
}
|
}
|
||||||
if (skyLight != null) {
|
if (skyLight != null) {
|
||||||
data.putByteArray("SkyLight", skyLight);
|
data.putByteArray("SkyLight", skyLight);
|
||||||
}
|
}
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Field getLongArrayValueField() {
|
|
||||||
Field f = null;
|
|
||||||
try {
|
|
||||||
f = AtomicLongArray.class.getDeclaredField("array");
|
|
||||||
f.setAccessible(true);
|
|
||||||
} catch (Throwable e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
return f;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user