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

The following are Jave code examples for showing how to use slime_block() 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: BlockPistonStructureHelper.java   View Source Code Vote up 5 votes
public boolean canMove()
{
    this.toMove.clear();
    this.toDestroy.clear();
    Block block = this.world.getBlockState(this.blockToMove).getBlock();

    if (!BlockPistonBase.canPush(block, this.world, this.blockToMove, this.moveDirection, false))
    {
        if (block.getMobilityFlag() != 1)
        {
            return false;
        }
        else
        {
            this.toDestroy.add(this.blockToMove);
            return true;
        }
    }
    else if (!this.func_177251_a(this.blockToMove))
    {
        return false;
    }
    else
    {
        for (int i = 0; i < this.toMove.size(); ++i)
        {
            BlockPos blockpos = (BlockPos)this.toMove.get(i);

            if (this.world.getBlockState(blockpos).getBlock() == Blocks.slime_block && !this.func_177250_b(blockpos))
            {
                return false;
            }
        }

        return true;
    }
}
 
Example 2
Project: DecompiledMinecraft   File: BlockPistonStructureHelper.java   View Source Code Vote up 5 votes
public boolean canMove()
{
    this.toMove.clear();
    this.toDestroy.clear();
    Block block = this.world.getBlockState(this.blockToMove).getBlock();

    if (!BlockPistonBase.canPush(block, this.world, this.blockToMove, this.moveDirection, false))
    {
        if (block.getMobilityFlag() != 1)
        {
            return false;
        }
        else
        {
            this.toDestroy.add(this.blockToMove);
            return true;
        }
    }
    else if (!this.func_177251_a(this.blockToMove))
    {
        return false;
    }
    else
    {
        for (int i = 0; i < this.toMove.size(); ++i)
        {
            BlockPos blockpos = (BlockPos)this.toMove.get(i);

            if (this.world.getBlockState(blockpos).getBlock() == Blocks.slime_block && !this.func_177250_b(blockpos))
            {
                return false;
            }
        }

        return true;
    }
}
 
Example 3
Project: BaseClient   File: BlockPistonStructureHelper.java   View Source Code Vote up 5 votes
public boolean canMove()
{
    this.toMove.clear();
    this.toDestroy.clear();
    Block block = this.world.getBlockState(this.blockToMove).getBlock();

    if (!BlockPistonBase.canPush(block, this.world, this.blockToMove, this.moveDirection, false))
    {
        if (block.getMobilityFlag() != 1)
        {
            return false;
        }
        else
        {
            this.toDestroy.add(this.blockToMove);
            return true;
        }
    }
    else if (!this.func_177251_a(this.blockToMove))
    {
        return false;
    }
    else
    {
        for (int i = 0; i < this.toMove.size(); ++i)
        {
            BlockPos blockpos = (BlockPos)this.toMove.get(i);

            if (this.world.getBlockState(blockpos).getBlock() == Blocks.slime_block && !this.func_177250_b(blockpos))
            {
                return false;
            }
        }

        return true;
    }
}
 
Example 4
Project: BaseClient   File: BlockPistonStructureHelper.java   View Source Code Vote up 5 votes
public boolean canMove()
{
    this.toMove.clear();
    this.toDestroy.clear();
    Block block = this.world.getBlockState(this.blockToMove).getBlock();

    if (!BlockPistonBase.canPush(block, this.world, this.blockToMove, this.moveDirection, false))
    {
        if (block.getMobilityFlag() != 1)
        {
            return false;
        }
        else
        {
            this.toDestroy.add(this.blockToMove);
            return true;
        }
    }
    else if (!this.func_177251_a(this.blockToMove))
    {
        return false;
    }
    else
    {
        for (int i = 0; i < this.toMove.size(); ++i)
        {
            BlockPos blockpos = (BlockPos)this.toMove.get(i);

            if (this.world.getBlockState(blockpos).getBlock() == Blocks.slime_block && !this.func_177250_b(blockpos))
            {
                return false;
            }
        }

        return true;
    }
}
 
Example 5
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 6
Project: DecompiledMinecraft   File: TileEntityPiston.java   View Source Code Vote up 4 votes
private void launchWithSlimeBlock(float p_145863_1_, float p_145863_2_)
{
    if (this.extending)
    {
        p_145863_1_ = 1.0F - p_145863_1_;
    }
    else
    {
        --p_145863_1_;
    }

    AxisAlignedBB axisalignedbb = Blocks.piston_extension.getBoundingBox(this.worldObj, this.pos, this.pistonState, p_145863_1_, this.pistonFacing);

    if (axisalignedbb != null)
    {
        List<Entity> list = this.worldObj.getEntitiesWithinAABBExcludingEntity((Entity)null, axisalignedbb);

        if (!list.isEmpty())
        {
            this.field_174933_k.addAll(list);

            for (Entity entity : this.field_174933_k)
            {
                if (this.pistonState.getBlock() == Blocks.slime_block && this.extending)
                {
                    switch (this.pistonFacing.getAxis())
                    {
                        case X:
                            entity.motionX = (double)this.pistonFacing.getFrontOffsetX();
                            break;

                        case Y:
                            entity.motionY = (double)this.pistonFacing.getFrontOffsetY();
                            break;

                        case Z:
                            entity.motionZ = (double)this.pistonFacing.getFrontOffsetZ();
                    }
                }
                else
                {
                    entity.moveEntity((double)(p_145863_2_ * (float)this.pistonFacing.getFrontOffsetX()), (double)(p_145863_2_ * (float)this.pistonFacing.getFrontOffsetY()), (double)(p_145863_2_ * (float)this.pistonFacing.getFrontOffsetZ()));
                }
            }

            this.field_174933_k.clear();
        }
    }
}
 
Example 7
Project: DecompiledMinecraft   File: TileEntityPiston.java   View Source Code Vote up 4 votes
private void launchWithSlimeBlock(float p_145863_1_, float p_145863_2_)
{
    if (this.extending)
    {
        p_145863_1_ = 1.0F - p_145863_1_;
    }
    else
    {
        --p_145863_1_;
    }

    AxisAlignedBB axisalignedbb = Blocks.piston_extension.getBoundingBox(this.worldObj, this.pos, this.pistonState, p_145863_1_, this.pistonFacing);

    if (axisalignedbb != null)
    {
        List<Entity> list = this.worldObj.getEntitiesWithinAABBExcludingEntity((Entity)null, axisalignedbb);

        if (!list.isEmpty())
        {
            this.field_174933_k.addAll(list);

            for (Entity entity : this.field_174933_k)
            {
                if (this.pistonState.getBlock() == Blocks.slime_block && this.extending)
                {
                    switch (this.pistonFacing.getAxis())
                    {
                        case X:
                            entity.motionX = (double)this.pistonFacing.getFrontOffsetX();
                            break;

                        case Y:
                            entity.motionY = (double)this.pistonFacing.getFrontOffsetY();
                            break;

                        case Z:
                            entity.motionZ = (double)this.pistonFacing.getFrontOffsetZ();
                    }
                }
                else
                {
                    entity.moveEntity((double)(p_145863_2_ * (float)this.pistonFacing.getFrontOffsetX()), (double)(p_145863_2_ * (float)this.pistonFacing.getFrontOffsetY()), (double)(p_145863_2_ * (float)this.pistonFacing.getFrontOffsetZ()));
                }
            }

            this.field_174933_k.clear();
        }
    }
}
 
Example 8
Project: BaseClient   File: TileEntityPiston.java   View Source Code Vote up 4 votes
private void launchWithSlimeBlock(float p_145863_1_, float p_145863_2_)
{
    if (this.extending)
    {
        p_145863_1_ = 1.0F - p_145863_1_;
    }
    else
    {
        --p_145863_1_;
    }

    AxisAlignedBB axisalignedbb = Blocks.piston_extension.getBoundingBox(this.worldObj, this.pos, this.pistonState, p_145863_1_, this.pistonFacing);

    if (axisalignedbb != null)
    {
        List<Entity> list = this.worldObj.getEntitiesWithinAABBExcludingEntity((Entity)null, axisalignedbb);

        if (!list.isEmpty())
        {
            this.field_174933_k.addAll(list);

            for (Entity entity : this.field_174933_k)
            {
                if (this.pistonState.getBlock() == Blocks.slime_block && this.extending)
                {
                    switch (this.pistonFacing.getAxis())
                    {
                        case X:
                            entity.motionX = (double)this.pistonFacing.getFrontOffsetX();
                            break;

                        case Y:
                            entity.motionY = (double)this.pistonFacing.getFrontOffsetY();
                            break;

                        case Z:
                            entity.motionZ = (double)this.pistonFacing.getFrontOffsetZ();
                    }
                }
                else
                {
                    entity.moveEntity((double)(p_145863_2_ * (float)this.pistonFacing.getFrontOffsetX()), (double)(p_145863_2_ * (float)this.pistonFacing.getFrontOffsetY()), (double)(p_145863_2_ * (float)this.pistonFacing.getFrontOffsetZ()));
                }
            }

            this.field_174933_k.clear();
        }
    }
}
 
Example 9
Project: BaseClient   File: TileEntityPiston.java   View Source Code Vote up 4 votes
private void launchWithSlimeBlock(float p_145863_1_, float p_145863_2_)
{
    if (this.extending)
    {
        p_145863_1_ = 1.0F - p_145863_1_;
    }
    else
    {
        --p_145863_1_;
    }

    AxisAlignedBB axisalignedbb = Blocks.piston_extension.getBoundingBox(this.worldObj, this.pos, this.pistonState, p_145863_1_, this.pistonFacing);

    if (axisalignedbb != null)
    {
        List<Entity> list = this.worldObj.getEntitiesWithinAABBExcludingEntity((Entity)null, axisalignedbb);

        if (!list.isEmpty())
        {
            this.field_174933_k.addAll(list);

            for (Entity entity : this.field_174933_k)
            {
                if (this.pistonState.getBlock() == Blocks.slime_block && this.extending)
                {
                    switch (this.pistonFacing.getAxis())
                    {
                        case X:
                            entity.motionX = (double)this.pistonFacing.getFrontOffsetX();
                            break;

                        case Y:
                            entity.motionY = (double)this.pistonFacing.getFrontOffsetY();
                            break;

                        case Z:
                            entity.motionZ = (double)this.pistonFacing.getFrontOffsetZ();
                    }
                }
                else
                {
                    entity.moveEntity((double)(p_145863_2_ * (float)this.pistonFacing.getFrontOffsetX()), (double)(p_145863_2_ * (float)this.pistonFacing.getFrontOffsetY()), (double)(p_145863_2_ * (float)this.pistonFacing.getFrontOffsetZ()));
                }
            }

            this.field_174933_k.clear();
        }
    }
}