Skip to content

Commit

Permalink
Correct unclear name for the tool damage hook
Browse files Browse the repository at this point in the history
  • Loading branch information
KnightMiner committed Dec 29, 2023
1 parent 090fc8f commit 8536138
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public void onEquipmentChange(IToolStackView tool, ModifierEntry modifier, Equip
public static final ModifierHook<RepairFactorModifierHook> REPAIR_FACTOR = register("repair_factor", RepairFactorModifierHook.class, RepairFactorModifierHook.ComposeMerger::new, (tool, entry, factor) -> entry.getModifier().getRepairFactor(tool, entry.getLevel(), factor));

/** Hook for modifying the damage amount for tools */
public static final ModifierHook<ToolDamageModifierHook> ON_DAMAGE = register("on_damage", ToolDamageModifierHook.class, ToolDamageModifierHook.Merger::new, (tool, modifier, amount, holder) -> modifier.getModifier().onDamageTool(tool, modifier.getLevel(), amount, holder));
public static final ModifierHook<ToolDamageModifierHook> TOOL_DAMAGE = register("tool_damage", ToolDamageModifierHook.class, ToolDamageModifierHook.Merger::new, (tool, modifier, amount, holder) -> modifier.getModifier().onDamageTool(tool, modifier.getLevel(), amount, holder));

/** Hook running while the tool is in the inventory */
public static final ModifierHook<InventoryTickModifierHook> INVENTORY_TICK = register("inventory_tick", InventoryTickModifierHook.class, InventoryTickModifierHook.AllMerger::new,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public static boolean damage(IToolStackView tool, int amount, @Nullable LivingEn

// try each modifier
for (ModifierEntry entry : tool.getModifierList()) {
amount = entry.getHook(TinkerHooks.ON_DAMAGE).onDamageTool(tool, entry, amount, entity);
amount = entry.getHook(TinkerHooks.TOOL_DAMAGE).onDamageTool(tool, entry, amount, entity);
// if no more damage, done
if (amount <= 0) {
return false;
Expand Down

0 comments on commit 8536138

Please sign in to comment.