Setting up BlockHandler for blocks loaded by AnvilLoader

This commit is contained in:
Шандуренко Константин Владимирович 2021-09-10 16:42:59 +03:00
parent 6355f06d53
commit 2f2254ebc2

View File

@ -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);