The value of the Mana Mirror may be negative
FortyTwoCn opened this issue · 2 comments
Mod Loader
Forge
Minecraft Version
1.21.1
Botania version
451
Modloader version
Neoforge 200
Modpack info
No response
The latest.log file
null
Issue description
[198月2025 09:58:21.101] [Server thread/ERROR] [net.minecraft.Util/]: Error saving [1 botania:mana_mirror]. Original cause: java.lang.IllegalStateException: Value must be positive: 0
With components:
{
botania:max_mana=>1000000
botania:mana_pool_pos=>ResourceKey[minecraft:dimension / minecraft:overworld] BlockPos{x=2549, y=75, z=-3207}
botania:mana=>0
botania:mana_backlog=>-2
minecraft:attribute_modifiers=>ItemAttributeModifiers[modifiers=[], showInTooltip=true]
minecraft:enchantments=>ItemEnchantments{enchantments={}, showInTooltip=true}
minecraft:rarity=>UNCOMMON
minecraft:max_stack_size=>1
minecraft:lore=>ItemLore[lines=[], styledLines=[]]
minecraft:repair_cost=>0
botania:can_provide_mana_to_items=>INSTANCE
}
Currently unclear how to reproduce
Testing the process to reproduce this issue
Steps to reproduce
No response
Other information
No response
So, this wasn't about the negative mana backlog value, that is intentional. (The mana mirror accumulates the mana difference and then synchronizes with the bound mirror once per tick.)
The actual issue was that the mana mirror incorrectly set its "mana" and "max_mana" components to zero instead of removing those components when they are at their default zero value, as originally intended.
Can reproduce this on Fabric. Just need to bind a new Mana Mirror to an empty pool in Creative.