mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 22:56:45 +01:00
Fix bleed tasks invoking ruptures
Also, made the mcmmo custom damage checks handle nested calls
This commit is contained in:
parent
4f6706b664
commit
e8165321e1
@ -539,7 +539,11 @@ public final class CombatUtils {
|
|||||||
|
|
||||||
if(newHealth == 0)
|
if(newHealth == 0)
|
||||||
{
|
{
|
||||||
|
// TODO: This is horrible, but there is no cleaner way to do this without potentially breaking existing code right now
|
||||||
|
boolean wasMetaSet = target.getMetadata(mcMMO.CUSTOM_DAMAGE_METAKEY).size() != 0;
|
||||||
|
target.setMetadata(mcMMO.CUSTOM_DAMAGE_METAKEY, mcMMO.metadataValue);
|
||||||
target.damage(9999, attacker);
|
target.damage(9999, attacker);
|
||||||
|
if (!wasMetaSet) target.removeMetadata(mcMMO.CUSTOM_DAMAGE_METAKEY, mcMMO.p);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
target.setHealth(newHealth);
|
target.setHealth(newHealth);
|
||||||
@ -550,9 +554,11 @@ public final class CombatUtils {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This is horrible, but there is no cleaner way to do this without potentially breaking existing code
|
||||||
|
boolean wasMetaSet = target.getMetadata(mcMMO.CUSTOM_DAMAGE_METAKEY).size() != 0;
|
||||||
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);
|
if (!wasMetaSet) 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