public abstract class SpawnInfo
extends java.lang.Object
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
Created by Hiroku
Modifier and Type | Field and Description |
---|---|
SpawnCondition |
anticondition |
CompositeSpawnCondition |
compositeCondition |
SpawnCondition |
condition |
static com.google.gson.Gson |
GSON |
java.util.ArrayList<LocationType> |
locationTypes
The cached list of
LocationType used for faster accessing. |
java.lang.Float |
percentage |
float |
rarity |
java.util.ArrayList<RarityMultiplier> |
rarityMultipliers |
int |
requiredSpace
Required diameter of the spawn location.
|
SpawnSet |
set
The cached
SpawnSet that this SpawnInfo belongs to. |
static java.util.HashMap<java.lang.String,java.lang.Class<? extends SpawnInfo>> |
spawnInfoTypes
A mapping from typeID to SpawnInfo subclass.
|
java.util.ArrayList<java.lang.String> |
stringLocationTypes |
java.util.ArrayList<java.lang.String> |
tags |
java.lang.String |
typeID
The ID for the type of SpawnInfo this is.
|
Constructor and Description |
---|
SpawnInfo(java.lang.String typeID) |
Modifier and Type | Method and Description |
---|---|
float |
calculateNominalRarity()
Attempts to calculate the nominal rarity of this spawn.
|
abstract SpawnAction<? extends net.minecraft.entity.Entity> |
construct(AbstractSpawner spawner,
SpawnLocation spawnLocation)
Constructs a
SpawnAction based on the information in this SpawnInfo, the AbstractSpawner , and the SpawnLocation . |
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 this
SpawnLocation by applying any RarityMultiplier s that exist. |
void |
onExport() |
void |
onImport() |
abstract java.lang.String |
toString()
Gets the display String for use in /checkspawns.
|
public static final com.google.gson.Gson GSON
public static java.util.HashMap<java.lang.String,java.lang.Class<? extends SpawnInfo>> spawnInfoTypes
public java.lang.String typeID
spawnInfoTypes
.public java.util.ArrayList<java.lang.String> tags
public SpawnCondition condition
public SpawnCondition anticondition
public CompositeSpawnCondition compositeCondition
public java.util.ArrayList<RarityMultiplier> rarityMultipliers
public int requiredSpace
public float rarity
public java.lang.Float percentage
public transient java.util.ArrayList<LocationType> locationTypes
LocationType
used for faster accessing.public java.util.ArrayList<java.lang.String> stringLocationTypes
public abstract SpawnAction<? extends net.minecraft.entity.Entity> construct(AbstractSpawner spawner, SpawnLocation spawnLocation)
SpawnAction
based on the information in this SpawnInfo, the AbstractSpawner
, and the SpawnLocation
.public boolean fits(AbstractSpawner spawner, SpawnLocation spawnLocation)
public void onExport()
public void onImport()
public float getAdjustedRarity(AbstractSpawner spawner, SpawnLocation spawnLocation)
SpawnLocation
by applying any RarityMultiplier
s that exist.public abstract java.lang.String toString()
toString
in class java.lang.Object
public float calculateNominalRarity()