diff --git a/block/networking/BlockCableBus.java b/block/networking/BlockCableBus.java index 9662d412..e2db0fcc 100644 --- a/block/networking/BlockCableBus.java +++ b/block/networking/BlockCableBus.java @@ -8,6 +8,7 @@ import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; @@ -40,6 +41,19 @@ public class BlockCableBus extends AEBaseBlock isFullSize = isOpaque = false; } + @Override + public boolean isLadder(World world, int x, int y, int z, EntityLivingBase entity) + { + try + { + return cb( world, x, y, z ).isLadder( entity ); + } + catch (Throwable t) + { + } + return false; + } + @Override public boolean recolourBlock(World world, int x, int y, int z, ForgeDirection side, int colour) { diff --git a/parts/AEBasePart.java b/parts/AEBasePart.java index 482ee006..2aac007b 100644 --- a/parts/AEBasePart.java +++ b/parts/AEBasePart.java @@ -9,6 +9,7 @@ import java.util.Random; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -237,4 +238,10 @@ public class AEBasePart implements IPart, IGridProxyable, IGridHost } + @Override + public boolean isLadder(EntityLivingBase entity) + { + return false; + } + } \ No newline at end of file diff --git a/parts/CableBusContainer.java b/parts/CableBusContainer.java index c78b40d1..1cc89f64 100644 --- a/parts/CableBusContainer.java +++ b/parts/CableBusContainer.java @@ -11,6 +11,7 @@ import java.util.Random; import net.minecraft.client.Minecraft; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -893,4 +894,19 @@ public class CableBusContainer implements AEMultiTile return hasRedstone; } + public boolean isLadder(EntityLivingBase entity) + { + for (ForgeDirection side : ForgeDirection.values()) + { + IPart p = getPart( side ); + if ( p != null ) + { + if ( p.isLadder( entity ) ) + return true; + } + } + + return false; + } + } diff --git a/parts/misc/PartCableAnchor.java b/parts/misc/PartCableAnchor.java index dd20d411..0f0fc22f 100644 --- a/parts/misc/PartCableAnchor.java +++ b/parts/misc/PartCableAnchor.java @@ -8,6 +8,7 @@ import java.util.Random; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -26,6 +27,7 @@ public class PartCableAnchor implements IPart { ItemStack is = null; + ForgeDirection mySide = ForgeDirection.UP; public PartCableAnchor(ItemStack is) { this.is = is; @@ -167,7 +169,7 @@ public class PartCableAnchor implements IPart @Override public void setPartHostInfo(ForgeDirection side, IPartHost host, TileEntity tile) { - + mySide = side; } @Override @@ -188,4 +190,9 @@ public class PartCableAnchor implements IPart return 0; } + @Override + public boolean isLadder(EntityLivingBase entity) + { + return mySide.offsetY == 0; + } }