Class WeaponFirearmEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.entity.EntityEvent
me.deecaad.weaponmechanics.weapon.weaponevents.WeaponEvent
me.deecaad.weaponmechanics.weapon.weaponevents.WeaponFirearmEvent
When a weapon's
FirearmState changes.-
Nested Class Summary
Nested 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
ConstructorsConstructorDescriptionWeaponFirearmEvent(String weaponTitle, org.bukkit.inventory.ItemStack weaponStack, org.bukkit.entity.LivingEntity shooter, org.bukkit.inventory.EquipmentSlot hand, FirearmAction action, FirearmState state) -
Method Summary
Modifier and TypeMethodDescriptionThe config options of the firearm.static org.bukkit.event.HandlerListorg.bukkit.event.HandlerListme.deecaad.core.mechanics.MechanicManagerThe mechanics that will be used (usually for sounds).getState()Returns whether the state is OPEN, CLOSE, or READY.intgetTime()Returns how long it takes for the firearm action to be completed.getType()Returns the firearm type.voidsetMechanics(me.deecaad.core.mechanics.MechanicManager mechanics) The mechanics that will be used (usually for sounds).voidsetTime(int time) Sets how long it takes for the firearm action to be completed.voiduseMechanics(me.deecaad.core.mechanics.CastData castData, boolean isOpen) 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
-
WeaponFirearmEvent
public WeaponFirearmEvent(String weaponTitle, org.bukkit.inventory.ItemStack weaponStack, org.bukkit.entity.LivingEntity shooter, org.bukkit.inventory.EquipmentSlot hand, FirearmAction action, FirearmState state)
-
-
Method Details
-
getAction
The config options of the firearm. You probably do not want to modify this value.- Returns:
- The firearm config options.
-
getType
Returns the firearm type.- Returns:
- The firearm type.
-
getState
Returns whether the state is OPEN, CLOSE, or READY.- Returns:
- The firearm state.
-
getMechanics
public me.deecaad.core.mechanics.MechanicManager getMechanics()The mechanics that will be used (usually for sounds).- Returns:
- The mechanics that will be played after the event.
-
setMechanics
public void setMechanics(me.deecaad.core.mechanics.MechanicManager mechanics) The mechanics that will be used (usually for sounds).- Parameters:
mechanics- The mechanics that will be played after the event.
-
getTime
public int getTime()Returns how long it takes for the firearm action to be completed.- Returns:
- The firearm action time.
-
setTime
public void setTime(int time) Sets how long it takes for the firearm action to be completed.- Parameters:
time- The firearm action time.
-
useMechanics
public void useMechanics(me.deecaad.core.mechanics.CastData castData, boolean isOpen) -
getHandlers
@NotNull public org.bukkit.event.HandlerList getHandlers()- Specified by:
getHandlersin classorg.bukkit.event.Event
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList()
-