mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-19 14:19:13 +00:00
Condition overhaul completed
This commit is contained in:
1 parent
a2e0bb50b9
commit
89e87b7656
9 files changed
+290
-292
No files matched your search
@@ -1233,6 +1233,7 @@ public abstract class Ability implements IAbility, IAbilityAction {
|
||||
|
||||
public boolean checkConditions(EntityLivingBase caster, EntityLivingBase target) {
|
||||
for (AbilityCondition c : conditions) {
|
||||
if (!c.getUserType().allowsNpc()) continue;
|
||||
if (!c.check(caster, target)) return false;
|
||||
}
|
||||
return true;
|
||||
@@ -1243,6 +1244,7 @@ public abstract class Ability implements IAbility, IAbilityAction {
|
||||
*/
|
||||
public boolean checkConditionsForPlayer(EntityLivingBase caster) {
|
||||
for (AbilityCondition c : conditions) {
|
||||
if (!c.getUserType().allowsPlayer()) continue;
|
||||
if (c.requiresTarget()) continue;
|
||||
if (!c.check(caster, null)) return false;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user