Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toggleable fixes #10532

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ private void checkPathBlocksCollided(final Path path)
}

final int maxLengthToCheck = Math.min(path.getNextNodeIndex() + LENGTH_TO_CHECK, path.getNodeCount());
for (int i = Math.max(0, path.getNextNodeIndex() - 1); i < maxLengthToCheck; i++)
for (int i = Math.max(0, path.getNextNodeIndex() - 2); i < maxLengthToCheck; i++)
{
if (i == path.getNodeCount() - 1)
{
Expand Down Expand Up @@ -249,7 +249,7 @@ private boolean checkPathBlocksBelow()
}

final int maxLengthToCheck = Math.min(path.getNextNodeIndex() + LENGTH_TO_CHECK, path.getNodeCount());
for (int i = Math.max(0, path.getNextNodeIndex() - 1); i < maxLengthToCheck; ++i)
for (int i = Math.max(0, path.getNextNodeIndex() - 2); i < maxLengthToCheck; ++i)
{
final Node pathpoint = path.getNode(i);

Expand All @@ -275,7 +275,8 @@ else if (i < path.getNodeCount() - 1)
{
// Check if the next pathing node is below
final Node nextPoint = path.getNode(i + 1);
if (pos.getX() == nextPoint.x && pos.getY() > nextPoint.y && pos.getZ() == nextPoint.z)
if ((pos.getX() == nextPoint.x && pos.getY() > nextPoint.y && pos.getZ() == nextPoint.z) ||
entity.getY() - pos.getY() > 1)
{
toggleAblePositions.put(pos, entity.level.getBlockState(pos).getValue(BlockStateProperties.OPEN));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,19 @@ public static SurfaceType getSurfaceType(final BlockGetter world, final BlockSta
}

if (block instanceof FenceBlock
|| block instanceof FenceGateBlock
|| block instanceof WallBlock
|| block instanceof AbstractBlockMinecoloniesDefault
|| block instanceof BambooStalkBlock
|| block instanceof BambooSaplingBlock
|| block instanceof DoorBlock)
|| block instanceof BambooSaplingBlock)
{
return SurfaceType.NOT_PASSABLE;
}

if (block instanceof FenceGateBlock || block instanceof DoorBlock)
{
return SurfaceType.DROPABLE;
}

final VoxelShape shape = blockState.getCollisionShape(world, pos);
final double maxShapeY = ShapeUtil.max(shape, Direction.Axis.Y);
if (maxShapeY < 0.5 && PathfindingUtils.isDangerous(world.getBlockState(pos.below())))
Expand Down
Loading