Interface IGenerator


public interface IGenerator
  • Method Summary Link icon

    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 Link icon

    • getLanguageHolograms Link icon

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

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

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

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

      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 Link icon

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

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

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

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

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

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

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

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

      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 Link icon

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

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

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

      GeneratorType getType()
      Get generator type.
    • getAmount Link icon

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

      int getDelay()
      Get spawn rate delay.
    • getNextSpawn Link icon

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

      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 Link icon

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

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

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

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

      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.