Examples of canSustainPlant()


Examples of net.minecraft.block.Block.canSustainPlant()

    @Override
    public boolean canBePlantedHere (World world, int x, int y, int z, ItemStack stack)
    {
        Block groundBlock = world.getBlock(x, y - 1, z);

        return (groundBlock != null && (groundBlock.canSustainPlant(world, x, y - 1, z, ForgeDirection.UP, (IPlantable) NContent.netherBerryBush) || groundBlock == Blocks.netherrack) && world
                .isAirBlock(x, y, z));
    }

    @Override
    public int getMeta (ItemStack stack)
View Full Code Here

Examples of net.minecraft.block.Block.canSustainPlant()

        else if (player.canPlayerEdit(x, y, z, side, stack) && player.canPlayerEdit(x, y + 1, z, side, stack))
        {
            Block block = world.getBlock(x, y, z);

            if (block != null && block.canSustainPlant(world, x, y, z, ForgeDirection.UP, NContent.berryBush) && world.isAirBlock(x, y + 1, z))
            {
                world.setBlock(x, y + 1, z, NContent.berryBush, stack.getItemDamage() % 4, 3);
                if (!player.capabilities.isCreativeMode)
                    stack.stackSize--;
                if (!world.isRemote)
View Full Code Here

Examples of net.minecraft.block.Block.canSustainPlant()

    @Override
    public boolean canBlockStay (World world, int x, int y, int z) {
        Block soil = blocksList[world.getBlockId(x, y - 1, z)];
        return (world.getFullBlockLightValue(x, y, z) >= 8 || world
                .canBlockSeeTheSky(x, y, z))
                && (soil != null && soil.canSustainPlant(world, x, y - 1, z,
                        ForgeDirection.UP, Generic.tomatoSeeds));
    }

    @Override
    public int idDropped (int metadata, Random random, int par2) {
View Full Code Here

Examples of net.minecraft.block.Block.canSustainPlant()

      int zOffset;

      blockId = world.getBlockId(x, y - 1, z);
      block = Block.blocksList[blockId];

      if((block != null && block.canSustainPlant(world, x, y - 1, z, ForgeDirection.UP,
          ((BlockSapling)MineFactoryReloadedCore.rubberSaplingBlock))) &&
          y < worldHeight - treeHeight - 1)
      {
        for(yOffset = y; yOffset <= y + 1 + treeHeight; ++yOffset)
        {
View Full Code Here

Examples of net.minecraft.block.Block.canSustainPlant()

    {
        int[] aint = new int[] {this.basePos[0], this.basePos[1], this.basePos[2]};
        int[] aint1 = new int[] {this.basePos[0], this.basePos[1] + this.heightLimit - 1, this.basePos[2]};
        Block block = this.worldObj.getBlock(this.basePos[0], this.basePos[1] - 1, this.basePos[2]);

        boolean isSoil = block.canSustainPlant(worldObj, basePos[0], basePos[1] - 1, basePos[2], ForgeDirection.UP, (BlockSapling)Blocks.sapling);
        if (!isSoil)
        {
            return false;
        }
        else
View Full Code Here

Examples of net.minecraft.block.Block.canSustainPlant()

            {
                if (player.canPlayerEdit(posX, y, posZ, side, stack) && player.canPlayerEdit(posX, y + 1, posZ, side, stack))
                {
                    Block block = world.getBlock(posX, y, posZ);

                    if (block != null && block.canSustainPlant(world, posX, y, posZ, ForgeDirection.UP, (IPlantable) crop) && world.isAirBlock(posX, y + 1, posZ))
                    {
                        world.setBlock(posX, y + 1, posZ, crop, cropMetadata, 3);
                        planted = true;
                    }
                }
View Full Code Here

Examples of net.minecraft.block.Block.canSustainPlant()

        }
        else if (player.canPlayerEdit(x, y, z, side, stack) && player.canPlayerEdit(x, y + 1, z, side, stack))
        {
            Block soil = world.getBlock(x, y, z);

            if (soil != null && soil.canSustainPlant(world, x, y, z, ForgeDirection.UP, (IPlantable) NContent.saguaro) && world.isAirBlock(x, y + 1, z))
            {
                world.setBlock(x, y + 1, z, this.crop, 1, 3);
                --stack.stackSize;
                if (!world.isRemote)
                    world.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(crop));
View Full Code Here

Examples of net.minecraft.block.Block.canSustainPlant()

    int findGround (World world, int x, int y, int z)
    {
        int returnHeight = -1;
        Block blockID = world.getBlock(x, y - 1, z);
        if (!world.isAirBlock(x, y - 1, z) && !world.getBlock(x, y, z).isOpaqueCube() && (blockID == Blocks.netherrack || blockID.canSustainPlant(world, x, y - 1, z, ForgeDirection.UP, (IPlantable) blockGen)))
        {
            //System.out.println("Returning "+y);
            return y;
        }
View Full Code Here

Examples of net.minecraft.block.Block.canSustainPlant()

        do
        {
            Block bID = world.getBlock(x, height, z);
            if (!world.isAirBlock(x, height, z))
            {
                if (bID == Blocks.netherrack || bID.canSustainPlant(world, x, height, z, ForgeDirection.UP, (IPlantable) blockGen))
                {
                    if (!world.getBlock(x, height + 1, z).isOpaqueCube())
                    {
                        returnHeight = height + 1;
                    }
View Full Code Here

Examples of net.minecraft.block.Block.canSustainPlant()

        if (!world.isAirBlock(x, yPos, z))
        {
            if (currentID == NContent.saguaro)
            {
                Block block = world.getBlock(x, yPos - 1, z);
                if (block == null || !block.canSustainPlant(world, x, yPos - 1, z, ForgeDirection.UP, (IPlantable) NContent.saguaro))
                    return false;
            }
            else
                return false;
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.