Package net.minecraftforge.common.world
Class StructureSpawnManager
- java.lang.Object
-
- net.minecraftforge.common.world.StructureSpawnManager
-
public class StructureSpawnManager extends java.lang.ObjectClass to help manage entity spawns inside of structures
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classStructureSpawnManager.StructureSpawnInfoHelper class to keep track of spawns and if the spawns should be restricted to inside the structure pieces.
-
Field Summary
Fields Modifier and Type Field Description private static java.util.Map<Structure<?>,StructureSpawnManager.StructureSpawnInfo>structuresWithSpawns
-
Constructor Summary
Constructors Constructor Description StructureSpawnManager()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidgatherEntitySpawns()Gathers potential entity spawns for all the different registered structures.private static voidgatherEntitySpawns(java.util.Map<Structure<?>,StructureSpawnManager.StructureSpawnInfo> structuresWithSpawns, Structure<?> structure)static java.util.List<MobSpawnInfo.Spawners>getSpawnList(Structure<?> structure, EntityClassification classification)Gets the entity spawn lists for entities of a given classification for a given structure.static java.util.List<MobSpawnInfo.Spawners>getStructureSpawns(StructureManager structureManager, EntityClassification classification, BlockPos pos)Looks up if a given position is within a structure and returns any entity spawns that structure has for the given classification, or null if none are found.
-
-
-
Field Detail
-
structuresWithSpawns
private static java.util.Map<Structure<?>,StructureSpawnManager.StructureSpawnInfo> structuresWithSpawns
-
-
Method Detail
-
gatherEntitySpawns
public static void gatherEntitySpawns()
Gathers potential entity spawns for all the different registered structures.
-
gatherEntitySpawns
private static void gatherEntitySpawns(java.util.Map<Structure<?>,StructureSpawnManager.StructureSpawnInfo> structuresWithSpawns, Structure<?> structure)
-
getStructureSpawns
@Nullable public static java.util.List<MobSpawnInfo.Spawners> getStructureSpawns(StructureManager structureManager, EntityClassification classification, BlockPos pos)
Looks up if a given position is within a structure and returns any entity spawns that structure has for the given classification, or null if none are found.- Parameters:
structureManager- Structure Manager, used to check if a position is within a structure.classification- Entity classificationpos- Position to get entity spawns of
-
getSpawnList
public static java.util.List<MobSpawnInfo.Spawners> getSpawnList(Structure<?> structure, EntityClassification classification)
Gets the entity spawn lists for entities of a given classification for a given structure.- Parameters:
structure- The Structureclassification- The classification to lookup
-
-