public enum PlantType extends java.lang.Enum<PlantType> implements IExtensibleEnum
Enum Constant and Description |
---|
Beach |
Cave |
Crop |
Desert |
Nether |
Plains |
Water |
Modifier and Type | Method and Description |
---|---|
static PlantType |
create(java.lang.String name)
Getting a custom
PlantType , or an existing one if it has the same name as that one. |
static PlantType |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static PlantType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
init
public static final PlantType Plains
public static final PlantType Desert
public static final PlantType Beach
public static final PlantType Cave
public static final PlantType Water
public static final PlantType Nether
public static final PlantType Crop
public static PlantType[] values()
for (PlantType c : PlantType.values()) System.out.println(c);
public static PlantType valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic static PlantType create(java.lang.String name)
PlantType
, or an existing one if it has the same name as that one. Your plant should implement IPlantable
and return this custom type in IPlantable#getPlantType(IBlockAccess, BlockPos)
.
If your new plant grows on blocks like any one of them above, never create a new PlantType
.
This enumeration is only functioning in
net.minecraft.block.Block#canSustainPlant(IBlockState, IWorldReader, BlockPos, EnumFacing, IPlantable)
,
which you are supposed to override this function in your new block and create a new plant type to grow on that block.
You can create an instance of your plant type in your API and let your/others mods access it. It will be faster than calling this method.
name
- the name of the type of plant, you had better follow the style abovePlantType
, a new one if not found.