mirror of
https://github.com/KAMKEEL/CustomNPC-Plus-API.git
synced 2026-11-17 21:35:13 +00:00
Fix DBC Toggle Abilities and Wheel System
This commit is contained in:
1 parent
ca2980909e
commit
2c2f0c0d8f
4 files changed
+124
No files matched your search
@@ -85,6 +85,58 @@ public interface IPlayerAbilityEvent extends IPlayerEvent {
|
||||
int getTick();
|
||||
}
|
||||
|
||||
/**
|
||||
* Fired when a toggle ability is switched ON or OFF.
|
||||
* Canceling prevents the toggle from changing state.
|
||||
*
|
||||
* @hookName abilityToggle
|
||||
*/
|
||||
@Cancelable
|
||||
interface ToggleEvent extends IPlayerAbilityEvent {
|
||||
/**
|
||||
* @return true if the toggle is being turned ON (any state), false if being turned OFF
|
||||
*/
|
||||
boolean isTogglingOn();
|
||||
|
||||
/**
|
||||
* @return the previous state (0 = was off, 1+ = previous active state)
|
||||
*/
|
||||
int getOldState();
|
||||
|
||||
/**
|
||||
* @return the new state (0 = turning off, 1+ = new active state)
|
||||
*/
|
||||
int getNewState();
|
||||
}
|
||||
|
||||
/**
|
||||
* Fired every 10 ticks for each active toggle ability.
|
||||
* Scripts can call {@link #setEnabled(boolean)} with false to force-deactivate the toggle.
|
||||
*
|
||||
* @hookName abilityToggleUpdate
|
||||
*/
|
||||
interface ToggleUpdateEvent extends IPlayerAbilityEvent {
|
||||
/**
|
||||
* @return the tick count since the toggle was activated
|
||||
*/
|
||||
int getTick();
|
||||
|
||||
/**
|
||||
* @return the current toggle state (1+)
|
||||
*/
|
||||
int getState();
|
||||
|
||||
/**
|
||||
* @return whether the toggle should remain active
|
||||
*/
|
||||
boolean isEnabled();
|
||||
|
||||
/**
|
||||
* Set to false to force-deactivate the toggle after this event completes.
|
||||
*/
|
||||
void setEnabled(boolean enabled);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fired when a player's ability hits an entity with damage.
|
||||
* Canceling this event prevents the damage from being applied.
|
||||
|
||||
Reference in new issue
Block a user