Class ScopeHandler

java.lang.Object
me.deecaad.weaponmechanics.weapon.scope.ScopeHandler
All Implemented Interfaces:
me.deecaad.core.file.IValidator, TriggerListener

public class ScopeHandler extends Object implements me.deecaad.core.file.IValidator, TriggerListener
  • Constructor Details

    • ScopeHandler

      public ScopeHandler()
      Defualt constructor for validator
    • ScopeHandler

      public ScopeHandler(WeaponHandler weaponHandler)
  • Method Details

    • allowOtherTriggers

      public boolean allowOtherTriggers()
      Description copied from interface: TriggerListener
      Mostly this is defaulted to false.
      Specified by:
      allowOtherTriggers in interface TriggerListener
      Returns:
      true if other triggers can occur even after this trigger is valid
    • tryUse

      public boolean tryUse(EntityWrapper entityWrapper, String weaponTitle, org.bukkit.inventory.ItemStack weaponStack, org.bukkit.inventory.EquipmentSlot slot, TriggerType triggerType, boolean dualWield, @Nullable org.bukkit.entity.LivingEntity victim)
      Description copied from interface: TriggerListener
      Tries to use given trigger type to trigger some action.
      Specified by:
      tryUse in interface TriggerListener
      Parameters:
      entityWrapper - the entity which caused trigger
      weaponTitle - the weapon title involved
      weaponStack - the weapon stack involved
      slot - the weapon slot used
      triggerType - the trigger which caused this
      dualWield - whether this was dual wield
      victim - if there is known victim
      Returns:
      true if was able to use
    • updateZoom

      public void updateZoom(EntityWrapper entityWrapper, ZoomData zoomData, double newZoomAmount)
      Updates the zoom amount of entity.
    • useNightVision

      public void useNightVision(EntityWrapper entityWrapper, ZoomData zoomData, boolean isEnable)
      Toggles night vision on or off whether it was on before
    • getKeyword

      public String getKeyword()
      Specified by:
      getKeyword in interface me.deecaad.core.file.IValidator
    • getAllowedPaths

      public List<String> getAllowedPaths()
      Specified by:
      getAllowedPaths in interface me.deecaad.core.file.IValidator
    • validate

      public void validate(me.deecaad.core.file.Configuration configuration, me.deecaad.core.file.SerializeData data) throws me.deecaad.core.file.SerializerException
      Specified by:
      validate in interface me.deecaad.core.file.IValidator
      Throws:
      me.deecaad.core.file.SerializerException