Improve support for custom block path types (#5203)

Co-authored-by: tterrag <tterrag1098@gmail.com>
This commit is contained in:
Ben Staddonandtterrag authored and tterrag committed 2019-04-12 13:47:48 -04:00
1 parent fa708f93ee
commit 2baa05ace9
4 files changed
+60 -19

No files matched your search

@@ -920,7 +920,7 @@ public interface IForgeBlock
* @return the PathNodeType
*/
@Nullable
default PathNodeType getAiPathNodeType(IBlockState state, IBlockReader world, BlockPos pos)
default PathNodeType getAiPathNodeType(IBlockState state, IBlockReader world, BlockPos pos, @Nullable EntityLiving entity)
{
return state.isBurning(world, pos) ? PathNodeType.DAMAGE_FIRE : null;
}
@@ -774,17 +774,6 @@ public interface IForgeBlockState
return getBlockState().getBlock().canBeConnectedTo(getBlockState(), world, pos, facing);
}
/**
* Get the {@code PathNodeType} for this block. Return {@code null} for vanilla behavior.
*
* @return the PathNodeType
*/
@Nullable
default PathNodeType getAiPathNodeType(IWorldReader world, BlockPos pos)
{
return getBlockState().getBlock().getAiPathNodeType(getBlockState(), world, pos);
}
/**
* @param blockState The state for this block
* @param world The world this block is in
@@ -932,8 +921,8 @@ public interface IForgeBlockState
* @return the PathNodeType
*/
@Nullable
default PathNodeType getAiPathNodeType(IBlockReader world, BlockPos pos)
default PathNodeType getAiPathNodeType(IBlockReader world, BlockPos pos, @Nullable EntityLiving entity)
{
return getBlockState().getBlock().getAiPathNodeType(getBlockState(), world, pos);
return getBlockState().getBlock().getAiPathNodeType(getBlockState(), world, pos, entity);
}
}