Ladders.
This commit is contained in:
parent
e9acdcbee2
commit
2878030744
4 changed files with 45 additions and 1 deletions
|
@ -8,6 +8,7 @@ import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.client.renderer.texture.IconRegister;
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
@ -40,6 +41,19 @@ public class BlockCableBus extends AEBaseBlock
|
||||||
isFullSize = isOpaque = false;
|
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
|
@Override
|
||||||
public boolean recolourBlock(World world, int x, int y, int z, ForgeDirection side, int colour)
|
public boolean recolourBlock(World world, int x, int y, int z, ForgeDirection side, int colour)
|
||||||
{
|
{
|
||||||
|
|
|
@ -9,6 +9,7 @@ import java.util.Random;
|
||||||
|
|
||||||
import net.minecraft.client.renderer.RenderBlocks;
|
import net.minecraft.client.renderer.RenderBlocks;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
@ -237,4 +238,10 @@ public class AEBasePart implements IPart, IGridProxyable, IGridHost
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isLadder(EntityLivingBase entity)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -11,6 +11,7 @@ import java.util.Random;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
@ -893,4 +894,19 @@ public class CableBusContainer implements AEMultiTile
|
||||||
return hasRedstone;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ import java.util.Random;
|
||||||
|
|
||||||
import net.minecraft.client.renderer.RenderBlocks;
|
import net.minecraft.client.renderer.RenderBlocks;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
@ -26,6 +27,7 @@ public class PartCableAnchor implements IPart
|
||||||
{
|
{
|
||||||
|
|
||||||
ItemStack is = null;
|
ItemStack is = null;
|
||||||
|
ForgeDirection mySide = ForgeDirection.UP;
|
||||||
|
|
||||||
public PartCableAnchor(ItemStack is) {
|
public PartCableAnchor(ItemStack is) {
|
||||||
this.is = is;
|
this.is = is;
|
||||||
|
@ -167,7 +169,7 @@ public class PartCableAnchor implements IPart
|
||||||
@Override
|
@Override
|
||||||
public void setPartHostInfo(ForgeDirection side, IPartHost host, TileEntity tile)
|
public void setPartHostInfo(ForgeDirection side, IPartHost host, TileEntity tile)
|
||||||
{
|
{
|
||||||
|
mySide = side;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -188,4 +190,9 @@ public class PartCableAnchor implements IPart
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isLadder(EntityLivingBase entity)
|
||||||
|
{
|
||||||
|
return mySide.offsetY == 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue