override anvil mod if present

This commit is contained in:
flux 2022-10-10 10:02:44 -07:00
parent e764a6d05c
commit e88660462f
No known key found for this signature in database
GPG Key ID: 9333B27816848A15
3 changed files with 14 additions and 4 deletions

View File

@ -6,4 +6,4 @@ description = Contains nodes for building medieval houses.
url = https://github.com/sokomine/cottages
version = 2022-09-29
depends = futil
optional_depends = 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, bucket, default, doors, env_sounds, ethereal, farming, moreblocks, node_entity_queue, player_api, player_monoids, stairs, stairsplus, stamina, technic, unified_inventory, wool, workbench

View File

@ -25,3 +25,11 @@ if cottages.has.technic then
cottages.anvil.make_unrepairable("technic:mining_drill_mk3_4")
cottages.anvil.make_unrepairable("technic:mining_drill_mk3_5")
end
if cottages.has.anvil then
minetest.clear_craft({output = "anvil:anvil"})
minetest.register_alias_force("anvil:anvil", "cottages:anvil")
minetest.clear_craft({output = "anvil:hammer"})
minetest.register_alias_force("anvil:hammer", "cottages:hammer")
end

View File

@ -1,5 +1,7 @@
local s = minetest.settings
local has_anvil_mod = not not cottages.has.anvil
cottages.settings = {
anvil = {
enabled = s:get_bool("cottages.anvil.enabled", true),
@ -9,9 +11,9 @@ cottages.settings = {
hud_timeout = tonumber(s:get("cottages.anvil.hud_timeout")) or 2, -- seconds
repair_amount = tonumber(s:get("cottages.anvil.repair_amount")) or 4369,
stamina = tonumber(s:get("cottages.anvil.stamina")) or 40,
formspec_enabled = s:get_bool("cottages.anvil.formspec_enabled", true),
tool_hud_enabled = s:get_bool("cottages.anvil.tool_hud_enabled", true),
tool_entity_enabled = s:get_bool("cottages.anvil.tool_entity_enabled", false),
formspec_enabled = s:get_bool("cottages.anvil.formspec_enabled", not has_anvil_mod),
tool_hud_enabled = s:get_bool("cottages.anvil.tool_hud_enabled", not has_anvil_mod),
tool_entity_enabled = s:get_bool("cottages.anvil.tool_entity_enabled", has_anvil_mod),
tool_entity_displacement = tonumber(s:get("cottages.anvil.tool_entity_displacement")) or 2 / 16,
},