示例#1
0
  @Override
  public boolean canSustainPlant(
      IBlockAccess world,
      BlockPos pos,
      EnumFacing direction,
      net.minecraftforge.common.IPlantable plantable) {
    IBlockState state = world.getBlockState(pos);
    IBlockState plant = plantable.getPlant(world, pos.offset(direction));
    net.minecraftforge.common.EnumPlantType plantType =
        plantable.getPlantType(world, pos.offset(direction));

    if (plantable == TFCBlocks.Sapling) return true;

    return false;
  }
 @Override
 public boolean canSustainPlant(
     IBlockAccess world, int x, int y, int z, ForgeDirection direction, IPlantable plantable) {
   Block plant = plantable.getPlant(world, x, y + 1, z);
   if (plant == TcBlocks.soybean) {
     return true;
   } else {
     return super.canSustainPlant(world, x, y, z, direction, plantable);
   }
 }
 @Override
 public boolean canSustainPlant(
     IBlockAccess world, int x, int y, int z, ForgeDirection direction, IPlantable plantable) {
   Block plant = plantable.getPlant(world, x, y + 1, z);
   int var6 = world.getBlockMetadata(x, y + 1, z) & 3;
   if (plant == TcBlocks.tcSapling && var6 == 1) {
     return true;
   } else {
     return super.canSustainPlant(world, x, y, z, direction, plantable);
   }
 }