All Implemented Interfaces:
Cloneable

public class Turret extends EquipablePart
The Turret part, used for tanks.
  • Constructor Details

    • Turret

      public Turret()
      Construct a new default Turret part
    • Turret

      public Turret(double xOffset, double yOffset, double zOffset, org.bukkit.inventory.ItemStack skin, HolderItemPosition position, float explosionSize, org.bukkit.inventory.ItemStack ammo)
      Construct a new Turret part
      Parameters:
      xOffset - The x-offset
      yOffset - The y-offset
      zOffset - The z-offset
      skin - The skin of the rotor
      explosionSize - The size of an explosion.
      ammo - The ammo required to shoot.
    • Turret

      public Turret(String identifier, double xOffset, double yOffset, double zOffset, org.bukkit.inventory.ItemStack skin, HolderItemPosition position, float explosionSize, org.bukkit.inventory.ItemStack ammo)
      Construct a new Turret part
      Parameters:
      identifier - The identifier
      xOffset - The x-offset
      yOffset - The y-offset
      zOffset - The z-offset
      skin - The skin of the rotor
      explosionSize - The size of an explosion.
      ammo - The ammo required to shoot.
  • Method Details

    • shoot

      public boolean shoot()
      Make the turret shoot
      Returns:
      True if fired, false if not (because of a cooldown)
    • getPartGUIItem

      public org.bukkit.inventory.ItemStack getPartGUIItem()
      Description copied from class: Part
      The Configuration and Addon GUI will call this method to get the item to display.
      Specified by:
      getPartGUIItem in class Part
      Returns:
      The item to display.
    • asString

      public String asString()
      Description copied from class: Part
      Get the part as string, for the info command.
      Specified by:
      asString in class Part
      Returns:
      The part as string.
    • despawnStand

      public void despawnStand()
      Despawn the stand
      Overrides:
      despawnStand in class Part
    • getIdentifier

      public String getIdentifier()
      Identifier of this turret
    • getExplosionSize

      public float getExplosionSize()
      The size of an explosion.
    • getAmmo

      public org.bukkit.inventory.ItemStack getAmmo()
      The ammo required to shoot.
    • getCooldown

      public int getCooldown()
      The shooting cooldown.
    • setIdentifier

      public void setIdentifier(String identifier)
      Identifier of this turret
    • setExplosionSize

      public void setExplosionSize(float explosionSize)
      The size of an explosion.
    • setAmmo

      public void setAmmo(org.bukkit.inventory.ItemStack ammo)
      The ammo required to shoot.
    • setCooldown

      public void setCooldown(int cooldown)
      The shooting cooldown.