Class SpawnInfo
java.lang.Object
com.pixelmonmod.pixelmon.api.spawning.SpawnInfo
- Direct Known Subclasses:
SpawnInfoCollection,SpawnInfoItem,SpawnInfoNPC,SpawnInfoPokemon,SpawnInfoWormhole
An outline for a particular spawnable entity. This is what is represented inside
SpawnSets and is
what SpawnConditions are applied to. Custom implementations are put in the spawnInfoTypes
map where the key is the typeID field in the JSONs. If this is done at some time during pre-initialization,
SpawnInfos of that custom type will automatically be imported with all subclass fields intact.
For the class members, I'm not going to recreate the wiki, so see the below link to know what each field is.
https://pixelmonmod.com/wiki/index.php?title=Better_Spawner/Spawn_Info
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.google.gson.GsonThe cached list ofLocationTypeused for faster accessing.floatintRequired diameter of the spawn location.The cachedSpawnSetthat this SpawnInfo belongs to.A mapping from typeID to SpawnInfo subclass.The ID for the type of SpawnInfo this is. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloatcalculateNominalRarity(net.minecraft.core.HolderLookup.Provider registryAccess) Attempts to calculate the nominal rarity of this spawn.abstract SpawnAction<? extends net.minecraft.world.entity.Entity> construct(AbstractSpawner spawner, SpawnLocation spawnLocation) Constructs aSpawnActionbased on the information in this SpawnInfo, theAbstractSpawner, and theSpawnLocation.booleanfits(AbstractSpawner spawner, SpawnLocation spawnLocation) Calculates if this SpawnInfo is capable of spawning at the given location.floatgetAdjustedRarity(AbstractSpawner spawner, SpawnLocation spawnLocation) Gets the adjusted rarity of this spawn at thisSpawnLocationby applying anyRarityMultipliers that exist.voidonExport()voidonImport()abstract StringtoString()Gets the display String for use in /checkspawns.
-
Field Details
-
GSON
public static final com.google.gson.Gson GSON -
spawnInfoTypes
A mapping from typeID to SpawnInfo subclass. Add to this during pre-initialization to have custom SpawnInfo. -
typeID
The ID for the type of SpawnInfo this is. This is used for deserialization. SeespawnInfoTypes. -
tags
-
condition
-
anticondition
-
compositeCondition
-
rarityMultipliers
-
requiredSpace
public int requiredSpaceRequired diameter of the spawn location. -
set
The cachedSpawnSetthat this SpawnInfo belongs to. -
rarity
public float rarity -
percentage
-
chance
-
locationTypes
The cached list ofLocationTypeused for faster accessing. -
stringLocationTypes
-
groupSpawnSettings
-
-
Constructor Details
-
SpawnInfo
-
-
Method Details
-
construct
public abstract SpawnAction<? extends net.minecraft.world.entity.Entity> construct(AbstractSpawner spawner, SpawnLocation spawnLocation) Constructs aSpawnActionbased on the information in this SpawnInfo, theAbstractSpawner, and theSpawnLocation. -
fits
Calculates if this SpawnInfo is capable of spawning at the given location. -
onExport
public void onExport() -
onImport
public void onImport() -
getAdjustedRarity
Gets the adjusted rarity of this spawn at thisSpawnLocationby applying anyRarityMultipliers that exist. -
toString
Gets the display String for use in /checkspawns. -
calculateNominalRarity
public float calculateNominalRarity(net.minecraft.core.HolderLookup.Provider registryAccess) Attempts to calculate the nominal rarity of this spawn. This tries to take into account the biomes, times, weather, and normal rarity to find a number that describes the rarity better. This is used for situations wherein a spawn might be very common but only under extremely specific circumstances. In such cases, the rarity number would most likely be very high, despite in actuality the spawn being incredibly rare. This calculation aims to take all those conditions into consideration to give an impression of the rarity. -
getDisplayedSpawning
-