Skip to content

Commit

Permalink
fix AttributeModifier constructor which was marked for removal
Browse files Browse the repository at this point in the history
  • Loading branch information
acrylic-style committed Nov 9, 2024
1 parent 811d46b commit 394f68e
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.github.mori01231.lifecore.LifeCore;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.NamespacedKey;
import org.bukkit.attribute.Attribute;
import org.bukkit.attribute.AttributeInstance;
import org.bukkit.attribute.AttributeModifier;
Expand Down Expand Up @@ -77,10 +78,10 @@ private static void checkAttribute0(LivingEntity entity) {
}
}
if (amountScalar != 0) {
attr.addModifier(new AttributeModifier("lifecore.temp_health_boost_scalar", amountScalar, AttributeModifier.Operation.ADD_SCALAR));
attr.addModifier(new AttributeModifier(new NamespacedKey("lifecore", "temp_health_boost_scalar"), amountScalar, AttributeModifier.Operation.ADD_SCALAR));
}
if (amountNumber != 0) {
attr.addModifier(new AttributeModifier("lifecore.temp_health_boost_number", amountNumber, AttributeModifier.Operation.ADD_NUMBER));
attr.addModifier(new AttributeModifier(new NamespacedKey("lifecore", "temp_health_boost_number"), amountNumber, AttributeModifier.Operation.ADD_NUMBER));
}
entity.sendMessage(ChatColor.RED + "不可能な装備の組み合わせです。最大体力が0以下になっています。");
}
Expand Down

0 comments on commit 394f68e

Please sign in to comment.