mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2025-01-03 06:37:47 +01:00
Null check for modelengine bmo
This commit is contained in:
parent
fdbda8f7db
commit
3a9491f654
@ -72,17 +72,18 @@ public class ElementalAttack {
|
|||||||
public double getDamageModifier() {
|
public double getDamageModifier() {
|
||||||
|
|
||||||
// Elemental defense
|
// Elemental defense
|
||||||
for (ItemStack equip : target.getEquipment().getArmorContents()) {
|
if (target.getEquipment() != null) // Null check for ModelEngine mobs
|
||||||
NBTItem nbtEquip = MythicLib.plugin.getVersion().getWrapper().getNBTItem(equip);
|
for (ItemStack equip : target.getEquipment().getArmorContents()) {
|
||||||
if (nbtEquip.getType() != null)
|
NBTItem nbtEquip = MythicLib.plugin.getVersion().getWrapper().getNBTItem(equip);
|
||||||
for (Element element : absolute.keySet()) {
|
if (nbtEquip.getType() != null)
|
||||||
double defense = nbtEquip.getStat(element.name() + "_DEFENSE") / 100;
|
for (Element element : absolute.keySet()) {
|
||||||
if (defense > 0) {
|
double defense = nbtEquip.getStat(element.name() + "_DEFENSE") / 100;
|
||||||
relative.put(element, relative.get(element) * (1 - defense));
|
if (defense > 0) {
|
||||||
absolute.put(element, absolute.get(element) * (1 - defense));
|
relative.put(element, relative.get(element) * (1 - defense));
|
||||||
|
absolute.put(element, absolute.get(element) * (1 - defense));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Elemental attacks
|
// Elemental attacks
|
||||||
double correctionCoeff = 1;
|
double correctionCoeff = 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user