Package net.minecraftforge.common

Examples of net.minecraftforge.common.IPlantable


  }

  protected boolean canPlant(World worldObj, BlockCoord bc) {
    Block target = getPlantedBlock();
    Block ground = worldObj.getBlock(bc.x, bc.y - 1, bc.z);
    IPlantable plantable = (IPlantable) getPlantedBlock();
    if(target.canPlaceBlockAt(worldObj, bc.x, bc.y, bc.z) &&
        target.canBlockStay(worldObj, bc.x, bc.y, bc.z) &&
        (ground.canSustainPlant(worldObj, bc.x, bc.y - 1, bc.z, ForgeDirection.UP, plantable) || ignoreSustainCheck)) {
      return true;
    }
View Full Code Here


    return false;
  }

  protected boolean canPlant(World worldObj, BlockCoord bc) {
    Block ground = worldObj.getBlock(bc.x, bc.y - 1, bc.z);
    IPlantable plantable = (IPlantable) sapling;
    if(sapling.canPlaceBlockAt(worldObj, bc.x, bc.y, bc.z) &&
        sapling.canBlockStay(worldObj, bc.x, bc.y, bc.z) &&
        ground.canSustainPlant(worldObj, bc.x, bc.y - 1, bc.z, ForgeDirection.UP, plantable)) {
      return true;
    }
View Full Code Here

    if(!(seedStack.getItem() instanceof IPlantable)) {
      return false;
    }

    IPlantable plantable = (IPlantable) seedStack.getItem();
    EnumPlantType type = plantable.getPlantType(farm.getWorldObj(), bc.x, bc.y, bc.z);
    if(type == null) {
      return false;
    }
    Block ground = farm.getBlock(bc.getLocation(ForgeDirection.DOWN));
    if(type == EnumPlantType.Nether) {
View Full Code Here

  private boolean isPlantableForBlock(ItemStack stack, Block block) {
    if(!(stack.getItem() instanceof IPlantable)) {
      return false;
    }
    IPlantable plantable = (IPlantable) stack.getItem();
    return plantable.getPlant(null, 0, 0, 0) == block;
  }
View Full Code Here

TOP

Related Classes of net.minecraftforge.common.IPlantable

Copyright © 2018 www.massapicom. 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.