Package net.minecraftforge.common.world
Class StructureSpawnManager
java.lang.Object
net.minecraftforge.common.world.StructureSpawnManager
Class to help manage entity spawns inside of structures
-
Nested Class Summary
Modifier and TypeClassDescriptionprivate static class
Helper class to keep track of spawns and if the spawns should be restricted to inside the structure pieces. -
Field Summary
Modifier and TypeFieldDescriptionprivate static Map<Structure<?>,
StructureSpawnManager.StructureSpawnInfo> -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Gathers potential entity spawns for all the different registered structures.private static void
gatherEntitySpawns
(Map<Structure<?>, StructureSpawnManager.StructureSpawnInfo> structuresWithSpawns, Structure<?> structure) static List<MobSpawnInfo.Spawners>
getSpawnList
(Structure<?> structure, EntityClassification classification) Gets the entity spawn lists for entities of a given classification for a given structure.static 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 Details
-
structuresWithSpawns
-
-
Constructor Details
-
StructureSpawnManager
public StructureSpawnManager()
-
-
Method Details
-
gatherEntitySpawns
public static void gatherEntitySpawns()Gathers potential entity spawns for all the different registered structures. -
gatherEntitySpawns
private static void gatherEntitySpawns(Map<Structure<?>, StructureSpawnManager.StructureSpawnInfo> structuresWithSpawns, Structure<?> structure) -
getStructureSpawns
@Nullable public static 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 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
-