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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanMostly this is defaulted to false.booleantryUse(EntityWrapper entityWrapper, String weaponTitle, org.bukkit.inventory.ItemStack weaponStack, org.bukkit.inventory.EquipmentSlot slot, TriggerType triggerType, boolean dualWield, org.bukkit.entity.LivingEntity victim) Tries to use given trigger type to trigger some action.voidupdateZoom(EntityWrapper entityWrapper, ZoomData zoomData, double newZoomAmount) Updates the zoom amount of entity.voiduseNightVision(EntityWrapper entityWrapper, ZoomData zoomData, boolean isEnable) Toggles night vision on or off whether it was on beforevoidvalidate(me.deecaad.core.file.Configuration configuration, me.deecaad.core.file.SerializeData data) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface me.deecaad.core.file.IValidator
denyKeys, shouldValidate
-
Constructor Details
-
ScopeHandler
public ScopeHandler()Defualt constructor for validator -
ScopeHandler
-
-
Method Details
-
allowOtherTriggers
public boolean allowOtherTriggers()Description copied from interface:TriggerListenerMostly this is defaulted to false.- Specified by:
allowOtherTriggersin interfaceTriggerListener- 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:TriggerListenerTries to use given trigger type to trigger some action.- Specified by:
tryUsein interfaceTriggerListener- Parameters:
entityWrapper- the entity which caused triggerweaponTitle- the weapon title involvedweaponStack- the weapon stack involvedslot- the weapon slot usedtriggerType- the trigger which caused thisdualWield- whether this was dual wieldvictim- if there is known victim- Returns:
- true if was able to use
-
updateZoom
Updates the zoom amount of entity. -
useNightVision
Toggles night vision on or off whether it was on before -
getKeyword
- Specified by:
getKeywordin interfaceme.deecaad.core.file.IValidator
-
getAllowedPaths
- Specified by:
getAllowedPathsin interfaceme.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:
validatein interfaceme.deecaad.core.file.IValidator- Throws:
me.deecaad.core.file.SerializerException
-