Skip to content

Commit ebe99bb

Browse files
authored
Update max placement height for scarecrows (#10571)
Use level max build height rather than hardcoded 255 Fix identical issue in tree lookup for the forester
1 parent ec6eccf commit ebe99bb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/main/java/com/minecolonies/core/blocks/BlockScarecrow.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ public BlockState getStateForPlacement(final BlockPlaceContext context)
153153
{
154154
@NotNull final Direction dir = (context.getPlayer() == null) ? Direction.NORTH : Direction.fromYRot(context.getPlayer().getYRot() + 180);
155155

156-
if (context.getClickedPos().getY() < 255 && context.getLevel().getBlockState(context.getClickedPos().above()).canBeReplaced(context))
156+
if (context.getClickedPos().getY() < context.getLevel().getMaxBuildHeight() && context.getLevel().getBlockState(context.getClickedPos().above()).canBeReplaced(context))
157157
{
158158
return this.defaultBlockState().setValue(FACING, dir).setValue(HALF, DoubleBlockHalf.LOWER);
159159
}

src/main/java/com/minecolonies/core/entity/ai/workers/util/Tree.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ public static List<ItemStack> getSaplingsForLeaf(ServerLevel world, BlockPos pos
327327
private BlockPos getFirstLeaf(final LevelAccessor world)
328328
{
329329
// Find the closest leaf above, stay below max height
330-
for (int i = 1; (i + topLog.getY()) < 255 && i < 10; i++)
330+
for (int i = 1; (i + topLog.getY()) < world.getMaxBuildHeight() && i < 10; i++)
331331
{
332332
final BlockState blockState = world.getBlockState(topLog.offset(0, i, 0));
333333
if (blockState.is(BlockTags.LEAVES) || blockState.is(ModTags.hugeMushroomBlocks))

0 commit comments

Comments
 (0)