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

@ -17,6 +17,7 @@ import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType;
import com.gmail.nossr50.locale.mcLocale;
import com.gmail.nossr50.party.Party;
import com.gmail.nossr50.runnables.mcBleedTimer;
public class Swords {
@ -66,7 +67,7 @@ public class Swords {
Users.getProfile(target).addBleedTicks(bleedTicks);
}
else {
plugin.misc.bleedQue.add(entity);
mcBleedTimer.add(entity);
}
attacker.sendMessage(mcLocale.getString("Swords.EnemyBleeding"));
}

View File

@ -21,6 +21,7 @@ import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType;
import com.gmail.nossr50.locale.mcLocale;
import com.gmail.nossr50.runnables.mcBleedTimer;
public class Taming {
@ -90,7 +91,7 @@ public class Taming {
Users.getProfile(target).setBleedTicks(2);
}
else {
plugin.misc.bleedQue.add((LivingEntity) entity);
mcBleedTimer.add((LivingEntity) entity);
}
master.sendMessage(mcLocale.getString("Combat.Gore"));