Class WeaponScopeEvent

java.lang.Object
org.bukkit.event.Event
org.bukkit.event.entity.EntityEvent
me.deecaad.weaponmechanics.weapon.weaponevents.WeaponEvent
me.deecaad.weaponmechanics.weapon.weaponevents.WeaponScopeEvent
All Implemented Interfaces:
org.bukkit.event.Cancellable

public class WeaponScopeEvent extends WeaponEvent implements org.bukkit.event.Cancellable
Called when a weapon scopes in, if the weapon stacks scopes, or if the weapon scopes out.
  • Constructor Details

    • WeaponScopeEvent

      public WeaponScopeEvent(String weaponTitle, org.bukkit.inventory.ItemStack weaponStack, org.bukkit.entity.LivingEntity livingEntity, org.bukkit.inventory.EquipmentSlot hand, WeaponScopeEvent.ScopeType scopeType, double zoomAmount, int zoomStack, me.deecaad.core.mechanics.MechanicManager mechanics)
  • Method Details

    • getScopeType

      public WeaponScopeEvent.ScopeType getScopeType()
      Returns whether the user is scoping in, stacking a zoom, or zooming out.
      Returns:
      the non-null scope cause.
    • getZoomAmount

      public double getZoomAmount()
      The new zoom amount that has the magnification amount. Should be 1..10. 1 likely means the user is scoping out (Check getScopeType()).
      Returns:
      The new zoom amount.
    • setZoomAmount

      public void setZoomAmount(double zoomAmount)
      Sets the new zoom magnification. Should be 1..10. Should probably be a number greater than 1.
      Parameters:
      zoomAmount - The new zoom amount.
    • getZoomStack

      public int getZoomStack()
      You can get the old zoom stack by reducing this by 1. If this is 0, it either means that stacking is not used or it was first zoom in. Make sure to check scope type.
      Returns:
      the NEW zoom stack amount
    • isNightVision

      public boolean isNightVision()
      Returns whether the user is using night vision or not.
      Returns:
      whether the user is using night vision or not.
    • setNightVision

      public void setNightVision(boolean isNightVision)
      Sets whether the user is using night vision or not.
      Parameters:
      isNightVision - whether the user is using night vision or not.
    • isPumpkinOverlay

      public boolean isPumpkinOverlay()
      Returns whether the user is using pumpkin overlay or not.
      Returns:
      whether the user is using pumpkin overlay or not.
    • setPumpkinOverlay

      public void setPumpkinOverlay(boolean isPumpkinOverlay)
      Sets whether the user is using pumpkin overlay or not.
      Parameters:
      isPumpkinOverlay - whether the user is using pumpkin overlay or not.
    • getMechanics

      public me.deecaad.core.mechanics.MechanicManager getMechanics()
    • setMechanics

      public void setMechanics(me.deecaad.core.mechanics.MechanicManager mechanics)
    • isCancelled

      public boolean isCancelled()
      Specified by:
      isCancelled in interface org.bukkit.event.Cancellable
    • setCancelled

      public void setCancelled(boolean b)
      Specified by:
      setCancelled in interface org.bukkit.event.Cancellable
    • getHandlers

      @NotNull public org.bukkit.event.HandlerList getHandlers()
      Specified by:
      getHandlers in class org.bukkit.event.Event
    • getHandlerList

      public static org.bukkit.event.HandlerList getHandlerList()