public enum EnumPlantType extends java.lang.Enum<EnumPlantType>
Enum Constant and Description |
---|
Beach |
Cave |
Crop |
Desert |
Nether |
Plains |
Water |
Modifier and Type | Method and Description |
---|---|
static EnumPlantType |
getPlantType(java.lang.String name)
Getting a custom
EnumPlantType , or an existing one if it has the same name as that one. |
static EnumPlantType |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static EnumPlantType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final EnumPlantType Plains
public static final EnumPlantType Desert
public static final EnumPlantType Beach
public static final EnumPlantType Cave
public static final EnumPlantType Water
public static final EnumPlantType Nether
public static final EnumPlantType Crop
public static EnumPlantType[] values()
for (EnumPlantType c : EnumPlantType.values()) System.out.println(c);
public static EnumPlantType 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 EnumPlantType getPlantType(java.lang.String name)
EnumPlantType
, 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 EnumPlantType
.
This enumeration is only functioning in
Block.canSustainPlant(IBlockState, IBlockAccess, 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 aboveEnumPlantType
, a new one if not found.