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
SpawnSet
s and is
what SpawnCondition
s 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
Modifier and TypeFieldDescriptionstatic final com.google.gson.Gson
The cached list ofLocationType
used for faster accessing.float
int
Required diameter of the spawn location.The cachedSpawnSet
that this SpawnInfo belongs to.A mapping from typeID to SpawnInfo subclass.The ID for the type of SpawnInfo this is. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfloat
Attempts to calculate the nominal rarity of this spawn.abstract SpawnAction<? extends net.minecraft.world.entity.Entity>
construct
(AbstractSpawner spawner, SpawnLocation spawnLocation) Constructs aSpawnAction
based on the information in this SpawnInfo, theAbstractSpawner
, and theSpawnLocation
.boolean
fits
(AbstractSpawner spawner, SpawnLocation spawnLocation) Calculates if this SpawnInfo is capable of spawning at the given location.float
getAdjustedRarity
(AbstractSpawner spawner, SpawnLocation spawnLocation) Gets the adjusted rarity of this spawn at thisSpawnLocation
by applying anyRarityMultiplier
s that exist.void
onExport()
void
onImport()
abstract String
toString()
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 cachedSpawnSet
that this SpawnInfo belongs to. -
rarity
public float rarity -
percentage
-
chance
-
locationTypes
The cached list ofLocationType
used 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 aSpawnAction
based 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 thisSpawnLocation
by applying anyRarityMultiplier
s that exist. -
toString
Gets the display String for use in /checkspawns. -
calculateNominalRarity
public float calculateNominalRarity()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.
-