Skip to content

Commit 2988155

Browse files
committed
fix 0 spell cost bug (mana attunement)
1 parent a25a8db commit 2988155

File tree

3 files changed

+14
-15
lines changed

3 files changed

+14
-15
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# Changelog
22

3-
## [0.3.0] - Unreleased
3+
## [0.3.1] - 2023-10-30
4+
5+
### Changed
6+
7+
- Removed the experience reduction of Heretic's Armor which caused upgrade tomes to be buggy
8+
- Changed Mana Attunement discount calculation to fix 0 spell cost due to integer conversion
9+
10+
## [0.3.0] - 2023-10-28
411

512
Configs have changed. It is recommended to delete the old `tomeofblood` config and let it regenerate.
613

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,8 @@ For a full overview, check the `Tome of Blood` section of the Worn Notebook (Ars
2424

2525
### License
2626

27-
- All the code in this repository is under **LGPLv3 License**.
27+
- All the code in this repository is under **LGPLv3 License**.
28+
29+
#### Notes:
30+
31+
A part of the assets are made by Gronglegrowth and are under CC BY 4.0 License.

src/main/java/com/mystchonky/tomeofblood/common/events/EventHandler.java

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,14 @@
66
import com.hollingsworth.arsnouveau.api.spell.SpellContext;
77
import com.mystchonky.tomeofblood.TomeOfBlood;
88
import com.mystchonky.tomeofblood.client.ClientInfo;
9-
import com.mystchonky.tomeofblood.common.config.BaseConfig;
10-
import com.mystchonky.tomeofblood.common.items.LivingMageArmorItem;
119
import com.mystchonky.tomeofblood.common.registry.LivingUpgradeRegistry;
1210
import com.mystchonky.tomeofblood.common.registry.MobEffectRegistry;
13-
import net.minecraft.world.entity.EquipmentSlot;
1411
import net.minecraft.world.entity.player.Player;
1512
import net.minecraftforge.event.TickEvent;
1613
import net.minecraftforge.eventbus.api.SubscribeEvent;
1714
import net.minecraftforge.fml.common.Mod;
1815
import wayoftime.bloodmagic.core.living.LivingStats;
1916
import wayoftime.bloodmagic.core.living.LivingUtil;
20-
import wayoftime.bloodmagic.event.LivingEquipmentEvent;
2117
import wayoftime.bloodmagic.event.SacrificeKnifeUsedEvent;
2218

2319
import static com.hollingsworth.arsnouveau.api.util.ManaUtil.getPlayerDiscounts;
@@ -45,20 +41,12 @@ public static void spellDiscount(SpellCostCalcEvent event) {
4541
LivingStats stats = LivingStats.fromPlayer(player);
4642
int level = stats.getLevel(LivingUpgradeRegistry.MANA_UPGRADE.getKey());
4743
double discount = level * 0.05;
48-
event.currentCost *= (int) (1 - discount);
44+
event.currentCost = (int) ((1 - discount) * event.currentCost);
4945
}
5046
}
5147

5248
}
5349

54-
// LivingMageArmor trains slower than Normal living armor
55-
@SubscribeEvent
56-
public static void reduceExpGain(LivingEquipmentEvent.GainExperience event) {
57-
if (event.getPlayer().getItemBySlot(EquipmentSlot.CHEST).getItem() instanceof LivingMageArmorItem) {
58-
event.setExperience(event.getExperience() * BaseConfig.COMMON.LIVING_MAGE_SCALE.get());
59-
}
60-
}
61-
6250
@SubscribeEvent
6351
public static void awardXPForSpellCast(SpellCastEvent event) {
6452
if (event.context.getUnwrappedCaster() instanceof Player player) {

0 commit comments

Comments
 (0)