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
Called when a weapon scopes in, if the weapon stacks scopes, or if the weapon scopes out.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Field Summary
Fields inherited from class me.deecaad.weaponmechanics.weapon.weaponevents.WeaponEvent
weaponTitleFields inherited from class org.bukkit.event.entity.EntityEvent
entity -
Constructor Summary
ConstructorsConstructorDescriptionWeaponScopeEvent(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 Summary
Modifier and TypeMethodDescriptionstatic org.bukkit.event.HandlerListorg.bukkit.event.HandlerListme.deecaad.core.mechanics.MechanicManagerReturns whether the user is scoping in, stacking a zoom, or zooming out.doubleThe new zoom amount that has the magnification amount.intYou can get the old zoom stack by reducing this by 1.booleanbooleanReturns whether the user is using night vision or not.booleanReturns whether the user is using pumpkin overlay or not.voidsetCancelled(boolean b) voidsetMechanics(me.deecaad.core.mechanics.MechanicManager mechanics) voidsetNightVision(boolean isNightVision) Sets whether the user is using night vision or not.voidsetPumpkinOverlay(boolean isPumpkinOverlay) Sets whether the user is using pumpkin overlay or not.voidsetZoomAmount(double zoomAmount) Sets the new zoom magnification.Methods inherited from class me.deecaad.weaponmechanics.weapon.weaponevents.WeaponEvent
getHand, getHandData, getShooter, getShooterWrapper, getWeaponStack, getWeaponTitle, isMainHand, isOffHandMethods inherited from class org.bukkit.event.entity.EntityEvent
getEntity, getEntityTypeMethods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
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
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 (CheckgetScopeType()).- 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:
isCancelledin interfaceorg.bukkit.event.Cancellable
-
setCancelled
public void setCancelled(boolean b) - Specified by:
setCancelledin interfaceorg.bukkit.event.Cancellable
-
getHandlers
@NotNull public org.bukkit.event.HandlerList getHandlers()- Specified by:
getHandlersin classorg.bukkit.event.Event
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList()
-