Enum Class SpawnLocationType
- All Implemented Interfaces:
Serializable,Comparable<SpawnLocationType>,Constable
Enum representation of spawn location.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescription -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancontains(SpawnLocationType[] locations, SpawnLocationType location) Checks if an array of spawn locations contains a certain type of spawn location.static booleancontainsOnly(SpawnLocationType[] locations, SpawnLocationType location) Checks if an array of spawn locations contains a certain type of spawn location and no other locations.static SpawnLocationTypegetFromIndex(int integer) Gets a spawn location from its enum index.Gets the localized name of the spawn location.static SpawnLocationTypegetSpawnLocation(String location) Gets the spawn location from a stringnet.minecraft.core.BlockPosgetSpawnLocation(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos xy) static SpawnLocationType[]getSpawnLocations(ArrayList<String> list) Gets the spawn locations from a list of string representations of spawn locations.static SpawnLocationTypenextLocation(SpawnLocationType spawnLocation) Gets the next spawn location (in enum index order) from an existing one.static SpawnLocationTypeReturns the enum constant of this class with the specified name.static SpawnLocationType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
LAND
-
LAND_NPC
-
LAND_VILLAGER
-
WATER
-
UNDERGROUND
-
AIR
-
AIR_PERSISTENT
-
LEGENDARY
-
TREE_TOP
-
BOSS
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getSpawnLocation
public net.minecraft.core.BlockPos getSpawnLocation(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos xy) -
getSpawnLocations
Gets the spawn locations from a list of string representations of spawn locations.- Parameters:
list- A list of string representations of spawn locations.- Returns:
- An array of spawn locations corresponding to the list's contents.
-
getSpawnLocation
Gets the spawn location from a string- Parameters:
location- The string representation of that spawn location- Returns:
- The spawn location corresponding to the string or null if there is no match
-
getFromIndex
Gets a spawn location from its enum index.- Parameters:
integer- The index of the spawn location enum.- Returns:
- The corresponding spawn location, or null if the index is out of bounds.
-
nextLocation
Gets the next spawn location (in enum index order) from an existing one.- Parameters:
spawnLocation- The current spawn location.- Returns:
- The next spawn location.
-
contains
Checks if an array of spawn locations contains a certain type of spawn location.- Parameters:
locations- The array of spawn locations to search.location- The spawn location to find.- Returns:
- Whether the array of spawn locations contains the specified spawn location.
-
containsOnly
Checks if an array of spawn locations contains a certain type of spawn location and no other locations.- Parameters:
locations- The array of spawn locations to search.location- The spawn location to find.- Returns:
- Whether the array of spawn locations contains the specified spawn location and no other locations.
-
getLocalizedName
Gets the localized name of the spawn location.- Returns:
- The localized name of the spawn location.
-