Move bleeding to mcBleedTimer

Put all the logic handling adding/removing/contains there and encapsulate our List
Additionally, should prevent a ConcurrentModificationException by locking, but I'm not 100% on the contiains not throing such an exception.
This commit is contained in:
NuclearW
2012-03-18 16:59:35 -04:00
parent b10f599a87
commit 8f2c424657
9 changed files with 182 additions and 84 deletions

View File

@ -1,25 +1,16 @@
package com.gmail.nossr50.config;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import com.gmail.nossr50.mcMMO;
public class Misc {
public HashMap<Entity, Integer> arrowTracker = new HashMap<Entity, Integer>();
public ArrayList<LivingEntity> bleedTracker = new ArrayList<LivingEntity>();
public HashMap<Integer, Player> tntTracker = new HashMap<Integer, Player>();
mcMMO plugin;
/* BLEED QUE STUFF */
public HashSet<LivingEntity> bleedQue = new HashSet<LivingEntity>();
public HashSet<LivingEntity> bleedRemovalQue = new HashSet<LivingEntity>();
public Misc(mcMMO mcMMO) {
this.plugin = mcMMO;
}