Class CreatureSpawnerMock

All Implemented Interfaces:
org.bukkit.block.BlockState, org.bukkit.block.CreatureSpawner, org.bukkit.block.TileState, org.bukkit.metadata.Metadatable, org.bukkit.persistence.PersistentDataHolder

public class CreatureSpawnerMock extends TileStateMock implements org.bukkit.block.CreatureSpawner
Mock implementation of a CreatureSpawner.
See Also:
  • Constructor Details

    • CreatureSpawnerMock

      public CreatureSpawnerMock(@NotNull @NotNull org.bukkit.Material material)
      Constructs a new CreatureSpawnerMock for the provided Material. Only supports Material.SPAWNER
      Parameters:
      material - The material this state is for.
    • CreatureSpawnerMock

      protected CreatureSpawnerMock(@NotNull @NotNull org.bukkit.block.Block block)
      Constructs a new CreatureSpawnerMock for the provided Block. Only supports Material.SPAWNER
      Parameters:
      block - The block this state is for.
    • CreatureSpawnerMock

      protected CreatureSpawnerMock(@NotNull @NotNull CreatureSpawnerMock state)
      Constructs a new CreatureSpawnerMock by cloning the data from an existing one.
      Parameters:
      state - The state to clone.
  • Method Details

    • getSnapshot

      @NotNull public @NotNull CreatureSpawnerMock getSnapshot()
      Description copied from class: BlockStateMock
      This returns a copy of this BlockStateMock. Inheritents of this class should override this method!
      Specified by:
      getSnapshot in class TileStateMock
      Returns:
      A snapshot of this BlockStateMock.
    • getSpawnedType

      @NotNull public @NotNull org.bukkit.entity.EntityType getSpawnedType()
      Specified by:
      getSpawnedType in interface org.bukkit.block.CreatureSpawner
    • setSpawnedType

      public void setSpawnedType(@NotNull @NotNull org.bukkit.entity.EntityType creatureType)
      Specified by:
      setSpawnedType in interface org.bukkit.block.CreatureSpawner
    • setCreatureTypeByName

      public void setCreatureTypeByName(@NotNull @NotNull String creatureType)
      Specified by:
      setCreatureTypeByName in interface org.bukkit.block.CreatureSpawner
    • getCreatureTypeName

      @NotNull public @NotNull String getCreatureTypeName()
      Specified by:
      getCreatureTypeName in interface org.bukkit.block.CreatureSpawner
    • getDelay

      public int getDelay()
      Specified by:
      getDelay in interface org.bukkit.block.CreatureSpawner
    • setDelay

      public void setDelay(int delay)
      Specified by:
      setDelay in interface org.bukkit.block.CreatureSpawner
    • getMinSpawnDelay

      public int getMinSpawnDelay()
      Specified by:
      getMinSpawnDelay in interface org.bukkit.block.CreatureSpawner
    • setMinSpawnDelay

      public void setMinSpawnDelay(int delay)
      Specified by:
      setMinSpawnDelay in interface org.bukkit.block.CreatureSpawner
    • getMaxSpawnDelay

      public int getMaxSpawnDelay()
      Specified by:
      getMaxSpawnDelay in interface org.bukkit.block.CreatureSpawner
    • setMaxSpawnDelay

      public void setMaxSpawnDelay(int delay)
      Specified by:
      setMaxSpawnDelay in interface org.bukkit.block.CreatureSpawner
    • getSpawnCount

      public int getSpawnCount()
      Specified by:
      getSpawnCount in interface org.bukkit.block.CreatureSpawner
    • setSpawnCount

      public void setSpawnCount(int spawnCount)
      Specified by:
      setSpawnCount in interface org.bukkit.block.CreatureSpawner
    • getMaxNearbyEntities

      public int getMaxNearbyEntities()
      Specified by:
      getMaxNearbyEntities in interface org.bukkit.block.CreatureSpawner
    • setMaxNearbyEntities

      public void setMaxNearbyEntities(int maxNearbyEntities)
      Specified by:
      setMaxNearbyEntities in interface org.bukkit.block.CreatureSpawner
    • getRequiredPlayerRange

      public int getRequiredPlayerRange()
      Specified by:
      getRequiredPlayerRange in interface org.bukkit.block.CreatureSpawner
    • setRequiredPlayerRange

      public void setRequiredPlayerRange(int requiredPlayerRange)
      Specified by:
      setRequiredPlayerRange in interface org.bukkit.block.CreatureSpawner
    • getSpawnRange

      public int getSpawnRange()
      Specified by:
      getSpawnRange in interface org.bukkit.block.CreatureSpawner
    • setSpawnRange

      public void setSpawnRange(int spawnRange)
      Specified by:
      setSpawnRange in interface org.bukkit.block.CreatureSpawner
    • getPotentialSpawns

      @NotNull public @NotNull List<org.bukkit.block.spawner.SpawnerEntry> getPotentialSpawns()
      Specified by:
      getPotentialSpawns in interface org.bukkit.block.CreatureSpawner
    • setPotentialSpawns

      public void setPotentialSpawns(@NotNull @NotNull Collection<org.bukkit.block.spawner.SpawnerEntry> entries)
      Specified by:
      setPotentialSpawns in interface org.bukkit.block.CreatureSpawner
    • addPotentialSpawn

      public void addPotentialSpawn(@NotNull @NotNull org.bukkit.block.spawner.SpawnerEntry spawnerEntry)
      Specified by:
      addPotentialSpawn in interface org.bukkit.block.CreatureSpawner
    • addPotentialSpawn

      public void addPotentialSpawn(@NotNull @NotNull org.bukkit.entity.EntitySnapshot snapshot, int weight, @Nullable @Nullable org.bukkit.block.spawner.SpawnRule spawnRule)
      Specified by:
      addPotentialSpawn in interface org.bukkit.block.CreatureSpawner
    • setSpawnedEntity

      public void setSpawnedEntity(@NotNull @NotNull org.bukkit.entity.EntitySnapshot snapshot)
      Specified by:
      setSpawnedEntity in interface org.bukkit.block.CreatureSpawner
    • getSpawnedEntity

      @Nullable public @Nullable org.bukkit.entity.EntitySnapshot getSpawnedEntity()
      Specified by:
      getSpawnedEntity in interface org.bukkit.block.CreatureSpawner
    • isActivated

      public boolean isActivated()
      Specified by:
      isActivated in interface org.bukkit.block.CreatureSpawner
    • resetTimer

      public void resetTimer()
      Specified by:
      resetTimer in interface org.bukkit.block.CreatureSpawner
    • setSpawnedItem

      public void setSpawnedItem(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack)
      Specified by:
      setSpawnedItem in interface org.bukkit.block.CreatureSpawner