mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-18 16:09:05 +00:00
Ability Checking
This commit is contained in:
1 parent
3919831857
commit
37d4b97a44
6 files changed
+79
-167
No files matched your search
@@ -381,6 +381,9 @@ public class PlayerAbilityData extends AbstractDataAbilities implements IPlayerA
|
||||
public boolean activateAbility(EntityPlayer player, String key) {
|
||||
if (player.worldObj.isRemote || key == null || key.isEmpty()) return false;
|
||||
|
||||
// Global activation check (e.g., addon-registered restrictions)
|
||||
if (!AbilityController.Instance.canPlayerActivate(player)) return false;
|
||||
|
||||
// Can't activate if already executing
|
||||
if (currentAbility != null && currentAbility.isExecuting()) return false;
|
||||
if (isExecutingChain()) return false;
|
||||
@@ -395,6 +398,9 @@ public class PlayerAbilityData extends AbstractDataAbilities implements IPlayerA
|
||||
// Check conditions (skip target-requiring ones)
|
||||
if (!action.checkConditionsForPlayer(player)) return false;
|
||||
|
||||
// Check player requirement (visibility/availability gate)
|
||||
if (!action.isAvailableFor(player)) return false;
|
||||
|
||||
// Dispatch: chain vs ability
|
||||
if (action.isChain()) {
|
||||
if (isOnCooldown()) return false;
|
||||
|
||||
Reference in new issue
Block a user