Java 类net.minecraftforge.common.EnumPlantType 实例源码

项目:Aether-Legacy    文件:BlockAetherGrass.java   
@Override
  public boolean canSustainPlant(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing direction, net.minecraftforge.common.IPlantable plantable)
  {
      EnumPlantType plantType = plantable.getPlantType(world, pos.offset(direction));

      switch (plantType)
      {
        case Plains: return true;
        case Beach: 
              boolean hasWater = (world.getBlockState(pos.east()).getMaterial() == Material.WATER ||
              world.getBlockState(pos.west()).getMaterial() == Material.WATER ||
              world.getBlockState(pos.north()).getMaterial() == Material.WATER ||
              world.getBlockState(pos.south()).getMaterial() == Material.WATER);
              return hasWater;
default:
    break;
      }

    return super.canSustainPlant(state, world, pos, direction, plantable);
  }
项目:PopularMMOS-EpicProportions-Mod    文件:BlockModBush.java   
@Override
  public EnumPlantType getPlantType(IBlockAccess world, int x, int y, int z)
  {
      EnumPlantType Custom;
      EnumPlantType Jen;
      EnumPlantType Pat;
//if (this == Blocks.wheat)          return Crop;
      //if (this == Blocks.carrots)        return Crop;
      //if (this == Blocks.potatoes)       return Crop;
      //if (this == Blocks.melon_stem)     return Crop;
      //if (this == Blocks.pumpkin_stem)   return Crop;
      //if (this == Blocks.deadbush)       return Desert;
      //if (this == Blocks.waterlily)      return Water;
      //if (this == Blocks.red_mushroom)   return Cave;
      //if (this == Blocks.brown_mushroom) return Cave;
      //if (this == Blocks.nether_wart)    return Nether;
      //if (this == Blocks.sapling)        return Plains;
      //if (this == Blocks.tallgrass)      return Plains;
    if (this == BlockLoader.BlockJenGrass_Plant) return Plains;
    if (this == BlockLoader.BlockPatGrass_Plant) return Plains;
    if (this == BlockLoader.BlockJenGrassTall_Plant) return Plains;
    if (this == BlockLoader.BlockPatGrassTall_Plant) return Plains;

return Plains;
  }
项目:TFC2    文件:BlockFarmland.java   
@Override
public boolean canSustainPlant(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing direction, IPlantable plantable)
{
    IBlockState plant = plantable.getPlant(world, pos.offset(direction));
    net.minecraftforge.common.EnumPlantType plantType = plantable.getPlantType(world, pos.offset(direction));

    if(plantType == EnumPlantType.Crop)
        return true;

    if(plantType == EnumPlantType.Plains)
        return true;

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

    return false;
}
项目:TFC2    文件:BlockVegetation.java   
@Override
public boolean canSustainPlant(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing direction, IPlantable plantable)
{
    IBlockState plant = plantable.getPlant(world, pos.offset(direction));
    EnumPlantType plantType = plantable.getPlantType(world, pos.offset(direction));

    VegType veg = (VegType)state.getValue(META_PROPERTY);
    if(plant.getBlock() == this)
    {
        if(veg == VegType.DoubleGrassBottom && plant.getValue(META_PROPERTY) == VegType.DoubleGrassTop)
            return true;
        if(veg == VegType.DoubleGrassBottomLush && plant.getValue(META_PROPERTY) == VegType.DoubleGrassTopLush)
            return true;
    }
    return false;
}
项目:TFC2    文件:BlockGrass.java   
@Override
public boolean canSustainPlant(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing direction, IPlantable plantable)
{
    IBlockState plant = plantable.getPlant(world, pos.offset(direction));
    net.minecraftforge.common.EnumPlantType plantType = plantable.getPlantType(world, pos.offset(direction));

    if(plant.getBlock() == Blocks.SAPLING)
        return false;//This may break some cross mod compatability but for now its needed to prevent vanilla and some pam trees from generating

    if(plantType == EnumPlantType.Plains)
        return true;

    if(plant.getBlock() == TFCBlocks.VegDesert)
        return true;
    return false;
}
项目:IlluminatedBows    文件:BlockIlluminatedFarmland.java   
@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);
    EnumPlantType plantType = plantable.getPlantType(world, x, y + 1, z);

    switch (plantType)
    {
    case Desert:
        return false;
    case Nether:
        return false;
    case Crop:
        return true;
    case Cave:
        return false;
    case Plains:
        return false;
    case Water:
        return false;
    case Beach:
        return false;
    }

    return false;
}
项目:TFC2    文件:BlockFarmland.java   
@Override
public boolean canSustainPlant(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing direction, IPlantable plantable)
{
    IBlockState plant = plantable.getPlant(world, pos.offset(direction));
    net.minecraftforge.common.EnumPlantType plantType = plantable.getPlantType(world, pos.offset(direction));

    if(plantType == EnumPlantType.Crop)
        return true;

    if(plantType == EnumPlantType.Plains)
        return true;

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

    return false;
}
项目:TFC2    文件:BlockVegetation.java   
@Override
public boolean canSustainPlant(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing direction, IPlantable plantable)
{
    IBlockState plant = plantable.getPlant(world, pos.offset(direction));
    EnumPlantType plantType = plantable.getPlantType(world, pos.offset(direction));

    VegType veg = (VegType)state.getValue(META_PROPERTY);
    if(plant.getBlock() == this)
    {
        if(veg == VegType.DoubleGrassBottom && plant.getValue(META_PROPERTY) == VegType.DoubleGrassTop)
            return true;
        if(veg == VegType.DoubleGrassBottomLush && plant.getValue(META_PROPERTY) == VegType.DoubleGrassTopLush)
            return true;
    }
    return false;
}
项目:TFC2    文件:BlockGrass.java   
@Override
public boolean canSustainPlant(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing direction, IPlantable plantable)
{
    IBlockState plant = plantable.getPlant(world, pos.offset(direction));
    net.minecraftforge.common.EnumPlantType plantType = plantable.getPlantType(world, pos.offset(direction));

    if(plant.getBlock() == Blocks.SAPLING)
        return false;//This may break some cross mod compatability but for now its needed to prevent vanilla and some pam trees from generating

    if(plantType == EnumPlantType.Plains)
        return true;

    if(plant.getBlock() == TFCBlocks.VegDesert)
        return true;
    return false;
}
项目:GalacticraftPixelGalaxy    文件:PixelItemSeed.java   
public boolean canSustainPlant(IBlockAccess world, int x, int y, int z, ForgeDirection direction, IPlantable plantable)
   {
   Block plant = plantable.getPlant(world, x, y + 1, z);
   EnumPlantType plantType = plantable.getPlantType(world, x, y + 1, z);
   switch (plantType)
   {
case Beach:
    break;
case Cave:
    break;
case Crop:
    break;
case Desert:
    break;
case Nether:
    break;
case Plains:
    break;
case Water:
    break;
default:
    break;
   }
   return false;
   }
项目:Myth    文件:MythHerb.java   
@Override
public EnumPlantType getPlantType(IBlockAccess world, int x, int y, int z)
{
    /*if (this == Blocks.wheat)          return Crop;
    if (this == Blocks.carrots)        return Crop;
    if (this == Blocks.potatoes)       return Crop;
    if (this == Blocks.melon_stem)     return Crop;
    if (this == Blocks.pumpkin_stem)   return Crop;
    if (this == Blocks.deadbush)       return Desert;
    if (this == Blocks.waterlily)      return Water;
    if (this == Blocks.red_mushroom)   return Cave;
    if (this == Blocks.brown_mushroom) return Cave;
    if (this == Blocks.nether_wart)    return Nether;
    if (this == Blocks.sapling)        return Plains;
    if (this == Blocks.tallgrass)      return Plains;
    if (this == Blocks.double_plant)   return Plains;
    if (this == Blocks.red_flower)     return Plains;
    if (this == Blocks.yellow_flower)  return Plains;*/     
    return Plains;
}
项目:Cauldron    文件:BlockBush.java   
@Override
public EnumPlantType getPlantType(IBlockAccess world, int x, int y, int z)
{
    if (this == Blocks.wheat)          return Crop;
    if (this == Blocks.carrots)        return Crop;
    if (this == Blocks.potatoes)       return Crop;
    if (this == Blocks.melon_stem)     return Crop;
    if (this == Blocks.pumpkin_stem)   return Crop;
    if (this == Blocks.deadbush)       return Desert;
    if (this == Blocks.waterlily)      return Water;
    if (this == Blocks.red_mushroom)   return Cave;
    if (this == Blocks.brown_mushroom) return Cave;
    if (this == Blocks.nether_wart)    return Nether;
    if (this == Blocks.sapling)        return Plains;
    if (this == Blocks.tallgrass)      return Plains;
    if (this == Blocks.double_plant)   return Plains;
    if (this == Blocks.red_flower)     return Plains;
    if (this == Blocks.yellow_flower)  return Plains;        
    return Plains;
}
项目:Cauldron    文件:BlockBush.java   
@Override
public EnumPlantType getPlantType(IBlockAccess world, int x, int y, int z)
{
    if (this == Blocks.wheat)          return Crop;
    if (this == Blocks.carrots)        return Crop;
    if (this == Blocks.potatoes)       return Crop;
    if (this == Blocks.melon_stem)     return Crop;
    if (this == Blocks.pumpkin_stem)   return Crop;
    if (this == Blocks.deadbush)       return Desert;
    if (this == Blocks.waterlily)      return Water;
    if (this == Blocks.red_mushroom)   return Cave;
    if (this == Blocks.brown_mushroom) return Cave;
    if (this == Blocks.nether_wart)    return Nether;
    if (this == Blocks.sapling)        return Plains;
    if (this == Blocks.tallgrass)      return Plains;
    if (this == Blocks.double_plant)   return Plains;
    if (this == Blocks.red_flower)     return Plains;
    if (this == Blocks.yellow_flower)  return Plains;        
    return Plains;
}
项目:ThermionicsWorld    文件:BlockMeat.java   
@Override
public boolean canSustainPlant(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing direction, net.minecraftforge.common.IPlantable plantable) {
    EnumPlantType plantType = plantable.getPlantType(world, pos);

    if (plantType==EnumPlantType.Nether) return true; //Nether plants grow extremely well on meat
    if (plantType==EnumPlantType.Cave) return true; //Cave plants like mushrooms will grow on bare stone

    return false;
}
项目:MrglgaghCore    文件:BlockCropsBase.java   
public BlockCropsBase(String unlocalizedName, String modId, Item seed, Item crop, Collection<Block> canGrowOn,
                        EnumPlantType plantType) {
      super();
      setUnlocalizedName(unlocalizedName);
      setRegistryName(new ResourceLocation(modId, unlocalizedName));
      this.seed = seed;
      this.crop = crop;
      this.canGrowOn = canGrowOn;
this.plantType = plantType;
  }
项目:customstuff4    文件:BlockMixin.java   
@Override
public boolean canSustainPlant(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing direction, IPlantable plantable)
{
    EnumPlantType type = plantable.getPlantType(world, pos.offset(direction));

    EnumPlantType[] sustainedPlants = getContent().sustainedPlants.get(getSubtype(state)).orElse(null);
    if (sustainedPlants != null)
    {
        return ArrayUtils.contains(sustainedPlants, type);
    } else
    {
        return super.canSustainPlant(state, world, pos, direction, plantable);
    }
}
项目:customstuff4    文件:EnumPlantTypeDeserializer.java   
@Override
public EnumPlantType deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException
{
    if (json.isJsonPrimitive())
    {
        JsonPrimitive primitive = json.getAsJsonPrimitive();
        if (primitive.isString())
        {
            return EnumPlantType.getPlantType(json.getAsString());
        }
    }

    throw new JsonParseException("Invalid plant type: " + json);
}
项目:customstuff4    文件:EnumPlantTypeDeserializerTest.java   
@Test
public void test() throws Exception
{
    Map<String, EnumPlantType> map = gson.fromJson("{ \"plant\": \"Crop\" }", new TypeToken<Map<String, EnumPlantType>>() {}.getType());

    EnumPlantType plant = map.get("plant");

    assertSame(EnumPlantType.Crop, plant);
}
项目:BetterWithAddons    文件:BlockExtraGrass.java   
public boolean canSustainPlantType(IBlockAccess world, BlockPos pos, EnumPlantType plantType)
{

    IBlockState state = world.getBlockState(pos);

    switch ((ExtraGrassType) state.getValue(VARIANT))
    {
        case FARM:
            if (plantType == EnumPlantType.Crop) {return true;}
            break;
        case SAND:
        case REDSAND:
            if (plantType == EnumPlantType.Desert) {return true;}
            break;

        default: break;
    }

    switch (plantType)
    {
        // support plains and cave plants
        case Plains: case Cave:
            return true;
        // support beach plants if there's water alongside
        case Beach:
            return (
                    (!world.isAirBlock(pos.east()) && world.getBlockState(pos.east()).getMaterial() == Material.WATER) ||
                            (!world.isAirBlock(pos.west()) && world.getBlockState(pos.west()).getMaterial() == Material.WATER) ||
                            (!world.isAirBlock(pos.north()) && world.getBlockState(pos.north()).getMaterial() == Material.WATER) ||
                            (!world.isAirBlock(pos.south()) && world.getBlockState(pos.south()).getMaterial() == Material.WATER)
            );
        // don't support nether plants, water plants, or crops (require farmland), or anything else by default
        default:
            return false;
    }
}
项目:Mekfarm    文件:CropClonerEntity.java   
@Override
protected boolean acceptsInputStack(int slot, ItemStack stack) {
    if (ItemStackUtil.isEmpty(stack)) {
        return false;
    }

    if (stack.getItem() instanceof IPlantable) {
        IPlantable plant = (IPlantable) stack.getItem();
        if (plant.getPlantType(this.getWorld(), this.getPos()) == EnumPlantType.Crop) {
            return true;
        }
    }
    return false;
}
项目:Snad    文件:BlockSnad.java   
@Override
public boolean canSustainPlant(IBlockState state, IBlockAccess world, BlockPos pos,
                               EnumFacing direction, IPlantable plantable) {
  final BlockPos plantPos = new BlockPos(pos.getX(), pos.getY() + 1, pos.getZ());
  final EnumPlantType plantType = plantable.getPlantType(world, plantPos);

  switch (plantType) {
    case Desert: {
      return true;
    }
    case Water: {
      return world.getBlockState(pos).getMaterial() == Material.WATER &&
             world.getBlockState(pos) == getDefaultState();
    }
    case Beach: {
      return (
          (world.getBlockState(new BlockPos(pos.getX() - 1, pos.getY(), pos.getZ())).getMaterial()
           == Material.WATER) ||
          (world.getBlockState(new BlockPos(pos.getX() + 1, pos.getY(), pos.getZ())).getMaterial()
           == Material.WATER) ||
          (world.getBlockState(new BlockPos(pos.getX(), pos.getY(), pos.getZ() - 1)).getMaterial()
           == Material.WATER) ||
          (world.getBlockState(new BlockPos(pos.getX(), pos.getY(), pos.getZ() + 1)).getMaterial()
           == Material.WATER));
    }
  }

  return false;
}
项目:geomastery    文件:ItemEdibleSeedDecayable.java   
@SafeVarargs
public ItemEdibleSeedDecayable(String name, int hunger, float saturation,
        int stackSize, Supplier<Block> crop, EnumPlantType plantType,
        EFoodType foodType, int shelfLife,
        Class<? extends EntityAnimal>... animalEaters) {

    super(name, hunger, saturation, stackSize, foodType,
            shelfLife, animalEaters);
    this.crop = crop;
    this.plantType = plantType;
}
项目:ExNihiloAdscensio    文件:ItemSeedBase.java   
public ItemSeedBase(String name, IBlockState plant) {
    super();
    this.setRegistryName("itemSeed" + StringUtils.capitalize(name));
    this.setUnlocalizedName("itemSeed" + StringUtils.capitalize(name));
    this.plant = plant;
    this.name = name;
    type = EnumPlantType.Plains;

    GameRegistry.<Item>register(this);
}
项目:TFC2    文件:BlockStone.java   
@Override
public boolean canSustainPlant(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing direction, IPlantable plantable)
{
    IBlockState plant = plantable.getPlant(world, pos.offset(direction));
    EnumPlantType plantType = plantable.getPlantType(world, pos.offset(direction));

    if(plantable == TFCBlocks.Vegetation && (VegType)plant.getValue(BlockVegetation.META_PROPERTY) == VegType.Grass)
        return true;
    return false;
}
项目:TFC2    文件:BlockDirt.java   
/*******************************************************************************
 * 1. Content
 *******************************************************************************/

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

    if(plantType == EnumPlantType.Plains)
        return true;
    return false;
}
项目:TFC2    文件:BlockCactus.java   
@Override
public boolean canSustainPlant(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing direction, IPlantable plantable)
{
    IBlockState plant = plantable.getPlant(world, pos.offset(direction));
    EnumPlantType plantType = plantable.getPlantType(world, pos.offset(direction));

    DesertCactusType veg = (DesertCactusType)state.getValue(META_PROPERTY);
    if(plant.getBlock() == this)
    {

    }
    return false;
}
项目:TFC2    文件:BlockVegDesert.java   
@Override
public boolean canSustainPlant(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing direction, IPlantable plantable)
{
    IBlockState plant = plantable.getPlant(world, pos.offset(direction));
    EnumPlantType plantType = plantable.getPlantType(world, pos.offset(direction));

    DesertVegType veg = (DesertVegType)state.getValue(META_PROPERTY);
    if(plant.getBlock() == this)
    {
        if(veg == DesertVegType.DoubleGrassBottomSparse && plant.getValue(META_PROPERTY) == DesertVegType.DoubleGrassTopSparse)
            return true;
    }
    return false;
}
项目:ThermalRecycling    文件:FertileLand.java   
public boolean canSustainPlant(final IBlockAccess world, final int x,
        final int y, final int z, final ForgeDirection direction,
        final IPlantable plantable) {
    final EnumPlantType plant = plantable.getPlantType(world, x, y + 1, z);
    // Crops or reeds
    return plant == EnumPlantType.Crop || plant == EnumPlantType.Beach;
}
项目:TFC2    文件:BlockStone.java   
@Override
public boolean canSustainPlant(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing direction, IPlantable plantable)
{
    IBlockState plant = plantable.getPlant(world, pos.offset(direction));
    EnumPlantType plantType = plantable.getPlantType(world, pos.offset(direction));

    if(plantable == TFCBlocks.Vegetation && (VegType)plant.getValue(BlockVegetation.META_PROPERTY) == VegType.Grass)
        return true;
    return false;
}
项目:TFC2    文件:BlockDirt.java   
/*******************************************************************************
 * 1. Content
 *******************************************************************************/

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

    if(plantType == EnumPlantType.Plains)
        return true;
    return false;
}
项目:TFC2    文件:BlockCactus.java   
@Override
public boolean canSustainPlant(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing direction, IPlantable plantable)
{
    IBlockState plant = plantable.getPlant(world, pos.offset(direction));
    EnumPlantType plantType = plantable.getPlantType(world, pos.offset(direction));

    DesertCactusType veg = (DesertCactusType)state.getValue(META_PROPERTY);
    if(plant.getBlock() == this)
    {

    }
    return false;
}
项目:TFC2    文件:BlockVegDesert.java   
@Override
public boolean canSustainPlant(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing direction, IPlantable plantable)
{
    IBlockState plant = plantable.getPlant(world, pos.offset(direction));
    EnumPlantType plantType = plantable.getPlantType(world, pos.offset(direction));

    DesertVegType veg = (DesertVegType)state.getValue(META_PROPERTY);
    if(plant.getBlock() == this)
    {
        if(veg == DesertVegType.DoubleGrassBottomSparse && plant.getValue(META_PROPERTY) == DesertVegType.DoubleGrassTopSparse)
            return true;
    }
    return false;
}
项目:Runes-And-Silver    文件:PinkFlower.java   
@Override
public EnumPlantType getPlantType(World world, int x, int y, int z)
{
    if (blockID == crops.blockID        ) return Crop;
    if (blockID == deadBush.blockID     ) return Desert;
    if (blockID == waterlily.blockID    ) return Water;
    if (blockID == mushroomRed.blockID  ) return Cave;
    if (blockID == mushroomBrown.blockID) return Cave;
    if (blockID == netherStalk.blockID  ) return Nether;
    if (blockID == sapling.blockID      ) return Plains;
    if (blockID == melonStem.blockID    ) return Crop;
    if (blockID == pumpkinStem.blockID  ) return Crop;
    if (blockID == tallGrass.blockID    ) return Plains;
    return Plains;
}
项目:Runes-And-Silver    文件:FlowerNightShade.java   
@Override
public EnumPlantType getPlantType(World world, int x, int y, int z)
{
    if (blockID == crops.blockID        ) return Crop;
    if (blockID == deadBush.blockID     ) return Desert;
    if (blockID == waterlily.blockID    ) return Water;
    if (blockID == mushroomRed.blockID  ) return Cave;
    if (blockID == mushroomBrown.blockID) return Cave;
    if (blockID == netherStalk.blockID  ) return Nether;
    if (blockID == sapling.blockID      ) return Plains;
    if (blockID == melonStem.blockID    ) return Crop;
    if (blockID == pumpkinStem.blockID  ) return Crop;
    if (blockID == tallGrass.blockID    ) return Plains;
    return Plains;
}
项目:Runes-And-Silver    文件:BlueFlower.java   
@Override
public EnumPlantType getPlantType(World world, int x, int y, int z)
{
    if (blockID == crops.blockID        ) return Crop;
    if (blockID == deadBush.blockID     ) return Desert;
    if (blockID == waterlily.blockID    ) return Water;
    if (blockID == mushroomRed.blockID  ) return Cave;
    if (blockID == mushroomBrown.blockID) return Cave;
    if (blockID == netherStalk.blockID  ) return Nether;
    if (blockID == sapling.blockID      ) return Plains;
    if (blockID == melonStem.blockID    ) return Crop;
    if (blockID == pumpkinStem.blockID  ) return Crop;
    if (blockID == tallGrass.blockID    ) return Plains;
    return Plains;
}
项目:PeripheralsPlusPlus    文件:Util.java   
public static HashMap<Integer, Object> EnumSetToMap(EnumSet<EnumPlantType> iterable) {
    HashMap<Integer,Object> map = new HashMap<Integer,Object>();
    Iterator<EnumPlantType> types = iterable.iterator();
    for (int i = 0; i < iterable.size(); i++) {
        map.put(i+1, types.next());
    }
    return map;
}
项目:AbyssalCraft    文件:BlockDreadGrass.java   
@Override
public boolean canSustainPlant(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing direction, IPlantable plantable)
{
    boolean hasWater = world.getBlockState(pos.east()).getMaterial() == Material.WATER ||
            world.getBlockState(pos.west()).getMaterial() == Material.WATER ||
            world.getBlockState(pos.north()).getMaterial() == Material.WATER ||
            world.getBlockState(pos.south()).getMaterial() == Material.WATER;
    return plantable.getPlantType(world, pos.offset(direction)) == EnumPlantType.Plains ||
            plantable.getPlantType(world, pos.offset(direction)) == EnumPlantType.Beach && hasWater;
}
项目:AbyssalCraft    文件:BlockDreadlandsDirt.java   
@Override
public boolean canSustainPlant(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing direction, IPlantable plantable)
{
    boolean hasWater = world.getBlockState(pos.east()).getMaterial() == Material.WATER ||
            world.getBlockState(pos.west()).getMaterial() == Material.WATER ||
            world.getBlockState(pos.north()).getMaterial() == Material.WATER ||
            world.getBlockState(pos.south()).getMaterial() == Material.WATER;
    return plantable.getPlantType(world, pos.offset(direction)) == EnumPlantType.Plains ||
            plantable.getPlantType(world, pos.offset(direction)) == EnumPlantType.Beach && hasWater;
}
项目:GardenCollection    文件:BlockLargePot.java   
@Override
public boolean canSustainPlant (IBlockAccess world, int x, int y, int z, ForgeDirection direction, IPlantable plantable) {
    TileEntityGarden gardenTile = getTileEntity(world, x, y, z);
    EnumPlantType plantType = plantable.getPlantType(world, x, y, z);

    if (plantType == EnumPlantType.Crop)
        return substrateSupportsCrops(gardenTile.getSubstrate());

    return false;
}
项目:GardenCollection    文件:BlockGardenFarmland.java   
@Override
public boolean canSustainPlant (IBlockAccess world, int x, int y, int z, ForgeDirection direction, IPlantable plantable) {
    EnumPlantType plantType = plantable.getPlantType(world, x, y, z);
    if (plantType == EnumPlantType.Crop)
        return true;

    return false;
}