From a5eef1c5de77fa7770877802e66c3e1c53f9a0da Mon Sep 17 00:00:00 2001 From: Vanessa Dannenberg Date: Wed, 24 Apr 2019 18:59:36 -0400 Subject: update castles, areas, homedecor, plantlife, gloopblocks, hotbar, inspector, maptools, mesecons, moreblocks, moreores, technic, teleport_request, and worldedit switched to caverealms_lite (with minor fixes by me) switched to CWz's fork of player_textures The homedecor update brings in the big split, and will require you to re-enable all modpack components in order to avoid loss of content. --- anvil/README.md | 4 +++- anvil/init.lua | 54 ++++++++++++++++++++++++++++++++++++----------- anvil/locale/de.po | 22 +++++++++++-------- anvil/locale/es.po | 4 ++++ anvil/locale/fr.po | 22 +++++++++++-------- anvil/locale/it.po | 22 +++++++++++-------- anvil/locale/template.pot | 22 +++++++++++-------- anvil/locale/update.bat | 6 ++++++ anvil/settingtypes.txt | 1 + 9 files changed, 108 insertions(+), 49 deletions(-) create mode 100644 anvil/locale/update.bat create mode 100644 anvil/settingtypes.txt (limited to 'anvil') diff --git a/anvil/README.md b/anvil/README.md index 227321f..f8cc4e7 100644 --- a/anvil/README.md +++ b/anvil/README.md @@ -1,3 +1,5 @@ Anvil mod by Sokomine, originally a part of the Cottages mod but extracted to stand alone. -This anvil (and its associated hammer) allows a player to repair worn tools. Place the worn tool in the anvil's inventory and strike it with the hammer to improve its condition. \ No newline at end of file +This anvil (and its associated hammer) allows a player to repair worn tools. Place the worn tool in the anvil's inventory and strike it with the hammer to improve its condition. + +By default, a hammer can be repaired on the anvil just like any other tool, allowing for infinite recycling of worn tools. Set "anvil_hammer_is_repairable false" to prevent this. \ No newline at end of file diff --git a/anvil/init.lua b/anvil/init.lua index fa554cd..324fba1 100644 --- a/anvil/init.lua +++ b/anvil/init.lua @@ -7,18 +7,32 @@ anvil = { setting = { - item_displacement = 7/16, + item_displacement = 2/16, } } minetest.register_alias("castle:anvil", "anvil:anvil") +local hammer_repairable = minetest.setting_getbool("anvil_hammer_is_repairable") +if hammer_repairable == nil then hammer_repairable = true end + +local make_unrepairable = function(item_name) + local item_def = minetest.registered_items[item_name] + if item_def then + item_def.groups.not_repaired_by_anvil = 1 + minetest.override_item(item_name, {groups = item_def.groups}) + end +end +make_unrepairable("technic:water_can") +make_unrepairable("technic:lava_can") + -- internationalization boilerplate local MP = minetest.get_modpath(minetest.get_current_modname()) local S, NS = dofile(MP.."/intllib.lua") -- the hammer for the anvil -minetest.register_tool("anvil:hammer", { + +local hammer_def = { description = S("Steel blacksmithing hammer"), _doc_items_longdesc = S("A tool for repairing other tools at a blacksmith's anvil."), _doc_items_usagehelp = S("Use this hammer to strike blows upon an anvil bearing a damaged tool and you can repair it. It can also be used for smashing stone, but it is not well suited to this task."), @@ -34,7 +48,13 @@ minetest.register_tool("anvil:hammer", { }, damage_groups = {fleshy=6}, } -}) +} + +if not hammer_repairable then + hammer_def.groups = {["not_repaired_by_anvil"] = 1} +end + +minetest.register_tool("anvil:hammer", hammer_def) local tmp = {} @@ -92,7 +112,14 @@ local update_item = function(pos, node) tmp.texture = inv:get_stack("input", 1):get_name() local e = minetest.add_entity(pos,"anvil:item") local yaw = math.pi*2 - node.param2 * math.pi/2 - e:setyaw(yaw) + if e.set_rotation == nil then + -- This is for 0.4.16 support, remove it eventually + e:set_yaw(yaw) + pos.y = pos.y + 5/16 + e:set_pos(pos) + else + e:set_rotation({x=-1.5708, y=yaw, z=0}) -- x is pitch, 1.5708 is 90 degrees. + end end end @@ -161,14 +188,17 @@ minetest.register_node("anvil:anvil", { if listname~="input" then return 0 end - if (listname=='input' - and(stack:get_wear() == 0 - or minetest.get_item_group(stack:get_name(), "not_repaired_by_anvil") ~= 0 - or stack:get_name() == "technic:water_can" - or stack:get_name() == "technic:lava_can" )) then - - minetest.chat_send_player( player:get_player_name(), S('This anvil is for damaged tools only.')) - return 0 + if (listname=='input') then + if (stack:get_wear() == 0) then + minetest.chat_send_player( player:get_player_name(), S('This anvil is for damaged tools only.')) + return 0 + end + + if (minetest.get_item_group(stack:get_name(), "not_repaired_by_anvil") ~= 0) then + local item_def = minetest.registered_items[stack:get_name()] + minetest.chat_send_player( player:get_player_name(), S('@1 cannot be repaired with an anvil.', item_def.description)) + return 0 + end end if meta:get_inventory():room_for_item("input", stack) then diff --git a/anvil/locale/de.po b/anvil/locale/de.po index 80a33a6..0d15a06 100644 --- a/anvil/locale/de.po +++ b/anvil/locale/de.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-03-07 22:17-0700\n" +"POT-Creation-Date: 2019-04-14 21:16-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: XanthinLanguage-Team: LANGUAGE \n" "Language: \n" @@ -16,32 +16,32 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: init.lua:19 +#: init.lua:36 msgid "Steel blacksmithing hammer" msgstr "" -#: init.lua:20 +#: init.lua:37 #, fuzzy msgid "A tool for repairing other tools at a blacksmith's anvil." msgstr "Stahlhammer um Werkzeuge auf dem Amboss zu reparieren" -#: init.lua:21 +#: init.lua:38 msgid "" "Use this hammer to strike blows upon an anvil bearing a damaged tool and you " "can repair it. It can also be used for smashing stone, but it is not well " "suited to this task." msgstr "" -#: init.lua:98 +#: init.lua:136 msgid "Anvil" msgstr "Amboss" -#: init.lua:99 +#: init.lua:137 msgid "" "A tool for repairing other tools in conjunction with a blacksmith's hammer." msgstr "" -#: init.lua:100 +#: init.lua:138 msgid "" "Right-click on this anvil with a damaged tool to place the damaged tool upon " "it. You can then repair the damaged tool by striking it with a blacksmith's " @@ -50,12 +50,16 @@ msgid "" "hand." msgstr "" -#: init.lua:155 +#: init.lua:193 #, fuzzy msgid "This anvil is for damaged tools only." msgstr "Das Werkstueckfeld gilt nur fuer beschaedigtes Werkzeug." -#: init.lua:267 +#: init.lua:199 +msgid "@1 cannot be repaired with an anvil." +msgstr "" + +#: init.lua:325 msgid "Your @1 has been repaired successfully." msgstr "" diff --git a/anvil/locale/es.po b/anvil/locale/es.po index 167dbb4..8e9216b 100644 --- a/anvil/locale/es.po +++ b/anvil/locale/es.po @@ -60,6 +60,10 @@ msgstr "" msgid "This anvil is for damaged tools only." msgstr "Este yunque es sólo para herramientas dañadas" +#: init.lua:199 +msgid "@1 cannot be repaired with an anvil." +msgstr "" + #: init.lua:267 msgid "Your @1 has been repaired successfully." msgstr "Su @1 ha sido reparado correctamente." diff --git a/anvil/locale/fr.po b/anvil/locale/fr.po index 66cc21d..788b9a4 100644 --- a/anvil/locale/fr.po +++ b/anvil/locale/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-06-26 12:18+0200\n" +"POT-Creation-Date: 2019-04-14 21:16-0600\n" "PO-Revision-Date: 2017-06-26 12:22+0200\n" "Last-Translator: \n" "Language-Team: \n" @@ -18,15 +18,15 @@ msgstr "" "X-Generator: Poedit 2.0.2\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: init.lua:19 +#: init.lua:36 msgid "Steel blacksmithing hammer" msgstr "Marteau de forgeron en acier" -#: init.lua:20 +#: init.lua:37 msgid "A tool for repairing other tools at a blacksmith's anvil." msgstr "Un outil pour réparer les autres outils avec une enclume de forgeron." -#: init.lua:21 +#: init.lua:38 msgid "" "Use this hammer to strike blows upon an anvil bearing a damaged tool and you " "can repair it. It can also be used for smashing stone, but it is not well " @@ -36,18 +36,18 @@ msgstr "" "ainsi vous pourrez le réparer. Il peut être aussi utilisé pour casser de la " "pierre, mais il n'est pas adapté à cette tâche." -#: init.lua:98 +#: init.lua:136 msgid "Anvil" msgstr "Enclume" -#: init.lua:99 +#: init.lua:137 msgid "" "A tool for repairing other tools in conjunction with a blacksmith's hammer." msgstr "" "Un outil pour réparer les autres outils à utiliser avec un marteau de " "forgeron." -#: init.lua:100 +#: init.lua:138 msgid "" "Right-click on this anvil with a damaged tool to place the damaged tool upon " "it. You can then repair the damaged tool by striking it with a blacksmith's " @@ -61,10 +61,14 @@ msgstr "" "l'outil entièrement. Pour récupérer l'outil, frappez dessus ou faites un " "click-droit en ayant la main vide." -#: init.lua:155 +#: init.lua:193 msgid "This anvil is for damaged tools only." msgstr "L'enclume s'utilise sur les outils endommagés." -#: init.lua:267 +#: init.lua:199 +msgid "@1 cannot be repaired with an anvil." +msgstr "" + +#: init.lua:325 msgid "Your @1 has been repaired successfully." msgstr "Votre @1 a été réparé avec succès." diff --git a/anvil/locale/it.po b/anvil/locale/it.po index 3659a1d..826625a 100644 --- a/anvil/locale/it.po +++ b/anvil/locale/it.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Italian locale file for the Anvil module\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-03-07 22:17-0700\n" +"POT-Creation-Date: 2019-04-14 21:16-0600\n" "PO-Revision-Date: 2017-08-18 16:14+0100\n" "Last-Translator: H4mlet \n" "Language-Team: \n" @@ -18,15 +18,15 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Generator: Poedit 1.6.10\n" -#: init.lua:19 +#: init.lua:36 msgid "Steel blacksmithing hammer" msgstr "Martello da fabbro di acciaio" -#: init.lua:20 +#: init.lua:37 msgid "A tool for repairing other tools at a blacksmith's anvil." msgstr "Un attrezzo per riparare altri attrezzi su di una incudine da fabbro." -#: init.lua:21 +#: init.lua:38 msgid "" "Use this hammer to strike blows upon an anvil bearing a damaged tool and you " "can repair it. It can also be used for smashing stone, but it is not well " @@ -36,16 +36,16 @@ msgstr "" "danneggiato e potrete ripararlo. Può anche essere usato per colpire la " "pietra, ma non è molto adatto a questo compito." -#: init.lua:98 +#: init.lua:136 msgid "Anvil" msgstr "Incudine" -#: init.lua:99 +#: init.lua:137 msgid "" "A tool for repairing other tools in conjunction with a blacksmith's hammer." msgstr "Un attrezzo per riparare altri attrezzi usando un martello da fabbro." -#: init.lua:100 +#: init.lua:138 msgid "" "Right-click on this anvil with a damaged tool to place the damaged tool upon " "it. You can then repair the damaged tool by striking it with a blacksmith's " @@ -59,10 +59,14 @@ msgstr "" "gravemente danneggiato. Per riprendere l'attrezzo colpite o fate click " "destro sull'incudine a mani vuote." -#: init.lua:155 +#: init.lua:193 msgid "This anvil is for damaged tools only." msgstr "Questa incudine è solo per attrezzi danneggiati." -#: init.lua:267 +#: init.lua:199 +msgid "@1 cannot be repaired with an anvil." +msgstr "" + +#: init.lua:325 msgid "Your @1 has been repaired successfully." msgstr "La/il vostr* @1 è stat* riparat* con successo." diff --git a/anvil/locale/template.pot b/anvil/locale/template.pot index 0be726a..44c68c3 100644 --- a/anvil/locale/template.pot +++ b/anvil/locale/template.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-03-07 22:17-0700\n" +"POT-Creation-Date: 2019-04-14 21:16-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,31 +17,31 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: init.lua:19 +#: init.lua:36 msgid "Steel blacksmithing hammer" msgstr "" -#: init.lua:20 +#: init.lua:37 msgid "A tool for repairing other tools at a blacksmith's anvil." msgstr "" -#: init.lua:21 +#: init.lua:38 msgid "" "Use this hammer to strike blows upon an anvil bearing a damaged tool and you " "can repair it. It can also be used for smashing stone, but it is not well " "suited to this task." msgstr "" -#: init.lua:98 +#: init.lua:136 msgid "Anvil" msgstr "" -#: init.lua:99 +#: init.lua:137 msgid "" "A tool for repairing other tools in conjunction with a blacksmith's hammer." msgstr "" -#: init.lua:100 +#: init.lua:138 msgid "" "Right-click on this anvil with a damaged tool to place the damaged tool upon " "it. You can then repair the damaged tool by striking it with a blacksmith's " @@ -50,10 +50,14 @@ msgid "" "hand." msgstr "" -#: init.lua:155 +#: init.lua:193 msgid "This anvil is for damaged tools only." msgstr "" -#: init.lua:267 +#: init.lua:199 +msgid "@1 cannot be repaired with an anvil." +msgstr "" + +#: init.lua:325 msgid "Your @1 has been repaired successfully." msgstr "" diff --git a/anvil/locale/update.bat b/anvil/locale/update.bat new file mode 100644 index 0000000..e87d44c --- /dev/null +++ b/anvil/locale/update.bat @@ -0,0 +1,6 @@ +@echo off +setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION +cd .. +set LIST= +for /r %%X in (*.lua) do set LIST=!LIST! %%X +..\intllib\tools\xgettext.bat %LIST% \ No newline at end of file diff --git a/anvil/settingtypes.txt b/anvil/settingtypes.txt new file mode 100644 index 0000000..9b845cc --- /dev/null +++ b/anvil/settingtypes.txt @@ -0,0 +1 @@ +anvil_hammer_is_repairable (Hammer can be repaired on anvil) bool true -- cgit v1.2.3