mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 07:06:45 +01:00
Fixed some concurrency concerns around BleedTasks
This commit is contained in:
parent
62ce98c8a5
commit
e4d980b135
@ -1,3 +1,7 @@
|
|||||||
|
Version 2.1.101
|
||||||
|
mcnotify command now checks that it's being executed by a player
|
||||||
|
Fixed some concurrency concerns around BleedTasks
|
||||||
|
|
||||||
Version 2.1.100
|
Version 2.1.100
|
||||||
Corrected some mistakes made in the updated Russian locale (thanks myfbone!)
|
Corrected some mistakes made in the updated Russian locale (thanks myfbone!)
|
||||||
|
|
||||||
|
@ -259,8 +259,6 @@ public class EntityListener implements Listener {
|
|||||||
|
|
||||||
if(defender.getMetadata(mcMMO.CUSTOM_DAMAGE_METAKEY).size() > 0)
|
if(defender.getMetadata(mcMMO.CUSTOM_DAMAGE_METAKEY).size() > 0)
|
||||||
{
|
{
|
||||||
defender.removeMetadata(mcMMO.CUSTOM_DAMAGE_METAKEY, plugin);
|
|
||||||
|
|
||||||
if(defender instanceof Player)
|
if(defender instanceof Player)
|
||||||
{
|
{
|
||||||
LivingEntity defLive = (LivingEntity) defender;
|
LivingEntity defLive = (LivingEntity) defender;
|
||||||
|
@ -9,6 +9,8 @@ import com.gmail.nossr50.util.skills.CombatUtils;
|
|||||||
import com.gmail.nossr50.util.skills.ParticleEffectUtils;
|
import com.gmail.nossr50.util.skills.ParticleEffectUtils;
|
||||||
import com.gmail.nossr50.util.sounds.SoundManager;
|
import com.gmail.nossr50.util.sounds.SoundManager;
|
||||||
import com.gmail.nossr50.util.sounds.SoundType;
|
import com.gmail.nossr50.util.sounds.SoundType;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
@ -171,6 +173,10 @@ public class BleedTimerTask extends BukkitRunnable {
|
|||||||
* @param ticks Number of bleeding ticks
|
* @param ticks Number of bleeding ticks
|
||||||
*/
|
*/
|
||||||
public static void add(LivingEntity entity, LivingEntity attacker, int ticks, int bleedRank, int toolTier) {
|
public static void add(LivingEntity entity, LivingEntity attacker, int ticks, int bleedRank, int toolTier) {
|
||||||
|
if (!Bukkit.isPrimaryThread()) {
|
||||||
|
throw new IllegalStateException("Cannot add bleed task async!");
|
||||||
|
}
|
||||||
|
|
||||||
if(toolTier < 4)
|
if(toolTier < 4)
|
||||||
ticks = Math.max(1, (ticks / 3));
|
ticks = Math.max(1, (ticks / 3));
|
||||||
|
|
||||||
|
@ -552,6 +552,7 @@ public final class CombatUtils {
|
|||||||
|
|
||||||
target.setMetadata(mcMMO.CUSTOM_DAMAGE_METAKEY, mcMMO.metadataValue);
|
target.setMetadata(mcMMO.CUSTOM_DAMAGE_METAKEY, mcMMO.metadataValue);
|
||||||
target.damage(damage, attacker);
|
target.damage(damage, attacker);
|
||||||
|
target.removeMetadata(mcMMO.CUSTOM_DAMAGE_METAKEY, mcMMO.p);
|
||||||
|
|
||||||
// //IFrame storage
|
// //IFrame storage
|
||||||
//// int noDamageTicks = target.getNoDamageTicks();
|
//// int noDamageTicks = target.getNoDamageTicks();
|
||||||
|
Loading…
Reference in New Issue
Block a user