This commit is contained in:
bm01
2012-05-01 01:32:50 +02:00
parent ca1954ff80
commit 18c52a5e23
5 changed files with 75 additions and 82 deletions

View File

@ -15,7 +15,7 @@ import com.gmail.nossr50.util.Combat;
public class BleedTimer implements Runnable {
private final static int MAX_BLEED_TICKS = 10;
private static Map<LivingEntity, Integer> bleedList = new HashMap<LivingEntity, Integer>();
private static Map<LivingEntity, Integer> bleedAddList = new HashMap<LivingEntity, Integer>();
private static List<LivingEntity> bleedRemoveList = new ArrayList<LivingEntity>();
@ -121,6 +121,7 @@ public class BleedTimer implements Runnable {
* Add a LivingEntity to the bleedList if it is not in it.
*
* @param entity LivingEntity to add
* @param ticks Number of bleeding ticks
*/
public static void add(LivingEntity entity, int ticks) {
int newTicks = ticks;
@ -128,7 +129,7 @@ public class BleedTimer implements Runnable {
if (lock) {
if (bleedAddList.containsKey(entity)) {
newTicks += bleedAddList.get(entity);
if (newTicks > MAX_BLEED_TICKS) {
newTicks = MAX_BLEED_TICKS;
}
@ -146,7 +147,7 @@ public class BleedTimer implements Runnable {
else {
if (bleedList.containsKey(entity)) {
newTicks += bleedList.get(entity);
if (newTicks > MAX_BLEED_TICKS) {
newTicks = MAX_BLEED_TICKS;
}