Class SpawnInfo

java.lang.Object
com.pixelmonmod.pixelmon.api.spawning.SpawnInfo
Direct Known Subclasses:
SpawnInfoCollection, SpawnInfoItem, SpawnInfoNPC, SpawnInfoNPCTrainer, SpawnInfoPokemon, SpawnInfoWormhole

public abstract class SpawnInfo extends Object
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 Details

    • GSON

      public static final com.google.gson.Gson GSON
    • spawnInfoTypes

      public static HashMap<String,Class<? extends SpawnInfo>> spawnInfoTypes
      A mapping from typeID to SpawnInfo subclass. Add to this during pre-initialization to have custom SpawnInfo.
    • typeID

      public String typeID
      The ID for the type of SpawnInfo this is. This is used for deserialization. See spawnInfoTypes.
    • tags

      public ArrayList<String> tags
    • condition

      public SpawnCondition condition
    • anticondition

      public SpawnCondition anticondition
    • compositeCondition

      public CompositeSpawnCondition compositeCondition
    • rarityMultipliers

      public ArrayList<RarityMultiplier> rarityMultipliers
    • requiredSpace

      public int requiredSpace
      Required diameter of the spawn location.
    • set

      public transient SpawnSet set
      The cached SpawnSet that this SpawnInfo belongs to.
    • rarity

      public float rarity
    • percentage

      public Float percentage
    • chance

      public Float chance
    • locationTypes

      public transient ArrayList<LocationType> locationTypes
      The cached list of LocationType used for faster accessing.
    • stringLocationTypes

      public ArrayList<String> stringLocationTypes
    • groupSpawnSettings

      public List<GroupSpawnSettings> groupSpawnSettings
  • Constructor Details

    • SpawnInfo

      public SpawnInfo(String typeID)
  • Method Details

    • construct

      public abstract SpawnAction<? extends net.minecraft.world.entity.Entity> construct(AbstractSpawner spawner, SpawnLocation spawnLocation)
      Constructs a SpawnAction based on the information in this SpawnInfo, the AbstractSpawner, and the SpawnLocation.
    • fits

      public boolean fits(AbstractSpawner spawner, SpawnLocation spawnLocation)
      Calculates if this SpawnInfo is capable of spawning at the given location.
    • onExport

      public void onExport()
    • onImport

      public void onImport()
    • getAdjustedRarity

      public float getAdjustedRarity(AbstractSpawner spawner, SpawnLocation spawnLocation)
      Gets the adjusted rarity of this spawn at this SpawnLocation by applying any RarityMultipliers that exist.
    • toString

      public abstract String toString()
      Gets the display String for use in /checkspawns.
      Overrides:
      toString in class Object
    • 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.