mirror of
https://github.com/Minestom/Minestom.git
synced 2024-12-30 21:17:53 +01:00
Setting up BlockHandler for blocks loaded by AnvilLoader
This commit is contained in:
parent
6355f06d53
commit
2f2254ebc2
@ -139,8 +139,12 @@ public class AnvilLoader implements IChunkLoader {
|
||||
for (int y = 0; y < Chunk.CHUNK_SECTION_SIZE; y++) {
|
||||
try {
|
||||
final BlockState blockState = section.get(x, y, z);
|
||||
final Block block = Objects.requireNonNull(Block.fromNamespaceId(blockState.getName()))
|
||||
Block block = Objects.requireNonNull(Block.fromNamespaceId(blockState.getName()))
|
||||
.withProperties(blockState.getProperties());
|
||||
BlockHandler handler = MinecraftServer.getBlockManager().getHandler(block.name());
|
||||
if (handler != null) {
|
||||
block = block.withHandler(handler);
|
||||
}
|
||||
chunk.setBlock(x, y + yOffset, z, block);
|
||||
} catch (Exception e) {
|
||||
EXCEPTION_MANAGER.handleException(e);
|
||||
|
Loading…
Reference in New Issue
Block a user