mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 08:17:35 +00:00
New hook to allow Trapdoors be climbable for custom ladders (#7816)
This commit is contained in:
1 parent
5169f1f6fe
commit
043e49a694
2 files changed
+17
-3
No files matched your search
@@ -116,6 +116,20 @@ public interface IForgeBlock
|
||||
return state.getBlock().is(BlockTags.CLIMBABLE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if this block makes an open trapdoor above it climbable.
|
||||
*
|
||||
* @param state The current state
|
||||
* @param world The current world
|
||||
* @param pos Block position in world
|
||||
* @param trapdoorState The current state of the open trapdoor above
|
||||
* @return True if the block should act like a ladder
|
||||
*/
|
||||
default boolean makesOpenTrapdoorAboveClimbable(BlockState state, IWorldReader world, BlockPos pos, BlockState trapdoorState)
|
||||
{
|
||||
return state.getBlock() instanceof LadderBlock && state.getValue(LadderBlock.FACING) == trapdoorState.getValue(TrapDoorBlock.FACING);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if this block should set fire and deal fire damage
|
||||
* to entities coming into contact with it.
|
||||
|
||||
Reference in new issue
Block a user