mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-20 04:09:57 +00:00
Fix Some GUI Saving Bugs in Abilities and Chained Abilities
This commit is contained in:
1 parent
755a9313e4
commit
a94219cd0d
5 files changed
+61
-43
No files matched your search
@@ -393,7 +393,7 @@ public class DataAbilities extends AbstractDataAbilities {
|
||||
|
||||
for (AbilityAction slot : actionSlots) {
|
||||
IAbilityAction action = slot.getAction();
|
||||
if (action != null && isActionEligible(action, target)) {
|
||||
if (action != null && isActionEligible(slot, action, target)) {
|
||||
eligible.add(action);
|
||||
weights.add(action.getWeight());
|
||||
totalWeight += action.getWeight();
|
||||
@@ -451,11 +451,11 @@ public class DataAbilities extends AbstractDataAbilities {
|
||||
/**
|
||||
* Check if an action (ability or chain) is eligible for use.
|
||||
*/
|
||||
private boolean isActionEligible(IAbilityAction action, EntityLivingBase target) {
|
||||
private boolean isActionEligible(AbilityAction slot, IAbilityAction action, EntityLivingBase target) {
|
||||
if (!action.getAllowedBy().allowsNpc()) {
|
||||
return false;
|
||||
}
|
||||
if (!action.isEnabled()) {
|
||||
if (!slot.isSlotEnabled()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user