mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-27 03:52:55 +00:00
Update Abilities to Support Player Casting (Part 1)
This commit is contained in:
1 parent
c05b6e60b8
commit
2387ece1ff
14 files changed
+259
-117
No files matched your search
@@ -392,6 +392,18 @@ public abstract class Ability implements IAbility {
|
||||
return 45.0f;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the caster is a player (not an NPC).
|
||||
* Use this instead of checking {@code target != null} to make NPC/Player
|
||||
* code paths explicit and readable.
|
||||
* <p>
|
||||
* NPCs always have an aggro target passed to ability methods.
|
||||
* Players never do — they use look direction for aiming instead.
|
||||
*/
|
||||
protected final boolean isPlayerCaster(EntityLivingBase caster) {
|
||||
return caster instanceof EntityPlayer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if this ability controls NPC movement during ACTIVE phase.
|
||||
* When true, AI pathfinding will be blocked during ability execution.
|
||||
|
||||
Reference in new issue
Block a user