From a3bd46a16be2e2a9630bcbafbaa9725e5787eb2d Mon Sep 17 00:00:00 2001 From: mystchonky Date: Sat, 25 Nov 2023 00:32:07 +0530 Subject: [PATCH] fixed bracket calculation for SentientWrath Will cost --- CHANGELOG.md | 6 ++++++ gradle.properties | 2 +- .../tomeofblood/common/glyphs/EffectSentientWrath.java | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fd7bf83..1cd03a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [0.4.3] - 2023-11-25 + +### Fixed + +- Fixed crash due to no will when using SentientWrath + ## [0.4.2] - 2023-11-23 ### Fixed diff --git a/gradle.properties b/gradle.properties index 6bb8e2b..c49c5f8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,7 +3,7 @@ org.gradle.jvmargs=-Xmx4G org.gradle.daemon=false # -mod_version=0.4.2 +mod_version=0.4.3 mod_id=tomeofblood mod_authors=mystchonky mod_group_id=com.mystchonky.tomeofblood diff --git a/src/main/java/com/mystchonky/tomeofblood/common/glyphs/EffectSentientWrath.java b/src/main/java/com/mystchonky/tomeofblood/common/glyphs/EffectSentientWrath.java index 2e28bc2..4af9a12 100644 --- a/src/main/java/com/mystchonky/tomeofblood/common/glyphs/EffectSentientWrath.java +++ b/src/main/java/com/mystchonky/tomeofblood/common/glyphs/EffectSentientWrath.java @@ -87,7 +87,7 @@ public void onResolveEntity(EntityHitResult rayTraceResult, Level world, @NotNul } // Consume will - double willCost = ItemSentientSword.soulDrainPerSwing[bracket] * targets.size() * (targets.size() > 1 ? 0.75 : 1); + double willCost = ItemSentientSword.soulDrainPerSwing[Math.max(bracket, 0)] * targets.size() * (targets.size() > 1 ? 0.75 : 1); PlayerDemonWillHandler.consumeDemonWill(type, player, willCost); //trigger on hit