Package net.minecraftforge.common
Class PlantType
- java.lang.Object
-
- net.minecraftforge.common.PlantType
-
public final class PlantType extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static PlantType
BEACH
static PlantType
CAVE
static PlantType
CROP
static PlantType
DESERT
private static java.util.regex.Pattern
INVALID_CHARACTERS
private java.lang.String
name
static PlantType
NETHER
static PlantType
PLAINS
private static java.util.Map<java.lang.String,PlantType>
VALUES
static PlantType
WATER
-
Constructor Summary
Constructors Modifier Constructor Description private
PlantType(java.lang.String name)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PlantType
get(java.lang.String name)
Getting a customPlantType
, or an existing one if it has the same name as that one.java.lang.String
getName()
-
-
-
Field Detail
-
INVALID_CHARACTERS
private static final java.util.regex.Pattern INVALID_CHARACTERS
-
VALUES
private static final java.util.Map<java.lang.String,PlantType> VALUES
-
PLAINS
public static final PlantType PLAINS
-
DESERT
public static final PlantType DESERT
-
BEACH
public static final PlantType BEACH
-
CAVE
public static final PlantType CAVE
-
WATER
public static final PlantType WATER
-
NETHER
public static final PlantType NETHER
-
CROP
public static final PlantType CROP
-
name
private final java.lang.String name
-
-
Method Detail
-
get
public static PlantType get(java.lang.String name)
Getting a customPlantType
, or an existing one if it has the same name as that one. Your plant should implementIPlantable
and return this custom type inIPlantable.getPlantType(IBlockReader, BlockPos)
.If your new plant grows on blocks like any one of them above, never create a new
PlantType
. This Type is only functioning inBlock.canSustainPlant(BlockState, IBlockReader, BlockPos, Direction, IPlantable)
, which you are supposed to override this function in your new block and create a new plant type to grow on that block. This method can be called during parallel loading- Parameters:
name
- the name of the type of plant, you had better follow the style above- Returns:
- the acquired
PlantType
, a new one if not found.
-
getName
public java.lang.String getName()
-
-