From a4222ac16a624177ffe8c3ddc74ec443ccc3dbdb Mon Sep 17 00:00:00 2001 From: Gardel Date: Sat, 11 Apr 2026 17:14:48 +0000 Subject: [PATCH] fix: skip light check in GrapeBush.canSurvive() during worldgen to prevent ScalableLux compatibility issue --- .../java/net/satisfy/vinery/core/block/GrapeBush.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/common/src/main/java/net/satisfy/vinery/core/block/GrapeBush.java b/common/src/main/java/net/satisfy/vinery/core/block/GrapeBush.java index 8b46645e..164344b8 100644 --- a/common/src/main/java/net/satisfy/vinery/core/block/GrapeBush.java +++ b/common/src/main/java/net/satisfy/vinery/core/block/GrapeBush.java @@ -24,6 +24,7 @@ import net.minecraft.world.level.block.state.StateDefinition; import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.minecraft.world.level.block.state.properties.IntegerProperty; +import net.minecraft.world.level.chunk.status.ChunkStatus; import net.minecraft.world.level.gameevent.GameEvent; import net.minecraft.world.level.pathfinder.PathComputationType; import net.minecraft.world.phys.BlockHitResult; @@ -114,7 +115,13 @@ public boolean canGrowPlace(LevelReader world, BlockPos blockPos, BlockState blo @Override public boolean canSurvive(BlockState blockState, LevelReader world, BlockPos blockPos) { - return canGrowPlace(world, blockPos, blockState) && this.mayPlaceOn(world.getBlockState(blockPos.below()), world, blockPos); + boolean soilValid = this.mayPlaceOn(world.getBlockState(blockPos.below()), world, blockPos); + if (!soilValid) return false; + + if (world.getChunk(blockPos).getPersistedStatus().getIndex() < ChunkStatus.FULL.getIndex()) { + return true; + } + return canGrowPlace(world, blockPos, blockState); } @Override