Skip to content
Open
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
17 changes: 16 additions & 1 deletion src/main/java/net/minecraftforge/common/ForgeHooks.java
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,21 @@ public static double getPlayerVisibilityDistance(EntityPlayer player, double xzD
return value >= maxXZDistance ? maxXZDistance : value;
}

/**
* Determines if the entity is on a ladder.
*
* Checks if the block at the current position is a ladder or checks
* multiple block positions within the entity's bounding box if
* {@code fullBoundingBoxLadders} is enabled. If the entity is a spectator it
* will return false
*
* @param state The current {@link IBlockState} of the block at the specified position.
* @param world The {@link World} object representing the current world.
* @param pos The {@link BlockPos} object representing the block position.
* @param entity The {@link EntityLivingBase} entity whose ladder status is being checked.
*
* @return {@code true} if the entity is standing on a ladder, {@code false} otherwise.
*/
public static boolean isLivingOnLadder(@Nonnull IBlockState state, @Nonnull World world, @Nonnull BlockPos pos, @Nonnull EntityLivingBase entity)
{
boolean isSpectator = (entity instanceof EntityPlayer && ((EntityPlayer)entity).isSpectator());
Expand Down Expand Up @@ -1000,7 +1015,7 @@ public static boolean onNoteChange(TileEntityNote te, byte old)

/**
* Default implementation of IRecipe.func_179532_b {getRemainingItems} because
* this is just copy pasted over a lot of recipes.
* this is just copy-pasted over a lot of recipes.
*
* @param inv Crafting inventory
* @return Crafting inventory contents after the recipe.
Expand Down