Mekanism

Mekanism

111M Downloads

Mekanism Jetpack breakable by RotaryCraft Bedrock Sword

BlueAgent opened this issue ยท 4 comments

commented

ReikaKalseki/Reika_Mods_Issues#627
Relevant files:
https://github.com/ReikaKalseki/RotaryCraft/blob/f7e9b3f91553aae85449dd5b5ce419456a74c32c/Items/Tools/Bedrock/ItemBedrockSword.java
https://github.com/aidancbrady/Mekanism/blob/bfd32a1c3e5cc97b90040e43270c6e87d5180189/src/main/java/mekanism/common/item/ItemJetpack.java

Mekanism overrides damageArmor from ItemArmor to do nothing.
damageArmor is used when the entity wearing the armor is taking damage.

The bedrock sword in addition to dealing damage, does durability damage directly to the item. https://github.com/ReikaKalseki/RotaryCraft/blob/f7e9b3f91553aae85449dd5b5ce419456a74c32c/Items/Tools/Bedrock/ItemBedrockSword.java#L130

Mekanism sets the maxDamage of the item. https://github.com/aidancbrady/Mekanism/blob/bfd32a1c3e5cc97b90040e43270c6e87d5180189/src/main/java/mekanism/common/item/ItemJetpack.java#L40
This causes the jetpack to become damageable.

Mekanism uses the durability value of the item to display the fuel level. If the item is not damageable, the damage bar does not render.

Potential solution:
Set maxDamage to 0 to make the item unbreakable.
Override Item.showDurabilityBar to return true. (By default it returns true if the item is damageable).
Override Item.getDurabilityForDisplay to return the fuel level. (By default it returns the ratio damage/maxDamage)

Off topic: I love both mods and want to make a mod too some day.
Edit: Changed links to files to permalinks

commented

https://github.com/Mithion/ArsMagica2/blob/5bc4c93979b6170d52cc9c7110f490b308ed058b/src/main/java/am2/spell/components/MeltArmor.java#L55
There's a similar interaction with the "melt armor" spell from the Ars Magica Fire Guardian

For testing I used creative mode to create a self + melt armor spell, it does 25% max durability damage to all armor pieces, the jetpack makes the item breaking sound when under 25% fuel level.

The jetpack is still working while in this state, and you can fly around.
Upon trying to drop the item, or taking damage while wearing the item, it disappears.

This may be because the item has a stack size of 0 from itemDamage, but is not cleaned up like the bedrock sword does.
(Only the fire guardian uses the spell and also has damaged attached it so it would be destroyed by the normal damage component in an actual boss fight if under 25% fuel level)
I'm not sure if this should be reported to Ars Magica 2 as well, since the melt armor spell is not normally obtainable through the skill tree and is only used by the fire guardian.

commented

No problem, it was fun to look into the interaction :)

commented

Fixed, thanks a bunch for the excellent report!

commented

Jetpack(or other armor without durability ) will be broken by any damage,when i have install minefantasy2
I don't know why,but I guess,it is because Jetpack does not have durability.
I don't know how to fix it.
please help!

Version :Mekanism-1.7.10-9.1.0.281