mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-27 11:14:44 +02:00
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:
@ -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"));
|
||||
}
|
||||
|
@ -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"));
|
||||
|
Reference in New Issue
Block a user