Interface IGenerator


public interface IGenerator
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    This only must be called by the arena instance when it restarts.
    void
    Disable a generator and destroy its data.
    void
    dropItem(org.bukkit.Location location)
    This will drop the item at a given location.
    void
    Enable generator rotation.
    int
    Get the amount of items that are dropped once.
    Get the arena assigned to this generator.
    Get the team assigned to this generator.
    int
    Get spawn rate delay.
    org.bukkit.entity.ArmorStand
    Get generator hologram holder (armor stand) containing the rotating item.
    Get holograms associated to this generator.
    org.bukkit.Location
    Get the generator location.
    int
    Get seconds before next item spawn.
    org.bukkit.inventory.ItemStack
    Get generator ore.
    int
    Get the spawn limit of the generators.
    Get generator type.
    boolean
    Check if the dropped items can be stacked.
    void
    This method is called every tick to manage the block rotation.
    void
    setAmount(int amount)
    Set how many items should the generator spawn at once.
    void
    setDelay(int delay)
    Change item spawn delay.
    void
    setNextSpawn(int nextSpawn)
    Set the remaining time till the next item spawn.
    void
    setOre(org.bukkit.inventory.ItemStack ore)
    Change the item that this generator will spawn.
    void
    setSpawnLimit(int value)
    This is the limit when the generator will stop spawning new items until they are collected.
    void
    setStack(boolean stack)
    Should the dropped items be stacked?
    void
    Set generator type.
    void
    This will attempt to spawn the items every second.
    void
    updateHolograms(org.bukkit.entity.Player p, String iso)
    This will hide generator holograms with a different iso.
    void
    Manage what to do when the generator upgrade is called from IArena.updateNextEvent()
  • Method Details

    • getLanguageHolograms

      HashMap<String,IGenHolo> getLanguageHolograms()
      Get holograms associated to this generator. Language iso, Hologram instance.
    • disable

      void disable()
      Disable a generator and destroy its data.
    • upgrade

      void upgrade()
      Manage what to do when the generator upgrade is called from IArena.updateNextEvent()
    • spawn

      void spawn()
      This will attempt to spawn the items every second.
    • dropItem

      void dropItem(org.bukkit.Location location)
      This will drop the item at a given location.
      Parameters:
      location - You can customize this location in order to drop items near a player if it's a base generator with multiple teammates.
    • setOre

      void setOre(org.bukkit.inventory.ItemStack ore)
      Change the item that this generator will spawn.
    • getArena

      IArena getArena()
      Get the arena assigned to this generator.
    • rotate

      void rotate()
      This method is called every tick to manage the block rotation.
    • setDelay

      void setDelay(int delay)
      Change item spawn delay. In seconds.
    • setAmount

      void setAmount(int amount)
      Set how many items should the generator spawn at once.
    • getLocation

      org.bukkit.Location getLocation()
      Get the generator location.
    • getOre

      org.bukkit.inventory.ItemStack getOre()
      Get generator ore.
    • updateHolograms

      void updateHolograms(org.bukkit.entity.Player p, String iso)
      This will hide generator holograms with a different iso.
      Parameters:
      iso - player language iso.
    • enableRotation

      void enableRotation()
      Enable generator rotation. Make sure it has a helmet set. DIAMOND and EMERALD generator types will get the rotation activated when the arena starts. If you want to have a different rotating type you should call this manually at GameStateChangeEvent
    • setSpawnLimit

      void setSpawnLimit(int value)
      This is the limit when the generator will stop spawning new items until they are collected.
    • getBwt

      ITeam getBwt()
      Get the team assigned to this generator.
      Returns:
      null if this is not a team generator.
    • getHologramHolder

      org.bukkit.entity.ArmorStand getHologramHolder()
      Get generator hologram holder (armor stand) containing the rotating item.
      Returns:
      null if there is no rotating item.
    • getType

      GeneratorType getType()
      Get generator type.
    • getAmount

      int getAmount()
      Get the amount of items that are dropped once.
    • getDelay

      int getDelay()
      Get spawn rate delay.
    • getNextSpawn

      int getNextSpawn()
      Get seconds before next item spawn.
    • getSpawnLimit

      int getSpawnLimit()
      Get the spawn limit of the generators. If there is this amount of items dropped near the generator it will stop spawning new items.
    • setNextSpawn

      void setNextSpawn(int nextSpawn)
      Set the remaining time till the next item spawn.
    • setStack

      void setStack(boolean stack)
      Should the dropped items be stacked?
    • isStack

      boolean isStack()
      Check if the dropped items can be stacked.
    • setType

      void setType(GeneratorType type)
      Set generator type. This may break things.
    • destroyData

      void destroyData()
      This only must be called by the arena instance when it restarts. Do never call it unless you have a custom arena. Manage your data destroy.