Class RangedTurret

All Implemented Interfaces:
org.kingdoms.abstraction.Levellable, org.kingdoms.abstraction.PlayerOperator, Keyed<SimpleLocation>, SmartObject, org.kingdoms.constants.group.model.logs.Loggable, org.kingdoms.data.Deserializable, org.kingdoms.data.Serializable, org.kingdoms.locale.provider.CascadingMessageContextProvider, org.kingdoms.locale.provider.MessageContextProvider
Direct Known Subclasses:
HealingTurret, SoldierTurret, TargetedRangedTurret

public class RangedTurret extends Turret implements org.kingdoms.abstraction.PlayerOperator
  • Field Details

  • Constructor Details

  • Method Details

    • getAmmo

      public int getAmmo()
    • setAmmo

      public void setAmmo(int ammo)
    • postActivation

      public void postActivation(Kingdom kingdom)
    • getActivationPoint

      public org.bukkit.Location getActivationPoint()
    • isOutOfAmmo

      public boolean isOutOfAmmo()
    • addAmmo

      public int addAmmo(int amount)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class KingdomBuilding<TurretStyle>
    • getProjectile

      @Nullable public @Nullable com.cryptomorin.xseries.XEntityType getProjectile()
    • getSpeed

      public double getSpeed(Kingdom kingdom)
    • getSpeed

      public double getSpeed(Kingdom kingdom, int lvl)
    • canFunction

      public boolean canFunction()
      Overrides:
      canFunction in class Turret
    • isInCooldown

      public boolean isInCooldown()
    • passThroughLevel

      public int passThroughLevel(Kingdom kingdom)
    • canPassThrough

      public boolean canPassThrough(Kingdom kingdom)
    • skipTarget

      public boolean skipTarget(org.bukkit.entity.LivingEntity target)
      Overrides:
      skipTarget in class Turret
    • setOperator

      public void setOperator(org.bukkit.entity.Player operator)
    • getOperator

      public org.bukkit.entity.Player getOperator()
    • addMessageContextEdits

      @MustBeInvokedByOverriders public MessagePlaceholderProvider addMessageContextEdits(MessagePlaceholderProvider context, Kingdom kingdom)
      Overrides:
      addMessageContextEdits in class Turret
    • remove

      public KingdomItemBreakEvent<?> remove(org.kingdoms.events.items.KingdomItemRemoveContext context)
      Overrides:
      remove in class KingdomBuilding<TurretStyle>
    • getRange

      public double getRange(Kingdom kingdom, int lvl)
    • getRange

      public double getRange(Kingdom kingdom)
    • getCooldown

      public int getCooldown(Kingdom kingdom, int lvl)
    • getCooldown

      public int getCooldown(Kingdom kingdom)
    • getAmmoCost

      public int getAmmoCost(Kingdom kingdom)
    • getMaxAmmo

      public int getMaxAmmo(Kingdom kingdom)
    • getMaxAmmo

      public int getMaxAmmo(Kingdom kingdom, int lvl)
    • getMaxTargets

      public int getMaxTargets(Kingdom kingdom, int lvl)
    • getMaxTargets

      public int getMaxTargets(Kingdom kingdom)
    • getCooldown

      public int getCooldown()
      The cooldown between each shot (depending on the turret's update ticks which is a configurable option.)
      Returns:
      a positive number if the turret is still in cooldown or a negative number depending on the ticks past the normal cooldown (how long the turret didn't shoot since the cooldown ended.)
    • setCooldown

      public void setCooldown(int cooldown)
    • tick

      public void tick()
    • serialize

      @MustBeInvokedByOverriders public void serialize(SerializationContext<org.kingdoms.data.database.dataprovider.SectionableDataSetter> context)
      Specified by:
      serialize in interface org.kingdoms.data.Serializable
      Overrides:
      serialize in class KingdomBuilding<TurretStyle>
      Parameters:
      context - can be also a ItemSerializationContext which implies that this building is being serialized into an in-game item.
    • deserialize

      @MustBeInvokedByOverriders public void deserialize(DeserializationContext<org.kingdoms.data.database.dataprovider.SectionableDataGetter> context)
      Specified by:
      deserialize in interface org.kingdoms.data.Deserializable
      Overrides:
      deserialize in class KingdomBuilding<TurretStyle>
    • rayTrace

      public boolean rayTrace(Kingdom kingdom, org.bukkit.entity.LivingEntity target, TurretTypeRanged.ShootingCalculations calc)
    • rayTrace

      public org.bukkit.entity.LivingEntity rayTrace(Kingdom kingdom, org.bukkit.Location from, org.bukkit.util.Vector direction)
    • shootProjectile

      public org.bukkit.entity.Entity shootProjectile(com.cryptomorin.xseries.XEntityType type, Kingdom kingdom, org.bukkit.Location from, org.bukkit.util.Vector direction)
    • setMetadata

      protected static void setMetadata(org.bukkit.entity.Entity entity, RangedTurret turret, Kingdom kingdom)
    • repeatedParticle

      public void repeatedParticle(Turret turret, org.bukkit.entity.Entity entity)
    • isManual

      public boolean isManual()
    • setManual

      public void setManual(boolean manual)
    • getPlayer

      @Nullable public @Nullable KingdomPlayer getPlayer()
      Specified by:
      getPlayer in interface org.kingdoms.abstraction.PlayerOperator