mirror of
https://github.com/GTNewHorizons/IguanaTweaksTConstruct.git
synced 2026-11-27 23:33:06 +00:00
Swapping parts instead of AmmoItem repair (#30)
This commit is contained in:
1 parent
2cf7f1bead
commit
f28c84287f
2 files changed
+7
-3
No files matched your search
@@ -24,6 +24,7 @@ import tconstruct.library.modifier.ItemModifier;
|
||||
import tconstruct.library.tools.DualMaterialToolPart;
|
||||
import tconstruct.library.tools.ToolCore;
|
||||
import tconstruct.library.util.IToolPart;
|
||||
import tconstruct.library.weaponry.AmmoItem;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
import tconstruct.weaponry.TinkerWeaponry;
|
||||
|
||||
@@ -50,6 +51,9 @@ public class ModPartReplacement extends ItemModifier {
|
||||
if (tags.getBoolean("Special")) return false;
|
||||
|
||||
if (tags.getInteger("Damage") > 0) return false;
|
||||
// Durability is written on "Ammo" tag instead of "Damage" tag for AmmoWeapons
|
||||
if (tool instanceof AmmoItem && ((AmmoItem) tool).getMaxAmmo(tags) != ((AmmoItem) tool).getAmmoCount(itemStack))
|
||||
return false;
|
||||
|
||||
// check if any of the tools parts contain stone. we have to prevent exchanging that with disabled stone tools
|
||||
// because otherwise the replacement-logic would not be able to obtain necessary information and crash.
|
||||
|
||||
Reference in new issue
Block a user