mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-13 00:37:52 +00:00
Add a RayTraceResult method to Block that can be can be overridden (#5354)
This commit is contained in:
1 parent
fa939a890c
commit
06a6fac23a
2 files changed
+26
No files matched your search
@@ -1084,4 +1084,21 @@ public interface IForgeBlock
|
||||
{
|
||||
return state.isTopSolid();
|
||||
}
|
||||
|
||||
/**
|
||||
* Ray traces through the blocks collision from start vector to end vector returning a ray trace hit.
|
||||
*
|
||||
* @param state The current state
|
||||
* @param world The current world
|
||||
* @param pos Block position in world
|
||||
* @param start The start vector
|
||||
* @param end The end vector
|
||||
* @param original The original result from {@link Block#collisionRayTrace(IBlockState, World, BlockPos, Vec3d, Vec3d)}
|
||||
* @return A result that suits your block
|
||||
*/
|
||||
@Nullable
|
||||
default RayTraceResult getRayTraceResult(IBlockState state, World world, BlockPos pos, Vec3d start, Vec3d end, RayTraceResult original)
|
||||
{
|
||||
return original;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user