mirror of
https://github.com/Sokomine/cottages.git
synced 2025-04-21 11:30:23 +02:00
compatibility w/ broken tools
This commit is contained in:
parent
549c697bc0
commit
cb9a744a1b
@ -659,7 +659,7 @@ stds.cottages = {
|
||||
},
|
||||
other_fields = true,
|
||||
},
|
||||
|
||||
"broken_tools",
|
||||
"carts",
|
||||
"default",
|
||||
"doors",
|
||||
|
1
init.lua
1
init.lua
@ -12,6 +12,7 @@ cottages = {
|
||||
|
||||
has = {
|
||||
anvil = minetest.get_modpath("anvil"),
|
||||
broken_tools = minetest.get_modpath("broken_tools"),
|
||||
bucket = minetest.get_modpath("bucket"),
|
||||
default = minetest.get_modpath("default"),
|
||||
doors = minetest.get_modpath("doors"),
|
||||
|
22
mod.conf
22
mod.conf
@ -5,4 +5,24 @@ author = Sokomine
|
||||
description = Contains nodes for building medieval houses.
|
||||
url = https://github.com/sokomine/cottages
|
||||
version = 2023-02-08
|
||||
optional_depends = anvil, bucket, default, doors, env_sounds, ethereal, farming, moreblocks, node_entity_queue, player_api, player_monoids, stairs, stairsplus, stamina, technic, unified_inventory, wool, workbench
|
||||
optional_depends = """
|
||||
anvil,
|
||||
broken_tools,
|
||||
bucket,
|
||||
default,
|
||||
doors,
|
||||
env_sounds,
|
||||
ethereal,
|
||||
farming,
|
||||
moreblocks,
|
||||
node_entity_queue,
|
||||
player_api,
|
||||
player_monoids,
|
||||
stairs,
|
||||
stairsplus,
|
||||
stamina,
|
||||
technic,
|
||||
unified_inventory,
|
||||
wool,
|
||||
workbench
|
||||
"""
|
||||
|
@ -18,6 +18,7 @@ local v_sub = vector.subtract
|
||||
local get_safe_short_description = cottages.util.get_safe_short_description
|
||||
local resolve_item = cottages.util.resolve_item
|
||||
|
||||
local has_broken_tools = cottages.has.broken_tools
|
||||
local has_stamina = cottages.has.stamina
|
||||
|
||||
local repair_amount = cottages.settings.anvil.repair_amount
|
||||
@ -185,6 +186,11 @@ function anvil.use_anvil(pos, puncher)
|
||||
|
||||
-- do the actual repair
|
||||
tool:add_wear(-repair_amount)
|
||||
|
||||
if has_broken_tools then
|
||||
broken_tools.fix_tool(tool)
|
||||
end
|
||||
|
||||
inv:set_stack("input", 1, tool)
|
||||
|
||||
-- damage the hammer slightly
|
||||
|
Loading…
x
Reference in New Issue
Block a user