Java Code Examples for net.minecraft.init.Blocks.ladder()

The following are Jave code examples for showing how to use ladder() of the net.minecraft.init.Blocks class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: DecompiledMinecraft   File: CombatTracker.java   View Source Code Vote up 6 votes
public void func_94545_a()
{
    this.func_94542_g();

    if (this.fighter.isOnLadder())
    {
        Block block = this.fighter.worldObj.getBlockState(new BlockPos(this.fighter.posX, this.fighter.getEntityBoundingBox().minY, this.fighter.posZ)).getBlock();

        if (block == Blocks.ladder)
        {
            this.field_94551_f = "ladder";
        }
        else if (block == Blocks.vine)
        {
            this.field_94551_f = "vines";
        }
    }
    else if (this.fighter.isInWater())
    {
        this.field_94551_f = "water";
    }
}
 
Example 2
Project: DecompiledMinecraft   File: CombatTracker.java   View Source Code Vote up 6 votes
public void func_94545_a()
{
    this.func_94542_g();

    if (this.fighter.isOnLadder())
    {
        Block block = this.fighter.worldObj.getBlockState(new BlockPos(this.fighter.posX, this.fighter.getEntityBoundingBox().minY, this.fighter.posZ)).getBlock();

        if (block == Blocks.ladder)
        {
            this.field_94551_f = "ladder";
        }
        else if (block == Blocks.vine)
        {
            this.field_94551_f = "vines";
        }
    }
    else if (this.fighter.isInWater())
    {
        this.field_94551_f = "water";
    }
}
 
Example 3
Project: BaseClient   File: CombatTracker.java   View Source Code Vote up 6 votes
public void func_94545_a()
{
    this.func_94542_g();

    if (this.fighter.isOnLadder())
    {
        Block block = this.fighter.worldObj.getBlockState(new BlockPos(this.fighter.posX, this.fighter.getEntityBoundingBox().minY, this.fighter.posZ)).getBlock();

        if (block == Blocks.ladder)
        {
            this.field_94551_f = "ladder";
        }
        else if (block == Blocks.vine)
        {
            this.field_94551_f = "vines";
        }
    }
    else if (this.fighter.isInWater())
    {
        this.field_94551_f = "water";
    }
}
 
Example 4
Project: BaseClient   File: CombatTracker.java   View Source Code Vote up 6 votes
public void func_94545_a()
{
    this.func_94542_g();

    if (this.fighter.isOnLadder())
    {
        Block block = this.fighter.worldObj.getBlockState(new BlockPos(this.fighter.posX, this.fighter.getEntityBoundingBox().minY, this.fighter.posZ)).getBlock();

        if (block == Blocks.ladder)
        {
            this.field_94551_f = "ladder";
        }
        else if (block == Blocks.vine)
        {
            this.field_94551_f = "vines";
        }
    }
    else if (this.fighter.isInWater())
    {
        this.field_94551_f = "water";
    }
}
 
Example 5
Project: DecompiledMinecraft   File: EntityLivingBase.java   View Source Code Vote up 5 votes
/**
 * returns true if this entity is by a ladder, false otherwise
 */
public boolean isOnLadder()
{
    int i = MathHelper.floor_double(this.posX);
    int j = MathHelper.floor_double(this.getEntityBoundingBox().minY);
    int k = MathHelper.floor_double(this.posZ);
    Block block = this.worldObj.getBlockState(new BlockPos(i, j, k)).getBlock();
    return (block == Blocks.ladder || block == Blocks.vine) && (!(this instanceof EntityPlayer) || !((EntityPlayer)this).isSpectator());
}
 
Example 6
Project: DecompiledMinecraft   File: EntityLivingBase.java   View Source Code Vote up 5 votes
/**
 * returns true if this entity is by a ladder, false otherwise
 */
public boolean isOnLadder()
{
    int i = MathHelper.floor_double(this.posX);
    int j = MathHelper.floor_double(this.getEntityBoundingBox().minY);
    int k = MathHelper.floor_double(this.posZ);
    Block block = this.worldObj.getBlockState(new BlockPos(i, j, k)).getBlock();
    return (block == Blocks.ladder || block == Blocks.vine) && (!(this instanceof EntityPlayer) || !((EntityPlayer)this).isSpectator());
}
 
Example 7
Project: BaseClient   File: EntityLivingBase.java   View Source Code Vote up 5 votes
/**
 * returns true if this entity is by a ladder, false otherwise
 */
public boolean isOnLadder()
{
    int i = MathHelper.floor_double(this.posX);
    int j = MathHelper.floor_double(this.getEntityBoundingBox().minY);
    int k = MathHelper.floor_double(this.posZ);
    Block block = this.worldObj.getBlockState(new BlockPos(i, j, k)).getBlock();
    return (block == Blocks.ladder || block == Blocks.vine) && (!(this instanceof EntityPlayer) || !((EntityPlayer)this).isSpectator());
}
 
Example 8
Project: BaseClient   File: EntityLivingBase.java   View Source Code Vote up 5 votes
/**
 * returns true if this entity is by a ladder, false otherwise
 */
public boolean isOnLadder()
{
    int i = MathHelper.floor_double(this.posX);
    int j = MathHelper.floor_double(this.getEntityBoundingBox().minY);
    int k = MathHelper.floor_double(this.posZ);
    Block block = this.worldObj.getBlockState(new BlockPos(i, j, k)).getBlock();
    return (block == Blocks.ladder || block == Blocks.vine) && (!(this instanceof EntityPlayer) || !((EntityPlayer)this).isSpectator());
}
 
Example 9
Project: SerenityCE   File: Parkour.java   View Source Code Vote up 5 votes
private Vector3[] getCorners(Block block, AxisAlignedBB boundingBox, boolean start) {
    if (boundingBox == null)
        return new Vector3[0];

    if (start)
        boundingBox = boundingBox.expand(0.299, 0, 0.299);

    // Return the center for slime block ending positions
    if (block == Blocks.slime_block && !start) {
        return new Vector3[] {
                new Vector3(boundingBox.minX + (boundingBox.maxX - boundingBox.minX) / 2.0,
                        boundingBox.maxY,
                        boundingBox.minZ + (boundingBox.maxZ - boundingBox.minZ) / 2.0),
        };
    }

    if (block == Blocks.ladder) {
        double xDiff = boundingBox.maxX - boundingBox.minX;
        double zDiff = boundingBox.maxZ - boundingBox.minZ;

        if (xDiff > zDiff) {

        } else if (zDiff > xDiff) {

        }
    }

    return new Vector3[] {
            new Vector3(boundingBox.minX, boundingBox.maxY, boundingBox.minZ),
            new Vector3(boundingBox.minX, boundingBox.maxY, boundingBox.maxZ),
            new Vector3(boundingBox.maxX, boundingBox.maxY, boundingBox.minZ),
            new Vector3(boundingBox.maxX, boundingBox.maxY, boundingBox.maxZ),

            new Vector3(boundingBox.minX + (boundingBox.maxX - boundingBox.minX) / 2.0, boundingBox.maxY, boundingBox.minZ),
            new Vector3(boundingBox.minX + (boundingBox.maxX - boundingBox.minX) / 2.0, boundingBox.maxY, boundingBox.maxZ),

            new Vector3(boundingBox.minX, boundingBox.maxY, boundingBox.minZ + (boundingBox.maxZ - boundingBox.minZ) / 2.0),
            new Vector3(boundingBox.maxX, boundingBox.maxY, boundingBox.minZ + (boundingBox.maxZ - boundingBox.minZ) / 2.0)
    };
}
 
Example 10
Project: DecompiledMinecraft   File: BlockDynamicLiquid.java   View Source Code Vote up 4 votes
private boolean isBlocked(World worldIn, BlockPos pos, IBlockState state)
{
    Block block = worldIn.getBlockState(pos).getBlock();
    return !(block instanceof BlockDoor) && block != Blocks.standing_sign && block != Blocks.ladder && block != Blocks.reeds ? (block.blockMaterial == Material.portal ? true : block.blockMaterial.blocksMovement()) : true;
}
 
Example 11
Project: DecompiledMinecraft   File: BlockDynamicLiquid.java   View Source Code Vote up 4 votes
private boolean isBlocked(World worldIn, BlockPos pos, IBlockState state)
{
    Block block = worldIn.getBlockState(pos).getBlock();
    return !(block instanceof BlockDoor) && block != Blocks.standing_sign && block != Blocks.ladder && block != Blocks.reeds ? (block.blockMaterial == Material.portal ? true : block.blockMaterial.blocksMovement()) : true;
}
 
Example 12
Project: BaseClient   File: BlockDynamicLiquid.java   View Source Code Vote up 4 votes
private boolean isBlocked(World worldIn, BlockPos pos, IBlockState state) {
	Block block = worldIn.getBlockState(pos).getBlock();
	return !(block instanceof BlockDoor) && block != Blocks.standing_sign && block != Blocks.ladder
			&& block != Blocks.reeds
					? (block.blockMaterial == Material.portal ? true : block.blockMaterial.blocksMovement()) : true;
}
 
Example 13
Project: BaseClient   File: BlockDynamicLiquid.java   View Source Code Vote up 4 votes
private boolean isBlocked(World worldIn, BlockPos pos, IBlockState state)
{
    Block block = worldIn.getBlockState(pos).getBlock();
    return !(block instanceof BlockDoor) && block != Blocks.standing_sign && block != Blocks.ladder && block != Blocks.reeds ? (block.blockMaterial == Material.portal ? true : block.blockMaterial.blocksMovement()) : true;
}