Examples of canSustainPlant()


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

                return false;
        }
        else
        {
            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;
            }
        }
View Full Code Here

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

                return false;
            }
            else
            {
                Block soil = world.getBlock(xPos, yPos - 1, zPos);
                boolean isSoil = (soil != null && soil.canSustainPlant(world, xPos, yPos - 1, zPos, ForgeDirection.UP, (NSaplingBlock) NContent.floraSapling)) || soil == Blocks.netherrack;

                if (isSoil && yPos < 256 - treeHeight - 1)
                {
                    soil.onPlantGrow(world, xPos, yPos - 1, zPos, xPos, yPos, zPos);
                    b0 = 3;
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.netherBerryBush) || block == Blocks.netherrack) && world.isAirBlock(x, y + 1, z))
            {
                world.setBlock(x, y + 1, z, NContent.netherBerryBush, stack.getItemDamage() % 4, 3);
                if (!player.capabilities.isCreativeMode)
                    stack.stackSize--;
                if (!world.isRemote)
View Full Code Here

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

        case 0:
        case 1:
        case 2:
        case 3:
            Block soil = world.getBlock(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, this));
            /*case 4:
            case 6:
                int belowID = world.getBlockId(x, y - 1, z);
                Block netherSoil = blocksList[belowID];
                return netherSoil != null && (netherSoil == Block.netherrack || netherSoil.canSustainPlant(world, x, y - 1, z, ForgeDirection.UP, this));
View Full Code Here

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

        case 0:
        case 1:
        case 2:
        case 3:
            Block soil = world.getBlock(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, this));
        case 4:
        case 6:
        case 7:
            Block netherSoil = world.getBlock(x, y - 1, z);
            return netherSoil != null && (netherSoil == Blocks.netherrack || netherSoil.canSustainPlant(world, x, y - 1, z, ForgeDirection.UP, this));
View Full Code Here

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

            return (world.getFullBlockLightValue(x, y, z) >= 8 || world.canBlockSeeTheSky(x, y, z)) && (soil != null && soil.canSustainPlant(world, x, y - 1, z, ForgeDirection.UP, this));
        case 4:
        case 6:
        case 7:
            Block netherSoil = world.getBlock(x, y - 1, z);
            return netherSoil != null && (netherSoil == Blocks.netherrack || netherSoil.canSustainPlant(world, x, y - 1, z, ForgeDirection.UP, this));
        case 5:
            Block nSoil = world.getBlock(x, y + 1, z);
            return nSoil != null && (nSoil == Blocks.netherrack || nSoil == Blocks.soul_sand || nSoil == NContent.taintedSoil);
        default:
            return true;
View Full Code Here

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

    for (int i = x - 1; i <= x + 1; ++i) {
      for (int j = z - 1; j <= z + 1; ++j) {
        final Block id_ground = world.getBlock(i, y - 1, j);
        float bonus = 0.0F;
       
        if (id_ground != null && id_ground.canSustainPlant(world, i, y - 1, j, ForgeDirection.UP, this)) {
          bonus = 1.0F;
         
          if (id_ground.isFertile(world, i, y - 1, j)) {
            bonus = 3.0F;
          }
View Full Code Here

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

    if (side != ForgeDirection.UP.ordinal()) {
      return false;
    } else if (player.canPlayerEdit(x, y, z, side, itemStack) && player.canPlayerEdit(x, y + 1, z, side, itemStack)) {
      final Block soil = world.getBlock(x, y, z);

      if (soil != null && soil.canSustainPlant(world, x, y, z, ForgeDirection.UP, this)
          && world.isAirBlock(x, y + 1, z)) {
       
        final SeedType seed = getSeedType(itemStack.getItemDamage());
        if( seed == null || seed.cropType == null ) {
                    LogHelper.severe("Got NULL seed type or crop when planting " + itemStack);
View Full Code Here

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

    if (block == null)
      return false;

    for (EnumPlantType type : getPlantTypes()) {
      this.plantType = type;
      if (block.canSustainPlant(world, x, y - 1, z, ForgeDirection.UP, this))
        return true;
    }

    return false;
  }
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, (IPlantable) TinkerWorld.oreBerrySecond) && WorldHelper.isAirBlock(world, x, y + 1, z))
            {
                world.setBlock(x, y + 1, z, blockB, stack.getItemDamage() % 4, 3);
                if (!player.capabilities.isCreativeMode)
                    stack.stackSize--;
                if (!world.isRemote)
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.