run the remove of the ability after the revert, since earth armor will run revert as part of its remove if this revert hasnt completed

This commit is contained in:
PhanaticD 2019-01-19 04:16:25 -05:00
parent 9fb35ecc60
commit c6021dd970

View file

@ -1,19 +1,12 @@
package com.projectkorra.projectkorra.util; package com.projectkorra.projectkorra.util;
import java.util.ArrayList; import com.projectkorra.projectkorra.ability.CoreAbility;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.PriorityQueue;
import java.util.concurrent.ConcurrentHashMap;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LivingEntity;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import com.projectkorra.projectkorra.ability.CoreAbility; import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
public class TempArmor { public class TempArmor {
@ -208,10 +201,6 @@ public class TempArmor {
* TempArmor instance was started, if the display queue is empty. * TempArmor instance was started, if the display queue is empty.
*/ */
public void revert() { public void revert() {
if (this.removeAbilOnForceRevert && this.ability != null && !this.ability.isRemoved()) {
this.ability.remove();
}
final PriorityQueue<TempArmor> queue = INSTANCES.get(this.entity); final PriorityQueue<TempArmor> queue = INSTANCES.get(this.entity);
if (queue.contains(this)) { if (queue.contains(this)) {
@ -231,6 +220,10 @@ public class TempArmor {
INSTANCES.remove(this.entity); INSTANCES.remove(this.entity);
ORIGINAL.remove(this.entity); ORIGINAL.remove(this.entity);
} }
if (this.removeAbilOnForceRevert && this.ability != null && !this.ability.isRemoved()) {
this.ability.remove();
}
} }
public static void cleanup() { public static void cleanup() {