mirror of
https://github.com/Minestom/Minestom.git
synced 2024-09-24 20:42:39 +02:00
Bump Hephaistos version + fix loading of <0 sections for 1.18 worlds
This commit is contained in:
parent
f708750045
commit
34030e3a8f
@ -3,6 +3,6 @@ mcVersion = 1.17
|
||||
|
||||
asmVersion=9.2
|
||||
mixinVersion=0.8.4
|
||||
hephaistosVersion=2.3.0
|
||||
hephaistosVersion=2.3.1
|
||||
kotlinVersion=1.5.31
|
||||
adventureVersion=4.9.3
|
||||
|
@ -94,6 +94,7 @@ public class AnvilLoader implements IChunkLoader {
|
||||
HashMap<String, Biome> biomeCache = new HashMap<>();
|
||||
|
||||
for (ChunkSection section : fileChunk.getSections().values()) {
|
||||
if(!section.getEmpty()) continue;
|
||||
for (int y = 0; y < Chunk.CHUNK_SECTION_SIZE; y++) {
|
||||
for (int z = 0; z < Chunk.CHUNK_SIZE_Z; z++) {
|
||||
for (int x = 0; x < Chunk.CHUNK_SIZE_X; x++) {
|
||||
|
@ -216,11 +216,11 @@ public class DynamicChunk extends Chunk {
|
||||
index++;
|
||||
final byte[] skyLight = section.getSkyLight();
|
||||
final byte[] blockLight = section.getBlockLight();
|
||||
if (!ArrayUtils.empty(skyLight)) {
|
||||
if (skyLight.length != 0) {
|
||||
skyLights.add(skyLight);
|
||||
skyMask.set(index);
|
||||
}
|
||||
if (!ArrayUtils.empty(blockLight)) {
|
||||
if (blockLight.length != 0) {
|
||||
blockLights.add(blockLight);
|
||||
blockMask.set(index);
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ public class Tag<T> {
|
||||
* Writing will override all tags. Proceed with caution.
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
public static final Tag<String> SNBT = new Tag<>(null, n -> n.toCompound().toSNBT(), (original, snbt) -> {
|
||||
public static final Tag<String> SNBT = new Tag<>(null, NBTCompoundLike::toSNBT, (original, snbt) -> {
|
||||
try {
|
||||
final var updated = new SNBTParser(new StringReader(snbt)).parse();
|
||||
if (!(updated instanceof NBTCompound updatedCompound))
|
||||
|
@ -48,13 +48,4 @@ public final class ArrayUtils {
|
||||
list.getElements(0, array, 0, array.length);
|
||||
return array;
|
||||
}
|
||||
|
||||
public static boolean empty(byte[] array) {
|
||||
for (byte b : array) {
|
||||
if (b != 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -140,7 +140,7 @@ public final class ChunkUtils {
|
||||
}
|
||||
|
||||
public static int getSectionAt(int y) {
|
||||
return y / Chunk.CHUNK_SECTION_SIZE;
|
||||
return (int) Math.floor((double)y / Chunk.CHUNK_SECTION_SIZE);
|
||||
}
|
||||
|
||||
public static void forDifferingChunksInRange(int newChunkX, int newChunkZ,
|
||||
|
Loading…
Reference in New Issue
Block a user