mirror of
https://github.com/Minestom/Minestom.git
synced 2025-02-01 21:11:33 +01:00
Save blocks nbt without handler
This commit is contained in:
parent
8ff7eed45c
commit
b49ccadadc
@ -238,10 +238,13 @@ public class AnvilLoader implements IChunkLoader {
|
|||||||
chunkColumn.setBiome(x, 0, z, biome.getId());
|
chunkColumn.setBiome(x, 0, z, biome.getId());
|
||||||
|
|
||||||
// Tile entity
|
// Tile entity
|
||||||
|
var nbt = block.nbt();
|
||||||
final BlockHandler handler = block.handler();
|
final BlockHandler handler = block.handler();
|
||||||
|
if (nbt != null || handler != null) {
|
||||||
|
nbt = Objects.requireNonNullElseGet(nbt, NBTCompound::new);
|
||||||
if (handler != null) {
|
if (handler != null) {
|
||||||
NBTCompound nbt = Objects.requireNonNullElseGet(block.nbt(), NBTCompound::new);
|
|
||||||
nbt.setString("id", handler.getNamespaceId().asString());
|
nbt.setString("id", handler.getNamespaceId().asString());
|
||||||
|
}
|
||||||
nbt.setInt("x", x + Chunk.CHUNK_SIZE_X * chunk.getChunkX());
|
nbt.setInt("x", x + Chunk.CHUNK_SIZE_X * chunk.getChunkX());
|
||||||
nbt.setInt("y", y);
|
nbt.setInt("y", y);
|
||||||
nbt.setInt("z", z + Chunk.CHUNK_SIZE_Z * chunk.getChunkZ());
|
nbt.setInt("z", z + Chunk.CHUNK_SIZE_Z * chunk.getChunkZ());
|
||||||
|
Loading…
Reference in New Issue
Block a user