Class SpawnLocation

java.lang.Object
com.pixelmonmod.pixelmon.api.spawning.SpawnLocation

public class SpawnLocation extends Object
A location at which an entity could feasibly spawn. The contract demands that a nullable 'cause' of a location, MutableLocation, a list of LocationTypes that it satisfies, the base block, a distinct list of the blocks within its diameter, the biome, whether or not it can see the sky, and the diameter of the spawn location (i.e. how much room exists for the spawned entity around this location) be provided. All of this information should be provided to maximise the utility of SpawnConditions.
  • Field Details

    • cause

      public net.minecraft.world.entity.Entity cause
      The 'cause' of this SpawnLocation. This can be null, but is generally a player.
    • location

      public MutableLocation location
      The MutableLocation at which the entity would spawn.
    • types

      public Set<LocationType> types
      The list of LocationTypes that are satisfied a this location. This is never empty.
    • baseBlock

      public net.minecraft.world.level.block.Block baseBlock
      The base block. This is generally the block the entity will spawn on but different spawners may have different definitions. For example, Rock Smash's implementation defines the block being broken as the base block, while fishing states the block the whatever block of fluid the hook is inside.
    • uniqueSurroundingBlocks

      public Set<net.minecraft.world.level.block.Block> uniqueSurroundingBlocks
      A unique list of blocks surrounding this location. In conforming implementations this is all distinct blocks within diameter/2 blocks of the location.
    • biome

      public net.minecraft.core.Holder<net.minecraft.world.level.biome.Biome> biome
      The biome in which the location sits.
    • seesSky

      public boolean seesSky
      Whether or not there is a clear* line of sight from the base block to the world ceiling.

      *Clear according to the seesSkyExceptions list in BetterSpawnerConfig.

    • light

      public int light
      The light pokemonLevel at this block.
    • diameter

      public int diameter
      The area of space around the location at which an entity can spawn. This does not count every single nearby block but is still extremely unlikely to be wrong.
    • flavor

      public EnumBerryFlavor flavor
  • Constructor Details

    • SpawnLocation

      public SpawnLocation(MutableLocation location, Set<LocationType> types, net.minecraft.world.level.block.Block baseBlock, Set<net.minecraft.world.level.block.Block> uniqueSurroundingBlocks, net.minecraft.core.Holder<net.minecraft.world.level.biome.Biome> biome, boolean seesSky, int diameter, int light)
    • SpawnLocation

      public SpawnLocation(net.minecraft.world.entity.Entity cause, MutableLocation location, Set<LocationType> types, net.minecraft.world.level.block.Block baseBlock, Set<net.minecraft.world.level.block.Block> uniqueSurroundingBlocks, net.minecraft.core.Holder<net.minecraft.world.level.biome.Biome> biome, boolean seesSky, int diameter, int light)
  • Method Details