diff --git a/common/net/minecraftforge/common/ForgeHooks.java b/common/net/minecraftforge/common/ForgeHooks.java index fa1883fea6..a76c3a9117 100644 --- a/common/net/minecraftforge/common/ForgeHooks.java +++ b/common/net/minecraftforge/common/ForgeHooks.java @@ -344,6 +344,11 @@ public class ForgeHooks return (MinecraftForge.EVENT_BUS.post(event) ? 0.0f : event.distance); } + public static boolean isLivingOnLadder(Block block, World world, int x, int y, int z, EntityLiving entity) + { + return block != null && block.isLadder(world, x, y, z, entity); + } + @Deprecated //See above public static boolean isLivingOnLadder(Block block, World world, int x, int y, int z) { return block != null && block.isLadder(world, x, y, z); diff --git a/patches/minecraft/net/minecraft/block/Block.java.patch b/patches/minecraft/net/minecraft/block/Block.java.patch index a251863240..c1ca758f59 100644 --- a/patches/minecraft/net/minecraft/block/Block.java.patch +++ b/patches/minecraft/net/minecraft/block/Block.java.patch @@ -165,7 +165,7 @@ } /** -@@ -1443,4 +1464,944 @@ +@@ -1443,4 +1464,950 @@ canBlockGrass[0] = true; StatList.initBreakableStats(); } @@ -197,8 +197,14 @@ + * @param x X Position + * @param y Y position + * @param z Z position ++ * @param entity The entity trying to use the ladder, CAN be null. + * @return True if the block should act like a ladder + */ ++ public boolean isLadder(World world, int x, int y, int z, EntityLiving entity) ++ { ++ return isLadder(world, x, y, z); ++ } ++ @Deprecated //See EntityLiving sensitive version above + public boolean isLadder(World world, int x, int y, int z) + { + return false; diff --git a/patches/minecraft/net/minecraft/block/BlockLadder.java.patch b/patches/minecraft/net/minecraft/block/BlockLadder.java.patch index 30a35a1f32..44d1a1c6b3 100644 --- a/patches/minecraft/net/minecraft/block/BlockLadder.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockLadder.java.patch @@ -1,6 +1,10 @@ --- ../src_base/minecraft/net/minecraft/block/BlockLadder.java +++ ../src_work/minecraft/net/minecraft/block/BlockLadder.java -@@ -8,6 +8,9 @@ +@@ -5,9 +5,13 @@ + import java.util.Random; + import net.minecraft.block.material.Material; + import net.minecraft.creativetab.CreativeTabs; ++import net.minecraft.entity.EntityLiving; import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; @@ -10,7 +14,7 @@ public class BlockLadder extends Block { -@@ -104,7 +107,10 @@ +@@ -104,7 +108,10 @@ */ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { @@ -22,7 +26,7 @@ } /** -@@ -114,22 +120,22 @@ +@@ -114,22 +121,22 @@ { int j1 = par9; @@ -49,7 +53,7 @@ { j1 = 5; } -@@ -146,22 +152,22 @@ +@@ -146,22 +153,22 @@ int i1 = par1World.getBlockMetadata(par2, par3, par4); boolean flag = false; @@ -76,13 +80,13 @@ { flag = true; } -@@ -182,4 +188,10 @@ +@@ -182,4 +189,10 @@ { return 1; } + + @Override -+ public boolean isLadder(World world, int x, int y, int z) ++ public boolean isLadder(World world, int x, int y, int z, EntityLiving entity) + { + return true; + } diff --git a/patches/minecraft/net/minecraft/block/BlockVine.java.patch b/patches/minecraft/net/minecraft/block/BlockVine.java.patch index 3a004fc5dd..3ee985bded 100644 --- a/patches/minecraft/net/minecraft/block/BlockVine.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockVine.java.patch @@ -1,6 +1,6 @@ --- ../src_base/minecraft/net/minecraft/block/BlockVine.java +++ ../src_work/minecraft/net/minecraft/block/BlockVine.java -@@ -2,6 +2,8 @@ +@@ -2,9 +2,12 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -9,7 +9,11 @@ import java.util.Random; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; -@@ -15,7 +17,9 @@ ++import net.minecraft.entity.EntityLiving; + import net.minecraft.entity.player.EntityPlayer; + import net.minecraft.item.Item; + import net.minecraft.item.ItemStack; +@@ -15,7 +18,9 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; @@ -20,7 +24,7 @@ { public BlockVine(int par1) { -@@ -439,14 +443,26 @@ +@@ -439,14 +444,26 @@ */ public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) { @@ -51,7 +55,7 @@ + } + + @Override -+ public boolean isLadder(World world, int x, int y, int z) ++ public boolean isLadder(World world, int x, int y, int z, EntityLiving entity) + { + return true; } diff --git a/patches/minecraft/net/minecraft/entity/EntityLiving.java.patch b/patches/minecraft/net/minecraft/entity/EntityLiving.java.patch index 1da5899871..2b18b87540 100644 --- a/patches/minecraft/net/minecraft/entity/EntityLiving.java.patch +++ b/patches/minecraft/net/minecraft/entity/EntityLiving.java.patch @@ -139,7 +139,7 @@ int k = MathHelper.floor_double(this.posZ); int l = this.worldObj.getBlockId(i, j, k); - return l == Block.ladder.blockID || l == Block.vine.blockID; -+ return ForgeHooks.isLivingOnLadder(Block.blocksList[l], worldObj, i, j, k); ++ return ForgeHooks.isLivingOnLadder(Block.blocksList[l], worldObj, i, j, k, this); } /**