From de7dbcb622b5bb4a891c57c58a3e088e9cb118ac Mon Sep 17 00:00:00 2001 From: TomTheFurry Date: Tue, 3 May 2022 14:18:51 +0800 Subject: [PATCH] Fix spawnerBlock bypass for 1.16.5 --- .../mimicObject/LightedWorldGenRegion.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/com/seibel/lod/common/wrappers/worldGeneration/mimicObject/LightedWorldGenRegion.java b/common/src/main/java/com/seibel/lod/common/wrappers/worldGeneration/mimicObject/LightedWorldGenRegion.java index f968d909e..38713c0d1 100644 --- a/common/src/main/java/com/seibel/lod/common/wrappers/worldGeneration/mimicObject/LightedWorldGenRegion.java +++ b/common/src/main/java/com/seibel/lod/common/wrappers/worldGeneration/mimicObject/LightedWorldGenRegion.java @@ -168,11 +168,17 @@ public class LightedWorldGenRegion extends WorldGenRegion @Override public BlockEntity getBlockEntity(BlockPos blockPos) { BlockState blockState = this.getBlockState(blockPos); - if (!blockState.hasBlockEntity()) return null; + + // This is a bypass for the spawner block since MC complains about not having it + #if POST_MC_1_17_1 if (blockState.getBlock() instanceof SpawnerBlock) { - // This is a bypass for the spawner block since MC complains about not having it return ((EntityBlock) blockState.getBlock()).newBlockEntity(blockPos, blockState); } else return null; + #else + if (blockState.getBlock() instanceof SpawnerBlock) { + return ((EntityBlock) blockState.getBlock()).newBlockEntity(this); + } else return null; + #endif } // Skip BlockEntity stuff. It aren't really needed