From 3d08b568ad1da1e3259a66cb91fd1039781c75cb Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Tue, 26 Sep 2017 00:11:57 -0400 Subject: update castles modpack, boost_cart, homedecor, currency, farming redo, framed glass, gloopblocks, mesecons, moreblocks, pipeworks, signs_lib, technic, unified mesecons, and worldedit created a new tag for this release (this will be standard procedure from now on) --- anvil/locale/fr.po | 70 + anvil/locale/it.po | 68 + boost_cart/README.txt | 23 +- boost_cart/functions.lua | 4 +- boost_cart/init.lua | 7 - castle_farming/locale/pt_br.po | 30 + castle_gates/gate_slots.lua | 15 +- castle_lighting/locale/it.po | 55 + castle_masonry/depends.txt | 3 +- castle_masonry/locale/fr.po | 189 +++ castle_masonry/locale/it.po | 191 +++ castle_masonry/pillars.lua | 8 +- castle_shields/locale/it.po | 23 + castle_storage/locale/it.po | 56 + castle_tapestries/locale/it.po | 35 + castle_weapons/locale/it.po | 31 + computer/locale/ru.txt | 6 + currency/locale/ru.po | 4 +- currency/safe.lua | 61 +- fake_fire/init.lua | 2 +- farming/README.txt | 7 +- farming/barley.lua | 2 + farming/beanpole.lua | 2 +- farming/chili.lua | 88 ++ farming/cocoa.lua | 2 +- farming/cotton.lua | 43 +- farming/donut.lua | 35 +- farming/farming.conf_example | 4 + farming/grapes.lua | 2 +- farming/grass.lua | 1 + farming/hoes.lua | 6 + farming/init.lua | 209 ++- farming/intllib.lua | 45 + farming/locale/de.po | 262 ++++ farming/locale/pt.po | 258 ++++ farming/locale/template.pot | 258 ++++ farming/lucky_block.lua | 2 + farming/mapgen.lua | 25 +- farming/textures/farming_chili_1.png | Bin 0 -> 113 bytes farming/textures/farming_chili_2.png | Bin 0 -> 107 bytes farming/textures/farming_chili_3.png | Bin 0 -> 137 bytes farming/textures/farming_chili_4.png | Bin 0 -> 144 bytes farming/textures/farming_chili_5.png | Bin 0 -> 154 bytes farming/textures/farming_chili_6.png | Bin 0 -> 157 bytes farming/textures/farming_chili_7.png | Bin 0 -> 169 bytes farming/textures/farming_chili_8.png | Bin 0 -> 169 bytes farming/textures/farming_chili_bowl.png | Bin 0 -> 183 bytes farming/textures/farming_chili_pepper.png | Bin 0 -> 194 bytes farming/textures/farming_cotton.png | Bin 166 -> 316 bytes farming/textures/farming_porridge.png | Bin 0 -> 193 bytes farming/textures/farming_string.png | Bin 0 -> 166 bytes farming/wheat.lua | 24 +- framedglass/init.lua | 44 +- gloopblocks/locale/ru.po | 176 +++ homedecor/exterior.lua | 4 +- homedecor/handlers/expansion.lua | 8 - homedecor/window_treatments.lua | 2 +- homedecor_i18n/locale/de.po | 78 +- homedecor_i18n/locale/ru.po | 1576 ++++++++++++++++++++ mesecons_button/init.lua | 16 +- mesecons_lightstone/init.lua | 6 + .../textures/jeija_lightstone_cyan_off.png | Bin 0 -> 443 bytes .../textures/jeija_lightstone_cyan_on.png | Bin 0 -> 663 bytes .../textures/jeija_lightstone_magenta_off.png | Bin 0 -> 387 bytes .../textures/jeija_lightstone_magenta_on.png | Bin 0 -> 633 bytes .../textures/jeija_lightstone_orange_off.png | Bin 0 -> 407 bytes .../textures/jeija_lightstone_orange_on.png | Bin 0 -> 641 bytes .../textures/jeija_lightstone_pink_off.png | Bin 0 -> 349 bytes .../textures/jeija_lightstone_pink_on.png | Bin 0 -> 546 bytes .../textures/jeija_lightstone_violet_off.png | Bin 0 -> 387 bytes .../textures/jeija_lightstone_violet_on.png | Bin 0 -> 633 bytes .../textures/jeija_lightstone_white_off.png | Bin 0 -> 429 bytes .../textures/jeija_lightstone_white_on.png | Bin 0 -> 357 bytes mesecons_microcontroller/init.lua | 29 +- mesecons_mvps/init.lua | 8 + mesecons_wires/init.lua | 3 +- moreblocks/circular_saw.lua | 2 +- moreblocks/config.lua | 4 +- moreblocks/crafting.lua | 2 +- moreblocks/init.lua | 10 +- moreblocks/stairsplus/init.lua | 2 +- moreblocks/stairsplus/registrations.lua | 7 + pipeworks/LICENSE | 191 +++ pipeworks/compat-chests.lua | 13 +- pipeworks/default_settings.lua | 2 + pipeworks/filter-injector.lua | 95 +- pipeworks/init.lua | 2 + pipeworks/item_transport.lua | 11 +- pipeworks/lua_tube.lua | 850 +++++++++++ pipeworks/models.lua | 4 +- pipeworks/settingtypes.txt | 9 +- pipeworks/signal_tubes.lua | 83 +- .../pipeworks_digiline_conductor_tube_end.png | Bin 0 -> 174 bytes .../pipeworks_digiline_conductor_tube_inv.png | Bin 0 -> 337 bytes .../pipeworks_digiline_conductor_tube_noctr.png | Bin 0 -> 179 bytes .../pipeworks_digiline_conductor_tube_plain.png | Bin 0 -> 169 bytes .../pipeworks_digiline_conductor_tube_short.png | Bin 0 -> 162 bytes .../textures/pipeworks_lua_tube_port_burnt.png | Bin 0 -> 178 bytes pipeworks/textures/pipeworks_lua_tube_port_off.png | Bin 0 -> 178 bytes pipeworks/textures/pipeworks_lua_tube_port_on.png | Bin 0 -> 178 bytes poisonivy/locale/pt_BR.txt | 5 + signs_lib/init.lua | 11 - technic/machines/HV/nuclear_reactor.lua | 2 +- unifiedmesecons/init.lua | 4 + worldedit/init.lua | 9 +- worldedit/manipulations.lua | 23 + worldedit/primitives.lua | 88 +- worldedit_commands/init.lua | 145 +- worldedit_commands/safe.lua | 11 +- worldedit_gui/functionality.lua | 82 +- worldedit_gui/init.lua | 94 +- .../textures/inventory_plus_worldedit_gui.png | Bin 25175 -> 21724 bytes worldedit_shortcommands/init.lua | 1 + 113 files changed, 5390 insertions(+), 478 deletions(-) create mode 100644 anvil/locale/fr.po create mode 100644 anvil/locale/it.po create mode 100644 castle_farming/locale/pt_br.po create mode 100644 castle_lighting/locale/it.po create mode 100644 castle_masonry/locale/fr.po create mode 100644 castle_masonry/locale/it.po create mode 100644 castle_shields/locale/it.po create mode 100644 castle_storage/locale/it.po create mode 100644 castle_tapestries/locale/it.po create mode 100644 castle_weapons/locale/it.po create mode 100644 computer/locale/ru.txt create mode 100644 farming/chili.lua create mode 100644 farming/intllib.lua create mode 100644 farming/locale/de.po create mode 100644 farming/locale/pt.po create mode 100644 farming/locale/template.pot create mode 100644 farming/textures/farming_chili_1.png create mode 100644 farming/textures/farming_chili_2.png create mode 100644 farming/textures/farming_chili_3.png create mode 100644 farming/textures/farming_chili_4.png create mode 100644 farming/textures/farming_chili_5.png create mode 100644 farming/textures/farming_chili_6.png create mode 100644 farming/textures/farming_chili_7.png create mode 100644 farming/textures/farming_chili_8.png create mode 100644 farming/textures/farming_chili_bowl.png create mode 100644 farming/textures/farming_chili_pepper.png create mode 100644 farming/textures/farming_porridge.png create mode 100644 farming/textures/farming_string.png create mode 100644 gloopblocks/locale/ru.po create mode 100644 homedecor_i18n/locale/ru.po create mode 100644 mesecons_lightstone/textures/jeija_lightstone_cyan_off.png create mode 100644 mesecons_lightstone/textures/jeija_lightstone_cyan_on.png create mode 100644 mesecons_lightstone/textures/jeija_lightstone_magenta_off.png create mode 100644 mesecons_lightstone/textures/jeija_lightstone_magenta_on.png create mode 100644 mesecons_lightstone/textures/jeija_lightstone_orange_off.png create mode 100644 mesecons_lightstone/textures/jeija_lightstone_orange_on.png create mode 100644 mesecons_lightstone/textures/jeija_lightstone_pink_off.png create mode 100644 mesecons_lightstone/textures/jeija_lightstone_pink_on.png create mode 100644 mesecons_lightstone/textures/jeija_lightstone_violet_off.png create mode 100644 mesecons_lightstone/textures/jeija_lightstone_violet_on.png create mode 100644 mesecons_lightstone/textures/jeija_lightstone_white_off.png create mode 100644 mesecons_lightstone/textures/jeija_lightstone_white_on.png create mode 100644 pipeworks/lua_tube.lua create mode 100644 pipeworks/textures/pipeworks_digiline_conductor_tube_end.png create mode 100644 pipeworks/textures/pipeworks_digiline_conductor_tube_inv.png create mode 100644 pipeworks/textures/pipeworks_digiline_conductor_tube_noctr.png create mode 100644 pipeworks/textures/pipeworks_digiline_conductor_tube_plain.png create mode 100644 pipeworks/textures/pipeworks_digiline_conductor_tube_short.png create mode 100644 pipeworks/textures/pipeworks_lua_tube_port_burnt.png create mode 100644 pipeworks/textures/pipeworks_lua_tube_port_off.png create mode 100644 pipeworks/textures/pipeworks_lua_tube_port_on.png create mode 100644 poisonivy/locale/pt_BR.txt diff --git a/anvil/locale/fr.po b/anvil/locale/fr.po new file mode 100644 index 0000000..66cc21d --- /dev/null +++ b/anvil/locale/fr.po @@ -0,0 +1,70 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-26 12:18+0200\n" +"PO-Revision-Date: 2017-06-26 12:22+0200\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: fr_FR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.0.2\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#: init.lua:19 +msgid "Steel blacksmithing hammer" +msgstr "Marteau de forgeron en acier" + +#: init.lua:20 +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 +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 "" +"Utilisez ce marteau pour frapper une enclume contenant un outil endommagé, " +"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 +msgid "Anvil" +msgstr "Enclume" + +#: init.lua:99 +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 +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 " +"hammer. Repeated blows may be necessary to fully repair a badly worn tool. " +"To retrieve the tool either punch or right-click the anvil with an empty " +"hand." +msgstr "" +"Cliquez-droit sur cette enclume avec un outil endommagé pour le placer " +"dessus. Vous pourrez alors réparer l'outil endommagé en le frappant avec un " +"marteau de forgeron. Des coups successifs seront nécessaires pour réparer " +"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 +msgid "This anvil is for damaged tools only." +msgstr "L'enclume s'utilise sur les outils endommagés." + +#: init.lua:267 +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 new file mode 100644 index 0000000..3659a1d --- /dev/null +++ b/anvil/locale/it.po @@ -0,0 +1,68 @@ +# ITALIAN LOCALE FILE FOR THE ANVIL MODULE +# Copyright (C) 2017 Sokomine +# This file is distributed under the same license as the ANVIL package. +# Hamlet , 2017. +# +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" +"PO-Revision-Date: 2017-08-18 16:14+0100\n" +"Last-Translator: H4mlet \n" +"Language-Team: \n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 1.6.10\n" + +#: init.lua:19 +msgid "Steel blacksmithing hammer" +msgstr "Martello da fabbro di acciaio" + +#: init.lua:20 +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 +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 "" +"Usate questo martello per colpire una incudine su cui è posto un attrezzo " +"danneggiato e potrete ripararlo. Può anche essere usato per colpire la " +"pietra, ma non è molto adatto a questo compito." + +#: init.lua:98 +msgid "Anvil" +msgstr "Incudine" + +#: init.lua:99 +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 +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 " +"hammer. Repeated blows may be necessary to fully repair a badly worn tool. " +"To retrieve the tool either punch or right-click the anvil with an empty " +"hand." +msgstr "" +"Fate click destro su questa incudine con un attrezzo danneggiato per " +"metterlo sull'incudine. Poi potrete ripararlo colpendolo con un martello da " +"fabbro. Potrebbero essere necessari più colpi per riparare un attrezzo " +"gravemente danneggiato. Per riprendere l'attrezzo colpite o fate click " +"destro sull'incudine a mani vuote." + +#: init.lua:155 +msgid "This anvil is for damaged tools only." +msgstr "Questa incudine è solo per attrezzi danneggiati." + +#: init.lua:267 +msgid "Your @1 has been repaired successfully." +msgstr "La/il vostr* @1 è stat* riparat* con successo." diff --git a/boost_cart/README.txt b/boost_cart/README.txt index 9442926..994a6ef 100644 --- a/boost_cart/README.txt +++ b/boost_cart/README.txt @@ -1,8 +1,8 @@ Minetest mod: boost_cart ========================== Based on (and fully compatible with) the mod "carts" by PilzAdam -Also compatible with the carts mod in the subgame "minetest_game". -Target: Run smoothly as possible even on laggy server +and the one contained in the subgame "minetest_game". +Target: Run smoothly as possible, even on laggy servers. Features @@ -12,8 +12,25 @@ Target: Run smoothly as possible even on laggy server - Boost and brake rails - By mesecons controlled Start-Stop rails - Detector rails that send a mesecons signal when the cart drives over them -- Rail junction switching with the 'right-left' walking keys +- Rail junction switching with the 'right/left' walking keys - Handbrake with the 'back' key +- Support for non-minetest_game subgames + + + Settings +---------- +This mod can be adjusted to fit the conditions of a player or server. +Use the Advanced Settings dialog in the main menu or tune your +minetest.conf file manually: + +boost_cart.speed_max = 10 + ^ Possible values: 1 ... 100 + ^ Maximal speed of the cart in m/s + +boost_cart.punch_speed_max = 7 + ^ Possible values: -1 ... 100 + ^ Maximal speed to which the driving player can accelerate the cart + by punching from inside the cart. -1 will disable this feature. License for everything diff --git a/boost_cart/functions.lua b/boost_cart/functions.lua index 1332578..86f8535 100644 --- a/boost_cart/functions.lua +++ b/boost_cart/functions.lua @@ -18,7 +18,9 @@ function boost_cart:manage_attachment(player, obj) default.player_attached[player_name] = status if status then - player:set_attach(obj, "", {x=0, y=6, z=0}, {x=0, y=0, z=0}) + -- player_api came after the new model. Check for it. + local y_pos = player_api and -4.5 or 6 + player:set_attach(obj, "", {x=0, y=y_pos, z=0}, {x=0, y=0, z=0}) player:set_eye_offset({x=0, y=-4, z=0},{x=0, y=-4, z=0}) else player:set_detach() diff --git a/boost_cart/init.lua b/boost_cart/init.lua index b9e0c67..9bcd785 100644 --- a/boost_cart/init.lua +++ b/boost_cart/init.lua @@ -16,13 +16,6 @@ boost_cart.speed_max = tonumber(setting_getter("boost_cart.speed_max")) or 10 -- Set to -1 to disable punching the cart from inside boost_cart.punch_speed_max = tonumber(setting_getter("boost_cart.punch_speed_max")) or 7 - -if not boost_cart.modpath then - -- For Minetest 0.4.12 and older that don't look at the "mod.conf" file - error("\nWrong mod directory name! Please change it to 'boost_cart'.\n" .. - "See also: http://dev.minetest.net/Installing_Mods") -end - -- Support for non-default games if not default.player_attached then default.player_attached = {} diff --git a/castle_farming/locale/pt_br.po b/castle_farming/locale/pt_br.po new file mode 100644 index 0000000..6030f97 --- /dev/null +++ b/castle_farming/locale/pt_br.po @@ -0,0 +1,30 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2017 +# This file is distributed under the same license as the castle_farming package. +# Caio Roberto , 2017. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-02-27 00:59-0700\n" +"PO-Revision-Date: 2017-06-29 13:00-0330\n" +"Last-Translator: Caio Roberto \n" +"Language-Team: Paulo Slomp FACED UFRGS <00009228@ufrgs.br>\n" +"Language: Brazilian Portuguese\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: hides.lua:9 +msgid "Hides" +msgstr "Esconde-se" + +#: straw.lua:13 +msgid "Bound Straw" +msgstr "Palha Amarrada" + +#: straw.lua:22 +msgid "Training Dummy" +msgstr "Vaca Parada de Madeira (para Laço)" diff --git a/castle_gates/gate_slots.lua b/castle_gates/gate_slots.lua index 8f3c095..e2c6287 100644 --- a/castle_gates/gate_slots.lua +++ b/castle_gates/gate_slots.lua @@ -91,34 +91,33 @@ castle_gates.register_gate_slot = function(material) minetest.register_craft({ - output = mod_name..":"..material.name.."_portcullis_slot 3", + output = mod_name..":"..material.name.."_gate_slot 2", recipe = { - {material.craft_material,"",material.craft_material}, {material.craft_material,"",material.craft_material}, {material.craft_material,"",material.craft_material}, }, }) minetest.register_craft({ - output = mod_name..":"..material.name.."_portcullis_slot", + output = mod_name..":"..material.name.."_gate_slot", type = "shapeless", - recipe = {mod_name..":"..material.name.."_portcullis_slot_reverse"}, + recipe = {mod_name..":"..material.name.."_gate_slot_reverse"}, }) minetest.register_craft({ - output = mod_name..":"..material.name.."_portcullis_slot_reverse", + output = mod_name..":"..material.name.."_gate_slot_reverse", type = "shapeless", - recipe = {mod_name..":"..material.name.."_portcullis_slot"}, + recipe = {mod_name..":"..material.name.."_gate_slot"}, }) if burn_time > 0 then minetest.register_craft({ type = "fuel", - recipe = mod_name..":"..material.name.."_portcullis_slot", + recipe = mod_name..":"..material.name.."_gate_slot", burntime = burn_time * 2, }) minetest.register_craft({ type = "fuel", - recipe = mod_name..":"..material.name.."_portcullis_slot_reverse", + recipe = mod_name..":"..material.name.."_gate_slot_reverse", burntime = burn_time * 2, }) end diff --git a/castle_lighting/locale/it.po b/castle_lighting/locale/it.po new file mode 100644 index 0000000..5acbb71 --- /dev/null +++ b/castle_lighting/locale/it.po @@ -0,0 +1,55 @@ +# ITALIAN LOCALE FILE FOR THE CASTLE LIGHTING MODULE +# Copyright (C) 2017 Philipbenr And DanDuncombe +# This file is distributed under the same license as the CASTLE LIGHTING package. +# Hamlet , 2017. +# +msgid "" +msgstr "" +"Project-Id-Version: Castle Lighting\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-03-01 23:52-0700\n" +"PO-Revision-Date: 2017-09-10 22:00+0100\n" +"Last-Translator: H4mlet \n" +"Language-Team: \n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 1.6.10\n" + +#: brasier.lua:7 +msgid "A brasier for producing copious amounts of light and heat." +msgstr "Un braciere per produrre grandi quantità di luce e calore." + +#: brasier.lua:8 +msgid "" +"To ignite the brasier place a flammable fuel in its inventory slot. A lump " +"of coal will burn for about half an hour." +msgstr "" +"Per accendere il braciere mettete del combustibile nella sua casella di " +"inventario. Un grumo di carbone brucerà per circa mezz'ora." + +#: brasier.lua:107 +msgid "Floor Brasier" +msgstr "Braciere da pavimento" + +#: brasier.lua:156 +msgid "Stonebrick" +msgstr "Mattoni di pietra" + +#: brasier.lua:228 +msgid "@1 Brasier" +msgstr "Braciere di @1" + +#: init.lua:17 +msgid "Light Block" +msgstr "Lampada" + +#: init.lua:37 +msgid "Chandelier" +msgstr "Candeliere" + +#: init.lua:76 +msgid "Chandelier Chain" +msgstr "Catena per candeliere" diff --git a/castle_masonry/depends.txt b/castle_masonry/depends.txt index 206a637..7c6d7fb 100644 --- a/castle_masonry/depends.txt +++ b/castle_masonry/depends.txt @@ -3,4 +3,5 @@ moreblocks? stairs? building_blocks? asphalt? -streets? \ No newline at end of file +streets? +intllib? diff --git a/castle_masonry/locale/fr.po b/castle_masonry/locale/fr.po new file mode 100644 index 0000000..5a73d18 --- /dev/null +++ b/castle_masonry/locale/fr.po @@ -0,0 +1,189 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-02-21 23:41-0700\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: arrow_slits.lua:12 +msgid "@1 Arrowslit" +msgstr "Meurtrière en @1" + +#: arrow_slits.lua:33 +msgid "@1 Arrowslit with Cross" +msgstr "Meurtrière en croix en @1" + +#: arrow_slits.lua:58 +msgid "@1 Arrowslit with Hole" +msgstr "Meurtrière avec trou en @1" + +#: arrow_slits.lua:81 +msgid "@1 Embrasure" +msgstr "Embrasure en @1" + +#: init.lua:29 +msgid "Stonewall" +msgstr "Pierre brune" + +#: init.lua:32 +msgid "Cobble" +msgstr "Pavé" + +#: init.lua:35 +msgid "Stonebrick" +msgstr "Brique de pierre" + +#: init.lua:38 +msgid "Sandstone Brick" +msgstr "Brique de grès" + +#: init.lua:41 +msgid "Desert Stone Brick" +msgstr "Brique de pierre du désert" + +#: init.lua:44 +msgid "Stone" +msgstr "Pierre" + +#: init.lua:47 +msgid "Sandstone" +msgstr "Grès" + +#: init.lua:50 +msgid "Desert Stone" +msgstr "Pierre du désert" + +#: init.lua:53 +msgid "Wood" +msgstr "Bois" + +#: init.lua:56 +msgid "Ice" +msgstr "Glace" + +#: init.lua:59 +msgid "Snow" +msgstr "Neige" + +#: init.lua:62 +msgid "Obsidian Brick" +msgstr "Brique d'obsidienne" + +#: murder_holes.lua:14 +msgid "@1 Murder Hole" +msgstr "Trou en @1" + +#: murder_holes.lua:33 +msgid "@1 Machicolation" +msgstr "Machicoulis en @1" + +#: paving.lua:11 +msgid "Paving Stone" +msgstr "Pierre de pavage" + +#: paving.lua:30 +msgid "Pavement Brick" +msgstr "Brique de pavage" + +#: paving.lua:40 +msgid "Castle Pavement Stair" +msgstr "Escaliers de chateau pavé" + +#: paving.lua:41 +msgid "Castle Pavement Slab" +msgstr "Dalle de chateau pavé" + +#: paving.lua:49 +msgid "Roof Slates" +msgstr "Toiture en ardoise" + +#: pillars.lua:18 +msgid "@1 Pillar Base" +msgstr "Base de pilier en @1" + +#: pillars.lua:36 +msgid "@1 Half Pillar Base" +msgstr "Base de demi pilier en @1" + +#: pillars.lua:54 +msgid "@1 Pillar Top" +msgstr "Haut de pilier en @1" + +#: pillars.lua:72 +msgid "@1 Half Pillar Top" +msgstr "Haut de demi pilier en @1" + +#: pillars.lua:90 +msgid "@1 Pillar Middle" +msgstr "Milieu de pilier en @1" + +#: pillars.lua:106 +msgid "@1 Half Pillar Middle" +msgstr "Milieu de demi pilier en @1" + +#: pillars.lua:123 +msgid "@1 Crossbrace" +msgstr "Travers en @1" + +#: pillars.lua:147 +msgid "@1 Extended Crossbrace" +msgstr "Travers entendu en @1" + +#: stone_wall.lua:11 +msgid "Castle Wall" +msgstr "Pierre brune" + +#: stone_wall.lua:22 +msgid "Castle Rubble" +msgstr "Gravats de chateau" + +#: stone_wall.lua:57 +msgid "Castle Corner" +msgstr "Angle de chateau" + +#: stone_wall.lua:78 +msgid "Stone Wall" +msgstr "Mur de pierre" + +#: stone_wall.lua:86 +msgid "Rubble" +msgstr "Décombre" + +#: stone_wall.lua:100 +msgid "Castle Stonewall Stair" +msgstr "Escalier en pierre brune" + +#: stone_wall.lua:101 +msgid "Castle Stonewall Slab" +msgstr "Dalle en pierre brune" + +#: stone_wall.lua:108 +msgid "Castle Rubble Stair" +msgstr "Escalier en gravats de chateau" + +#: stone_wall.lua:109 +msgid "Castle Rubble Slab" +msgstr "Dalle en gravats de chateau" + +#: stone_wall.lua:117 stone_wall.lua:143 +msgid "Dungeon Stone" +msgstr "Pierre de dongeon" + +#: stone_wall.lua:156 +msgid "Dungeon Stone Stair" +msgstr "Escalier en pierre de dongeon" + +#: stone_wall.lua:157 +msgid "Dungeon Stone Slab" +msgstr "Dalle en pierre de dongeon" diff --git a/castle_masonry/locale/it.po b/castle_masonry/locale/it.po new file mode 100644 index 0000000..3b71932 --- /dev/null +++ b/castle_masonry/locale/it.po @@ -0,0 +1,191 @@ +# ITALIAN LOCALE FILE FOR THE CASTLE MASONRY MODULE +# Copyright (C) 2017 Philipbenr And DanDuncombe +# This file is distributed under the same license as the CASTLE MASONRY package. +# Hamlet , 2017. +# +msgid "" +msgstr "" +"Project-Id-Version: Castle Masonry\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-02-21 23:41-0700\n" +"PO-Revision-Date: 2017-09-10 22:36+0100\n" +"Last-Translator: H4mlet \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Language: it\n" +"X-Generator: Poedit 1.6.10\n" + +#: arrow_slits.lua:12 +msgid "@1 Arrowslit" +msgstr "Feritoia per frecce di @1" + +#: arrow_slits.lua:33 +msgid "@1 Arrowslit with Cross" +msgstr "Feritoia a croce per frecce di @1" + +#: arrow_slits.lua:58 +msgid "@1 Arrowslit with Hole" +msgstr "Feritoia a foro per frecce di @1" + +#: arrow_slits.lua:81 +msgid "@1 Embrasure" +msgstr "Feritoia di @1" + +#: init.lua:29 +msgid "Stonewall" +msgstr "muro di pietra" + +#: init.lua:32 +msgid "Cobble" +msgstr "ciottoli" + +#: init.lua:35 +msgid "Stonebrick" +msgstr "mattoni di pietra" + +#: init.lua:38 +msgid "Sandstone Brick" +msgstr "mattoni di arenaria del deserto" + +#: init.lua:41 +msgid "Desert Stone Brick" +msgstr "mattoni di pietra del deserto" + +#: init.lua:44 +msgid "Stone" +msgstr "pietra" + +#: init.lua:47 +msgid "Sandstone" +msgstr "arenaria" + +#: init.lua:50 +msgid "Desert Stone" +msgstr "pietra del deserto" + +#: init.lua:53 +msgid "Wood" +msgstr "legno" + +#: init.lua:56 +msgid "Ice" +msgstr "ghiaccio" + +#: init.lua:59 +msgid "Snow" +msgstr "neve" + +#: init.lua:62 +msgid "Obsidian Brick" +msgstr "mattoni di ossidiana" + +#: murder_holes.lua:14 +msgid "@1 Murder Hole" +msgstr "Buca assassina di @1" + +#: murder_holes.lua:33 +msgid "@1 Machicolation" +msgstr "Caditoia di @1" + +#: paving.lua:11 +msgid "Paving Stone" +msgstr "Pietra pavimentale" + +#: paving.lua:30 +msgid "Pavement Brick" +msgstr "Mattoni pavimentali" + +#: paving.lua:40 +msgid "Castle Pavement Stair" +msgstr "Scala pavimentale del castello" + +#: paving.lua:41 +msgid "Castle Pavement Slab" +msgstr "Lastra pavimentale del castello" + +#: paving.lua:49 +msgid "Roof Slates" +msgstr "Tegole di ardesia" + +#: pillars.lua:18 +msgid "@1 Pillar Base" +msgstr "Base della colonna di @1" + +#: pillars.lua:36 +msgid "@1 Half Pillar Base" +msgstr "Mezza base della colonna di @1" + +#: pillars.lua:54 +msgid "@1 Pillar Top" +msgstr "Capitello di @1" + +#: pillars.lua:72 +msgid "@1 Half Pillar Top" +msgstr "Mezzo capitello di @1" + +#: pillars.lua:90 +msgid "@1 Pillar Middle" +msgstr "Fusto della colonna di @1" + +#: pillars.lua:106 +msgid "@1 Half Pillar Middle" +msgstr "Mezzo fusto della colonna di @1" + +#: pillars.lua:123 +msgid "@1 Crossbrace" +msgstr "Costolone di @1" + +#: pillars.lua:147 +msgid "@1 Extended Crossbrace" +msgstr "Costolone esteso di @1" + +#: stone_wall.lua:11 +msgid "Castle Wall" +msgstr "Muro del castello" + +#: stone_wall.lua:22 +msgid "Castle Rubble" +msgstr "Detriti del castello" + +#: stone_wall.lua:57 +msgid "Castle Corner" +msgstr "Angolo del castello" + +#: stone_wall.lua:78 +msgid "Stone Wall" +msgstr "Muro di pietra" + +#: stone_wall.lua:86 +msgid "Rubble" +msgstr "Detriti" + +#: stone_wall.lua:100 +msgid "Castle Stonewall Stair" +msgstr "Scala del castello in muro di pietra" + +#: stone_wall.lua:101 +msgid "Castle Stonewall Slab" +msgstr "Lastra del castello in muro di pietra" + +#: stone_wall.lua:108 +msgid "Castle Rubble Stair" +msgstr "Scala del castello in detriti" + +#: stone_wall.lua:109 +msgid "Castle Rubble Slab" +msgstr "Lastra del castello in detriti" + +#: stone_wall.lua:117 stone_wall.lua:143 +msgid "Dungeon Stone" +msgstr "Pietra del sotterraneo" + +#: stone_wall.lua:156 +msgid "Dungeon Stone Stair" +msgstr "Scala di pietra del sotterraneo" + +#: stone_wall.lua:157 +msgid "Dungeon Stone Slab" +msgstr "Lastra di pietra del sotterraneo" diff --git a/castle_masonry/pillars.lua b/castle_masonry/pillars.lua index 96d76a3..082f82e 100644 --- a/castle_masonry/pillars.lua +++ b/castle_masonry/pillars.lua @@ -173,11 +173,11 @@ castle_masonry.register_pillar = function(material) }) minetest.register_craft({ - output = mod_name..":pillar_"..material.name.."_middle 4", + output = mod_name..":pillar_"..material.name.."_middle 2", recipe = { - {material.craft_material,material.craft_material}, - {material.craft_material,material.craft_material}, - {material.craft_material,material.craft_material} }, + {material.craft_material}, + {material.craft_material}, + {material.craft_material} }, }) minetest.register_craft({ diff --git a/castle_shields/locale/it.po b/castle_shields/locale/it.po new file mode 100644 index 0000000..be34709 --- /dev/null +++ b/castle_shields/locale/it.po @@ -0,0 +1,23 @@ +# ITALIAN LOCALE FILE FOR THE CASTLE SHIELDS MODULE +# Copyright (C) 2017 Philipbenr And DanDuncombe +# This file is distributed under the same license as the CASTLE SHIELDS package. +# Hamlet , 2017. +# +msgid "" +msgstr "" +"Project-Id-Version: Castle Shields\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-02-25 14:47-0700\n" +"PO-Revision-Date: 2017-09-10 22:38+0100\n" +"Last-Translator: H4mlet \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Language: it\n" +"X-Generator: Poedit 1.6.10\n" + +#: init.lua:6 init.lua:41 init.lua:75 +msgid "Mounted Shield" +msgstr "Scudo appeso" diff --git a/castle_storage/locale/it.po b/castle_storage/locale/it.po new file mode 100644 index 0000000..a512bbe --- /dev/null +++ b/castle_storage/locale/it.po @@ -0,0 +1,56 @@ +# ITALIAN LOCALE FILE FOR THE CASTLE STORAGE MODULE +# Copyright (C) 2017 Philipbenr And DanDuncombe +# This file is distributed under the same license as the CASTLE STORAGE package. +# Hamlet , 2017. +# +msgid "" +msgstr "" +"Project-Id-Version: Castle Storage\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-02-25 19:18-0700\n" +"PO-Revision-Date: 2017-09-10 22:46+0100\n" +"Last-Translator: H4mlet \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Language: it\n" +"X-Generator: Poedit 1.6.10\n" + +#: crate.lua:9 crate.lua:24 +msgid "Crate" +msgstr "Cassa" + +#: crate.lua:34 +msgid "@1 moves stuff in crate at @2" +msgstr "@1 mette delle cose nella cassa alle coordinate @2" + +#: crate.lua:37 +msgid "@1 moves stuff to crate at @2" +msgstr "@1 prende delle cose dalla cassa alle coordinate @2" + +#: crate.lua:40 ironbound_chest.lua:113 +msgid "@1 takes stuff from locked chest at @2" +msgstr "@1 prende delle cose dal baule chiuso a chiave alle coordinate @2" + +#: ironbound_chest.lua:35 ironbound_chest.lua:69 +msgid "Ironbound Chest" +msgstr "Baule rinforzato col ferro" + +#: ironbound_chest.lua:65 +msgid "Ironbound Chest (owned by @1)" +msgstr "Baule rinforzato col ferro (di @1)" + +#: ironbound_chest.lua:82 ironbound_chest.lua:91 ironbound_chest.lua:100 +msgid "@1 tried to access a locked chest belonging to @2 at @3" +msgstr "" +"@1 ha tentato di aprire un baule chiuso a chiave di @2 alle coordinate @3" + +#: ironbound_chest.lua:107 +msgid "@1 moves stuff in locked chest at @2" +msgstr "@1 sposta delle cose nel baule chiuso a chiave alle coordinate @2" + +#: ironbound_chest.lua:110 +msgid "@1 moves stuff to locked chest at @2" +msgstr "@1 mette delle cose nel baule chiuso a chiave alle coordinate @2" diff --git a/castle_tapestries/locale/it.po b/castle_tapestries/locale/it.po new file mode 100644 index 0000000..3d86b13 --- /dev/null +++ b/castle_tapestries/locale/it.po @@ -0,0 +1,35 @@ +# ITALIAN LOCALE FILE FOR THE CASTLE TAPESTRIES MODULE +# Copyright (C) 2017 Philipbenr And DanDuncombe +# This file is distributed under the same license as the CASTLE TAPESTRIES package. +# Hamlet , 2017. +# +msgid "" +msgstr "" +"Project-Id-Version: Castle Tapestries\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-02-25 14:32-0700\n" +"PO-Revision-Date: 2017-09-20 00:41+0100\n" +"Last-Translator: Hamlet \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Language: it\n" +"X-Generator: Poedit 1.6.10\n" + +#: init.lua:14 +msgid "Tapestry Top" +msgstr "Cima dell'arazzo" + +#: init.lua:64 +msgid "Tapestry" +msgstr "Arazzo" + +#: init.lua:94 +msgid "Tapestry (Long)" +msgstr "Arazzo (lungo)" + +#: init.lua:124 +msgid "Tapestry (Very Long)" +msgstr "Arazzo (molto lungo)" diff --git a/castle_weapons/locale/it.po b/castle_weapons/locale/it.po new file mode 100644 index 0000000..e83b45f --- /dev/null +++ b/castle_weapons/locale/it.po @@ -0,0 +1,31 @@ +# ITALIAN LOCALE FILE FOR THE CASTLE WEAPONS MODULE +# Copyright (C) 2017 Philipbenr And DanDuncombe +# This file is distributed under the same license as the CASTLE WEAPONS package. +# Hamlet , 2017. +# +msgid "" +msgstr "" +"Project-Id-Version: Castle Weapons\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-02-25 19:35-0700\n" +"PO-Revision-Date: 2017-09-10 22:49+0100\n" +"Last-Translator: H4mlet \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Language: it\n" +"X-Generator: Poedit 1.6.10\n" + +#: battleaxe.lua:8 +msgid "Battleaxe" +msgstr "Ascia da guerra" + +#: crossbow.lua:244 +msgid "Bolt" +msgstr "Quadrello" + +#: crossbow.lua:357 crossbow.lua:416 +msgid "Crossbow" +msgstr "Balestra" diff --git a/computer/locale/ru.txt b/computer/locale/ru.txt new file mode 100644 index 0000000..36ce653 --- /dev/null +++ b/computer/locale/ru.txt @@ -0,0 +1,6 @@ + +# Language: Russian +# Author: inpos + +Plastic sheet = Лист пластика +Unprocessed Plastic base = Необработанная пластиковая основа diff --git a/currency/locale/ru.po b/currency/locale/ru.po index 951e75f..15f54d9 100644 --- a/currency/locale/ru.po +++ b/currency/locale/ru.po @@ -8,14 +8,14 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-02-20 13:58-0700\n" -"PO-Revision-Date: 2017-08-11 17:09+0300\n" +"PO-Revision-Date: 2017-08-11 19:03+0300\n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 2.0.3\n" "Last-Translator: \n" -"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" "Language: ru\n" #: barter.lua:14 barter.lua:22 diff --git a/currency/safe.lua b/currency/safe.lua index 1c53184..ed26119 100644 --- a/currency/safe.lua +++ b/currency/safe.lua @@ -2,15 +2,40 @@ local MP = minetest.get_modpath(minetest.get_current_modname()) local S, NS = dofile(MP.."/intllib.lua") -function default.get_safe_formspec(pos) +function default.get_safe_formspec(pos, page) local spos = pos.x .. "," .. pos.y .. "," ..pos.z + local ipos = 50*page local formspec = - "size[8,9]".. - "list[nodemeta:".. spos .. ";main;1,1;6,2;]".. - "list[current_player;main;0,5;8,4;]" + "size[8,11]".. + default.gui_bg.. + default.gui_bg_img.. + default.gui_slots.. + "button[1,-0.1;2,1;page1;Page 1]".. + "button[5,-0.1;2,1;page2;Page 2]".. + "list[nodemeta:".. spos .. ";main;0,0.9;8,6;"..ipos.."]".. + "list[current_player;main;0,7.2;8,4;]".. + "listring[nodemeta:".. spos .. ";main]".. + "listring[current_player;main]" return formspec end +local function show_safe_form(clicker, pos, page) + minetest.show_formspec( + clicker:get_player_name(), + "currency:safe", + default.get_safe_formspec(pos, page) + ) + minetest.register_on_receive_fields(function(player, form, pressed) + print("[SAFE] page button pressed: "..dump(pressed)) + if form=="currency:safe" then + if pressed.page1 then show_safe_form(clicker, pos, 0) end + if pressed.page2 then show_safe_form(clicker, pos, 1) end + end + end) +end + + + local function has_safe_privilege(meta, player) local name = "" if player then @@ -31,13 +56,19 @@ minetest.register_node("currency:safe", { paramtype = "light", paramtype2 = "facedir", tiles = {"safe_side.png", - "safe_side.png", + "safe_side.png", "safe_side.png", "safe_side.png", "safe_side.png", "safe_front.png",}, is_ground_content = false, groups = {cracky=1}, + on_rightclick = function(pos, node, clicker) + local meta = minetest.get_meta(pos) + if has_safe_privilege(meta, clicker) then + show_safe_form(clicker, pos, 0) + end + end, after_place_node = function(pos, placer) local meta = minetest.get_meta(pos) meta:set_string("owner", placer:get_player_name() or "") @@ -48,7 +79,7 @@ minetest.register_node("currency:safe", { meta:set_string("infotext", "Safe") meta:set_string("owner", "") local inv = meta:get_inventory() - inv:set_size("main", 6*2) + inv:set_size("main", 12*8) end, can_dig = function(pos,player) local meta = minetest.get_meta(pos); @@ -64,7 +95,7 @@ minetest.register_node("currency:safe", { end return count end, - allow_metadata_inventory_put = function(pos, listname, index, stack, player) + allow_metadata_inventory_put = function(pos, listname, index, stack, player) local meta = minetest.get_meta(pos) if not has_safe_privilege(meta, player) then minetest.log("action", S("@1 tried to access a safe belonging to @2 at @3", @@ -73,7 +104,7 @@ minetest.register_node("currency:safe", { end return stack:get_count() end, - allow_metadata_inventory_take = function(pos, listname, index, stack, player) + allow_metadata_inventory_take = function(pos, listname, index, stack, player) local meta = minetest.get_meta(pos) if not has_safe_privilege(meta, player) then minetest.log("action", S("@1 tried to access a safe belonging to @2 at @3", @@ -85,20 +116,10 @@ minetest.register_node("currency:safe", { on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) minetest.log("action", S("@1 moves stuff in safe at @2", player:get_player_name(), minetest.pos_to_string(pos))) end, - on_metadata_inventory_put = function(pos, listname, index, stack, player) + on_metadata_inventory_put = function(pos, listname, index, stack, player) minetest.log("action", S("@1 moves stuff to safe at @2", player:get_player_name(), minetest.pos_to_string(pos))) end, - on_metadata_inventory_take = function(pos, listname, index, stack, player) + on_metadata_inventory_take = function(pos, listname, index, stack, player) minetest.log("action", S("@1 takes stuff from safe at @2", player:get_player_name(), minetest.pos_to_string(pos))) end, - on_rightclick = function(pos, node, clicker) - local meta = minetest.get_meta(pos) - if has_safe_privilege(meta, clicker) then - minetest.show_formspec( - clicker:get_player_name(), - "currency:safe", - default.get_safe_formspec(pos) - ) - end - end, }) diff --git a/fake_fire/init.lua b/fake_fire/init.lua index 628438b..c7408b4 100644 --- a/fake_fire/init.lua +++ b/fake_fire/init.lua @@ -68,7 +68,7 @@ end minetest.register_node("fake_fire:ice_fire", { inventory_image = "ice_fire_inv.png", - description = desc, + description = S("Ice fire"), drawtype = "plantlike", paramtype = "light", paramtype2 = "facedir", diff --git a/farming/README.txt b/farming/README.txt index 00c2dda..2b3fa26 100644 --- a/farming/README.txt +++ b/farming/README.txt @@ -13,6 +13,8 @@ This mod works by adding your new plant to the {growing=1} group and numbering t Changelog: +1.28 - Added chili peppers and bowl of chili, optimized code and fixed a few bugs, added porridge +1.27 - Added meshoptions to api and wheat plants, added farming.rarity setting to spawn more/less crops on map, have separate cotton/string items (4x cotton = 1x wool, 2x cotton = 2x string) 1.26 - Added support for [toolranks] mod when using hoe's 1.25 - Added check for farming.conf setting file to disable specific crops globally (inside mod folder) or world specific (inside world folder) 1.24 - Added Hemp which can be crafted into fibre, paper, string, rope and oil. @@ -48,7 +50,7 @@ Changelog: 0.1 - Fixed growing bug 0.0 - Initial release -Lucky Blocks: 11 (plus 3 for default farming items) +Lucky Blocks: 16 License of media (textures): @@ -60,6 +62,9 @@ Created by PilzAdam (License: WTFPL): farming_soil_wet_side.png farming_string.png +Created by Napiophelios (CC BY-SA 3.0): + farming_cotton.png + Created by Calinou (License: CC BY-SA): farming_tool_bronzehoe.png farming_tool_steelhoe.png diff --git a/farming/barley.lua b/farming/barley.lua index b7bf530..8611ee5 100644 --- a/farming/barley.lua +++ b/farming/barley.lua @@ -37,6 +37,8 @@ local crop_def = { drawtype = "plantlike", tiles = {"farming_barley_1.png"}, paramtype = "light", + paramtype2 = "meshoptions", + place_param2 = 3, sunlight_propagates = true, walkable = false, buildable_to = true, diff --git a/farming/beanpole.lua b/farming/beanpole.lua index fd93383..8afead6 100644 --- a/farming/beanpole.lua +++ b/farming/beanpole.lua @@ -41,7 +41,7 @@ function place_beans(itemstack, placer, pointed_thing, plantname) minetest.sound_play("default_place_node", {pos = pt.under, gain = 1.0}) - if not minetest.setting_getbool("creative_mode") then + if not farming.is_creative(placer:get_player_name()) then itemstack:take_item() diff --git a/farming/chili.lua b/farming/chili.lua new file mode 100644 index 0000000..ec2a1a9 --- /dev/null +++ b/farming/chili.lua @@ -0,0 +1,88 @@ + +local S = farming.intllib + +-- chili pepper +minetest.register_craftitem("farming:chili_pepper", { + description = S("Chili Pepper"), + inventory_image = "farming_chili_pepper.png", + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed(itemstack, placer, pointed_thing, "farming:chili_1") + end, + on_use = minetest.item_eat(2), +}) + +-- bowl of chili +minetest.register_craftitem("farming:chili_bowl", { + description = S("Bowl of Chili"), + inventory_image = "farming_chili_bowl.png", + on_use = minetest.item_eat(8), +}) + +minetest.register_craft({ + type = "shapeless", + output = "farming:chili_bowl", + recipe = {"farming:chili_pepper", "farming:barley", "farming:tomato", "farming:beans"} +}) + +-- chili can be used for red dye +minetest.register_craft({ + output = "dye:red", + recipe = { + {'farming:chili_pepper'}, + } +}) + +-- chili definition +local crop_def = { + drawtype = "plantlike", + tiles = {"farming_chili_1.png"}, + paramtype = "light", + sunlight_propagates = true, + walkable = false, + buildable_to = true, + drop = "", + selection_box = farming.select, + groups = { + snappy = 3, flammable = 4, plant = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, + sounds = default.node_sound_leaves_defaults() +} + +-- stage 1 +minetest.register_node("farming:chili_1", table.copy(crop_def)) + +-- stage 2 +crop_def.tiles = {"farming_chili_2.png"} +minetest.register_node("farming:chili_2", table.copy(crop_def)) + +-- stage 3 +crop_def.tiles = {"farming_chili_3.png"} +minetest.register_node("farming:chili_3", table.copy(crop_def)) + +-- stage 4 +crop_def.tiles = {"farming_chili_4.png"} +minetest.register_node("farming:chili_4", table.copy(crop_def)) + +-- stage 5 +crop_def.tiles = {"farming_chili_5.png"} +minetest.register_node("farming:chili_5", table.copy(crop_def)) + +-- stage 6 +crop_def.tiles = {"farming_chili_6.png"} +minetest.register_node("farming:chili_6", table.copy(crop_def)) + +-- stage 7 +crop_def.tiles = {"farming_chili_7.png"} +minetest.register_node("farming:chili_7", table.copy(crop_def)) + +-- stage 8 (final) +crop_def.tiles = {"farming_chili_8.png"} +crop_def.groups.growing = 0 +crop_def.drop = { + items = { + {items = {'farming:chili_pepper 3'}, rarity = 1}, + {items = {'farming:chili_pepper 2'}, rarity = 2}, + } +} +minetest.register_node("farming:chili_8", table.copy(crop_def)) diff --git a/farming/cocoa.lua b/farming/cocoa.lua index fad1733..3ee3532 100644 --- a/farming/cocoa.lua +++ b/farming/cocoa.lua @@ -36,7 +36,7 @@ function place_cocoa(itemstack, placer, pointed_thing, plantname) minetest.sound_play("default_place_node", {pos = pt.above, gain = 1.0}) - if not minetest.setting_getbool("creative_mode") then + if not farming.is_creative(placer:get_player_name()) then itemstack:take_item() diff --git a/farming/cotton.lua b/farming/cotton.lua index eef6425..bf0412e 100644 --- a/farming/cotton.lua +++ b/farming/cotton.lua @@ -8,7 +8,7 @@ minetest.register_node("farming:seed_cotton", { inventory_image = "farming_cotton_seed.png", wield_image = "farming_cotton_seed.png", drawtype = "signlike", - groups = {seed = 1, snappy = 3, attached_node = 1}, + groups = {seed = 1, snappy = 3, attached_node = 1, flammable = 4}, paramtype = "light", paramtype2 = "wallmounted", walkable = false, @@ -24,19 +24,46 @@ minetest.register_node("farming:seed_cotton", { minetest.register_craftitem("farming:cotton", { description = S("Cotton"), inventory_image = "farming_cotton.png", + groups = {flammable = 4}, }) -minetest.register_alias("farming:string", "farming:cotton") +minetest.register_craftitem("farming:string", { + description = S("String"), + inventory_image = "farming_string.png", + groups = {flammable = 2}, +}) -- cotton to wool minetest.register_craft({ output = "wool:white", recipe = { - {"farming:string", "farming:string"}, - {"farming:string", "farming:string"}, + {"farming:cotton", "farming:cotton"}, + {"farming:cotton", "farming:cotton"}, } }) +-- cotton to string +minetest.register_craft({ + output = "farming:string 2", + recipe = { + {"farming:cotton"}, + {"farming:cotton"}, + } +}) + +-- can be used as fuel +minetest.register_craft({ + type = "fuel", + recipe = "farming:string", + burntime = 1, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "farming:cotton", + burntime = 1, +}) + -- cotton definition local crop_def = { drawtype = "plantlike", @@ -48,7 +75,7 @@ local crop_def = { drop = "", selection_box = farming.select, groups = { - snappy = 3, flammable = 2, plant = 1, attached_node = 1, + snappy = 3, flammable = 4, plant = 1, attached_node = 1, not_in_creative_inventory = 1, growing = 1 }, sounds = default.node_sound_leaves_defaults() @@ -105,9 +132,9 @@ crop_def.tiles = {"farming_cotton_8.png"} crop_def.groups.growing = 0 crop_def.drop = { items = { - {items = {"farming:string"}, rarity = 1}, - {items = {"farming:string"}, rarity = 2}, - {items = {"farming:string"}, rarity = 3}, + {items = {"farming:cotton"}, rarity = 1}, + {items = {"farming:cotton"}, rarity = 2}, + {items = {"farming:cotton"}, rarity = 3}, {items = {"farming:seed_cotton"}, rarity = 1}, {items = {"farming:seed_cotton"}, rarity = 2}, {items = {"farming:seed_cotton"}, rarity = 3}, diff --git a/farming/donut.lua b/farming/donut.lua index 68aeb8e..be2e9b8 100644 --- a/farming/donut.lua +++ b/farming/donut.lua @@ -12,7 +12,7 @@ minetest.register_craft({ output = "farming:donut 3", recipe = { {'', 'farming:wheat', ''}, - {'farming:wheat', '', 'farming:wheat'}, + {'farming:wheat', 'farming:sugar', 'farming:wheat'}, {'', 'farming:wheat', ''}, } }) @@ -46,3 +46,36 @@ minetest.register_craft({ {'farming:donut'}, } }) + +-- Porridge Oats +minetest.register_craftitem("farming:porridge", { + description = S("Porridge"), + inventory_image = "farming_porridge.png", + on_use = minetest.item_eat(6), +}) + +minetest.after(0, function() + + if minetest.get_modpath("mobs") and mobs and mobs.mod == "redo" then + + minetest.register_craft({ + output = "farming:porridge", + type = "shapeless", + recipe = { + "farming:barley", "farming:barley", "farming:wheat", + "farming:wheat", "mobs:bucket_milk" + }, + replacements = {{"mobs:bucket_milk", "bucket:bucket_empty"}} + }) +else + minetest.register_craft({ + output = "farming:porridge", + type = "shapeless", + recipe = { + "farming:barley", "farming:barley", "farming:wheat", + "farming:wheat", "bucket:bucket_water" + }, + replacements = {{"bucket:bucket_water", "bucket:bucket_empty"}} + }) + end +end) diff --git a/farming/farming.conf_example b/farming/farming.conf_example index 696d007..be6e398 100644 --- a/farming/farming.conf_example +++ b/farming/farming.conf_example @@ -23,5 +23,9 @@ farming.rhubarb = true farming.beans = true farming.grapes = true farming.barley = true +farming.chili = true farming.hemp = true farming.donuts = true + +-- rarety of crops on map, default is 0.006 (higher number = more crops) +farming.rarety = 0.006 diff --git a/farming/grapes.lua b/farming/grapes.lua index 9070d0e..d443c33 100644 --- a/farming/grapes.lua +++ b/farming/grapes.lua @@ -36,7 +36,7 @@ function place_grapes(itemstack, placer, pointed_thing, plantname) minetest.sound_play("default_place_node", {pos = pt.under, gain = 1.0}) - if not minetest.setting_getbool("creative_mode") then + if not farming.is_creative(placer:get_player_name()) then itemstack:take_item() diff --git a/farming/grass.lua b/farming/grass.lua index aacb220..f6f777b 100644 --- a/farming/grass.lua +++ b/farming/grass.lua @@ -14,6 +14,7 @@ for i = 3, 5 do }) -- Override default dry grass and have it drop Barley Seeds + if minetest.registered_nodes["default:dry_grass_1"] then minetest.override_item("default:dry_grass_" .. i, { diff --git a/farming/hoes.lua b/farming/hoes.lua index dd7a11c..c883e22 100644 --- a/farming/hoes.lua +++ b/farming/hoes.lua @@ -130,6 +130,12 @@ farming.register_hoe(":farming:hoe_wood", { material = "group:wood" }) +minetest.register_craft({ + type = "fuel", + recipe = "farming:hoe_wood", + burntime = 5, +}) + farming.register_hoe(":farming:hoe_stone", { description = S("Stone Hoe"), inventory_image = "farming_tool_stonehoe.png", diff --git a/farming/init.lua b/farming/init.lua index 07e935c..3f026fb 100644 --- a/farming/init.lua +++ b/farming/init.lua @@ -1,5 +1,5 @@ --[[ - Farming Redo Mod 1.25 (6th May 2017) + Farming Redo Mod by TenPlus1 NEW growing routine by prestidigitator auto-refill by crabman77 @@ -8,53 +8,39 @@ farming = {} farming.mod = "redo" farming.path = minetest.get_modpath("farming") -farming.hoe_on_use = default.hoe_on_use farming.select = { type = "fixed", fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5} } +local creative_mode_cache = minetest.setting_getbool("creative_mode") + +function farming.is_creative(name) + return creative_mode_cache or minetest.check_player_privs(name, {creative = true}) +end + + local statistics = dofile(farming.path.."/statistics.lua") -- Intllib - -local S -if minetest.get_modpath("intllib") then - S = intllib.Getter() -else - S = function(s) return s end -end +local S = dofile(farming.path.."/intllib.lua") farming.intllib = S --- Utility Functions +-- Utility Function local time_speed = tonumber(minetest.setting_get("time_speed")) or 72 local SECS_PER_CYCLE = (time_speed > 0 and 24 * 60 * 60 / time_speed) or 0 - local function clamp(x, min, max) return (x < min and min) or (x > max and max) or x end -local function in_range(x, min, max) - return min <= x and x <= max -end - ---- Tests the amount of day or night time between two times. - -- - -- @param t_game - -- The current time, as reported by mintest.get_gametime(). - -- @param t_day - -- The current time, as reported by mintest.get_timeofday(). - -- @param dt - -- The amount of elapsed time. - -- @param count_day - -- If true, count elapsed day time. Otherwise, count elapsed night time. - -- @return - -- The amount of day or night time that has elapsed. -local function day_or_night_time(t_game, t_day, dt, count_day) +-- return amount of day or night that has elapsed +-- dt is time elapsed, count_day if true counts day, otherwise night +local function day_or_night_time(dt, count_day) + local t_day = minetest.get_timeofday() local t1_day = t_day - dt / SECS_PER_CYCLE local t1_c, t2_c -- t1_c < t2_c and t2_c always in [0, 1) @@ -88,45 +74,13 @@ local function day_or_night_time(t_game, t_day, dt, count_day) return dt_c * SECS_PER_CYCLE end ---- Tests the amount of elapsed day time. - -- - -- @param dt - -- The amount of elapsed time. - -- @return - -- The amount of day time that has elapsed. - -- -local function day_time(dt) - return day_or_night_time(minetest.get_gametime(), minetest.get_timeofday(), dt, true) -end - ---- Tests the amount of elapsed night time. - -- - -- @param dt - -- The amount of elapsed time. - -- @return - -- The amount of night time that has elapsed. - -- -local function night_time(time_game, time_day, dt, count_day) - return day_or_night_time(minetest.get_gametime(), minetest.get_timeofday(), dt, false) -end - -- Growth Logic - local STAGE_LENGTH_AVG = 160.0 local STAGE_LENGTH_DEV = STAGE_LENGTH_AVG / 6 -local MIN_LIGHT = 13 -local MAX_LIGHT = 1000 ---- Determines plant name and stage from node. - -- - -- Separates node name on the last underscore (_). - -- - -- @param node - -- Node or position table, or node name. - -- @return - -- List (plant_name, stage), or nothing (nil) if node isn't loaded +-- return plant name and stage from node provided local function plant_name_stage(node) local name @@ -161,6 +115,7 @@ local function plant_name_stage(node) return name, 0 end + -- Map from node name to -- { plant_name = ..., name = ..., stage = n, stages_left = { node_name, ... } } @@ -254,6 +209,7 @@ local function reg_plant_stages(plant_name, stage, force_last) return stages end + register_plant_node = function(node) local plant_name, stage = plant_name_stage(node) @@ -267,6 +223,7 @@ register_plant_node = function(node) end end + local function set_growing(pos, stages_left) if not stages_left then @@ -291,14 +248,8 @@ local function set_growing(pos, stages_left) end end --- Detects a plant type node at the given position, starting --- or stopping the plant growth timer as appopriate - --- @param pos --- The node's position. --- @param node --- The cached node table if available, or nil. +-- detects a crop at given position, starting or stopping growth timer when needed function farming.handle_growth(pos, node) if not pos then @@ -312,6 +263,7 @@ function farming.handle_growth(pos, node) end end + minetest.after(0, function() for _, node_def in ipairs(minetest.registered_nodes) do @@ -319,11 +271,11 @@ minetest.after(0, function() end end) + local abm_func = farming.handle_growth -- Just in case a growing type or added node is missed (also catches existing -- nodes added to map before timers were incorporated). - minetest.register_abm({ nodenames = { "group:growing" }, interval = 300, @@ -331,9 +283,8 @@ minetest.register_abm({ action = abm_func }) --- Plant timer function. --- Grows plants under the right conditions. +-- Plant timer function that grows plants under the right conditions. function farming.plant_growth_timer(pos, elapsed, node_name) local stages = plant_stages[node_name] @@ -351,7 +302,6 @@ function farming.plant_growth_timer(pos, elapsed, node_name) if stages.plant_name == "farming:cocoa" then if not minetest.find_node_near(pos, 1, {"default:jungletree"}) then - return true end else @@ -363,19 +313,23 @@ function farming.plant_growth_timer(pos, elapsed, node_name) end local growth - local light_pos = {x = pos.x, y = pos.y + 1, z = pos.z} + local light_pos = {x = pos.x, y = pos.y, z = pos.z} -- was y + 1 local lambda = elapsed / STAGE_LENGTH_AVG if lambda < 0.1 then return true end + local MIN_LIGHT = minetest.registered_nodes[node_name].minlight or 13 + local MAX_LIGHT = minetest.registered_nodes[node_name].maxlight or 15 + --print ("---", MIN_LIGHT, MAX_LIGHT) + if max_growth == 1 or lambda < 2.0 then local light = (minetest.get_node_light(light_pos) or 0) --print ("light level:", light) - if not in_range(light, MIN_LIGHT, MAX_LIGHT) then + if light < MIN_LIGHT or light > MAX_LIGHT then return true end @@ -383,8 +337,8 @@ function farming.plant_growth_timer(pos, elapsed, node_name) else local night_light = (minetest.get_node_light(light_pos, 0) or 0) local day_light = (minetest.get_node_light(light_pos, 0.5) or 0) - local night_growth = in_range(night_light, MIN_LIGHT, MAX_LIGHT) - local day_growth = in_range(day_light, MIN_LIGHT, MAX_LIGHT) + local night_growth = night_light >= MIN_LIGHT and night_light <= MAX_LIGHT + local day_growth = day_light >= MIN_LIGHT and day_light <= MAX_LIGHT if not night_growth then @@ -392,11 +346,11 @@ function farming.plant_growth_timer(pos, elapsed, node_name) return true end - lambda = day_time(elapsed) / STAGE_LENGTH_AVG + lambda = day_or_night_time(elapsed, true) / STAGE_LENGTH_AVG elseif not day_growth then - lambda = night_time(elapsed) / STAGE_LENGTH_AVG + lambda = day_or_night_time(elapsed, false) / STAGE_LENGTH_AVG end growth = statistics.poisson(lambda, max_growth) @@ -407,7 +361,10 @@ function farming.plant_growth_timer(pos, elapsed, node_name) end if minetest.registered_nodes[stages.stages_left[growth]] then - minetest.swap_node(pos, {name = stages.stages_left[growth]}) + + local p2 = minetest.registered_nodes[stages.stages_left[growth] ].place_param2 or 1 + + minetest.swap_node(pos, {name = stages.stages_left[growth], param2 = p2}) else return true end @@ -415,29 +372,8 @@ function farming.plant_growth_timer(pos, elapsed, node_name) return growth ~= max_growth end --- refill placed plant by crabman (26/08/2015) -local can_refill_plant = { - ["farming:blueberry_1"] = "farming:blueberries", - ["farming:carrot_1"] = "farming:carrot", - ["farming:coffee_1"] = "farming:coffee_beans", - ["farming:corn_1"] = "farming:corn", - ["farming:cotton_1"] = "farming:seed_cotton", - ["farming:cucumber_1"] = "farming:cucumber", - ["farming:melon_1"] = "farming:melon_slice", - ["farming:potato_1"] = "farming:potato", - ["farming:pumpkin_1"] = "farming:pumpkin_slice", - ["farming:raspberry_1"] = "farming:raspberries", - ["farming:rhubarb_1"] = "farming:rhubarb", - ["farming:tomato_1"] = "farming:tomato", - ["farming:wheat_1"] = "farming:seed_wheat", - ["farming:grapes_1"] = "farming:grapes", - ["farming:beans_1"] = "farming:beans", - ["farming:rhubarb_1"] = "farming:rhubarb", - ["farming:cocoa_1"] = "farming:cocoa_beans", - ["farming:barley_1"] = "farming:seed_barley", - ["farming:hemp_1"] = "farming:seed_hemp", -} +-- refill placed plant by crabman (26/08/2015) updated by TenPlus1 function farming.refill_plant(player, plantname, index) local inv = player:get_inventory() @@ -454,14 +390,14 @@ function farming.refill_plant(player, plantname, index) inv:set_stack("main", index, stack) stack:clear() inv:set_stack("main", i, stack) - --minetest.log("action", "farming: refilled stack("..plantname..") of " .. player:get_player_name() ) + return end end end --- Place Seeds on Soil +-- Place Seeds on Soil function farming.place_seed(itemstack, placer, pointed_thing, plantname) local pt = pointed_thing @@ -504,22 +440,25 @@ function farming.place_seed(itemstack, placer, pointed_thing, plantname) -- if not protected then add node and remove 1 item from the itemstack if not minetest.is_protected(pt.above, placer:get_player_name()) then - minetest.set_node(pt.above, {name = plantname, param2 = 1}) + local p2 = minetest.registered_nodes[plantname].place_param2 or 1 + + minetest.set_node(pt.above, {name = plantname, param2 = p2}) minetest.sound_play("default_place_node", {pos = pt.above, gain = 1.0}) - if not minetest.setting_getbool("creative_mode") then + if not farming.is_creative(placer:get_player_name()) then + + local name = itemstack:get_name() itemstack:take_item() -- check for refill - if itemstack:get_count() == 0 - and can_refill_plant[plantname] then + if itemstack:get_count() == 0 then minetest.after(0.10, farming.refill_plant, placer, - can_refill_plant[plantname], + name, placer:get_wield_index() ) end @@ -529,26 +468,23 @@ function farming.place_seed(itemstack, placer, pointed_thing, plantname) end end --- Function to register plants (default farming compatibility) +-- Function to register plants (default farming compatibility) farming.register_plant = function(name, def) - local mname = name:split(":")[1] - local pname = name:split(":")[2] - - -- Check def table - if not def.description then - def.description = S("Seed") - end - - if not def.inventory_image then - def.inventory_image = "unknown_item.png" - end - if not def.steps then return nil end + local mname = name:split(":")[1] + local pname = name:split(":")[2] + + -- Check def + def.description = def.description or S("Seed") + def.inventory_image = def.inventory_image or "unknown_item.png" + def.minlight = def.minlight or 13 + def.maxlight = def.maxlight or 15 + -- Register seed minetest.register_node(":" .. mname .. ":seed_" .. pname, { @@ -563,6 +499,8 @@ farming.register_plant = function(name, def) walkable = false, sunlight_propagates = true, selection_box = farming.select, + place_param2 = def.place_param2 or nil, + next_plant = mname .. ":" .. pname .. "_1", on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, @@ -592,7 +530,10 @@ farming.register_plant = function(name, def) } } - local g = {snappy = 3, flammable = 2, plant = 1, not_in_creative_inventory = 1, attached_node = 1, growing = 1} + local g = { + snappy = 3, flammable = 2, plant = 1, growing = 1, + attached_node = 1, not_in_creative_inventory = 1, + } -- Last step doesn't need growing=1 so Abm never has to check these if i == def.steps then @@ -601,25 +542,35 @@ farming.register_plant = function(name, def) local node_name = mname .. ":" .. pname .. "_" .. i + local next_plant = nil + + if i < def.steps then + next_plant = mname .. ":" .. pname .. "_" .. (i + 1) + end + minetest.register_node(node_name, { drawtype = "plantlike", waving = 1, tiles = {mname .. "_" .. pname .. "_" .. i .. ".png"}, paramtype = "light", + paramtype2 = def.paramtype2 or nil, + place_param2 = def.place_param2 or nil, walkable = false, buildable_to = true, drop = drop, selection_box = farming.select, groups = g, sounds = default.node_sound_leaves_defaults(), + minlight = def.minlight, + maxlight = def.maxlight, + next_plant = next_plant, }) register_plant_node(node_name) end -- Return info - local r = {seed = mname .. ":seed_" .. pname, harvest = mname .. ":" .. pname} - return r + return {seed = mname .. ":seed_" .. pname, harvest = mname .. ":" .. pname} end @@ -641,8 +592,10 @@ farming.rhubarb = true farming.beans = true farming.grapes = true farming.barley = true +farming.chili = true farming.hemp = true farming.donuts = true +farming.rarety = 0.006 -- Load new global settings if found inside mod folder @@ -663,12 +616,16 @@ if input then end --- load crops +-- important items dofile(farming.path.."/soil.lua") dofile(farming.path.."/hoes.lua") dofile(farming.path.."/grass.lua") + +-- default crops dofile(farming.path.."/wheat.lua") dofile(farming.path.."/cotton.lua") + +-- additional crops and food (if enabled) if farming.carrot then dofile(farming.path.."/carrot.lua") end if farming.potato then dofile(farming.path.."/potato.lua") end if farming.tomato then dofile(farming.path.."/tomato.lua") end @@ -685,8 +642,10 @@ if farming.rhubarb then dofile(farming.path.."/rhubarb.lua") end if farming.beans then dofile(farming.path.."/beanpole.lua") end if farming.grapes then dofile(farming.path.."/grapes.lua") end if farming.barley then dofile(farming.path.."/barley.lua") end +if farming.chili then dofile(farming.path.."/chili.lua") end if farming.hemp then dofile(farming.path.."/hemp.lua") end if farming.donuts then dofile(farming.path.."/donut.lua") end + dofile(farming.path.."/mapgen.lua") dofile(farming.path.."/compatibility.lua") -- Farming Plus compatibility dofile(farming.path.."/lucky_block.lua") diff --git a/farming/intllib.lua b/farming/intllib.lua new file mode 100644 index 0000000..6669d72 --- /dev/null +++ b/farming/intllib.lua @@ -0,0 +1,45 @@ + +-- Fallback functions for when `intllib` is not installed. +-- Code released under Unlicense . + +-- Get the latest version of this file at: +-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua + +local function format(str, ...) + local args = { ... } + local function repl(escape, open, num, close) + if escape == "" then + local replacement = tostring(args[tonumber(num)]) + if open == "" then + replacement = replacement..close + end + return replacement + else + return "@"..open..num..close + end + end + return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl)) +end + +local gettext, ngettext +if minetest.get_modpath("intllib") then + if intllib.make_gettext_pair then + -- New method using gettext. + gettext, ngettext = intllib.make_gettext_pair() + else + -- Old method using text files. + gettext = intllib.Getter() + end +end + +-- Fill in missing functions. + +gettext = gettext or function(msgid, ...) + return format(msgid, ...) +end + +ngettext = ngettext or function(msgid, msgid_plural, n, ...) + return format(n==1 and msgid or msgid_plural, ...) +end + +return gettext, ngettext diff --git a/farming/locale/de.po b/farming/locale/de.po new file mode 100644 index 0000000..1db5d72 --- /dev/null +++ b/farming/locale/de.po @@ -0,0 +1,262 @@ +# German Translation for farming mod. +# Copyright (C) 2017 +# This file is distributed under the same license as the farming package. +# Xanthin. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: 1.27\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-03-31 HO:MI+ZONE\n" +"PO-Revision-Date: 2016-03-31 HO:MI+ZONE\n" +"Last-Translator: Xanthin\n" +"Language-Team: \n" +"Language: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: barley.lua +msgid "Barley Seed" +msgstr "Gerstenkörner" + +#: barley.lua +msgid "Barley" +msgstr "Gerste" + +#: beanpole.lua +msgid "Green Beans" +msgstr "Grüne Bohnen" + +#: beanpole.lua +msgid "Bean Pole (place on soil before planting beans)" +msgstr "Bohnenstange (vor dem Pflanzen der Bohnen auf den\nAckerboden stellen)" + +#: blueberry.lua +msgid "Blueberries" +msgstr "Blaubeeren" + +#: blueberry.lua +msgid "Blueberry Muffin" +msgstr "Blaubeermuffin" + +#: carrot.lua +msgid "Carrot" +msgstr "Möhre" + +#: carrot.lua +msgid "Golden Carrot" +msgstr "Goldene Möhre" + +#: cocoa.lua +msgid "Cocoa Beans" +msgstr "Kakaobohne" + +#: cocoa.lua +msgid "Cookie" +msgstr "Keks" + +#: cocoa.lua +msgid "Bar of Dark Chocolate" +msgstr "Tafel Zartbitterschokolade" + +#: coffee.lua +msgid "Coffee Beans" +msgstr "Kaffeebohnen" + +#: coffee.lua +msgid "Drinking Cup (empty)" +msgstr "Tasse (leer)" + +#: coffee.lua +msgid "Cold Cup of Coffee" +msgstr "Kalte Tasse Kaffee" + +#: coffee.lua +msgid "Hot Cup of Coffee" +msgstr "Heiße Tasse Kaffee" + +#: corn.lua +msgid "Corn" +msgstr "Mais" + +#: corn.lua +msgid "Corn on the Cob" +msgstr "Maiskolben" + +#: corn.lua +msgid "Bottle of Ethanol" +msgstr "Flasche Ethanol" + +#: cotton.lua +msgid "Cotton Seed" +msgstr "Baumwollsamen" + +#: cotton.lua +msgid "Cotton" +msgstr "Baumwolle" + +#: cucumber.lua +msgid "Cucumber" +msgstr "Gurke" + +#: donut.lua +msgid "Donut" +msgstr "Donut" + +#: donut.lua +msgid "Chocolate Donut" +msgstr "Schokodonut" + +#: donut.lua +msgid "Apple Donut" +msgstr "Apfeldonut" + +#: grapes.lua +msgid "Grapes" +msgstr "Weintrauben" + +#: grapes.lua +msgid "Trellis (place on soil before planting grapes)" +msgstr "Spalier (vor dem Pflanzen der Weintrauben auf den\nAckerboden stellen)" + +#: hemp.lua +msgid "Hemp Seed" +msgstr "" + +#: hemp.lua +msgid "Hemp Leaf" +msgstr "" + +#: hemp.lua +msgid "Bottle of Hemp Oil" +msgstr "" + +#: hemp.lua +msgid "Hemp Fibre" +msgstr "" + +#: hemp.lua +msgid "Hemp Rope" +msgstr "" + +#: ???? +msgid "Hoe" +msgstr "Hacke" + +#: hoes.lua +msgid "Wooden Hoe" +msgstr "Holzhacke" + +#: hoes.lua +msgid "Stone Hoe" +msgstr "Steinhacke" + +#: hoes.lua +msgid "Steel Hoe" +msgstr "Stahlhacke" + +#: hoes.lua +msgid "Bronze Hoe" +msgstr "Bronzehacke" + +#: hoes.lua +msgid "Mese Hoe" +msgstr "Mesehacke" + +#: hoes.lua +msgid "Diamond Hoe" +msgstr "Diamanthacke" + +#: init.lua +msgid "Seed" +msgstr "Saatgut" + +#: melon.lua +msgid "Melon Slice" +msgstr "Melonenscheibe" + +#: melon.lua +msgid "Melon" +msgstr "Melone" + +#: potato.lua +msgid "Potato" +msgstr "Kartoffel" + +#: potato.lua +msgid "Baked Potato" +msgstr "Ofenkartoffel" + +#: pumpkin.lua +msgid "Pumpkin" +msgstr "Kürbis" + +#: pumpkin.lua +msgid "Pumpkin Slice" +msgstr "Kürbisscheibe" + +#: pumpkin.lua +msgid "Jack 'O Lantern (punch to turn on and off)" +msgstr "Kürbislaterne (Punch zum Ein- und Ausschalten)" + +#: pumpkin.lua +msgid "Pumpkin Bread" +msgstr "Kürbisbrot" + +#: pumpkin.lua +msgid "Pumpkin Dough" +msgstr "Kürbisteig" + +#: raspberry.lua +msgid "Raspberries" +msgstr "Himbeeren" + +#: raspberry.lua +msgid "Raspberry Smoothie" +msgstr "Himbeersmoothie" + +#: rhubarb.lua +msgid "Rhubarb" +msgstr "Rhabarber" + +#: rhubarb.lua +msgid "Rhubarb Pie" +msgstr "Rhabarberkuchen" + +#: soil.lua +msgid "Soil" +msgstr "Ackerboden" + +#: soil.lua +msgid "Wet Soil" +msgstr "Bewässerter Ackerboden" + +#: sugar.lua +msgid "Sugar" +msgstr "Zucker" + +#: tomato.lua +msgid "Tomato" +msgstr "Tomate" + +#: wheat.lua +msgid "Wheat Seed" +msgstr "Weizenkörner" + +#: wheat.lua +msgid "Wheat" +msgstr "Weizen" + +#: wheat.lua +msgid "Straw" +msgstr "Stroh" + +#: wheat.lua +msgid "Flour" +msgstr "Mehl" + +#: wheat.lua +msgid "Bread" +msgstr "Brot" diff --git a/farming/locale/pt.po b/farming/locale/pt.po new file mode 100644 index 0000000..bc4352f --- /dev/null +++ b/farming/locale/pt.po @@ -0,0 +1,258 @@ +# Portuguese Translation for farming mod. +# Copyright (C) 2017 +# This file is distributed under the same license as the farming package. +# BrunoMine , 2017. +# +msgid "" +msgstr "" +"Project-Id-Version: 1.27\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-08-16 17:38-0300\n" +"PO-Revision-Date: 2017-08-17 17:01-0300\n" +"Last-Translator: BrunoMine \n" +"Language-Team: \n" +"Language: Portuguese\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Gtranslator 2.91.7\n" + +#: barley.lua +msgid "Barley Seed" +msgstr "Sementes de Cevada" + +#: barley.lua +msgid "Barley" +msgstr "Cevada" + +#: beanpole.lua +msgid "Green Beans" +msgstr "Feijoes Verdes" + +#: beanpole.lua +msgid "Bean Pole (place on soil before planting beans)" +msgstr "Apoio de feijao (coloque no solo antes de plantar feijao)" + +#: blueberry.lua +msgid "Blueberries" +msgstr "Mirtilos" + +#: blueberry.lua +msgid "Blueberry Muffin" +msgstr "Muffin de Mirtilos" + +#: carrot.lua +msgid "Carrot" +msgstr "Cenoura" + +#: carrot.lua +msgid "Golden Carrot" +msgstr "Cenoura Dourada" + +#: cocoa.lua +msgid "Cocoa Beans" +msgstr "Amendoas de Cacau" + +#: cocoa.lua +msgid "Cookie" +msgstr "Cookie" + +#: cocoa.lua +msgid "Bar of Dark Chocolate" +msgstr "Barra de Chocolate Preto" + +#: coffee.lua +msgid "Coffee Beans" +msgstr "Grao de Cafe" + +#: coffee.lua +msgid "Drinking Cup (empty)" +msgstr "Xicara (vazia)" + +#: coffee.lua +msgid "Cold Cup of Coffee" +msgstr "Xicara de Cafe Frio" + +#: coffee.lua +msgid "Hot Cup of Coffee" +msgstr "Xicara de Cafe Quente" + +#: corn.lua +msgid "Corn" +msgstr "Milho" + +#: corn.lua +msgid "Corn on the Cob" +msgstr "Espiga de Milho" + +#: corn.lua +msgid "Bottle of Ethanol" +msgstr "Garrafa de Etanol" + +#: cotton.lua +msgid "Cotton Seed" +msgstr "Sementes de Algodao" + +#: cotton.lua +msgid "Cotton" +msgstr "Algodao" + +#: cucumber.lua +msgid "Cucumber" +msgstr "Pepino" + +#: donut.lua +msgid "Donut" +msgstr "Donut" + +#: donut.lua +msgid "Chocolate Donut" +msgstr "Donut de Chocolate" + +#: donut.lua +msgid "Apple Donut" +msgstr "Donut de Maça" + +#: grapes.lua +msgid "Grapes" +msgstr "Uvas" + +#: grapes.lua +msgid "Trellis (place on soil before planting grapes)" +msgstr "Grade de Ripas (colocar no solo antes de plantar uvas)" + +#: hemp.lua +msgid "Hemp Seed" +msgstr "Sementes de Canhamo" + +#: hemp.lua +msgid "Hemp Leaf" +msgstr "Folha de Canhamo" + +#: hemp.lua +msgid "Bottle of Hemp Oil" +msgstr "Garrafa de Oleo de Canhamo" + +#: hemp.lua +msgid "Hemp Fibre" +msgstr "Fibra de Canhamo" + +#: hemp.lua +msgid "Hemp Rope" +msgstr "Corda de Canhamo" + +#: hoes.lua +msgid "Wooden Hoe" +msgstr "Enxada de Madeira" + +#: hoes.lua +msgid "Stone Hoe" +msgstr "Enxada de Pedra" + +#: hoes.lua +msgid "Steel Hoe" +msgstr "Enxada de Aço" + +#: hoes.lua +msgid "Bronze Hoe" +msgstr "Enxada de Bronze" + +#: hoes.lua +msgid "Mese Hoe" +msgstr "Enxada de Mese" + +#: hoes.lua +msgid "Diamond Hoe" +msgstr "Enxada de Diamante" + +#: init.lua +msgid "Seed" +msgstr "Sementes" + +#: melon.lua +msgid "Melon Slice" +msgstr "Sementes de Melancia" + +#: melon.lua +msgid "Melon" +msgstr "Melancia" + +#: potato.lua +msgid "Potato" +msgstr "Batata" + +#: potato.lua +msgid "Baked Potato" +msgstr "Batata Cozida" + +#: pumpkin.lua +msgid "Pumpkin" +msgstr "Abobora" + +#: pumpkin.lua +msgid "Pumpkin Slice" +msgstr "Pedaço de Abobora" + +#: pumpkin.lua +msgid "Jack 'O Lantern (punch to turn on and off)" +msgstr "Jack 'O Lantern (Socos para ligar e desligar)" + +#: pumpkin.lua +msgid "Pumpkin Bread" +msgstr "Pao de Abobora" + +#: pumpkin.lua +msgid "Pumpkin Dough" +msgstr "Massa de Abobora" + +#: raspberry.lua +msgid "Raspberries" +msgstr "Framboesa" + +#: raspberry.lua +msgid "Raspberry Smoothie" +msgstr "Batida de Framboesa" + +#: rhubarb.lua +msgid "Rhubarb" +msgstr "Ruibarbo" + +#: rhubarb.lua +msgid "Rhubarb Pie" +msgstr "Torta de Ruibarbo" + +#: soil.lua +msgid "Soil" +msgstr "Solo" + +#: soil.lua +msgid "Wet Soil" +msgstr "Solo Seco" + +#: sugar.lua +msgid "Sugar" +msgstr "Açucar" + +#: tomato.lua +msgid "Tomato" +msgstr "Tomate" + +#: wheat.lua +msgid "Wheat Seed" +msgstr "Sementes de Trigo" + +#: wheat.lua +msgid "Wheat" +msgstr "Trigo" + +#: wheat.lua +msgid "Straw" +msgstr "Palha" + +#: wheat.lua +msgid "Flour" +msgstr "Farinha" + +#: wheat.lua +msgid "Bread" +msgstr "Pao" diff --git a/farming/locale/template.pot b/farming/locale/template.pot new file mode 100644 index 0000000..210d946 --- /dev/null +++ b/farming/locale/template.pot @@ -0,0 +1,258 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-08-16 17:38-0300\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: barley.lua +msgid "Barley Seed" +msgstr "" + +#: barley.lua +msgid "Barley" +msgstr "" + +#: beanpole.lua +msgid "Green Beans" +msgstr "" + +#: beanpole.lua +msgid "Bean Pole (place on soil before planting beans)" +msgstr "" + +#: blueberry.lua +msgid "Blueberries" +msgstr "" + +#: blueberry.lua +msgid "Blueberry Muffin" +msgstr "" + +#: carrot.lua +msgid "Carrot" +msgstr "" + +#: carrot.lua +msgid "Golden Carrot" +msgstr "" + +#: cocoa.lua +msgid "Cocoa Beans" +msgstr "" + +#: cocoa.lua +msgid "Cookie" +msgstr "" + +#: cocoa.lua +msgid "Bar of Dark Chocolate" +msgstr "" + +#: coffee.lua +msgid "Coffee Beans" +msgstr "" + +#: coffee.lua +msgid "Drinking Cup (empty)" +msgstr "" + +#: coffee.lua +msgid "Cold Cup of Coffee" +msgstr "" + +#: coffee.lua +msgid "Hot Cup of Coffee" +msgstr "" + +#: corn.lua +msgid "Corn" +msgstr "" + +#: corn.lua +msgid "Corn on the Cob" +msgstr "" + +#: corn.lua +msgid "Bottle of Ethanol" +msgstr "" + +#: cotton.lua +msgid "Cotton Seed" +msgstr "" + +#: cotton.lua +msgid "Cotton" +msgstr "" + +#: cucumber.lua +msgid "Cucumber" +msgstr "" + +#: donut.lua +msgid "Donut" +msgstr "" + +#: donut.lua +msgid "Chocolate Donut" +msgstr "" + +#: donut.lua +msgid "Apple Donut" +msgstr "" + +#: grapes.lua +msgid "Grapes" +msgstr "" + +#: grapes.lua +msgid "Trellis (place on soil before planting grapes)" +msgstr "" + +#: hemp.lua +msgid "Hemp Seed" +msgstr "" + +#: hemp.lua +msgid "Hemp Leaf" +msgstr "" + +#: hemp.lua +msgid "Bottle of Hemp Oil" +msgstr "" + +#: hemp.lua +msgid "Hemp Fibre" +msgstr "" + +#: hemp.lua +msgid "Hemp Rope" +msgstr "" + +#: hoes.lua +msgid "Wooden Hoe" +msgstr "" + +#: hoes.lua +msgid "Stone Hoe" +msgstr "" + +#: hoes.lua +msgid "Steel Hoe" +msgstr "" + +#: hoes.lua +msgid "Bronze Hoe" +msgstr "" + +#: hoes.lua +msgid "Mese Hoe" +msgstr "" + +#: hoes.lua +msgid "Diamond Hoe" +msgstr "" + +#: init.lua +msgid "Seed" +msgstr "" + +#: melon.lua +msgid "Melon Slice" +msgstr "" + +#: melon.lua +msgid "Melon" +msgstr "" + +#: potato.lua +msgid "Potato" +msgstr "" + +#: potato.lua +msgid "Baked Potato" +msgstr "" + +#: pumpkin.lua +msgid "Pumpkin" +msgstr "" + +#: pumpkin.lua +msgid "Pumpkin Slice" +msgstr "" + +#: pumpkin.lua +msgid "Jack 'O Lantern (punch to turn on and off)" +msgstr "" + +#: pumpkin.lua +msgid "Pumpkin Bread" +msgstr "" + +#: pumpkin.lua +msgid "Pumpkin Dough" +msgstr "" + +#: raspberry.lua +msgid "Raspberries" +msgstr "" + +#: raspberry.lua +msgid "Raspberry Smoothie" +msgstr "" + +#: rhubarb.lua +msgid "Rhubarb" +msgstr "" + +#: rhubarb.lua +msgid "Rhubarb Pie" +msgstr "" + +#: soil.lua +msgid "Soil" +msgstr "" + +#: soil.lua +msgid "Wet Soil" +msgstr "" + +#: sugar.lua +msgid "Sugar" +msgstr "" + +#: tomato.lua +msgid "Tomato" +msgstr "" + +#: wheat.lua +msgid "Wheat Seed" +msgstr "" + +#: wheat.lua +msgid "Wheat" +msgstr "" + +#: wheat.lua +msgid "Straw" +msgstr "" + +#: wheat.lua +msgid "Flour" +msgstr "" + +#: wheat.lua +msgid "Bread" +msgstr "" diff --git a/farming/lucky_block.lua b/farming/lucky_block.lua index 94d7d36..01b4c27 100644 --- a/farming/lucky_block.lua +++ b/farming/lucky_block.lua @@ -15,5 +15,7 @@ if minetest.get_modpath("lucky_block") then {"nod", "farming:melon", 0}, {"dro", {"farming:donut", "farming:donut_chocolate", "farming:donut_apple"}, 5}, {"dro", {"farming:hemp_leaf", "farming:hemp_fibre", "farming:seed_hemp"}, 5}, + {"nod", "fire:permanent_flame", 1}, + {"dro", {"farming:chili_pepper", "farming:chili_bowl"}, 5}, }) end diff --git a/farming/mapgen.lua b/farming/mapgen.lua index 090c193..929f181 100644 --- a/farming/mapgen.lua +++ b/farming/mapgen.lua @@ -12,7 +12,7 @@ local function register_plant(name, min, max, spawnby, num, enabled) sidelen = 16, noise_params = { offset = 0, - scale = 0.006, + scale = farming.rarety, -- 0.006, spread = {x = 100, y = 100, z = 100}, seed = 329, octaves = 3, @@ -60,7 +60,7 @@ minetest.register_decoration({ sidelen = 16, noise_params = { offset = 0, - scale = 0.06, + scale = farming.rarety, -- 0.06, spread = {x = 100, y = 100, z = 100}, seed = 420, octaves = 3, @@ -73,3 +73,24 @@ minetest.register_decoration({ num_spawn_by = 1, }) end + +if farming.chili then +minetest.register_decoration({ + deco_type = "simple", + place_on = {"default:dirt_with_grass", "default:dirt_with_rainforest_litter"}, + sidelen = 16, + noise_params = { + offset = 0, + scale = farming.rarety, -- 0.06, + spread = {x = 100, y = 100, z = 100}, + seed = 760, + octaves = 3, + persist = 0.6 + }, + y_min = 5, + y_max = 35, + decoration = {"farming:chili_8"}, + spawn_by = "group:tree", + num_spawn_by = 1, +}) +end diff --git a/farming/textures/farming_chili_1.png b/farming/textures/farming_chili_1.png new file mode 100644 index 0000000..aa11988 Binary files /dev/null and b/farming/textures/farming_chili_1.png differ diff --git a/farming/textures/farming_chili_2.png b/farming/textures/farming_chili_2.png new file mode 100644 index 0000000..ae34506 Binary files /dev/null and b/farming/textures/farming_chili_2.png differ diff --git a/farming/textures/farming_chili_3.png b/farming/textures/farming_chili_3.png new file mode 100644 index 0000000..5e1d901 Binary files /dev/null and b/farming/textures/farming_chili_3.png differ diff --git a/farming/textures/farming_chili_4.png b/farming/textures/farming_chili_4.png new file mode 100644 index 0000000..d97769b Binary files /dev/null and b/farming/textures/farming_chili_4.png differ diff --git a/farming/textures/farming_chili_5.png b/farming/textures/farming_chili_5.png new file mode 100644 index 0000000..dd4755d Binary files /dev/null and b/farming/textures/farming_chili_5.png differ diff --git a/farming/textures/farming_chili_6.png b/farming/textures/farming_chili_6.png new file mode 100644 index 0000000..4ee057b Binary files /dev/null and b/farming/textures/farming_chili_6.png differ diff --git a/farming/textures/farming_chili_7.png b/farming/textures/farming_chili_7.png new file mode 100644 index 0000000..5912c2e Binary files /dev/null and b/farming/textures/farming_chili_7.png differ diff --git a/farming/textures/farming_chili_8.png b/farming/textures/farming_chili_8.png new file mode 100644 index 0000000..976eb52 Binary files /dev/null and b/farming/textures/farming_chili_8.png differ diff --git a/farming/textures/farming_chili_bowl.png b/farming/textures/farming_chili_bowl.png new file mode 100644 index 0000000..6454ba3 Binary files /dev/null and b/farming/textures/farming_chili_bowl.png differ diff --git a/farming/textures/farming_chili_pepper.png b/farming/textures/farming_chili_pepper.png new file mode 100644 index 0000000..922cec4 Binary files /dev/null and b/farming/textures/farming_chili_pepper.png differ diff --git a/farming/textures/farming_cotton.png b/farming/textures/farming_cotton.png index e2bbfd7..8aa50e4 100644 Binary files a/farming/textures/farming_cotton.png and b/farming/textures/farming_cotton.png differ diff --git a/farming/textures/farming_porridge.png b/farming/textures/farming_porridge.png new file mode 100644 index 0000000..cd4466f Binary files /dev/null and b/farming/textures/farming_porridge.png differ diff --git a/farming/textures/farming_string.png b/farming/textures/farming_string.png new file mode 100644 index 0000000..e2bbfd7 Binary files /dev/null and b/farming/textures/farming_string.png differ diff --git a/farming/wheat.lua b/farming/wheat.lua index 65e5ce6..79988b6 100644 --- a/farming/wheat.lua +++ b/farming/wheat.lua @@ -8,7 +8,7 @@ minetest.register_node("farming:seed_wheat", { inventory_image = "farming_wheat_seed.png", wield_image = "farming_wheat_seed.png", drawtype = "signlike", - groups = {seed = 1, snappy = 3, attached_node = 1}, + groups = {seed = 1, snappy = 3, attached_node = 1, flammable = 4}, paramtype = "light", paramtype2 = "wallmounted", walkable = false, @@ -23,6 +23,7 @@ minetest.register_node("farming:seed_wheat", { minetest.register_craftitem("farming:wheat", { description = S("Wheat"), inventory_image = "farming_wheat.png", + groups = {flammable = 4}, }) -- straw @@ -30,7 +31,7 @@ minetest.register_node("farming:straw", { description = S("Straw"), tiles = {"farming_straw.png"}, is_ground_content = false, - groups = {snappy = 3, flammable = 4}, + groups = {snappy = 3, flammable = 4, fall_damage_add_percent = -30}, sounds = default.node_sound_leaves_defaults(), }) @@ -54,6 +55,7 @@ minetest.register_craft({ minetest.register_craftitem("farming:flour", { description = S("Flour"), inventory_image = "farming_flour.png", + groups = {flammable = 1}, }) minetest.register_craft({ @@ -67,6 +69,7 @@ minetest.register_craftitem("farming:bread", { description = S("Bread"), inventory_image = "farming_bread.png", on_use = minetest.item_eat(5), + groups = {flammable = 2}, }) minetest.register_craft({ @@ -81,13 +84,15 @@ local crop_def = { drawtype = "plantlike", tiles = {"farming_wheat_1.png"}, paramtype = "light", + paramtype2 = "meshoptions", + place_param2 = 3, sunlight_propagates = true, walkable = false, buildable_to = true, drop = "", selection_box = farming.select, groups = { - snappy = 3, flammable = 2, plant = 1, attached_node = 1, + snappy = 3, flammable = 4, plant = 1, attached_node = 1, not_in_creative_inventory = 1, growing = 1 }, sounds = default.node_sound_leaves_defaults() @@ -152,3 +157,16 @@ crop_def.drop = { } } minetest.register_node("farming:wheat_8", table.copy(crop_def)) + +-- fuels +minetest.register_craft({ + type = "fuel", + recipe = "farming:straw", + burntime = 3, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "farming:wheat", + burntime = 1, +}) diff --git a/framedglass/init.lua b/framedglass/init.lua index d42a07b..06b4472 100644 --- a/framedglass/init.lua +++ b/framedglass/init.lua @@ -39,7 +39,7 @@ minetest.register_craft({ }) minetest.register_node("framedglass:wooden_framed_glass", { - description = "Wooden-framed Glass", + description = "Деревянное окно", drawtype = "glasslike_framed", tiles = {"framedglass_wooden_frame.png","framedglass_glass_face_streaks.png"}, paramtype = "light", @@ -49,7 +49,7 @@ minetest.register_node("framedglass:wooden_framed_glass", { }) minetest.register_node("framedglass:steel_framed_glass", { - description = "Steel-framed Glass", + description = "Стальное окно", drawtype = "glasslike_framed", tiles = {"framedglass_steel_frame.png","framedglass_glass_face_streaks.png"}, paramtype = "light", @@ -59,7 +59,7 @@ minetest.register_node("framedglass:steel_framed_glass", { }) minetest.register_node("framedglass:wooden_framed_obsidian_glass", { - description = "Wooden-framed Obsidian Glass", + description = "Деревянное окно с обсидиановым стеклом", drawtype = "glasslike_framed", tiles = {"framedglass_wooden_frame.png","framedglass_glass_face_clean.png"}, paramtype = "light", @@ -164,7 +164,7 @@ local return_dye_after_dig = function(pos, oldnode, oldmetadata, digger) end minetest.register_node("framedglass:steel_framed_obsidian_glass", { - description = "Steel-framed Obsidian Glass", + description = "Стальное окно с обсидиановым стеклом", drawtype = "glasslike_framed", tiles = {"framedglass_steel_frame.png","framedglass_glass_face_clean.png"}, paramtype = "light", @@ -177,7 +177,7 @@ minetest.register_node("framedglass:steel_framed_obsidian_glass", { function add_coloured_framedglass(name, desc, color) minetest.register_node( "framedglass:steel_framed_obsidian_glass"..name, { - description = "Steel-framed "..desc.." Obsidian Glass", + description = "Стальное окно с "..desc.." обсидиановым стеклом", tiles = { "framedglass_steel_frame.png", { name = "framedglass_whiteglass.png", color = color } @@ -195,20 +195,20 @@ function add_coloured_framedglass(name, desc, color) }) end -add_coloured_framedglass ("red", "Red", 0xffff0000) -add_coloured_framedglass ("orange", "Orange", 0xfffe7f00) -add_coloured_framedglass ("yellow", "Yellow", 0xffffff01) -add_coloured_framedglass ("green", "Green", 0xff0cff00) -add_coloured_framedglass ("cyan", "Cyan", 0xff7affff) -add_coloured_framedglass ("blue", "Blue", 0xff1600ff) -add_coloured_framedglass ("violet", "Violet", 0xff7d00ff) -add_coloured_framedglass ("magenta", "Magenta", 0xfffd05ff) - -add_coloured_framedglass ("darkgreen", "Dark Green", 0xff144f00) -add_coloured_framedglass ("pink", "Pink", 0xffffa4a4) -add_coloured_framedglass ("brown", "Brown", 0xff542a00) - -add_coloured_framedglass ("white", "White", 0xffffffff) -add_coloured_framedglass ("grey", "Grey", 0xff7f817e) -add_coloured_framedglass ("darkgrey", "Dark Grey", 0xff3f403e) -add_coloured_framedglass ("black", "Black", 0xff000000) +add_coloured_framedglass ("red", "красным", 0xffff0000) +add_coloured_framedglass ("orange", "оранжевым", 0xfffe7f00) +add_coloured_framedglass ("yellow", "жёлтым", 0xffffff01) +add_coloured_framedglass ("green", "зелёным", 0xff0cff00) +add_coloured_framedglass ("cyan", "голубым", 0xff7affff) +add_coloured_framedglass ("blue", "синим", 0xff1600ff) +add_coloured_framedglass ("violet", "фиолетовым", 0xff7d00ff) +add_coloured_framedglass ("magenta", "пурпурным", 0xfffd05ff) + +add_coloured_framedglass ("darkgreen", "тёмно-зелёным", 0xff144f00) +add_coloured_framedglass ("pink", "розовым", 0xffffa4a4) +add_coloured_framedglass ("brown", "коричневым", 0xff542a00) + +add_coloured_framedglass ("white", "белым", 0xffffffff) +add_coloured_framedglass ("grey", "серым", 0xff7f817e) +add_coloured_framedglass ("darkgrey", "тёмно-серым", 0xff3f403e) +add_coloured_framedglass ("black", "чёрным", 0xff000000) diff --git a/gloopblocks/locale/ru.po b/gloopblocks/locale/ru.po new file mode 100644 index 0000000..68cb7f8 --- /dev/null +++ b/gloopblocks/locale/ru.po @@ -0,0 +1,176 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-05-14 06:45+0200\n" +"PO-Revision-Date: 2017-08-17 12:47+0300\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.0.3\n" +"Last-Translator: inpos \n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"Language: ru\n" + +msgid "Diagonal Rainbow Block" +msgstr "Блок с радугой по диагонали" + +msgid "Horizontal Rainbow Block" +msgstr "Блок с радугой по горизонтали" + +msgid "Cement" +msgstr "Цемент" + +msgid "Evil Block" +msgstr "Злой блок" + +msgid "Basalt" +msgstr "Базальт" + +msgid "Pumice" +msgstr "Пемза" + +msgid "Pavement" +msgstr "Мостовая" + +msgid "Oerkki Block" +msgstr "Блок Оеркки" + +msgid "Mossy Stone Brick" +msgstr "Кирпич из мшистого камня" + +msgid "Mossy Stone" +msgstr "Мшистый камень" + +msgid "Cobblestone Road Bed" +msgstr "Брусчатка" + +msgid "Mossy Cobblestone Road Bed" +msgstr "Мшистая брусчатка" + +msgid "Wooden Scaffold" +msgstr "Деревянные строительные леса" + +msgid "Cobblestone Roadbed" +msgstr "Брусчатка" + +msgid "Mossy Cobblestone Roadbed" +msgstr "Мшистая брусчатка" + +msgid "Rainbow Block" +msgstr "Радужный блок" + +msgid "Glow Crystal" +msgstr "Светящийся хрусталь" + +msgid "Glow Emerald" +msgstr "Светящийся изумруд" + +msgid "Glow Mese" +msgstr "Светящийся камень" + +msgid "Mossy Stone Stair" +msgstr "Ступенька из мшистого камня" + +msgid "Mossy Stone Slab" +msgstr "Плита из мшистого камня" + +msgid "Mossy Cobble Stair" +msgstr "Ступенька из мшистого булыжника" + +msgid "Mossy Cobble Slab" +msgstr "Плита из мшистого булыжника" + +msgid "Mossy Stone Brick Stair" +msgstr "Ступенька из мшистого каменного кирпича" + +msgid "Mossy Stone Brick Slab" +msgstr "Плита из мшистого каменного кирпича" + +msgid "Cobble Roadbed Stair" +msgstr "Ступенька из брусчатки" + +msgid "Cobble Roadbed Slab" +msgstr "Плита из брусчатки" + +msgid "Mossy Cobble Roadbed Stair" +msgstr "Ступенька из мшистой брусчатки" + +msgid "Mossy Cobble Roadbed Slab" +msgstr "Плита из мшистой брусчатки" + +msgid "Cement Stair" +msgstr "Ступенька из цемента" + +msgid "Cement Slab" +msgstr "Плита из цемента" + +msgid "Pavement Stair" +msgstr "Ступенька из мостовой" + +msgid "Pavement Slab" +msgstr "Плита из мостовой" + +msgid "Basalt Stair" +msgstr "Базальтовая ступенька" + +msgid "Basalt Slab" +msgstr "Базальтовая плита" + +msgid "Pumice Stair" +msgstr "Ступенька из пемзы" + +msgid "Pumice Slab" +msgstr "Плита из пемзы" + +msgid "Rainbow Block Stair" +msgstr "Ступенька из радужного блока" + +msgid "Rainbow Block Slab" +msgstr "Плита из радужного блока" + +msgid "Cement Pickaxe" +msgstr "Кирка из цемента" + +msgid "Cement Shovel" +msgstr "Лопата из цемента" + +msgid "Cement Axe" +msgstr "Топор из цемента" + +msgid "Cement Sword" +msgstr "Меч из цемента" + +msgid "Evil Pickaxe" +msgstr "Кирка зла" + +msgid "Evil Shovel" +msgstr "Лопата зла" + +msgid "Evil Axe" +msgstr "Топор зла" + +msgid "Evil Sword" +msgstr "Меч зла" + +msgid "Wet Cement" +msgstr "Мокрый цемент" + +msgid "Evil Stick" +msgstr "Злая палка" + +msgid "Obsidian" +msgstr "Обсидиан" + +msgid "Steel Fence" +msgstr "Стальной забор" + +msgid "Gloopblocks Loaded!" +msgstr "Gloopblocks загружен!" + diff --git a/homedecor/exterior.lua b/homedecor/exterior.lua index 4eed35c..a4e0fda 100644 --- a/homedecor/exterior.lua +++ b/homedecor/exterior.lua @@ -118,7 +118,7 @@ minetest.register_alias("homedecor:deckchair_head", "air") homedecor.register("deckchair_striped_blue", { mesh = "homedecor_deckchair.obj", tiles = {"homedecor_deckchair_striped_blue.png"}, - description = S("Deck Chair"), + description = S("Deck Chair (blue striped)"), groups = { snappy = 3 }, expand = { forward="placeholder" }, sounds = default.node_sound_wood_defaults(), @@ -368,7 +368,7 @@ local shrub_cbox = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 } for _, color in ipairs(homedecor.shrub_colors) do minetest.register_node("homedecor:shrubbery_large_"..color, { - description = S("Shrubbery (@1)", S(color)), + description = S("Shrubbery (large, @1)", S(color)), drawtype = "mesh", mesh = "homedecor_cube.obj", tiles = {"homedecor_shrubbery_"..color..".png"}, diff --git a/homedecor/handlers/expansion.lua b/homedecor/handlers/expansion.lua index c010bf4..e9d2ec5 100644 --- a/homedecor/handlers/expansion.lua +++ b/homedecor/handlers/expansion.lua @@ -368,14 +368,6 @@ function homedecor.place_banister(itemstack, placer, pointed_thing) fdir = right_fwd_node.param2 pos = fwd_pos new_place_name = string.gsub(right_fwd_node.name, "_diagonal_.-$", "_horizontal") - - -- try to follow a horizontal with another of the same - elseif left_node and string.find(left_node.name, "homedecor:banister_.*_horizontal") then - fdir = left_node.param2 - new_place_name = left_node.name - elseif right_node and string.find(right_node.name, "homedecor:banister_.*_horizontal") then - fdir = right_node.param2 - new_place_name = right_node.name end -- manually invert left-right orientation diff --git a/homedecor/window_treatments.lua b/homedecor/window_treatments.lua index d6d776b..71935b0 100644 --- a/homedecor/window_treatments.lua +++ b/homedecor/window_treatments.lua @@ -129,7 +129,7 @@ minetest.register_node("homedecor:curtain_closed", { }) minetest.register_node("homedecor:curtain_open", { - description = S("Curtains"), + description = S("Curtains (open)"), tiles = { "homedecor_curtain_open.png" }, inventory_image = "homedecor_curtain_open.png", drawtype = 'signlike', diff --git a/homedecor_i18n/locale/de.po b/homedecor_i18n/locale/de.po index b508ee0..b208dd2 100644 --- a/homedecor_i18n/locale/de.po +++ b/homedecor_i18n/locale/de.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-08-03 20:37+0200\n" -"PO-Revision-Date: 2017-07-30 17:09+0200\n" +"PO-Revision-Date: 2017-08-13 13:26+0200\n" "Last-Translator: Wuzzy \n" "Language-Team: German\n" "Language: de\n" @@ -73,18 +73,16 @@ msgid "Marble" msgstr "Marmor" #: ../building_blocks/init.lua -#, fuzzy msgid "Grass" -msgstr "Messing" +msgstr "Gras" #: ../building_blocks/init.lua msgid "Tar" msgstr "Teer" #: ../building_blocks/init.lua -#, fuzzy msgid "Roofing" -msgstr "Dachstufe" +msgstr "Dachdeckung" #: ../building_blocks/init.lua msgid "Marble stair" @@ -220,23 +218,23 @@ msgstr "Unverarbeiteter Kunststoff" #: ../computer/tetris.lua msgid "L" -msgstr "" +msgstr "L" #: ../computer/tetris.lua msgid "R" -msgstr "" +msgstr "R" #: ../computer/tetris.lua msgid "New Game" -msgstr "Neuese Spiel" +msgstr "Neues Spiel" #: ../computer/tetris.lua msgid "Next..." -msgstr "" +msgstr "Nächster …" #: ../computer/tetris.lua msgid "Score: " -msgstr "" +msgstr "Punktzahl: " #: ../computer/tetris.lua msgid "Tetris Arcade" @@ -328,11 +326,11 @@ msgstr "Duschbrause" #: ../homedecor/bathroom_sanitation.lua msgid "Bathtub, clawfoot, with brass taps" -msgstr "" +msgstr "Badewanne, Krallenfuß, mit Messingwasserhähnen" #: ../homedecor/bathroom_sanitation.lua msgid "Bathtub, clawfoot, with chrome taps" -msgstr "" +msgstr "Badewanne, Krallenfuß, mit Chromwasserhähnen" #: ../homedecor/bathroom_sanitation.lua msgid "Bathroom sundries set" @@ -371,8 +369,8 @@ msgid "Two-drawer Nightstand" msgstr "Nachttisch mit zwei Schubladen" #: ../homedecor/books.lua -msgid "Writable Book" -msgstr "Schreibbares Buch" +msgid "Writable Book (@1)" +msgstr "Schreibbares Buch (@1)" #: ../homedecor/books.lua msgid "@1 has written in a book (title: \"@2\"): \"@3\" at location @4" @@ -600,11 +598,11 @@ msgstr "Maschendrahtzauntor" #: ../homedecor/doors_and_gates.lua msgid "\"Half\" Door" -msgstr "" +msgstr "„Halbe“ Tür" #: ../homedecor/doors_and_gates.lua msgid "\"Half\" Door (white)" -msgstr "" +msgstr "„Halbe“ Tür (weiß)" #: ../homedecor/doors_and_gates.lua msgid "Japanese wall (top)" @@ -1296,8 +1294,12 @@ msgid "Metal tool cabinet and work table" msgstr "Metallwerkzeugschrank und Arbeitstisch" #: ../homedecor/misc-nodes.lua -msgid "Picture Frame" -msgstr "Bilderrahmen" +msgid "Picture Frame 1" +msgstr "Bilderrahmen 1" + +#: ../homedecor/misc-nodes.lua +msgid "Picture Frame 2" +msgstr "Bilderrahmen 2" #: ../homedecor/misc-nodes.lua msgid "Decorative painting #@1" @@ -1305,7 +1307,7 @@ msgstr "Dekoratives Gemälde Nr. @1" #: ../homedecor/misc-nodes.lua msgid "dark topped" -msgstr "dunkle Oberseite" +msgstr "dunkler Handlauf" #: ../homedecor/misc-nodes.lua msgid "diagonal" @@ -1540,19 +1542,16 @@ msgid "End Table" msgstr "Beitisch" #: ../lrfurn/init.lua -#, fuzzy msgid "Someone else owns the spot where other end goes!" -msgstr "Jemanden gehört schon der Platz, wo das Kopfende hingehen würde." +msgstr "Jemanden gehört schon die Stelle, wo das andere Ende hingehen würde." #: ../lrfurn/init.lua -#, fuzzy msgid "Someone else owns the spot where the middle or far end goes!" -msgstr "Jemanden gehört schon der Platz, wo das Kopfende hingehen würde." +msgstr "Jemanden gehört schon die Stelle, wo das mittlere oder ferne Stück hingehen würde." #: ../lrfurn/init.lua -#, fuzzy msgid "Someone else owns the spot where the other end goes!" -msgstr "Jemanden gehört schon der Platz, wo das Kopfende hingehen würde." +msgstr "Jemanden gehört schon die Stelle, wo das andere Ende hingehen würde." #: ../lrfurn/longsofas.lua msgid "Long Sofa" @@ -1578,8 +1577,23 @@ msgstr "Plasmafernseher" msgid "Plasma TV (off)" msgstr "Plasmafernseher (aus)" -#~ msgid "blue" -#~ msgstr "blau" +msgid "Tumble dryer" +msgstr "Wäschetrockner" + +msgid "Ironing board" +msgstr "Bügelbrett" + +msgid "Spiral Staircase" +msgstr "Wendeltreppe" + +msgid "Washing Machine" +msgstr "Waschmaschine" + +msgid "blue" +msgstr "blau" + +msgid "brown" +msgstr "braun" #~ msgid "white" #~ msgstr "weiß" @@ -1587,8 +1601,11 @@ msgstr "Plasmafernseher (aus)" #~ msgid "pink" #~ msgstr "rosa" -#~ msgid "violet" -#~ msgstr "violett" +msgid "violet" +msgstr "violett" + +msgid "grey" +msgstr "grau" #~ msgid "dark green" #~ msgstr "dunkelgrün" @@ -1639,8 +1656,7 @@ msgstr "Plasmafernseher (aus)" #~ msgstr "%s nimmt etwas aus dem Kuechenschrank bei %s" #~ msgid "Not enough space above that spot to place a door! " -#~ msgstr "" -#~ "Es gibt nicht genug Raum ueber dieser Stelle um die Tuer zu platzieren!" +#~ msgstr "Es gibt nicht genug Raum ueber dieser Stelle um die Tuer zu platzieren!" #~ msgid "Bucket of white paint " #~ msgstr "Eimer mit weisser Farbe" diff --git a/homedecor_i18n/locale/ru.po b/homedecor_i18n/locale/ru.po new file mode 100644 index 0000000..6995385 --- /dev/null +++ b/homedecor_i18n/locale/ru.po @@ -0,0 +1,1576 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-08-03 20:37+0200\n" +"PO-Revision-Date: 2017-08-21 16:17+0300\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.0.3\n" +"Last-Translator: inpos \n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"Language: ru\n" + +#: ../building_blocks/init.lua +msgid "Adobe" +msgstr "Саман" + +#: ../building_blocks/init.lua +msgid "Roof block" +msgstr "Кровельный блок" + +#: ../building_blocks/init.lua +msgid "Streak Free Glass" +msgstr "Стекло без стыков" + +#: ../building_blocks/init.lua +msgid "Grate" +msgstr "Каминная решётка" + +#: ../building_blocks/init.lua +msgid "Fireplace" +msgstr "Камин" + +#: ../building_blocks/init.lua +msgid "Wood Framed Glass" +msgstr "Деревянное окно" + +#: ../building_blocks/init.lua +msgid "Terrycloth towel" +msgstr "Махровое полотенце" + +#: ../building_blocks/init.lua +msgid "Tarmac Spread" +msgstr "Покрытие гудронной смолой" + +#: ../building_blocks/init.lua +msgid "Chess board tiling" +msgstr "Шахматная плитка" + +#. Translators: "Brobble" is a portmanteau of "Brick" and "Cobble". +#. Translate however you see fit. +#: ../building_blocks/init.lua +msgid "Brobble Spread" +msgstr "Настил кирпичного булыжника" + +#: ../building_blocks/init.lua +msgid "Gravel Spread" +msgstr "Настил гравия" + +#: ../building_blocks/init.lua +msgid "Hardwood" +msgstr "Твёрдая древесина" + +#: ../building_blocks/init.lua +msgid "Marble" +msgstr "Мрамор" + +#: ../building_blocks/init.lua +msgid "Grass" +msgstr "Трава" + +#: ../building_blocks/init.lua +msgid "Tar" +msgstr "Смола" + +#: ../building_blocks/init.lua +msgid "Roofing" +msgstr "Кровля" + +#: ../building_blocks/init.lua +msgid "Marble stair" +msgstr "Мраморная ступенька" + +#: ../building_blocks/init.lua +msgid "Marble slab" +msgstr "Мраморная блита" + +#: ../building_blocks/init.lua +msgid "Hardwood stair" +msgstr "Ступенька из твёрдой древесины" + +#: ../building_blocks/init.lua +msgid "Hardwood slab" +msgstr "Плита из твёрдой древесины" + +#: ../building_blocks/init.lua +msgid "Grass stair" +msgstr "Ступенька из травы" + +#: ../building_blocks/init.lua +msgid "Grass slab" +msgstr "Плита из травы" + +#: ../building_blocks/init.lua +msgid "Tar stair" +msgstr "Ступенька из смолы" + +#: ../building_blocks/init.lua +msgid "Tar slab" +msgstr "Плита из смолы" + +#: ../building_blocks/init.lua +msgid "Grate Stair" +msgstr "Решётчатая ступенька" + +#: ../building_blocks/init.lua +msgid "Grate Slab" +msgstr "Решётчатая плита" + +#: ../building_blocks/init.lua +msgid "Adobe stair" +msgstr "Саманная ступенька" + +#: ../building_blocks/init.lua +msgid "Adobe slab" +msgstr "Саманная плита" + +#: ../building_blocks/init.lua +msgid "Roofing stair" +msgstr "Ступенька из кровли" + +#: ../building_blocks/init.lua +msgid "Roofing slab" +msgstr "Плита из кровли" + +#: ../building_blocks/init.lua +msgid "Fake Grass" +msgstr "Псевдо трава" + +#: ../building_blocks/init.lua +msgid "Small bundle of sticks" +msgstr "Небольшая связка палок" + +#: ../building_blocks/init.lua +msgid "Tar base" +msgstr "Смоляная основа" + +#: ../building_blocks/init.lua +msgid "Tar Knife" +msgstr "Смоляной нож" + +#: ../building_blocks/init.lua +msgid "Granite" +msgstr "Гранит" + +#: ../chains/init.lua +msgid "Hanging chain (wrought iron)" +msgstr "Висящая цепь (кованое железо)" + +#: ../chains/init.lua +msgid "Hanging chain (brass)" +msgstr "Висящая цепь (латунь)" + +#: ../chains/init.lua +msgid "Hanging chain (ceiling mount, wrought iron)" +msgstr "Висящая цепь (потолочное крепление, кованое железо)" + +#: ../chains/init.lua +msgid "Hanging chain (ceiling mount, brass)" +msgstr "Висящая цепь (потолочное крепление, латунь)" + +#: ../chains/init.lua +msgid "Chandelier (wrought iron)" +msgstr "Люстра (кованое железо)" + +#: ../chains/init.lua +msgid "Chandelier (brass)" +msgstr "Люстра (латунь)" + +#: ../computer/computers.lua +msgid "Monitor and keyboard" +msgstr "Монитор и клавиатура" + +#: ../computer/computers.lua +msgid "WIFI Router" +msgstr "WIFI-роутер" + +#: ../computer/computers.lua +msgid "Computer Tower" +msgstr "Системный блок" + +#: ../computer/computers.lua +msgid "Printer-Scanner Combo" +msgstr "МФУ" + +#: ../computer/computers.lua +msgid "Rack Server" +msgstr "Стоечный сервер" + +#: ../computer/computers.lua +msgid "Not enough vertical space to place a server!" +msgstr "Недостаточно вертикального пространства для размещения сервера!" + +#: ../computer/miscitems.lua ../homedecor/crafts.lua +msgid "Plastic sheet" +msgstr "Лист пластика" + +#: ../computer/miscitems.lua +msgid "Unprocessed Plastic base" +msgstr "Необработанная пластиковая основа" + +#: ../computer/tetris.lua +msgid "L" +msgstr "Лев." + +#: ../computer/tetris.lua +msgid "R" +msgstr "Прав." + +#: ../computer/tetris.lua +msgid "New Game" +msgstr "Новая игра" + +#: ../computer/tetris.lua +msgid "Next..." +msgstr "Далее..." + +#: ../computer/tetris.lua +msgid "Score: " +msgstr "Счёт: " + +#: ../computer/tetris.lua +msgid "Tetris Arcade" +msgstr "Игровой автомат Тетрис" + +#: ../computer/tetris.lua +msgid "No room for place the Arcade!" +msgstr "Недостаточно места для размещения игрового автомата!" + +#: ../fake_fire/init.lua +msgid "Fake fire" +msgstr "Псевдо огонь" + +#: ../fake_fire/init.lua +msgid "Ice fire" +msgstr "Ледяной огонь" + +#: ../fake_fire/init.lua +msgid "Fancy Fire" +msgstr "Необычный огонь" + +#: ../fake_fire/init.lua +msgid "Glowing Embers" +msgstr "Светящиеся угли" + +#: ../fake_fire/init.lua +msgid "Stone chimney top" +msgstr "Каменный дымоход на крышу" + +#: ../fake_fire/init.lua +msgid "Sandstone chimney top" +msgstr "Дымоход из песчаника на крышу" + +#: ../fake_fire/init.lua +msgid "Flint and steel" +msgstr "Кремень и сталь" + +#: ../fake_fire/init.lua +msgid "This area is protected!" +msgstr "Эта область защищена!" + +#: ../homedecor/bathroom_furniture.lua +msgid "Bathroom/kitchen tiles (dark)" +msgstr "Плитка для ванной/кухни (тёмная)" + +#: ../homedecor/bathroom_furniture.lua +msgid "Bathroom/kitchen tiles (medium)" +msgstr "Плитка для ванной/кухни (обычная)" + +#: ../homedecor/bathroom_furniture.lua +msgid "Bathroom/kitchen tiles (light)" +msgstr "Плитка для ванной/кухни (светлая)" + +#: ../homedecor/bathroom_furniture.lua +msgid "Towel rod with towel" +msgstr "Полотенцедержатель с полотенцем" + +#: ../homedecor/bathroom_furniture.lua +msgid "Medicine cabinet" +msgstr "Медицинский кабинет" + +#: ../homedecor/bathroom_sanitation.lua +msgid "Toilet" +msgstr "Туалет" + +#: ../homedecor/bathroom_sanitation.lua +msgid "Toilet paper" +msgstr "Туалетная бумага" + +#: ../homedecor/bathroom_sanitation.lua +msgid "Bathroom Sink" +msgstr "Раковина для ванной комнаты" + +#: ../homedecor/bathroom_sanitation.lua +msgid "Bathroom taps/faucet" +msgstr "м" + +#: ../homedecor/bathroom_sanitation.lua +msgid "Bathroom taps/faucet (brass)" +msgstr "Краны(смесители) для ванной комнаты (латунь)" + +#: ../homedecor/bathroom_sanitation.lua +msgid "Shower Tray" +msgstr "Душевой поддон" + +#: ../homedecor/bathroom_sanitation.lua +msgid "Shower Head" +msgstr "Душевая лейка" + +#: ../homedecor/bathroom_sanitation.lua +msgid "Bathtub, clawfoot, with brass taps" +msgstr "Ванна на острых ножках с латунными кранами" + +#: ../homedecor/bathroom_sanitation.lua +msgid "Bathtub, clawfoot, with chrome taps" +msgstr "Ванна на острых ножках с хромированными кранами" + +#: ../homedecor/bathroom_sanitation.lua +msgid "Bathroom sundries set" +msgstr "Набор для ванных комнат" + +#: ../homedecor/bedroom.lua +msgid "Bed" +msgstr "Кровать" + +#: ../homedecor/bedroom.lua +msgid "Bed (king sized)" +msgstr "Кровать (большая)" + +#: ../homedecor/bedroom.lua +msgid "mahogany" +msgstr "красное дерево" + +#: ../homedecor/bedroom.lua +msgid "oak" +msgstr "дуб" + +#: ../homedecor/bedroom.lua +msgid "Nightstand with One Drawer (@1)" +msgstr "Тумба с одним ящиком (@1)" + +#: ../homedecor/bedroom.lua +msgid "One-drawer Nightstand" +msgstr "Тумба с одним ящиком" + +#: ../homedecor/bedroom.lua +msgid "Nightstand with Two Drawers (@1)" +msgstr "Тумба с двумя ящиками (@1)" + +#: ../homedecor/bedroom.lua +msgid "Two-drawer Nightstand" +msgstr "Тумба с двумя ящиками" + +#: ../homedecor/books.lua +msgid "Writable Book" +msgstr "Записная книга" + +#: ../homedecor/books.lua +msgid "@1 has written in a book (title: \"@2\"): \"@3\" at location @4" +msgstr "@1 написал в книге (заголовок: \"@2\"): \"@3\" в позиции @4" + +#: ../homedecor/climate-control.lua +msgid "Air Conditioner" +msgstr "Кондиционер" + +#: ../homedecor/climate-control.lua +msgid "Desk Fan" +msgstr "Настольный вентилятор" + +#: ../homedecor/climate-control.lua +msgid "Ceiling Fan" +msgstr "Потолочный вентилятор" + +#: ../homedecor/climate-control.lua +msgid "Space heater" +msgstr "Обогреватель" + +#: ../homedecor/climate-control.lua +msgid "Radiator heater" +msgstr "Масленый обогреватель" + +#: ../homedecor/clocks.lua +msgid "Plastic analog clock" +msgstr "Пластиковые стрелочные часы" + +#: ../homedecor/clocks.lua +msgid "Wooden analog clock" +msgstr "Деревянные стрелочные часы" + +#: ../homedecor/clocks.lua +msgid "Digital clock" +msgstr "Цифровые часы" + +#: ../homedecor/clocks.lua +msgid "Alarm clock" +msgstr "Будильник" + +#: ../homedecor/clocks.lua +msgid "Grandfather Clock" +msgstr "Дедушкины часы" + +#: ../homedecor/cobweb.lua +msgid "Cobweb" +msgstr "Паутина" + +#: ../homedecor/crafts.lua +msgid "Uncooked Terracotta Base" +msgstr "Необработанная терракотовая основа" + +#: ../homedecor/crafts.lua +msgid "Terracotta Roof Tile" +msgstr "Терракотовая крыша" + +#: ../homedecor/crafts.lua +msgid "Oil extract" +msgstr "Выжимка масла" + +#: ../homedecor/crafts.lua +msgid "Unprocessed paraffin" +msgstr "Необработанный парафин" + +#: ../homedecor/crafts.lua +msgid "Plastic strips" +msgstr "Пластиковые полоски" + +#: ../homedecor/crafts.lua +msgid "Small Wooden Drawer" +msgstr "Маленький деревянный выдвижной ящик" + +#: ../homedecor/crafts.lua +msgid "Simple Integrated Circuit" +msgstr "Простая интегральная схема" + +#: ../homedecor/crafts.lua +msgid "Heating element" +msgstr "" +"Нагревательный элемент\n" +"Предложить исправление" + +#: ../homedecor/crafts.lua +msgid "Motor" +msgstr "Двигатель" + +#: ../homedecor/crafts.lua +msgid "Power Crystal" +msgstr "Силовой кристалл" + +#: ../homedecor/crafts.lua +msgid "Blank Canvas" +msgstr "Пустой холст" + +#: ../homedecor/crafts.lua +msgid "VCR" +msgstr "Видеомагнитофон" + +#: ../homedecor/crafts.lua +msgid "DVD Player" +msgstr "DVD-проигрыватель" + +#: ../homedecor/crafts.lua +msgid "Spool of copper wire" +msgstr "Катушка из медной проволоки" + +#: ../homedecor/crafts.lua +msgid "Spool of steel wire" +msgstr "Катушка из стальной проволоки" + +#: ../homedecor/crafts.lua +msgid "Speaker driver" +msgstr "Динамик" + +#: ../homedecor/crafts.lua +msgid "Fan blades" +msgstr "Лопасти вентилятора" + +#: ../homedecor/crafts.lua +msgid "Copper Strip" +msgstr "Медные полоски" + +#: ../homedecor/crafts.lua +msgid "Steel Strip" +msgstr "Стальные полоски" + +#: ../homedecor/crafts.lua +msgid "Steel chainlink" +msgstr "Стальное звено цепи" + +#: ../homedecor/crafts.lua +msgid "Brass chainlink" +msgstr "Латунное звено цепи" + +#: ../homedecor/crafts.lua +msgid "Soda Can" +msgstr "Банка газировки" + +#: ../homedecor/crafts.lua +msgid "Gold Coin (for soda vending machine)" +msgstr "Золотая монета (для автомата с газировкой)" + +#: ../homedecor/crafts.lua +msgid "Silicon lump" +msgstr "Кусок кремния" + +#: ../homedecor/crafts.lua +msgid "Brass Ingot" +msgstr "Слиток латуни" + +#: ../homedecor/crafts.lua +msgid "Small Flower Pot" +msgstr "Маленький цветочный горшок" + +#: ../homedecor/doors_and_gates.lua +msgid "Mahogany Closet Door (@1 opening)" +msgstr "Дверь стенного шкафа из красного дерева (открывается @1)" + +#: ../homedecor/doors_and_gates.lua +msgid "Oak Closet Door (@1 opening)" +msgstr "Дверь стенного шкафа из дуба (открывается @1)" + +#: ../homedecor/doors_and_gates.lua +msgid "Fancy Wood/Glass Door (@1 opening)" +msgstr "Необычная деревянная/стеклянная дверь (открывается @1)" + +#: ../homedecor/doors_and_gates.lua +msgid "Glass Office Door (@1 opening)" +msgstr "Стеклянная офисная дверь (открывается @1)" + +#: ../homedecor/doors_and_gates.lua +msgid "Glass and Wood, Oak-colored (@1 opening)" +msgstr "Стекло и дерево, дуб (открывается @1)" + +#: ../homedecor/doors_and_gates.lua +msgid "Glass and Wood, Mahogany-colored (@1 opening)" +msgstr "Стекло и дерево, красное дерево (открывается @1)" + +#: ../homedecor/doors_and_gates.lua +msgid "Glass and Wood, White (@1 opening)" +msgstr "Стекло и дерево, Белое (открывается @1)" + +#: ../homedecor/doors_and_gates.lua +msgid "Plain Wooden Door (@1 opening)" +msgstr "Простая деревянная дверь (открывается @1)" + +#: ../homedecor/doors_and_gates.lua +msgid "White Bedroom Door (@1 opening)" +msgstr "Белая дверь спальни (открывается @1)" + +#: ../homedecor/doors_and_gates.lua +msgid "Wrought Iron Gate/Door (@1 opening)" +msgstr "Кованные железные ворота/дверь (открывается @1)" + +#: ../homedecor/doors_and_gates.lua +msgid "Wooden door with glass insert (@1 opening)" +msgstr "Деревянная дверь со стеклянной вставкой (открывается @1)" + +#: ../homedecor/doors_and_gates.lua +msgid "Wooden door with glass insert, type 2 (@1 opening)" +msgstr "Деревянная дверь со стеклянной вставкой, второй тип (открывается @1)" + +#: ../homedecor/doors_and_gates.lua +msgid "left" +msgstr "влево" + +#: ../homedecor/doors_and_gates.lua +msgid "right" +msgstr "вправо" + +#: ../homedecor/doors_and_gates.lua +msgid "Unpainted Picket Fence Gate" +msgstr "Некрашеные ворота для забора из частокола" + +#: ../homedecor/doors_and_gates.lua +msgid "White Picket Fence Gate" +msgstr "Белые ворота для забора из частокола" + +#: ../homedecor/doors_and_gates.lua +msgid "Barbed Wire Fence Gate" +msgstr "Ворота для забора из колючей проволоки" + +#: ../homedecor/doors_and_gates.lua +msgid "Chainlink Fence Gate" +msgstr "Ворота для цепного забора" + +#: ../homedecor/doors_and_gates.lua +msgid "\"Half\" Door" +msgstr "Полуразмерная дверь" + +#: ../homedecor/doors_and_gates.lua +msgid "\"Half\" Door (white)" +msgstr "Полуразмерная дверь (белая)" + +#: ../homedecor/doors_and_gates.lua +msgid "Japanese wall (top)" +msgstr "Японская стена (верх)" + +#: ../homedecor/doors_and_gates.lua +msgid "Japanese wall" +msgstr "Японская стена" + +#: ../homedecor/doors_and_gates.lua +msgid "Japanese wall (bottom)" +msgstr "Японская стена (низ)" + +#: ../homedecor/doors_and_gates.lua +msgid "Japanese tatami" +msgstr "Японский татами" + +#: ../homedecor/doors_and_gates.lua +msgid "Japanese-style door" +msgstr "Дверь в японском стиле" + +#: ../homedecor/electrics.lua +msgid "Power Outlet" +msgstr "Розетка" + +#: ../homedecor/electrics.lua +msgid "Light switch" +msgstr "Выключатель света" + +#: ../homedecor/electrics.lua +msgid "Doorbell" +msgstr "Дверной звонок" + +#: ../homedecor/electronics.lua +msgid "Large Stereo Speaker" +msgstr "Большой стерео громкоговоритель" + +#: ../homedecor/electronics.lua +msgid "Large Stereo Speaker, open front" +msgstr "Большой стерео громкоговоритель (открытый)" + +#: ../homedecor/electronics.lua +msgid "Small Surround Speaker" +msgstr "Малый круговой громкоговоритель" + +#: ../homedecor/electronics.lua +msgid "Stereo Receiver" +msgstr "Стерео приёмник" + +#: ../homedecor/electronics.lua +msgid "Projection Screen Material" +msgstr "Материал проекционного экрана" + +#: ../homedecor/electronics.lua +msgid "Small CRT Television" +msgstr "Малый кинескопный телевизор" + +#: ../homedecor/electronics.lua +msgid "DVD and VCR" +msgstr "DVD и Видеомагнитофон" + +#: ../homedecor/electronics.lua +msgid "Telephone" +msgstr "Телефон" + +#: ../homedecor/exterior.lua +msgid "Barbecue" +msgstr "Барбекю" + +#: ../homedecor/exterior.lua +msgid "Garden Bench (style 1)" +msgstr "Садовая скамья (1й стиль)" + +#: ../homedecor/exterior.lua +msgid "Garden Bench (style 2)" +msgstr "Садовая скамья (2й стиль)" + +#: ../homedecor/exterior.lua +msgid "Deck Chair" +msgstr "Шезлонг" + +#: ../homedecor/exterior.lua +msgid "Doghouse" +msgstr "Собачья будка" + +#: ../homedecor/exterior.lua +msgid "Simple Bench" +msgstr "Простая скамья" + +#: ../homedecor/exterior.lua +msgid "Garden stone path" +msgstr "Садовая каменная дорожка" + +#: ../homedecor/exterior.lua ../homedecor/kitchen_appliances.lua +#: ../homedecor/misc-nodes.lua ../homedecor/roofing.lua +#: ../homedecor/window_treatments.lua +msgid "wood" +msgstr "дерево" + +#: ../homedecor/exterior.lua +msgid "white wood" +msgstr "белое дерево" + +#: ../homedecor/exterior.lua +msgid "wood, with vegetation" +msgstr "дерево с растительностью" + +#: ../homedecor/exterior.lua +msgid "white wood, with vegetation" +msgstr "белое дерево с растительностью" + +#: ../homedecor/exterior.lua +msgid "Garden Lattice (@1)" +msgstr "Садовая решётка (@1)" + +#: ../homedecor/exterior.lua +msgid "Tree's swing" +msgstr "Качели для дерева" + +#: ../homedecor/exterior.lua +msgid "Water well" +msgstr "Колодец с водой" + +#: ../homedecor/exterior.lua ../homedecor/misc-nodes.lua +msgid "green" +msgstr "зелёный" + +#: ../homedecor/exterior.lua +msgid "red" +msgstr "красный" + +#: ../homedecor/exterior.lua +msgid "yellow" +msgstr "жёлтый" + +#: ../homedecor/exterior.lua +msgid "Shrubbery (@1)" +msgstr "Кустарник (@1)" + +#: ../homedecor/fences.lua ../homedecor/misc-nodes.lua ../homedecor/tables.lua +#: ../homedecor/window_treatments.lua +msgid "brass" +msgstr "латунь" + +#: ../homedecor/fences.lua ../homedecor/misc-nodes.lua ../homedecor/tables.lua +#: ../homedecor/window_treatments.lua +msgid "wrought iron" +msgstr "кованное железо" + +#: ../homedecor/fences.lua +msgid "Fence/railing (@1)" +msgstr "Забор/ограда (@1)" + +#: ../homedecor/fences.lua +msgid "Fence/railing with sign (@1)" +msgstr "Забор/ограда со знаком (@1)" + +#: ../homedecor/fences.lua +msgid "Unpainted Picket Fence" +msgstr "Некрашеный забор из частокола" + +#: ../homedecor/fences.lua +msgid "Unpainted Picket Fence Corner" +msgstr "Угол некрашеного забора из частокола" + +#: ../homedecor/fences.lua +msgid "White Picket Fence" +msgstr "Белый забор из частокола" + +#: ../homedecor/fences.lua +msgid "White Picket Fence Corner" +msgstr "Угол белого забора из частокола" + +#: ../homedecor/fences.lua +msgid "Wooden Privacy Fence" +msgstr "Деревянный глухой забор" + +#: ../homedecor/fences.lua +msgid "Wooden Privacy Fence Corner" +msgstr "Угол деревянного глухого забора" + +#: ../homedecor/fences.lua +msgid "Barbed Wire Fence" +msgstr "Забор из колючей проволоки" + +#: ../homedecor/fences.lua +msgid "Barbed Wire Fence Corner" +msgstr "Угол забора из колючей проволоки" + +#: ../homedecor/fences.lua +msgid "Chainlink Fence" +msgstr "Цепной забор" + +#: ../homedecor/fences.lua +msgid "Chainlink Fence Corner" +msgstr "Угол цепного забора" + +#: ../homedecor/fences.lua +msgid "Wrought Iron fence (type 2)" +msgstr "Кованный железный забор (2й тип)" + +#: ../homedecor/fences.lua +msgid "Wrought Iron fence (type 2) Corner" +msgstr "Угол кованного железного забора (2й тип)" + +#: ../homedecor/foyer.lua +msgid "Wall-mounted coat rack" +msgstr "Настенная вешалка для одежды" + +#: ../homedecor/foyer.lua +msgid "Coat tree" +msgstr "Стоечная вешалка для одежды" + +#: ../homedecor/foyer.lua +msgid "Green welcome mat" +msgstr "Зелёный коврик под входную дверь" + +#: ../homedecor/foyer.lua +msgid "Brown welcome mat" +msgstr "Коричневый коврик под входную дверь" + +#: ../homedecor/foyer.lua +msgid "Grey welcome mat" +msgstr "Серый коврик под входную дверь" + +#: ../homedecor/furniture.lua +msgid "Table" +msgstr "Стол" + +#: ../homedecor/furniture.lua +msgid "Mahogany Table" +msgstr "Стол из красного дерева" + +#: ../homedecor/furniture.lua +msgid "White Table" +msgstr "Белый стол" + +#: ../homedecor/furniture.lua +msgid "Kitchen chair" +msgstr "Кухонный стул" + +#: ../homedecor/furniture.lua ../lrfurn/armchairs.lua +msgid "Armchair" +msgstr "Кресло" + +#: ../homedecor/furniture.lua +msgid "Bookshelf (open-frame)" +msgstr "Книжная полка (открытая)" + +#: ../homedecor/furniture.lua +msgid "Wall Shelf" +msgstr "Настенная полка" + +#: ../homedecor/furniture_medieval.lua +msgid "Bars" +msgstr "Стержни" + +#: ../homedecor/furniture_medieval.lua +msgid "Binding Bars" +msgstr "Связующие стержни" + +#: ../homedecor/furniture_medieval.lua +msgid "Chains" +msgstr "Цепи" + +#: ../homedecor/furniture_medieval.lua +msgid "Wall Torch" +msgstr "Настенный факел" + +#: ../homedecor/furniture_medieval.lua +msgid "Wall Lamp" +msgstr "Настенная лампа" + +#: ../homedecor/gastronomy.lua +msgid "Cutlery set" +msgstr "Набор столовых приборов" + +#: ../homedecor/gastronomy.lua +msgid "Brown bottle" +msgstr "Коричневая бутылка" + +#: ../homedecor/gastronomy.lua +msgid "Four brown bottles" +msgstr "Четыре коричневых бутылки" + +#: ../homedecor/gastronomy.lua +msgid "Four green bottles" +msgstr "Четыре зелёных бутылки" + +#: ../homedecor/gastronomy.lua +msgid "Green bottle" +msgstr "Зелёная бутылка" + +#: ../homedecor/gastronomy.lua +msgid "Four misc brown/green bottles" +msgstr "Четыре разные коричневые/зелёные " + +#: ../homedecor/gastronomy.lua +msgid "Wine rack" +msgstr "Винный шкаф" + +#: ../homedecor/gastronomy.lua +msgid "Dartboard" +msgstr "Мишень для дротиков" + +#: ../homedecor/gastronomy.lua +msgid "Beer tap" +msgstr "Пивной кран" + +#: ../homedecor/gastronomy.lua +msgid "Ahh, a frosty cold beer - look in your inventory for it!" +msgstr "О, холодное пиво! Ищи его в инвентаре!" + +#: ../homedecor/gastronomy.lua +msgid "No room in your inventory to add a beer mug!" +msgstr "В инвентаре нет места для пивной кружки!" + +#: ../homedecor/gastronomy.lua +msgid "Beer mug" +msgstr "Пивная кружка" + +#: ../homedecor/gastronomy.lua +msgid "Soda vending machine" +msgstr "Автомат с газировкой" + +#: ../homedecor/gastronomy.lua +msgid "Please insert a coin in the machine." +msgstr "Вставьте монету в автомат." + +#: ../homedecor/handlers/expansion.lua +msgid "Not enough room - the space for the headboard is occupied!" +msgstr "Не хватает места - пространство для изголовья занято!" + +#: ../homedecor/handlers/expansion.lua +msgid "Someone already owns the spot where the headboard goes." +msgstr "Точка, куда ставится изголовье, уже принадлежит кому-то." + +#: ../homedecor/handlers/expansion.lua +msgid "Not enough room - the upper space is occupied!" +msgstr "Не хватает места - верхнее пространство занято!" + +#: ../homedecor/handlers/expansion.lua +msgid "Someone already owns that spot." +msgstr "Та точка уже принадлежит кому-то." + +#: ../homedecor/handlers/furnaces.lua +msgid "Furnace" +msgstr "Печь" + +#: ../homedecor/handlers/furnaces.lua +msgid "@1 (empty)" +msgstr "@1 (пусто)" + +#: ../homedecor/handlers/furnaces.lua +msgid "@1 (active)" +msgstr "@1 (активно)" + +#: ../homedecor/handlers/furnaces.lua +msgid "@1 (active: @2%)" +msgstr "@1 (активно: @2%)" + +#: ../homedecor/handlers/furnaces.lua +msgid "@1 (out of fuel)" +msgstr "@1 (не хватает топлива)" + +#: ../homedecor/handlers/furnaces.lua +msgid "@1 (output bins are full)" +msgstr "@1 (выходные ячейки заполнены)" + +#: ../homedecor/handlers/inventory.lua +msgid "@1 moves stuff in @2 at @3" +msgstr "@1 перемещает вещи в @2 в @3" + +#: ../homedecor/handlers/inventory.lua +msgid "@1 moves @2 to @3 at @4" +msgstr "@1 перемещает @2 в @3 в @4" + +#: ../homedecor/handlers/inventory.lua +msgid "@1 takes @2 from @3 at @4" +msgstr "@1 берёт @2 из @3 в @4" + +#: ../homedecor/handlers/inventory.lua +msgid "@1 (owned by @2)" +msgstr "@1 (принадлежит @2)" + +#: ../homedecor/handlers/inventory.lua +msgid "@1 tried to access a @2 belonging to @3 at @4" +msgstr "@1 пытается получить доступ к @2, принадлежащий @3 в @4" + +#: ../homedecor/handlers/inventory.lua +msgid "@1 (Locked)" +msgstr "@1 (Закрыто)" + +#: ../homedecor/init.lua ../lrfurn/armchairs.lua ../lrfurn/coffeetable.lua +#: ../lrfurn/endtable.lua ../lrfurn/longsofas.lua ../lrfurn/sofas.lua +msgid "Loaded!" +msgstr "Загружен!" + +#: ../homedecor/kitchen_appliances.lua +msgid "Refrigerator (stainless steel)" +msgstr "Холодильник (нержавеющая сталь)" + +#: ../homedecor/kitchen_appliances.lua +msgid "Refrigerator" +msgstr "Холодильник" + +#: ../homedecor/kitchen_appliances.lua +msgid "Oven" +msgstr "Духовка" + +#: ../homedecor/kitchen_appliances.lua +msgid "Oven (stainless steel)" +msgstr "Духовка (нержавеющая сталь)" + +#: ../homedecor/kitchen_appliances.lua +msgid "Microwave Oven" +msgstr "Микроволновая печь" + +#: ../homedecor/kitchen_appliances.lua +msgid "Coffee Maker" +msgstr "Кофеварка" + +#: ../homedecor/kitchen_appliances.lua +msgid "Toaster" +msgstr "Тостер" + +#: ../homedecor/kitchen_appliances.lua +msgid "Dishwasher" +msgstr "Посудомоечная машина" + +#: ../homedecor/kitchen_appliances.lua ../homedecor/kitchen_furniture.lua +msgid "granite" +msgstr "гранит" + +#: ../homedecor/kitchen_appliances.lua ../homedecor/kitchen_furniture.lua +msgid "marble" +msgstr "мрамор" + +#: ../homedecor/kitchen_appliances.lua ../homedecor/kitchen_furniture.lua +msgid "steel" +msgstr "сталь" + +#: ../homedecor/kitchen_appliances.lua +msgid "Dishwasher (@1)" +msgstr "Посудомоечная машина (@1)" + +#: ../homedecor/kitchen_furniture.lua +msgid "Kitchen Cabinet" +msgstr "Кухонный шкаф" + +#: ../homedecor/kitchen_furniture.lua +msgid "Kitchen Cabinet (@1 top)" +msgstr "Кухонный шкаф (@1 верх)" + +#: ../homedecor/kitchen_furniture.lua +msgid "Half-height Kitchen Cabinet (on ceiling)" +msgstr "Полуразмерный кухонный шкаф (потолочный)" + +#: ../homedecor/kitchen_furniture.lua +msgid "Kitchen Cabinet with sink" +msgstr "Кухонный шкаф с раковиной" + +#: ../homedecor/kitchen_furniture.lua +msgid "Under-sink cabinet" +msgstr "Шкаф для раковины" + +#: ../homedecor/kitchen_furniture.lua +msgid "Copper pans" +msgstr "Медные кастрюли" + +#: ../homedecor/kitchen_furniture.lua +msgid "Kitchen Faucet" +msgstr "Кухонный смеситель" + +#: ../homedecor/kitchen_furniture.lua +msgid "Paper towels" +msgstr "Бумажные полотенца" + +#: ../homedecor/lighting.lua +msgid "Thick Glowlight" +msgstr "Толстый светильник" + +#: ../homedecor/lighting.lua +msgid "Thin Glowlight" +msgstr "Тонкий светильник" + +#: ../homedecor/lighting.lua +msgid "Small Glowlight Cube" +msgstr "Малый светящийся куб" + +#: ../homedecor/lighting.lua +msgid "Plasma Lamp" +msgstr "Плазменный светильник" + +#: ../homedecor/lighting.lua +msgid "Plasma Ball" +msgstr "Плазменный шар" + +#: ../homedecor/lighting.lua +msgid "Thick Candle" +msgstr "Толстая свеча" + +#: ../homedecor/lighting.lua +msgid "Thin Candle" +msgstr "Тонкая свеча" + +#: ../homedecor/lighting.lua +msgid "Candlestick (wrought iron)" +msgstr "Подсвечник (кованное железо)" + +#: ../homedecor/lighting.lua +msgid "Candlestick (brass)" +msgstr "Подсвечник (латунь)" + +#: ../homedecor/lighting.lua +msgid "Wall sconce" +msgstr "Настенный светильник" + +#: ../homedecor/lighting.lua +msgid "Oil lamp (hurricane)" +msgstr "Масленая лампа (подвесная)" + +#: ../homedecor/lighting.lua +msgid "Oil Lamp (tabletop)" +msgstr "Масленая лампа (настольная)" + +#: ../homedecor/lighting.lua +msgid "Ground Lantern" +msgstr "Наземный фонарь" + +#: ../homedecor/lighting.lua +msgid "Hanging Lantern" +msgstr "Подвесной фонарь" + +#: ../homedecor/lighting.lua +msgid "Ceiling Lantern" +msgstr "Потолочный фонарь" + +#: ../homedecor/lighting.lua +msgid "Lattice lantern (large)" +msgstr "Решётчатый фонарь (большой)" + +#: ../homedecor/lighting.lua +msgid "Lattice lantern (small)" +msgstr "Решётчатый фонарь (малый)" + +#: ../homedecor/lighting.lua +msgid "Table Lamp" +msgstr "Настольный светильник" + +#: ../homedecor/lighting.lua +msgid "Standing Lamp" +msgstr "Напольный светильник" + +#: ../homedecor/lighting.lua +msgid "Desk Lamp" +msgstr "Настольный светильник" + +#: ../homedecor/lighting.lua +msgid "Ceiling Lamp" +msgstr "Потолочный светильник" + +#: ../homedecor/lighting.lua +msgid "Ceiling Lamp (off)" +msgstr "Потолочный светильник (выключен)" + +#: ../homedecor/misc-nodes.lua +msgid "Textured Ceiling Paint" +msgstr "Текстурированная потолочная краска" + +#: ../homedecor/misc-nodes.lua +msgid "Drop-Ceiling Tile" +msgstr "Потолочная плитка" + +#: ../homedecor/misc-nodes.lua +msgid "small" +msgstr "малый" + +#: ../homedecor/misc-nodes.lua +msgid "large" +msgstr "большой" + +#: ../homedecor/misc-nodes.lua +msgid "persian" +msgstr "персидский" + +#: ../homedecor/misc-nodes.lua +msgid "Rug (@1)" +msgstr "Ковёр (@1)" + +#: ../homedecor/misc-nodes.lua +msgid "black" +msgstr "чёрный" + +#: ../homedecor/misc-nodes.lua ../homedecor/roofing.lua +msgid "terracotta" +msgstr "терракотовый" + +#: ../homedecor/misc-nodes.lua +msgid "Flower Pot (@1)" +msgstr "Цветочный горшок" + +#: ../homedecor/misc-nodes.lua +msgid "Rose" +msgstr "Роза" + +#: ../homedecor/misc-nodes.lua +msgid "Tulip" +msgstr "Тюльпан" + +#: ../homedecor/misc-nodes.lua +msgid "Yellow Dandelion" +msgstr "Жёлтый одуванчик" + +#: ../homedecor/misc-nodes.lua +msgid "White Dandelion" +msgstr "Белый одуванчик" + +#: ../homedecor/misc-nodes.lua +msgid "Blue Geranium" +msgstr "Голубая герань" + +#: ../homedecor/misc-nodes.lua +msgid "Viola" +msgstr "Фиалка" + +#: ../homedecor/misc-nodes.lua +msgid "Cactus" +msgstr "Кактус" + +#: ../homedecor/misc-nodes.lua +msgid "Bonsai" +msgstr "Карликовое дерево" + +#: ../homedecor/misc-nodes.lua +msgid "Potted flower (@1)" +msgstr "Цветок в горшке (@1)" + +#: ../homedecor/misc-nodes.lua +msgid "Brass Pole" +msgstr "Латунный столб" + +#: ../homedecor/misc-nodes.lua +msgid "Wrought Iron Pole" +msgstr "Кованный железный столб" + +#: ../homedecor/misc-nodes.lua +msgid "Fishtank" +msgstr "Аквариум" + +#: ../homedecor/misc-nodes.lua +msgid "Fishtank (lighted)" +msgstr "Аквариум (освещённый)" + +#: ../homedecor/misc-nodes.lua +msgid "Cardboard box (big)" +msgstr "Картонная коробка (большая)" + +#: ../homedecor/misc-nodes.lua +msgid "Cardboard box" +msgstr "Картонная коробка" + +#: ../homedecor/misc-nodes.lua +msgid "DVD/CD cabinet" +msgstr "Шкаф с дисками DVD/CD" + +#: ../homedecor/misc-nodes.lua +msgid "Pool Table" +msgstr "Бильярдный стол" + +#: ../homedecor/misc-nodes.lua +msgid "Piano" +msgstr "Пианино" + +#: ../homedecor/misc-nodes.lua +msgid "Trophy" +msgstr "Награда" + +#: ../homedecor/misc-nodes.lua +msgid "Sport bench" +msgstr "Спортивная скамья" + +#: ../homedecor/misc-nodes.lua +msgid "Skateboard" +msgstr "Скейт" + +#: ../homedecor/misc-nodes.lua +msgid "Metal tool cabinet and work table" +msgstr "Шкаф с металлическим инструментом и рабочий стол" + +#: ../homedecor/misc-nodes.lua +msgid "Picture Frame" +msgstr "Рамка для картины" + +#: ../homedecor/misc-nodes.lua +msgid "Decorative painting #@1" +msgstr "Декоративная живопись #@1" + +#: ../homedecor/misc-nodes.lua +msgid "dark topped" +msgstr "тёмный верх" + +#: ../homedecor/misc-nodes.lua +msgid "diagonal" +msgstr "диагональный" + +#: ../homedecor/misc-nodes.lua +msgid "horizontal" +msgstr "горизонтальный" + +#: ../homedecor/misc-nodes.lua +msgid "Banister for Stairs (@1, @2)" +msgstr "Перила для ступеней (@1, @2)" + +#: ../homedecor/misc-nodes.lua +msgid "not enough space" +msgstr "не хватает места" + +#: ../homedecor/office.lua +msgid "Filing cabinet" +msgstr "Шкаф для документов" + +#: ../homedecor/office.lua +msgid "Desk" +msgstr "Письменный стол" + +#: ../homedecor/office.lua +msgid "Desk globe" +msgstr "Настольный глобус" + +#: ../homedecor/office.lua +msgid "Calendar" +msgstr "Календарь" + +#: ../homedecor/office.lua +msgid "" +"Date (right-click to update):\n" +"@1" +msgstr "" +"Дата (правая кнопка мыши для обновления):\n" +"@1" + +#: ../homedecor/office.lua +msgid "Basic office chair" +msgstr "Офисный стул" + +#: ../homedecor/office.lua +msgid "Upscale office chair" +msgstr "Высококлассное офисное кресло" + +#: ../homedecor/roofing.lua +msgid "Glass Skylight" +msgstr "Стеклянный люк" + +#: ../homedecor/roofing.lua +msgid "Glass Skylight Frosted" +msgstr "Матовый стеклянный люк" + +#: ../homedecor/roofing.lua +msgid "asphalt" +msgstr "асфальт" + +#: ../homedecor/roofing.lua +msgid "Shingles (@1)" +msgstr "Черепица (@1)" + +#: ../homedecor/roofing.lua +msgid "@1 (outer corner)" +msgstr "@1 (внешний угол)" + +#: ../homedecor/roofing.lua +msgid "@1 (inner corner)" +msgstr "@1 (внутренний угол)" + +#: ../homedecor/roofing.lua +msgid "Wood Shingles" +msgstr "Деревянная черепица" + +#: ../homedecor/roofing.lua +msgid "Asphalt Shingles" +msgstr "Асфальтовая черепица" + +#: ../homedecor/roofing.lua +msgid "Terracotta Shingles" +msgstr "Терракотовая черепица" + +#: ../homedecor/roofing.lua +msgid "Glass Shingles" +msgstr "Стеклянная черепица" + +#: ../homedecor/roofing.lua +msgid "Chimney" +msgstr "Дымоход" + +#: ../homedecor/shutters.lua +msgid "Wooden Shutter" +msgstr "Деревянные ставни" + +#: ../homedecor/tables.lua +msgid "Small square glass table" +msgstr "Маленький квадратный стеклянный столик" + +#: ../homedecor/tables.lua +msgid "Small round glass table" +msgstr "Маленький круглый стеклянный столик" + +#: ../homedecor/tables.lua +msgid "Large glass table piece" +msgstr "Большая стеклянная столешница" + +#: ../homedecor/tables.lua +msgid "Small square wooden table" +msgstr "Маленький квадратный деревянный столик" + +#: ../homedecor/tables.lua +msgid "Small round wooden table" +msgstr "Маленький круглый деревянный столик" + +#: ../homedecor/tables.lua +msgid "Large wooden table piece" +msgstr "Большая деревянная столешница" + +#: ../homedecor/tables.lua +msgid "Utility Table" +msgstr "Вспомогательный стол" + +#: ../homedecor/tables.lua +msgid "Table Legs (@1)" +msgstr "Ножки стола (@1)" + +#: ../homedecor/tables.lua +msgid "Legs for Utility Table" +msgstr "Ножки вспомогательного стола" + +#: ../homedecor/trash_cans.lua +msgid "Green Trash Can" +msgstr "Зелёный мусорный контейнер" + +#: ../homedecor/trash_cans.lua +msgid "Trash Can" +msgstr "Мусорный контейнер" + +#: ../homedecor/trash_cans.lua +msgid "Small Trash Can" +msgstr "Малый мусорный контейнер" + +#: ../homedecor/wardrobe.lua +msgid "Wardrobe" +msgstr "Гардероб" + +#: ../homedecor/wardrobe.lua +msgid "Clothes" +msgstr "Одежда" + +#: ../homedecor/wardrobe.lua +msgid "Storage" +msgstr "Хранилище" + +#: ../homedecor/window_treatments.lua +msgid "Window (quartered)" +msgstr "Окно (разделённое)" + +#: ../homedecor/window_treatments.lua +msgid "Window (plain)" +msgstr "Окно (простое)" + +#: ../homedecor/window_treatments.lua +msgid "Window Blinds (thick)" +msgstr "Жалюзи (широкие)" + +#: ../homedecor/window_treatments.lua +msgid "Window Blinds (thin)" +msgstr "Жалюзи (узкие)" + +#: ../homedecor/window_treatments.lua +msgid "Curtains" +msgstr "Шторы" + +#: ../homedecor/window_treatments.lua +msgid "Curtain Rod (@1)" +msgstr "Карниз для штор (@1)" + +#: ../homedecor/window_treatments.lua +msgid "Window flowerbox" +msgstr "Оконный цветочный ящик" + +#: ../homedecor/window_treatments.lua +msgid "Stained Glass" +msgstr "Витражное стекло" + +#: ../inbox/init.lua +msgid "Mailbox" +msgstr "Почтовый ящик" + +#: ../inbox/init.lua +msgid "@1's Mailbox" +msgstr "Почтовый ящик @1" + +#: ../itemframes/init.lua +msgid "Item frame" +msgstr "Рамка предметов" + +#: ../itemframes/init.lua +msgid "Item frame (owned by @1)" +msgstr "Рамка предметов (принадлежит @1)" + +#: ../itemframes/init.lua +msgid "Pedestal" +msgstr "Пьедестал" + +#: ../itemframes/init.lua +msgid "Pedestal (owned by @1)" +msgstr "Пьедестал (принадлежит @1)" + +#: ../lavalamp/init.lua +msgid "Lava Lamp" +msgstr "Лавовый светильник" + +#: ../lavalamp/init.lua +msgid "Lava Lamp (off)" +msgstr "Лавовый светильник (выключен)" + +#: ../lrfurn/coffeetable.lua +msgid "Coffee Table" +msgstr "Кофейный столик" + +#: ../lrfurn/coffeetable.lua +msgid "No room to place the coffee table!" +msgstr "Нет места для установки кофейного столика!" + +#: ../lrfurn/endtable.lua +msgid "End Table" +msgstr "Оконечный стол" + +#: ../lrfurn/init.lua +msgid "Someone else owns the spot where other end goes!" +msgstr "Кому-то другому принадлежит точка, где заканчивается другой конец!" + +#: ../lrfurn/init.lua +msgid "Someone else owns the spot where the middle or far end goes!" +msgstr "Кому-то другому принадлежит точка, куда выходит средний или дальний конец!" + +#: ../lrfurn/init.lua +msgid "Someone else owns the spot where the other end goes!" +msgstr "Кому-то другому принадлежит точка, где выходит другой конец!" + +#: ../lrfurn/longsofas.lua +msgid "Long Sofa" +msgstr "Длинный диван" + +#: ../lrfurn/longsofas.lua ../lrfurn/sofas.lua +msgid "No room to place the sofa!" +msgstr "Нет места для дивана!" + +#: ../lrfurn/sofas.lua +msgid "Sofa" +msgstr "Диван" + +#: ../plasmascreen/init.lua +msgid "Plasma Screen TV Stand" +msgstr "Подставка для плазменного телевизора" + +#: ../plasmascreen/init.lua +msgid "Plasma TV" +msgstr "Плазменный телевизор" + +#: ../plasmascreen/init.lua +msgid "Plasma TV (off)" +msgstr "Плазменный телевизор (выключен)" diff --git a/mesecons_button/init.lua b/mesecons_button/init.lua index 11c328c..c67c149 100644 --- a/mesecons_button/init.lua +++ b/mesecons_button/init.lua @@ -4,12 +4,13 @@ mesecon.button_turnoff = function (pos) local node = minetest.get_node(pos) - if node.name=="mesecons_button:button_on" then --has not been dug - minetest.swap_node(pos, {name = "mesecons_button:button_off", param2=node.param2}) - minetest.sound_play("mesecons_button_pop", {pos=pos}) - local rules = mesecon.rules.buttonlike_get(node) - mesecon.receptor_off(pos, rules) + if node.name ~= "mesecons_button:button_on" then -- has been dug + return end + minetest.swap_node(pos, {name = "mesecons_button:button_off", param2 = node.param2}) + minetest.sound_play("mesecons_button_pop", {pos = pos}) + local rules = mesecon.rules.buttonlike_get(node) + mesecon.receptor_off(pos, rules) end minetest.register_node("mesecons_button:button_off", { @@ -45,7 +46,7 @@ minetest.register_node("mesecons_button:button_off", { minetest.swap_node(pos, {name = "mesecons_button:button_on", param2=node.param2}) mesecon.receptor_on(pos, mesecon.rules.buttonlike_get(node)) minetest.sound_play("mesecons_button_push", {pos=pos}) - minetest.after(1, mesecon.button_turnoff, pos) + minetest.get_node_timer(pos):start(1) end, sounds = default.node_sound_stone_defaults(), mesecons = {receptor = { @@ -89,7 +90,8 @@ minetest.register_node("mesecons_button:button_on", { mesecons = {receptor = { state = mesecon.state.on, rules = mesecon.rules.buttonlike_get - }} + }}, + on_timer = mesecon.button_turnoff, }) minetest.register_craft({ diff --git a/mesecons_lightstone/init.lua b/mesecons_lightstone/init.lua index ab820bf..1b8e222 100644 --- a/mesecons_lightstone/init.lua +++ b/mesecons_lightstone/init.lua @@ -61,3 +61,9 @@ mesecon.lightstone_add("blue", "dye:blue", "jeija_lightstone_blue_off.png", "jei mesecon.lightstone_add("gray", "dye:grey", "jeija_lightstone_gray_off.png", "jeija_lightstone_gray_on.png", "Grey Lightstone") mesecon.lightstone_add("darkgray", "dye:dark_grey", "jeija_lightstone_darkgray_off.png", "jeija_lightstone_darkgray_on.png", "Dark Grey Lightstone") mesecon.lightstone_add("yellow", "dye:yellow", "jeija_lightstone_yellow_off.png", "jeija_lightstone_yellow_on.png", "Yellow Lightstone") +mesecon.lightstone_add("orange", "dye:orange", "jeija_lightstone_orange_off.png", "jeija_lightstone_orange_on.png", "Orange Lightstone") +mesecon.lightstone_add("white", "dye:white", "jeija_lightstone_white_off.png", "jeija_lightstone_white_on.png", "White Lightstone") +mesecon.lightstone_add("pink", "dye:pink", "jeija_lightstone_pink_off.png", "jeija_lightstone_pink_on.png", "Pink Lightstone") +mesecon.lightstone_add("magenta", "dye:magenta", "jeija_lightstone_magenta_off.png", "jeija_lightstone_magenta_on.png", "Magenta Lightstone") +mesecon.lightstone_add("cyan", "dye:cyan", "jeija_lightstone_cyan_off.png", "jeija_lightstone_cyan_on.png", "Cyan Lightstone") +mesecon.lightstone_add("violet", "dye:violet", "jeija_lightstone_violet_off.png", "jeija_lightstone_violet_on.png", "Violet Lightstone") diff --git a/mesecons_lightstone/textures/jeija_lightstone_cyan_off.png b/mesecons_lightstone/textures/jeija_lightstone_cyan_off.png new file mode 100644 index 0000000..5315110 Binary files /dev/null and b/mesecons_lightstone/textures/jeija_lightstone_cyan_off.png differ diff --git a/mesecons_lightstone/textures/jeija_lightstone_cyan_on.png b/mesecons_lightstone/textures/jeija_lightstone_cyan_on.png new file mode 100644 index 0000000..200345c Binary files /dev/null and b/mesecons_lightstone/textures/jeija_lightstone_cyan_on.png differ diff --git a/mesecons_lightstone/textures/jeija_lightstone_magenta_off.png b/mesecons_lightstone/textures/jeija_lightstone_magenta_off.png new file mode 100644 index 0000000..43fa524 Binary files /dev/null and b/mesecons_lightstone/textures/jeija_lightstone_magenta_off.png differ diff --git a/mesecons_lightstone/textures/jeija_lightstone_magenta_on.png b/mesecons_lightstone/textures/jeija_lightstone_magenta_on.png new file mode 100644 index 0000000..8f28b7c Binary files /dev/null and b/mesecons_lightstone/textures/jeija_lightstone_magenta_on.png differ diff --git a/mesecons_lightstone/textures/jeija_lightstone_orange_off.png b/mesecons_lightstone/textures/jeija_lightstone_orange_off.png new file mode 100644 index 0000000..4bf206e Binary files /dev/null and b/mesecons_lightstone/textures/jeija_lightstone_orange_off.png differ diff --git a/mesecons_lightstone/textures/jeija_lightstone_orange_on.png b/mesecons_lightstone/textures/jeija_lightstone_orange_on.png new file mode 100644 index 0000000..bcba4d2 Binary files /dev/null and b/mesecons_lightstone/textures/jeija_lightstone_orange_on.png differ diff --git a/mesecons_lightstone/textures/jeija_lightstone_pink_off.png b/mesecons_lightstone/textures/jeija_lightstone_pink_off.png new file mode 100644 index 0000000..ee265f9 Binary files /dev/null and b/mesecons_lightstone/textures/jeija_lightstone_pink_off.png differ diff --git a/mesecons_lightstone/textures/jeija_lightstone_pink_on.png b/mesecons_lightstone/textures/jeija_lightstone_pink_on.png new file mode 100644 index 0000000..ba85110 Binary files /dev/null and b/mesecons_lightstone/textures/jeija_lightstone_pink_on.png differ diff --git a/mesecons_lightstone/textures/jeija_lightstone_violet_off.png b/mesecons_lightstone/textures/jeija_lightstone_violet_off.png new file mode 100644 index 0000000..83b5e2d Binary files /dev/null and b/mesecons_lightstone/textures/jeija_lightstone_violet_off.png differ diff --git a/mesecons_lightstone/textures/jeija_lightstone_violet_on.png b/mesecons_lightstone/textures/jeija_lightstone_violet_on.png new file mode 100644 index 0000000..2b3eb2e Binary files /dev/null and b/mesecons_lightstone/textures/jeija_lightstone_violet_on.png differ diff --git a/mesecons_lightstone/textures/jeija_lightstone_white_off.png b/mesecons_lightstone/textures/jeija_lightstone_white_off.png new file mode 100644 index 0000000..78338c8 Binary files /dev/null and b/mesecons_lightstone/textures/jeija_lightstone_white_off.png differ diff --git a/mesecons_lightstone/textures/jeija_lightstone_white_on.png b/mesecons_lightstone/textures/jeija_lightstone_white_on.png new file mode 100644 index 0000000..792d89d Binary files /dev/null and b/mesecons_lightstone/textures/jeija_lightstone_white_on.png differ diff --git a/mesecons_microcontroller/init.lua b/mesecons_microcontroller/init.lua index b241713..ef78f60 100644 --- a/mesecons_microcontroller/init.lua +++ b/mesecons_microcontroller/init.lua @@ -144,14 +144,27 @@ end end end -minetest.register_craft({ - output = 'craft "mesecons_microcontroller:microcontroller0000" 2', - recipe = { - {'mesecons_materials:silicon', 'mesecons_materials:silicon', 'group:mesecon_conductor_craftable'}, - {'mesecons_materials:silicon', 'mesecons_materials:silicon', 'group:mesecon_conductor_craftable'}, - {'group:mesecon_conductor_craftable', 'group:mesecon_conductor_craftable', ''}, - } -}) +if minetest.get_modpath("mesecons_luacontroller") then + minetest.register_craft({ + type = "shapeless", + output = "mesecons_microcontroller:microcontroller0000", + recipe = {"mesecons_luacontroller:luacontroller0000"}, + }) + minetest.register_craft({ + type = "shapeless", + output = "mesecons_luacontroller:luacontroller0000", + recipe = {"mesecons_microcontroller:microcontroller0000"}, + }) +else + minetest.register_craft({ + output = 'craft "mesecons_microcontroller:microcontroller0000" 2', + recipe = { + {'mesecons_materials:silicon', 'mesecons_materials:silicon', 'group:mesecon_conductor_craftable'}, + {'mesecons_materials:silicon', 'mesecons_materials:silicon', 'group:mesecon_conductor_craftable'}, + {'group:mesecon_conductor_craftable', 'group:mesecon_conductor_craftable', ''}, + } + }) +end yc.reset = function(pos) yc.action(pos, {a=false, b=false, c=false, d=false}) diff --git a/mesecons_mvps/init.lua b/mesecons_mvps/init.lua index 252acf7..08c4785 100644 --- a/mesecons_mvps/init.lua +++ b/mesecons_mvps/init.lua @@ -165,6 +165,10 @@ function mesecon.mvps_push_or_pull(pos, stackdir, movedir, maximum, all_pull_sti -- remove all nodes for _, n in ipairs(nodes) do n.meta = minetest.get_meta(n.pos):to_table() + local node_timer = minetest.get_node_timer(n.pos) + if node_timer:is_started() then + n.node_timer = {node_timer:get_timeout(), node_timer:get_elapsed()} + end minetest.remove_node(n.pos) end @@ -179,6 +183,9 @@ function mesecon.mvps_push_or_pull(pos, stackdir, movedir, maximum, all_pull_sti minetest.set_node(np, n.node) minetest.get_meta(np):from_table(n.meta) + if n.node_timer then + minetest.get_node_timer(np):set(unpack(n.node_timer)) + end end local moved_nodes = {} @@ -190,6 +197,7 @@ function mesecon.mvps_push_or_pull(pos, stackdir, movedir, maximum, all_pull_sti moved_nodes[i].pos = nodes[i].pos moved_nodes[i].node = nodes[i].node moved_nodes[i].meta = nodes[i].meta + moved_nodes[i].node_timer = nodes[i].node_timer end on_mvps_move(moved_nodes) diff --git a/mesecons_wires/init.lua b/mesecons_wires/init.lua index ced7c99..60a8d76 100644 --- a/mesecons_wires/init.lua +++ b/mesecons_wires/init.lua @@ -213,7 +213,8 @@ local function register_wires() node_box = nodebox, walkable = false, drop = "mesecons:wire_00000000_off", - mesecon_wire = true + mesecon_wire = true, + on_rotate = false, }, {tiles = tiles_off, mesecons = meseconspec_off, groups = groups_off}, {tiles = tiles_on, mesecons = meseconspec_on, groups = groups_on}) diff --git a/moreblocks/circular_saw.lua b/moreblocks/circular_saw.lua index 7c4eb61..6c3a974 100644 --- a/moreblocks/circular_saw.lua +++ b/moreblocks/circular_saw.lua @@ -1,7 +1,7 @@ --[[ More Blocks: circular saw -Copyright (c) 2011-2017 Hugo Locurcio and contributors. +Copyright (c) 2011-2017 Hugo Locurcio, Sokomine and contributors. Licensed under the zlib license. See LICENSE.md for more information. --]] diff --git a/moreblocks/config.lua b/moreblocks/config.lua index da5cd6e..8d49c3b 100644 --- a/moreblocks/config.lua +++ b/moreblocks/config.lua @@ -8,7 +8,7 @@ Licensed under the zlib license. See LICENSE.md for more information. moreblocks.config = {} local function getbool_default(setting, default) - local value = minetest.setting_getbool(setting) + local value = minetest.settings:get_bool(setting) if value == nil then value = default end @@ -21,7 +21,7 @@ local function setting(settingtype, name, default) getbool_default("moreblocks." .. name, default) else moreblocks.config[name] = - minetest.setting_get("moreblocks." .. name) or default + minetest.settings:get("moreblocks." .. name) or default end end diff --git a/moreblocks/crafting.lua b/moreblocks/crafting.lua index 88862b7..8741c53 100644 --- a/moreblocks/crafting.lua +++ b/moreblocks/crafting.lua @@ -454,7 +454,7 @@ minetest.register_craft({ } }) -if minetest.setting_getbool("moreblocks.circular_saw_crafting") ~= false then -- “If nil or true then” +if minetest.settings:get_bool("moreblocks.circular_saw_crafting") ~= false then -- “If nil or true then” minetest.register_craft({ output = "moreblocks:circular_saw", recipe = { diff --git a/moreblocks/init.lua b/moreblocks/init.lua index 5e7fc6b..c12f5e0 100644 --- a/moreblocks/init.lua +++ b/moreblocks/init.lua @@ -11,8 +11,12 @@ Licensed under the zlib license. See LICENSE.md for more information. moreblocks = {} local S -if minetest.get_modpath("intllib") then - S = intllib.Getter() +if minetest.global_exists("intllib") then + if intllib.make_gettext_pair then + S = intllib.make_gettext_pair() + else + S = intllib.Getter() + end else S = function(s) return s end end @@ -28,6 +32,6 @@ dofile(modpath .. "/redefinitions.lua") dofile(modpath .. "/crafting.lua") dofile(modpath .. "/aliases.lua") -if minetest.setting_getbool("log_mods") then +if minetest.settings:get_bool("log_mods") then minetest.log("action", S("[moreblocks] loaded.")) end diff --git a/moreblocks/stairsplus/init.lua b/moreblocks/stairsplus/init.lua index 598f21c..5cd415c 100644 --- a/moreblocks/stairsplus/init.lua +++ b/moreblocks/stairsplus/init.lua @@ -15,7 +15,7 @@ stairsplus.expect_infinite_stacks = false stairsplus.shapes_list = {} if not minetest.get_modpath("unified_inventory") -and minetest.setting_getbool("creative_mode") then +and minetest.settings:get_bool("creative_mode") then stairsplus.expect_infinite_stacks = true end diff --git a/moreblocks/stairsplus/registrations.lua b/moreblocks/stairsplus/registrations.lua index 065bc9d..7c5ad50 100644 --- a/moreblocks/stairsplus/registrations.lua +++ b/moreblocks/stairsplus/registrations.lua @@ -17,6 +17,7 @@ local default_nodes = { -- Default stairs/slabs/panels/microblocks: "copperblock", "bronzeblock", "diamondblock", + "tinblock", "desert_stone", "desert_stone_block", "desert_cobble", @@ -39,6 +40,12 @@ local default_nodes = { -- Default stairs/slabs/panels/microblocks: "stonebrick", "desert_stonebrick", "sandstonebrick", + "silver_sandstone", + "silver_sandstone_brick", + "silver_sandstone_block", + "desert_sandstone", + "desert_sandstone_brick", + "desert_sandstone_block", "sandstone_block", "coral_skeleton", "farming:straw" diff --git a/pipeworks/LICENSE b/pipeworks/LICENSE index 4362b49..ecbf212 100644 --- a/pipeworks/LICENSE +++ b/pipeworks/LICENSE @@ -500,3 +500,194 @@ necessary. Here is a sample; alter the names: Ty Coon, President of Vice That's all there is to it! + + +-------------------------------------------------------------------------------- + +Some code in lua_tube.lua is copied from The Mesecons Mod for Minetest: + +License of source code +---------------------- +Copyright (C) 2011-2016 Mesecons Mod Developer Team and contributors + +This program is free software; you can redistribute the Mesecons Mod and/or +modify it under the terms of the GNU Lesser General Public License version 3 +published by the Free Software Foundation. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with this library; if not, write to the +Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, +Boston, MA 02110-1301, USA. + + +GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. + diff --git a/pipeworks/compat-chests.lua b/pipeworks/compat-chests.lua index 7cff6fd..69eb2f1 100644 --- a/pipeworks/compat-chests.lua +++ b/pipeworks/compat-chests.lua @@ -36,7 +36,7 @@ local function get_chest_formspec(pos) pipeworks.button_on } )..pipeworks.button_label - + return formspec end @@ -62,7 +62,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) local sound = open_chests[pn].sound local swap = open_chests[pn].swap local node = minetest.get_node(pos) - + open_chests[pn] = nil for k, v in pairs(open_chests) do if v.pos.x == pos.x and v.pos.y == pos.y and v.pos.z == pos.z then @@ -71,13 +71,13 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) end minetest.after(0.2, function() minetest.swap_node(pos, { name = "default:" .. swap, param2 = node.param2 }) - + -- Pipeworks notification pipeworks.after_place(pos) end) minetest.sound_play(sound, {gain = 0.3, pos = pos, max_hear_distance = 10}) end - + -- Pipeworks Switch if pipeworks.may_configure(pos, player) and not fields.quit then fs_helpers.on_receive_fields(pos, fields) @@ -142,6 +142,7 @@ override_protected = { end return inv:room_for_item("main", stack) end, + input_inventory = "main", connect_sides = {left = 1, right = 1, back = 1, bottom = 1, top = 1} }, after_dig_node = pipeworks.after_dig @@ -191,9 +192,9 @@ override = { after_dig_node = pipeworks.after_dig } --[[local override_common = { - + } -for k,v in pairs(override_common) do +for k,v in pairs(override_common) do override_protected[k] = v override[k] = v end]] diff --git a/pipeworks/default_settings.lua b/pipeworks/default_settings.lua index 99b86fe..91e511c 100644 --- a/pipeworks/default_settings.lua +++ b/pipeworks/default_settings.lua @@ -15,12 +15,14 @@ local settings = { enable_detector_tube = true, enable_digiline_detector_tube = true, enable_conductor_tube = true, + enable_digiline_conductor_tube = true, enable_accelerator_tube = true, enable_crossing_tube = true, enable_sand_tube = true, enable_mese_sand_tube = true, enable_one_way_tube = true, enable_priority_tube = true, + enable_lua_tube = true, enable_cyclic_mode = true, drop_on_routing_fail = false, diff --git a/pipeworks/filter-injector.lua b/pipeworks/filter-injector.lua index 45b27c4..c9d132f 100644 --- a/pipeworks/filter-injector.lua +++ b/pipeworks/filter-injector.lua @@ -156,7 +156,7 @@ local function grabAndFire(data,slotseq_mode,exmatch_mode,filtmeta,frominv,fromi end local pos = vector.add(frompos, vector.multiply(dir, 1.4)) local start_pos = vector.add(frompos, dir) - local item1 = pipeworks.tube_inject_item(pos, start_pos, dir, item) + local item1 = pipeworks.tube_inject_item(pos, start_pos, dir, item, fakePlayer:get_player_name()) return true-- only fire one item, please end end @@ -219,7 +219,7 @@ local function punch_filter(data, filtpos, filtnode, msg) local filters = {} if data.digiline then local function add_filter(name, group, count, wear, metadata) - table.insert(filters, {name = name, group = group, count = count, wear = wear, metadata = metadata}) + table.insert(filters, {name = name, group = group, count = tonumber(count), wear = wear, metadata = metadata}) end local function add_itemstring_filter(filter) @@ -317,8 +317,16 @@ local function punch_filter(data, filtpos, filtnode, msg) exact_match = filtmeta:get_int("exmatch_mode") end - local frommeta = minetest.get_meta(frompos) - local frominv = frommeta:get_inventory() + local frominv + if fromtube.return_input_invref then + frominv = fromtube.return_input_invref(frompos, fromnode, dir, owner) + if not frominv then + return + end + else + local frommeta = minetest.get_meta(frompos) + frominv = frommeta:get_inventory() + end if fromtube.before_filter then fromtube.before_filter(frompos) end for _, frominvname in ipairs(type(fromtube.input_inventory) == "table" and fromtube.input_inventory or {fromtube.input_inventory}) do local done = false @@ -378,12 +386,22 @@ for _, data in ipairs({ end, after_dig_node = pipeworks.after_dig, allow_metadata_inventory_put = function(pos, listname, index, stack, player) - if not pipeworks.may_configure(pos, player) then return 0 end - return stack:get_count() + if not pipeworks.may_configure(pos, player) then + return 0 + end + local inv = minetest.get_meta(pos):get_inventory() + inv:set_stack("main", index, stack) + return 0 end, allow_metadata_inventory_take = function(pos, listname, index, stack, player) - if not pipeworks.may_configure(pos, player) then return 0 end - return stack:get_count() + if not pipeworks.may_configure(pos, player) then + return 0 + end + local inv = minetest.get_meta(pos):get_inventory() + local fake_stack = inv:get_stack("main", index) + fake_stack:take_item(stack:get_count()) + inv:set_stack("main", index, fake_stack) + return 0 end, allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) if not pipeworks.may_configure(pos, player) then return 0 end @@ -481,3 +499,64 @@ if minetest.get_modpath("digilines") then }, }) end + +--[[ +In the past the filter-injectors had real items in their inventories. This code +puts them to the input to the filter-injector if possible. Else the items are +dropped. +]] +local function put_to_inputinv(pos, node, filtmeta, list) + local dir = pipeworks.facedir_to_right_dir(node.param2) + local frompos = vector.subtract(pos, dir) + local fromnode = minetest.get_node(frompos) + local fromdef = minetest.registered_nodes[fromnode.name] + if not fromdef or not fromdef.tube then + return + end + local fromtube = fromdef.tube + local frominv + if fromtube.return_input_invref then + local owner = filtmeta:get_string("owner") + frominv = fromtube.return_input_invref(frompos, fromnode, dir, owner) + if not frominv then + return + end + else + frominv = minetest.get_meta(frompos):get_inventory() + end + local listname = type(fromtube.input_inventory) == "table" and + fromtube.input_inventory[1] or fromtube.input_inventory + if not listname then + return + end + for i = 1, #list do + local item = list[i] + if not item:is_empty() then + local leftover = frominv:add_item(listname, item) + if not leftover:is_empty() then + minetest.add_item(pos, leftover) + end + end + end + return true +end +minetest.register_lbm({ + label = "Give back items of old filters that had real inventories", + name = "pipeworks:give_back_old_filter_items", + nodenames = {"pipeworks:filter", "pipeworks:mese_filter"}, + run_at_every_load = false, + action = function(pos, node) + local meta = minetest.get_meta(pos) + local list = meta:get_inventory():get_list("main") + if put_to_inputinv(pos, node, meta, list) then + return + end + pos.y = pos.y + 1 + for i = 1, #list do + local item = list[i] + if not item:is_empty() then + minetest.add_item(pos, item) + end + end + end, +}) diff --git a/pipeworks/init.lua b/pipeworks/init.lua index a3f31c7..2e05337 100644 --- a/pipeworks/init.lua +++ b/pipeworks/init.lua @@ -38,6 +38,7 @@ pipeworks.rules_all = {{x=0, y=0, z=1},{x=0, y=0, z=-1},{x=1, y=0, z=0},{x=-1, y {x=0, y=1, z=0}, {x=0, y=-1, z=0}} pipeworks.mesecons_rules={{x=0,y=0,z=1},{x=0,y=0,z=-1},{x=1,y=0,z=0},{x=-1,y=0,z=0},{x=0,y=1,z=0},{x=0,y=-1,z=0}} +pipeworks.digilines_rules={{x=0,y=0,z=1},{x=0,y=0,z=-1},{x=1,y=0,z=0},{x=-1,y=0,z=0},{x=0,y=1,z=0},{x=0,y=-1,z=0}} pipeworks.liquid_texture = "default_water.png" @@ -118,6 +119,7 @@ if pipeworks.enable_redefines then dofile(pipeworks.modpath.."/compat-furnaces.lua") end if pipeworks.enable_autocrafter then dofile(pipeworks.modpath.."/autocrafter.lua") end +if pipeworks.enable_lua_tube then dofile(pipeworks.modpath.."/lua_tube.lua") end minetest.register_alias("pipeworks:pipe", "pipeworks:pipe_110000_empty") diff --git a/pipeworks/item_transport.lua b/pipeworks/item_transport.lua index b2d2aa2..551db07 100644 --- a/pipeworks/item_transport.lua +++ b/pipeworks/item_transport.lua @@ -7,13 +7,14 @@ function pipeworks.tube_item(pos, item) error("obsolete pipeworks.tube_item() called; change caller to use pipeworks.tube_inject_item() instead") end -function pipeworks.tube_inject_item(pos, start_pos, velocity, item) +function pipeworks.tube_inject_item(pos, start_pos, velocity, item, owner) -- Take item in any format local stack = ItemStack(item) local obj = luaentity.add_entity(pos, "pipeworks:tubed_item") obj:set_item(stack:to_string()) obj.start_pos = vector.new(start_pos) obj:setvelocity(velocity) + obj.owner = owner --obj:set_color("red") -- todo: this is test-only code return obj end @@ -49,7 +50,7 @@ minetest.register_globalstep(function(dtime) end end) -local function go_next(pos, velocity, stack) +local function go_next(pos, velocity, stack, owner) local next_positions = {} local max_priority = 0 local cnode = minetest.get_node(pos) @@ -84,7 +85,7 @@ local function go_next(pos, velocity, stack) local tube_priority = (tube_def and tube_def.priority) or 100 if tubedevice > 0 and tube_priority >= max_priority then if not tube_def or not tube_def.can_insert or - tube_def.can_insert(npos, node, stack, vect) then + tube_def.can_insert(npos, node, stack, vect, owner) then if tube_priority > max_priority then max_priority = tube_priority next_positions = {} @@ -260,7 +261,7 @@ luaentity.register_entity("pipeworks:tubed_item", { if moved and minetest.get_item_group(node.name, "tubedevice_receiver") == 1 then local leftover if minetest.registered_nodes[node.name].tube and minetest.registered_nodes[node.name].tube.insert_object then - leftover = minetest.registered_nodes[node.name].tube.insert_object(self.start_pos, node, stack, vel) + leftover = minetest.registered_nodes[node.name].tube.insert_object(self.start_pos, node, stack, vel, self.owner) else leftover = stack end @@ -276,7 +277,7 @@ luaentity.register_entity("pipeworks:tubed_item", { end if moved then - local found_next, new_velocity = go_next(self.start_pos, velocity, stack) -- todo: color + local found_next, new_velocity = go_next(self.start_pos, velocity, stack, self.owner) -- todo: color local rev_vel = vector.multiply(velocity, -1) local rev_dir = vector.direction(self.start_pos,vector.add(self.start_pos,rev_vel)) local rev_node = minetest.get_node(vector.round(vector.add(self.start_pos,rev_dir))) diff --git a/pipeworks/lua_tube.lua b/pipeworks/lua_tube.lua new file mode 100644 index 0000000..51665ae --- /dev/null +++ b/pipeworks/lua_tube.lua @@ -0,0 +1,850 @@ +-- ______ +-- | +-- | +-- | __ ___ _ __ _ _ +-- | | | | | |\ | | |_| | | | | |_ |_| +-- |___| |______ |__| | \| | | \ |__| |_ |_ |_ |\ tube +-- | +-- | +-- + +-- Reference +-- ports = get_real_port_states(pos): gets if inputs are powered from outside +-- newport = merge_port_states(state1, state2): just does result = state1 or state2 for every port +-- set_port(pos, rule, state): activates/deactivates the mesecons according to the port states +-- set_port_states(pos, ports): Applies new port states to a Luacontroller at pos +-- run(pos): runs the code in the controller at pos +-- reset_meta(pos, code, errmsg): performs a software-reset, installs new code and prints error messages +-- resetn(pos): performs a hardware reset, turns off all ports +-- +-- The Sandbox +-- The whole code of the controller runs in a sandbox, +-- a very restricted environment. +-- Actually the only way to damage the server is to +-- use too much memory from the sandbox. +-- You can add more functions to the environment +-- (see where local env is defined) +-- Something nice to play is is appending minetest.env to it. + +local BASENAME = "pipeworks:lua_tube" + +local rules = { + red = {x = -1, y = 0, z = 0, name = "red"}, + blue = {x = 1, y = 0, z = 0, name = "blue"}, + yellow = {x = 0, y = -1, z = 0, name = "yellow"}, + green = {x = 0, y = 1, z = 0, name = "green"}, + black = {x = 0, y = 0, z = -1, name = "black"}, + white = {x = 0, y = 0, z = 1, name = "white"}, +} + + +------------------ +-- Action stuff -- +------------------ +-- These helpers are required to set the port states of the lua_tube + +local function update_real_port_states(pos, rule_name, new_state) + local meta = minetest.get_meta(pos) + if rule_name == nil then + meta:set_int("real_portstates", 1) + return + end + local n = meta:get_int("real_portstates") - 1 + local L = {} + for i = 1, 6 do + L[i] = n % 2 + n = math.floor(n / 2) + end + -- (0,0,-1) (0,-1,0) (-1,0,0) (1,0,0) (0,1,0) (0,0,1) + local pos_to_side = { 5, 3, 1, nil, 2, 4, 6 } + if rule_name.x == nil then + for _, rname in ipairs(rule_name) do + local port = pos_to_side[rname.x + (2 * rname.y) + (3 * rname.z) + 4] + L[port] = (newstate == "on") and 1 or 0 + end + else + local port = pos_to_side[rule_name.x + (2 * rule_name.y) + (3 * rule_name.z) + 4] + L[port] = (new_state == "on") and 1 or 0 + end + meta:set_int("real_portstates", + 1 + + 1 * L[1] + + 2 * L[2] + + 4 * L[3] + + 8 * L[4] + + 16 * L[5] + + 32 * L[6]) +end + + +local port_names = {"red", "blue", "yellow", "green", "black", "white"} + +local function get_real_port_states(pos) + -- Determine if ports are powered (by itself or from outside) + local meta = minetest.get_meta(pos) + local L = {} + local n = meta:get_int("real_portstates") - 1 + for _, name in ipairs(port_names) do + L[name] = ((n % 2) == 1) + n = math.floor(n / 2) + end + return L +end + + +local function merge_port_states(ports, vports) + return { + red = ports.red or vports.red, + blue = ports.blue or vports.blue, + yellow = ports.yellow or vports.yellow, + green = ports.green or vports.green, + black = ports.black or vports.black, + white = ports.white or vports.white, + } +end + +local function generate_name(ports) + local red = ports.red and 1 or 0 + local blue = ports.blue and 1 or 0 + local yellow = ports.yellow and 1 or 0 + local green = ports.green and 1 or 0 + local black = ports.black and 1 or 0 + local white = ports.white and 1 or 0 + return BASENAME..white..black..green..yellow..blue..red +end + + +local function set_port(pos, rule, state) + if state then + mesecon.receptor_on(pos, {rule}) + else + mesecon.receptor_off(pos, {rule}) + end +end + + +local function clean_port_states(ports) + ports.red = ports.red and true or false + ports.blue = ports.blue and true or false + ports.yellow = ports.yellow and true or false + ports.green = ports.green and true or false + ports.black = ports.black and true or false + ports.white = ports.white and true or false +end + + +local function set_port_states(pos, ports) + local node = minetest.get_node(pos) + local name = node.name + clean_port_states(ports) + local vports = minetest.registered_nodes[name].virtual_portstates + local new_name = generate_name(ports) + + if name ~= new_name and vports then + -- Problem: + -- We need to place the new node first so that when turning + -- off some port, it won't stay on because the rules indicate + -- there is an onstate output port there. + -- When turning the output off then, it will however cause feedback + -- so that the lua_tube will receive an "off" event by turning + -- its output off. + -- Solution / Workaround: + -- Remember which output was turned off and ignore next "off" event. + local meta = minetest.get_meta(pos) + local ign = minetest.deserialize(meta:get_string("ignore_offevents")) or {} + if ports.red and not vports.red and not mesecon.is_powered(pos, rules.red) then ign.red = true end + if ports.blue and not vports.blue and not mesecon.is_powered(pos, rules.blue) then ign.blue = true end + if ports.yellow and not vports.yellow and not mesecon.is_powered(pos, rules.yellow) then ign.yellow = true end + if ports.green and not vports.green and not mesecon.is_powered(pos, rules.green) then ign.green = true end + if ports.black and not vports.black and not mesecon.is_powered(pos, rules.black) then ign.black = true end + if ports.white and not vports.white and not mesecon.is_powered(pos, rules.white) then ign.white = true end + meta:set_string("ignore_offevents", minetest.serialize(ign)) + + minetest.swap_node(pos, {name = new_name, param2 = node.param2}) + + if ports.red ~= vports.red then set_port(pos, rules.red, ports.red) end + if ports.blue ~= vports.blue then set_port(pos, rules.blue, ports.blue) end + if ports.yellow ~= vports.yellow then set_port(pos, rules.yellow, ports.yellow) end + if ports.green ~= vports.green then set_port(pos, rules.green, ports.green) end + if ports.black ~= vports.black then set_port(pos, rules.black, ports.black) end + if ports.white ~= vports.white then set_port(pos, rules.white, ports.white) end + end +end + + +----------------- +-- Overheating -- +----------------- +local function burn_controller(pos) + local node = minetest.get_node(pos) + node.name = BASENAME.."_burnt" + minetest.swap_node(pos, node) + minetest.get_meta(pos):set_string("lc_memory", ""); + -- Wait for pending operations + minetest.after(0.2, mesecon.receptor_off, pos, mesecon.rules.flat) +end + +local function overheat(pos, meta) + if mesecon.do_overheat(pos) then -- If too hot + burn_controller(pos) + return true + end +end + +------------------------ +-- Ignored off events -- +------------------------ + +local function ignore_event(event, meta) + if event.type ~= "off" then return false end + local ignore_offevents = minetest.deserialize(meta:get_string("ignore_offevents")) or {} + if ignore_offevents[event.pin.name] then + ignore_offevents[event.pin.name] = nil + meta:set_string("ignore_offevents", minetest.serialize(ignore_offevents)) + return true + end +end + +------------------------- +-- Parsing and running -- +------------------------- + +local function safe_print(param) + print(dump(param)) +end + +local function safe_date() + return(os.date("*t",os.time())) +end + +-- string.rep(str, n) with a high value for n can be used to DoS +-- the server. Therefore, limit max. length of generated string. +local function safe_string_rep(str, n) + if #str * n > mesecon.setting("luacontroller_string_rep_max", 64000) then + debug.sethook() -- Clear hook + error("string.rep: string length overflow", 2) + end + + return string.rep(str, n) +end + +-- string.find with a pattern can be used to DoS the server. +-- Therefore, limit string.find to patternless matching. +local function safe_string_find(...) + if (select(4, ...)) ~= true then + debug.sethook() -- Clear hook + error("string.find: 'plain' (fourth parameter) must always be true in a lua controlled tube") + end + + return string.find(...) +end + +local function remove_functions(x) + local tp = type(x) + if tp == "function" then + return nil + end + + -- Make sure to not serialize the same table multiple times, otherwise + -- writing mem.test = mem in the lua controlled tube will lead to infinite recursion + local seen = {} + + local function rfuncs(x) + if seen[x] then return end + seen[x] = true + if type(x) ~= "table" then return end + + for key, value in pairs(x) do + if type(key) == "function" or type(value) == "function" then + x[key] = nil + else + if type(key) == "table" then + rfuncs(key) + end + if type(value) == "table" then + rfuncs(value) + end + end + end + end + + rfuncs(x) + + return x +end + +local function get_interrupt(pos) + -- iid = interrupt id + local function interrupt(time, iid) + if type(time) ~= "number" then return end + local luac_id = minetest.get_meta(pos):get_int("luac_id") + mesecon.queue:add_action(pos, "pipeworks:lc_tube_interrupt", {luac_id, iid}, time, iid, 1) + end + return interrupt +end + + +local function get_digiline_send(pos) + if not digiline then return end + return function(channel, msg) + -- Make sure channel is string, number or boolean + if (type(channel) ~= "string" and type(channel) ~= "number" and type(channel) ~= "boolean") then + return false + end + + -- It is technically possible to send functions over the wire since + -- the high performance impact of stripping those from the data has + -- been decided to not be worth the added realism. + -- Make sure serialized version of the data is not insanely long to + -- prevent DoS-like attacks + local msg_ser = minetest.serialize(msg) + if #msg_ser > mesecon.setting("luacontroller_digiline_maxlen", 50000) then + return false + end + + minetest.after(0, function() + digilines.receptor_send(pos, digiline.rules.default, channel, msg) + end) + return true + end +end + + +local safe_globals = { + "assert", "error", "ipairs", "next", "pairs", "select", + "tonumber", "tostring", "type", "unpack", "_VERSION" +} + +local function create_environment(pos, mem, event) + -- Gather variables for the environment + local vports = minetest.registered_nodes[minetest.get_node(pos).name].virtual_portstates + local vports_copy = {} + for k, v in pairs(vports) do vports_copy[k] = v end + local rports = get_real_port_states(pos) + + -- Create new library tables on each call to prevent one Luacontroller + -- from breaking a library and messing up other Luacontrollers. + local env = { + pin = merge_port_states(vports, rports), + port = vports_copy, + event = event, + mem = mem, + heat = mesecon.get_heat(pos), + heat_max = mesecon.setting("overheat_max", 20), + print = safe_print, + interrupt = get_interrupt(pos), + digiline_send = get_digiline_send(pos), + string = { + byte = string.byte, + char = string.char, + format = string.format, + len = string.len, + lower = string.lower, + upper = string.upper, + rep = safe_string_rep, + reverse = string.reverse, + sub = string.sub, + find = safe_string_find, + }, + math = { + abs = math.abs, + acos = math.acos, + asin = math.asin, + atan = math.atan, + atan2 = math.atan2, + ceil = math.ceil, + cos = math.cos, + cosh = math.cosh, + deg = math.deg, + exp = math.exp, + floor = math.floor, + fmod = math.fmod, + frexp = math.frexp, + huge = math.huge, + ldexp = math.ldexp, + log = math.log, + log10 = math.log10, + max = math.max, + min = math.min, + modf = math.modf, + pi = math.pi, + pow = math.pow, + rad = math.rad, + random = math.random, + sin = math.sin, + sinh = math.sinh, + sqrt = math.sqrt, + tan = math.tan, + tanh = math.tanh, + }, + table = { + concat = table.concat, + insert = table.insert, + maxn = table.maxn, + remove = table.remove, + sort = table.sort, + }, + os = { + clock = os.clock, + difftime = os.difftime, + time = os.time, + datetable = safe_date, + }, + } + env._G = env + + for _, name in pairs(safe_globals) do + env[name] = _G[name] + end + + return env +end + + +local function timeout() + debug.sethook() -- Clear hook + error("Code timed out!", 2) +end + + +local function create_sandbox(code, env) + if code:byte(1) == 27 then + return nil, "Binary code prohibited." + end + local f, msg = loadstring(code) + if not f then return nil, msg end + setfenv(f, env) + + -- Turn off JIT optimization for user code so that count + -- events are generated when adding debug hooks + if rawget(_G, "jit") then + jit.off(f, true) + end + + return function(...) + -- Use instruction counter to stop execution + -- after luacontroller_maxevents + local maxevents = mesecon.setting("luacontroller_maxevents", 10000) + debug.sethook(timeout, "", maxevents) + local ok, ret = pcall(f, ...) + debug.sethook() -- Clear hook + if not ok then error(ret, 0) end + return ret + end +end + + +local function load_memory(meta) + return minetest.deserialize(meta:get_string("lc_memory")) or {} +end + + +local function save_memory(pos, meta, mem) + local memstring = minetest.serialize(remove_functions(mem)) + local memsize_max = mesecon.setting("luacontroller_memsize", 100000) + + if (#memstring <= memsize_max) then + meta:set_string("lc_memory", memstring) + else + print("Error: lua_tube memory overflow. "..memsize_max.." bytes available, " + ..#memstring.." required. Controller overheats.") + burn_controller(pos) + end +end + + +local function run(pos, event) + local meta = minetest.get_meta(pos) + if overheat(pos) then return end + if ignore_event(event, meta) then return end + + -- Load code & mem from meta + local mem = load_memory(meta) + local code = meta:get_string("code") + + -- Create environment + local env = create_environment(pos, mem, event) + + -- Create the sandbox and execute code + local f, msg = create_sandbox(code, env) + if not f then return false, msg end + local succ, msg = pcall(f) + if not succ then return false, msg end + if type(env.port) ~= "table" then + return false, "Ports set are invalid." + end + + -- Actually set the ports + set_port_states(pos, env.port) + + -- Save memory. This may burn the luacontroller if a memory overflow occurs. + save_memory(pos, meta, env.mem) + + return succ, msg +end + +mesecon.queue:add_function("pipeworks:lc_tube_interrupt", function (pos, luac_id, iid) + -- There is no lua_tube anymore / it has been reprogrammed / replaced / burnt + if (minetest.get_meta(pos):get_int("luac_id") ~= luac_id) then return end + if (minetest.registered_nodes[minetest.get_node(pos).name].is_burnt) then return end + run(pos, {type = "interrupt", iid = iid}) +end) + +local function reset_meta(pos, code, errmsg) + local meta = minetest.get_meta(pos) + meta:set_string("code", code) + code = minetest.formspec_escape(code or "") + errmsg = minetest.formspec_escape(tostring(errmsg or "")) + meta:set_string("formspec", "size[12,10]".. + "background[-0.2,-0.25;12.4,10.75;jeija_luac_background.png]".. + "textarea[0.2,0.2;12.2,9.5;code;;"..code.."]".. + "image_button[4.75,8.75;2.5,1;jeija_luac_runbutton.png;program;]".. + "image_button_exit[11.72,-0.25;0.425,0.4;jeija_close_window.png;exit;]".. + "label[0.1,9;"..errmsg.."]") + meta:set_int("luac_id", math.random(1, 65535)) +end + +local function reset(pos) + set_port_states(pos, {red = false, blue = false, yellow = false, + green = false, black = false, white = false}) +end + + +----------------------- +-- Node Registration -- +----------------------- + +local output_rules = {} +local input_rules = {} + +local node_box = { + type = "fixed", + fixed = { + pipeworks.tube_leftstub[1], -- tube segment against -X face + pipeworks.tube_rightstub[1], -- tube segment against +X face + pipeworks.tube_bottomstub[1], -- tube segment against -Y face + pipeworks.tube_topstub[1], -- tube segment against +Y face + pipeworks.tube_frontstub[1], -- tube segment against -Z face + pipeworks.tube_backstub[1], -- tube segment against +Z face + } +} + +local selection_box = { + type = "fixed", + fixed = pipeworks.tube_selectboxes, +} + +local digiline = { + receptor = {}, + effector = { + action = function(pos, node, channel, msg) + run(pos, {type = "digiline", channel = channel, msg = msg}) + end + } +} +local function on_receive_fields(pos, form_name, fields, sender) + if not fields.program then + return + end + local name = sender:get_player_name() + if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, {protection_bypass=true}) then + minetest.record_protection_violation(pos, name) + return + end + reset(pos) + reset_meta(pos, fields.code) + local succ, err = run(pos, {type="program"}) + if not succ then + print(err) + reset_meta(pos, fields.code, err) + end +end + +local function go_back(velocity) + local adjlist={{x=0,y=0,z=1},{x=0,y=0,z=-1},{x=0,y=1,z=0},{x=0,y=-1,z=0},{x=1,y=0,z=0},{x=-1,y=0,z=0}} + local speed = math.abs(velocity.x + velocity.y + velocity.z) + if speed == 0 then + speed = 1 + end + local vel = {x = velocity.x/speed, y = velocity.y/speed, z = velocity.z/speed,speed=speed} + if speed >= 4.1 then + speed = 4 + elseif speed >= 1.1 then + speed = speed - 0.1 + else + speed = 1 + end + vel.speed = speed + return pipeworks.notvel(adjlist, vel) +end + +local tiles_base = { + "pipeworks_mese_tube_plain_4.png", "pipeworks_mese_tube_plain_3.png", + "pipeworks_mese_tube_plain_2.png", "pipeworks_mese_tube_plain_1.png", + "pipeworks_mese_tube_plain_6.png", "pipeworks_mese_tube_plain_5.png"} + +for red = 0, 1 do -- 0 = off 1 = on +for blue = 0, 1 do +for yellow = 0, 1 do +for green = 0, 1 do +for black = 0, 1 do +for white = 0, 1 do + local cid = tostring(white)..tostring(black)..tostring(green).. + tostring(yellow)..tostring(blue)..tostring(red) + local node_name = BASENAME..cid + local tiles = table.copy(tiles_base) + if red == 1 then + tiles[1] = tiles[1].."^(pipeworks_lua_tube_port_on.png^[transformR90)" + tiles[2] = tiles[2].."^(pipeworks_lua_tube_port_on.png^[transformR90)" + tiles[5] = tiles[5].."^(pipeworks_lua_tube_port_on.png^[transformR270)" + tiles[6] = tiles[6].."^(pipeworks_lua_tube_port_on.png^[transformR90)" + else + tiles[1] = tiles[1].."^(pipeworks_lua_tube_port_off.png^[transformR90)" + tiles[2] = tiles[2].."^(pipeworks_lua_tube_port_off.png^[transformR90)" + tiles[5] = tiles[5].."^(pipeworks_lua_tube_port_off.png^[transformR270)" + tiles[6] = tiles[6].."^(pipeworks_lua_tube_port_off.png^[transformR90)" + end + if blue == 1 then + tiles[1] = tiles[1].."^(pipeworks_lua_tube_port_on.png^[transformR270)" + tiles[2] = tiles[2].."^(pipeworks_lua_tube_port_on.png^[transformR270)" + tiles[5] = tiles[5].."^(pipeworks_lua_tube_port_on.png^[transformR90)" + tiles[6] = tiles[6].."^(pipeworks_lua_tube_port_on.png^[transformR270)" + else + tiles[1] = tiles[1].."^(pipeworks_lua_tube_port_off.png^[transformR270)" + tiles[2] = tiles[2].."^(pipeworks_lua_tube_port_off.png^[transformR270)" + tiles[5] = tiles[5].."^(pipeworks_lua_tube_port_off.png^[transformR90)" + tiles[6] = tiles[6].."^(pipeworks_lua_tube_port_off.png^[transformR270)" + end + if yellow == 1 then + tiles[3] = tiles[3].."^(pipeworks_lua_tube_port_on.png^[transformR180)" + tiles[4] = tiles[4].."^(pipeworks_lua_tube_port_on.png^[transformR180)" + tiles[5] = tiles[5].."^(pipeworks_lua_tube_port_on.png^[transformR180)" + tiles[6] = tiles[6].."^(pipeworks_lua_tube_port_on.png^[transformR180)" + else + tiles[3] = tiles[3].."^(pipeworks_lua_tube_port_off.png^[transformR180)" + tiles[4] = tiles[4].."^(pipeworks_lua_tube_port_off.png^[transformR180)" + tiles[5] = tiles[5].."^(pipeworks_lua_tube_port_off.png^[transformR180)" + tiles[6] = tiles[6].."^(pipeworks_lua_tube_port_off.png^[transformR180)" + end + if green == 1 then + tiles[3] = tiles[3].."^pipeworks_lua_tube_port_on.png" + tiles[4] = tiles[4].."^pipeworks_lua_tube_port_on.png" + tiles[5] = tiles[5].."^pipeworks_lua_tube_port_on.png" + tiles[6] = tiles[6].."^pipeworks_lua_tube_port_on.png" + else + tiles[3] = tiles[3].."^pipeworks_lua_tube_port_off.png" + tiles[4] = tiles[4].."^pipeworks_lua_tube_port_off.png" + tiles[5] = tiles[5].."^pipeworks_lua_tube_port_off.png" + tiles[6] = tiles[6].."^pipeworks_lua_tube_port_off.png" + end + if black == 1 then + tiles[1] = tiles[1].."^(pipeworks_lua_tube_port_on.png^[transformR180)" + tiles[2] = tiles[2].."^pipeworks_lua_tube_port_on.png" + tiles[3] = tiles[3].."^(pipeworks_lua_tube_port_on.png^[transformR90)" + tiles[4] = tiles[4].."^(pipeworks_lua_tube_port_on.png^[transformR270)" + else + tiles[1] = tiles[1].."^(pipeworks_lua_tube_port_off.png^[transformR180)" + tiles[2] = tiles[2].."^pipeworks_lua_tube_port_off.png" + tiles[3] = tiles[3].."^(pipeworks_lua_tube_port_off.png^[transformR90)" + tiles[4] = tiles[4].."^(pipeworks_lua_tube_port_off.png^[transformR270)" + end + if white == 1 then + tiles[1] = tiles[1].."^pipeworks_lua_tube_port_on.png" + tiles[2] = tiles[2].."^(pipeworks_lua_tube_port_on.png^[transformR180)" + tiles[3] = tiles[3].."^(pipeworks_lua_tube_port_on.png^[transformR270)" + tiles[4] = tiles[4].."^(pipeworks_lua_tube_port_on.png^[transformR90)" + else + tiles[1] = tiles[1].."^pipeworks_lua_tube_port_off.png" + tiles[2] = tiles[2].."^(pipeworks_lua_tube_port_off.png^[transformR180)" + tiles[3] = tiles[3].."^(pipeworks_lua_tube_port_off.png^[transformR270)" + tiles[4] = tiles[4].."^(pipeworks_lua_tube_port_off.png^[transformR90)" + end + + local groups = {snappy = 3, tube = 1, tubedevice = 1, overheat = 1} + if red + blue + yellow + green + black + white ~= 0 then + groups.not_in_creative_inventory = 1 + end + + output_rules[cid] = {} + input_rules[cid] = {} + if red == 1 then table.insert(output_rules[cid], rules.red) end + if blue == 1 then table.insert(output_rules[cid], rules.blue) end + if yellow == 1 then table.insert(output_rules[cid], rules.yellow) end + if green == 1 then table.insert(output_rules[cid], rules.green) end + if black == 1 then table.insert(output_rules[cid], rules.black) end + if white == 1 then table.insert(output_rules[cid], rules.white) end + + if red == 0 then table.insert( input_rules[cid], rules.red) end + if blue == 0 then table.insert( input_rules[cid], rules.blue) end + if yellow == 0 then table.insert( input_rules[cid], rules.yellow) end + if green == 0 then table.insert( input_rules[cid], rules.green) end + if black == 0 then table.insert( input_rules[cid], rules.black) end + if white == 0 then table.insert( input_rules[cid], rules.white) end + + local mesecons = { + effector = { + rules = input_rules[cid], + action_change = function (pos, _, rule_name, new_state) + update_real_port_states(pos, rule_name, new_state) + run(pos, {type=new_state, pin=rule_name}) + end, + }, + receptor = { + state = mesecon.state.on, + rules = output_rules[cid] + } + } + + minetest.register_node(node_name, { + description = "Lua controlled Tube", + drawtype = "nodebox", + tiles = tiles, + paramtype = "light", + groups = groups, + drop = BASENAME.."000000", + sunlight_propagates = true, + selection_box = selection_box, + node_box = node_box, + on_construct = reset_meta, + on_receive_fields = on_receive_fields, + sounds = default.node_sound_wood_defaults(), + mesecons = mesecons, + digiline = digiline, + -- Virtual portstates are the ports that + -- the node shows as powered up (light up). + virtual_portstates = { + red = red == 1, + blue = blue == 1, + yellow = yellow == 1, + green = green == 1, + black = black == 1, + white = white == 1, + }, + after_dig_node = function(pos, node) + mesecon.do_cooldown(pos) + mesecon.receptor_off(pos, output_rules) + pipeworks.after_dig(pos, node) + end, + is_luacontroller = true, + tubelike = 1, + tube = { + connect_sides = {front = 1, back = 1, left = 1, right = 1, top = 1, bottom = 1}, + priority = 50, + can_go = function(pos, node, velocity, stack) + local succ, msg = run(pos, { + type = "item", + itemstring = stack:to_string(), + item = stack:to_table(), + velocity = velocity, + }) + if not succ or type(msg) ~= "string" then + return go_back(velocity) + end + local r = rules[msg] + return r and {r} or go_back(velocity) + end, + }, + after_place_node = pipeworks.after_place, + on_blast = function(pos, intensity) + if not intensity or intensity > 1 + 3^0.5 then + minetest.remove_node(pos) + return {string.format("%s_%s", name, dropname)} + end + minetest.swap_node(pos, {name = "pipeworks:broken_tube_1"}) + pipeworks.scan_for_tube_objects(pos) + end, + on_blast = function(pos, intensity) + if not intensity or intensity > 1 + 3^0.5 then + minetest.remove_node(pos) + return {string.format("%s_%s", name, dropname)} + end + minetest.swap_node(pos, {name = "pipeworks:broken_tube_1"}) + pipeworks.scan_for_tube_objects(pos) + end, + }) +end +end +end +end +end +end + +------------------------------------ +-- Overheated Lua controlled Tube -- +------------------------------------ + +local tiles_burnt = table.copy(tiles_base) +tiles_burnt[1] = tiles_burnt[1].."^(pipeworks_lua_tube_port_burnt.png^[transformR90)" +tiles_burnt[2] = tiles_burnt[2].."^(pipeworks_lua_tube_port_burnt.png^[transformR90)" +tiles_burnt[5] = tiles_burnt[5].."^(pipeworks_lua_tube_port_burnt.png^[transformR270)" +tiles_burnt[6] = tiles_burnt[6].."^(pipeworks_lua_tube_port_burnt.png^[transformR90)" +tiles_burnt[1] = tiles_burnt[1].."^(pipeworks_lua_tube_port_burnt.png^[transformR270)" +tiles_burnt[2] = tiles_burnt[2].."^(pipeworks_lua_tube_port_burnt.png^[transformR270)" +tiles_burnt[5] = tiles_burnt[5].."^(pipeworks_lua_tube_port_burnt.png^[transformR90)" +tiles_burnt[6] = tiles_burnt[6].."^(pipeworks_lua_tube_port_burnt.png^[transformR270)" +tiles_burnt[3] = tiles_burnt[3].."^(pipeworks_lua_tube_port_burnt.png^[transformR180)" +tiles_burnt[4] = tiles_burnt[4].."^(pipeworks_lua_tube_port_burnt.png^[transformR180)" +tiles_burnt[5] = tiles_burnt[5].."^(pipeworks_lua_tube_port_burnt.png^[transformR180)" +tiles_burnt[6] = tiles_burnt[6].."^(pipeworks_lua_tube_port_burnt.png^[transformR180)" +tiles_burnt[3] = tiles_burnt[3].."^pipeworks_lua_tube_port_burnt.png" +tiles_burnt[4] = tiles_burnt[4].."^pipeworks_lua_tube_port_burnt.png" +tiles_burnt[5] = tiles_burnt[5].."^pipeworks_lua_tube_port_burnt.png" +tiles_burnt[6] = tiles_burnt[6].."^pipeworks_lua_tube_port_burnt.png" +tiles_burnt[1] = tiles_burnt[1].."^(pipeworks_lua_tube_port_burnt.png^[transformR180)" +tiles_burnt[2] = tiles_burnt[2].."^pipeworks_lua_tube_port_burnt.png" +tiles_burnt[3] = tiles_burnt[3].."^(pipeworks_lua_tube_port_burnt.png^[transformR90)" +tiles_burnt[4] = tiles_burnt[4].."^(pipeworks_lua_tube_port_burnt.png^[transformR270)" +tiles_burnt[1] = tiles_burnt[1].."^pipeworks_lua_tube_port_burnt.png" +tiles_burnt[2] = tiles_burnt[2].."^(pipeworks_lua_tube_port_burnt.png^[transformR180)" +tiles_burnt[3] = tiles_burnt[3].."^(pipeworks_lua_tube_port_burnt.png^[transformR270)" +tiles_burnt[4] = tiles_burnt[4].."^(pipeworks_lua_tube_port_burnt.png^[transformR90)" + +minetest.register_node(BASENAME .. "_burnt", { + drawtype = "nodebox", + tiles = tiles_burnt, + is_burnt = true, + paramtype = "light", + groups = {snappy = 3, tube = 1, tubedevice = 1, not_in_creative_inventory=1}, + drop = BASENAME.."000000", + sunlight_propagates = true, + selection_box = selection_box, + node_box = node_box, + on_construct = reset_meta, + on_receive_fields = on_receive_fields, + sounds = default.node_sound_wood_defaults(), + virtual_portstates = {red = false, blue = false, yellow = false, + green = false, black = false, white = false}, + mesecons = { + effector = { + rules = mesecon.rules.alldirs, + action_change = function(pos, _, rule_name, new_state) + update_real_port_states(pos, rule_name, new_state) + end, + }, + }, + tubelike = 1, + tube = { + connect_sides = {front = 1, back = 1, left = 1, right = 1, top = 1, bottom = 1}, + priority = 50, + }, + after_place_node = pipeworks.after_place, + after_dig_node = pipeworks.after_dig, + on_blast = function(pos, intensity) + if not intensity or intensity > 1 + 3^0.5 then + minetest.remove_node(pos) + return {string.format("%s_%s", name, dropname)} + end + minetest.swap_node(pos, {name = "pipeworks:broken_tube_1"}) + pipeworks.scan_for_tube_objects(pos) + end, +}) + +------------------------ +-- Craft Registration -- +------------------------ + +minetest.register_craft({ + type = "shapeless", + output = BASENAME.."000000", + recipe = {"pipeworks:mese_tube_000000", "mesecons_luacontroller:luacontroller0000"}, +}) diff --git a/pipeworks/models.lua b/pipeworks/models.lua index 3be773c..d9928d2 100644 --- a/pipeworks/models.lua +++ b/pipeworks/models.lua @@ -33,8 +33,8 @@ pipeworks.tube_frontstub = { } pipeworks.tube_backstub = { - { -9/64, -9/64, -9/64, 9/64, 9/64, 32/64 }, -- tube segment against -Z face -} + { -9/64, -9/64, -9/64, 9/64, 9/64, 32/64 }, -- tube segment against +Z face +} pipeworks.tube_boxes = {pipeworks.tube_leftstub, pipeworks.tube_rightstub, pipeworks.tube_bottomstub, pipeworks.tube_topstub, pipeworks.tube_frontstub, pipeworks.tube_backstub} diff --git a/pipeworks/settingtypes.txt b/pipeworks/settingtypes.txt index 1d3c10c..cd6efbc 100644 --- a/pipeworks/settingtypes.txt +++ b/pipeworks/settingtypes.txt @@ -34,6 +34,9 @@ pipeworks_enable_digiline_detector_tube (Enable Digiline Detector Tube) bool tru #Enable mesecon signal conducting tube. pipeworks_enable_conductor_tube (Enable Conductor Tube) bool true +#Enable digiline signal conducting tube. +pipeworks_enable_digiline_conductor_tube (Enable Digiline Conductor Tube) bool true + #Enable accelerator tube. pipeworks_enable_accelerator_tube (Enable Accelerator Tube) bool true @@ -60,6 +63,10 @@ pipeworks_enable_one_way_tube (Enable One Way Tube) bool true #always go to it if there are multible ways. pipeworks_enable_priority_tube (Enable High Priority Tube) bool true +#Enable lua controlled tube. +#It is comparable with mesecons luacontroller. +pipeworks_enable_lua_tube (Enable Lua controlled Tube) bool true + #Enable cyclic mode. pipeworks_enable_cyclic_mode (Enable Cyclic Mode) bool true @@ -67,4 +74,4 @@ pipeworks_enable_cyclic_mode (Enable Cyclic Mode) bool true pipeworks_drop_on_routing_fail (Drop On Routing Fail) bool false #Delete item on clearobject. -pipeworks_delete_item_on_clearobject (Delete Item On Clearobject) bool true \ No newline at end of file +pipeworks_delete_item_on_clearobject (Delete Item On Clearobject) bool true diff --git a/pipeworks/signal_tubes.lua b/pipeworks/signal_tubes.lua index a0a8039..b955a16 100644 --- a/pipeworks/signal_tubes.lua +++ b/pipeworks/signal_tubes.lua @@ -67,7 +67,8 @@ if pipeworks.enable_detector_tube then }) end -if minetest.get_modpath("digilines") and pipeworks.enable_digiline_detector_tube then +local digiline_enabled = minetest.get_modpath("digilines") ~= nil +if digiline_enabled and pipeworks.enable_digiline_detector_tube then pipeworks.register_tube("pipeworks:digiline_detector_tube", { description = "Digiline Detecting Pneumatic Tube Segment", inventory_image = "pipeworks_digiline_detector_tube_inv.png", @@ -147,14 +148,80 @@ if pipeworks.enable_conductor_tube then }, }) - minetest.register_craft( { - output = "pipeworks:conductor_tube_off_1 6", - recipe = { - { "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" }, - { "mesecons:mesecon", "mesecons:mesecon", "mesecons:mesecon" }, - { "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" } - }, + minetest.register_craft({ + type = "shapeless", + output = "pipeworks:conductor_tube_off_1", + recipe = {"pipeworks:tube_1", "mesecons:mesecon"} }) end +if digiline_enabled and pipeworks.enable_digiline_conductor_tube then + pipeworks.register_tube("pipeworks:digiline_conductor_tube", { + description = "Digiline Conducting Pneumatic Tube Segment", + inventory_image = "pipeworks_tube_inv.png^pipeworks_digiline_conductor_tube_inv.png", + short = "pipeworks_tube_short.png^pipeworks_digiline_conductor_tube_short.png", + plain = {"pipeworks_tube_plain.png^pipeworks_digiline_conductor_tube_plain.png"}, + noctr = {"pipeworks_tube_noctr.png^pipeworks_digiline_conductor_tube_noctr.png"}, + ends = {"pipeworks_tube_end.png^pipeworks_digiline_conductor_tube_end.png"}, + node_def = {digiline = {wire = {rules = pipeworks.digilines_rules}}}, + }) + minetest.register_craft({ + type = "shapeless", + output = "pipeworks:digiline_conductor_tube_1", + recipe = {"pipeworks:tube_1", "digilines:wire_std_00000000"} + }) +end +if digiline_enabled and pipeworks.enable_digiline_conductor_tube and + pipeworks.enable_conductor_tube then + pipeworks.register_tube("pipeworks:mesecon_and_digiline_conductor_tube_off", { + description = "Mesecon and Digiline Conducting Pneumatic Tube Segment", + inventory_image = "pipeworks_conductor_tube_inv.png^pipeworks_digiline_conductor_tube_inv.png", + short = "pipeworks_conductor_tube_short.png^pipeworks_digiline_conductor_tube_short.png", + plain = {"pipeworks_conductor_tube_plain.png^pipeworks_digiline_conductor_tube_plain.png"}, + noctr = {"pipeworks_conductor_tube_noctr.png^pipeworks_digiline_conductor_tube_noctr.png"}, + ends = {"pipeworks_conductor_tube_end.png^pipeworks_digiline_conductor_tube_end.png"}, + node_def = { + digiline = {wire = {rules = pipeworks.digilines_rules}}, + groups = {mesecon = 2}, + mesecons = {conductor = { + state = "off", + rules = pipeworks.mesecons_rules, + onstate = "pipeworks:mesecon_and_digiline_conductor_tube_on_#id" + }}, + }, + }) + pipeworks.register_tube("pipeworks:mesecon_and_digiline_conductor_tube_on", { + description = "Mesecon and Digiline Conducting Pneumatic Tube Segment on (you hacker you)", + inventory_image = "pipeworks_conductor_tube_inv.png^pipeworks_digiline_conductor_tube_inv.png", + short = "pipeworks_conductor_tube_short.png^pipeworks_digiline_conductor_tube_short.png", + plain = {"pipeworks_conductor_tube_on_plain.png^pipeworks_digiline_conductor_tube_plain.png"}, + noctr = {"pipeworks_conductor_tube_on_noctr.png^pipeworks_digiline_conductor_tube_noctr.png"}, + ends = {"pipeworks_conductor_tube_on_end.png^pipeworks_digiline_conductor_tube_end.png"}, + node_def = { + digiline = {wire = {rules = pipeworks.digilines_rules}}, + groups = {mesecon = 2, not_in_creative_inventory = 1}, + drop = "pipeworks:mesecon_and_digiline_conductor_tube_off_1", + mesecons = {conductor = { + state = "on", + rules = pipeworks.mesecons_rules, + offstate = "pipeworks:mesecon_and_digiline_conductor_tube_off_#id"} + }, + }, + }) + minetest.register_craft({ + type = "shapeless", + output = "pipeworks:mesecon_and_digiline_conductor_tube_off_1", + recipe = {"pipeworks:tube_1", "mesecons:mesecon", "digilines:wire_std_00000000"} + }) + minetest.register_craft({ + type = "shapeless", + output = "pipeworks:mesecon_and_digiline_conductor_tube_off_1", + recipe = {"pipeworks:conductor_tube_off_1", "digilines:wire_std_00000000"} + }) + minetest.register_craft({ + type = "shapeless", + output = "pipeworks:mesecon_and_digiline_conductor_tube_off_1", + recipe = {"pipeworks:digiline_conductor_tube_1", "mesecons:mesecon"} + }) +end diff --git a/pipeworks/textures/pipeworks_digiline_conductor_tube_end.png b/pipeworks/textures/pipeworks_digiline_conductor_tube_end.png new file mode 100644 index 0000000..e6c2cfc Binary files /dev/null and b/pipeworks/textures/pipeworks_digiline_conductor_tube_end.png differ diff --git a/pipeworks/textures/pipeworks_digiline_conductor_tube_inv.png b/pipeworks/textures/pipeworks_digiline_conductor_tube_inv.png new file mode 100644 index 0000000..7f23c8c Binary files /dev/null and b/pipeworks/textures/pipeworks_digiline_conductor_tube_inv.png differ diff --git a/pipeworks/textures/pipeworks_digiline_conductor_tube_noctr.png b/pipeworks/textures/pipeworks_digiline_conductor_tube_noctr.png new file mode 100644 index 0000000..b58a4d3 Binary files /dev/null and b/pipeworks/textures/pipeworks_digiline_conductor_tube_noctr.png differ diff --git a/pipeworks/textures/pipeworks_digiline_conductor_tube_plain.png b/pipeworks/textures/pipeworks_digiline_conductor_tube_plain.png new file mode 100644 index 0000000..de31307 Binary files /dev/null and b/pipeworks/textures/pipeworks_digiline_conductor_tube_plain.png differ diff --git a/pipeworks/textures/pipeworks_digiline_conductor_tube_short.png b/pipeworks/textures/pipeworks_digiline_conductor_tube_short.png new file mode 100644 index 0000000..6108485 Binary files /dev/null and b/pipeworks/textures/pipeworks_digiline_conductor_tube_short.png differ diff --git a/pipeworks/textures/pipeworks_lua_tube_port_burnt.png b/pipeworks/textures/pipeworks_lua_tube_port_burnt.png new file mode 100644 index 0000000..3384eff Binary files /dev/null and b/pipeworks/textures/pipeworks_lua_tube_port_burnt.png differ diff --git a/pipeworks/textures/pipeworks_lua_tube_port_off.png b/pipeworks/textures/pipeworks_lua_tube_port_off.png new file mode 100644 index 0000000..03f7069 Binary files /dev/null and b/pipeworks/textures/pipeworks_lua_tube_port_off.png differ diff --git a/pipeworks/textures/pipeworks_lua_tube_port_on.png b/pipeworks/textures/pipeworks_lua_tube_port_on.png new file mode 100644 index 0000000..a7e3d09 Binary files /dev/null and b/pipeworks/textures/pipeworks_lua_tube_port_on.png differ diff --git a/poisonivy/locale/pt_BR.txt b/poisonivy/locale/pt_BR.txt new file mode 100644 index 0000000..9f61092 --- /dev/null +++ b/poisonivy/locale/pt_BR.txt @@ -0,0 +1,5 @@ +Poison ivy (seedling) = Hera venenosa (plantilha) +Poison ivy (sproutling) = Hera venenosa (brotando) +Poison ivy (climbing plant) = Hera venenosa (planta trepadeira) + +[Poison Ivy] Loaded. =[Poison Ivy] Carregado diff --git a/signs_lib/init.lua b/signs_lib/init.lua index 5f3acfc..804a720 100644 --- a/signs_lib/init.lua +++ b/signs_lib/init.lua @@ -1018,17 +1018,6 @@ minetest.register_lbm({ -- locked sign -minetest.register_craft({ - output = "locked_sign:sign_wall_locked", - recipe = { - {"group:wood", "group:wood", "group:wood"}, - {"group:wood", "group:wood", "default:steel_ingot"}, - {"", "group:stick", ""}, - } -}) - ---Alternate recipe - minetest.register_craft({ output = "locked_sign:sign_wall_locked", recipe = { diff --git a/technic/machines/HV/nuclear_reactor.lua b/technic/machines/HV/nuclear_reactor.lua index 3377710..231b6b3 100644 --- a/technic/machines/HV/nuclear_reactor.lua +++ b/technic/machines/HV/nuclear_reactor.lua @@ -257,7 +257,7 @@ minetest.register_abm({ local accum_badness = meta:get_int("structure_accumulated_badness") if badness == 0 then if accum_badness ~= 0 then - meta:set_int("structure_accumulated_badness", accum_badness - 4) + meta:set_int("structure_accumulated_badness", math.max(accum_badness - 4, 0)) siren_clear(pos, meta) end else diff --git a/unifiedmesecons/init.lua b/unifiedmesecons/init.lua index 7147301..0a2bfec 100644 --- a/unifiedmesecons/init.lua +++ b/unifiedmesecons/init.lua @@ -55,6 +55,10 @@ minetest.unregister_item("mesecons_extrawires:corner_on") minetest.unregister_item("mesecons_extrawires:tjunction_off") minetest.unregister_item("mesecons_extrawires:tjunction_on") +minetest.register_alias("mesecons_insulated:insulated_off", "mesecons_insulated:insulated_grey_off") +minetest.register_alias("mesecons_extrawires:corner_off", "mesecons_extrawires:insulated_corner_grey_off") +minetest.register_alias("mesecons_extrawires:tjunction_off", "mesecons_extrawires:insulated_tjunction_grey_off") + for _,color in pairs(hues) do mesecon.register_node(":mesecons_insulated:insulated_"..color, { drawtype = "nodebox", diff --git a/worldedit/init.lua b/worldedit/init.lua index 0305c4d..8358e3b 100644 --- a/worldedit/init.lua +++ b/worldedit/init.lua @@ -1,6 +1,6 @@ --- Worldedit. -- @module worldedit --- @release 1.1 +-- @release 1.2 -- @copyright 2013 sfan5, Anthony Zhang (Uberi/Temperest), and Brett O'Donnell (cornernote). -- @license GNU Affero General Public License version 3 (AGPLv3) -- @author sfan5 @@ -8,9 +8,12 @@ -- @author Bret O'Donnel (cornernote) -- @author ShadowNinja + worldedit = {} -worldedit.version = {1, 1, major=1, minor=1} -worldedit.version_string = table.concat(worldedit.version, ".") + +local ver = {major=1, minor=2} +worldedit.version = ver +worldedit.version_string = string.format("%d.%d", ver.major, ver.minor) if not minetest.get_voxel_manip then local err_msg = "This version of WorldEdit requires Minetest 0.4.8 or later! You have an old version." diff --git a/worldedit/manipulations.lua b/worldedit/manipulations.lua index 57c7a76..995619c 100644 --- a/worldedit/manipulations.lua +++ b/worldedit/manipulations.lua @@ -38,6 +38,29 @@ function worldedit.set(pos1, pos2, node_names) return worldedit.volume(pos1, pos2) end +--- Sets param2 of a region. +-- @param pos1 +-- @param pos2 +-- @param param2 Value of param2 to set +-- @return The number of nodes set. +function worldedit.set_param2(pos1, pos2, param2) + pos1, pos2 = worldedit.sort_pos(pos1, pos2) + + local manip, area = mh.init(pos1, pos2) + local param2_data = manip:get_param2_data() + + -- Set param2 for every node + for i in area:iterp(pos1, pos2) do + param2_data[i] = param2 + end + + -- Update map + manip:set_param2_data(param2_data) + manip:write_to_map() + manip:update_map() + + return worldedit.volume(pos1, pos2) +end --- Replaces all instances of `search_node` with `replace_node` in a region. -- When `inverse` is `true`, replaces all instances that are NOT `search_node`. diff --git a/worldedit/primitives.lua b/worldedit/primitives.lua index fe22fff..1bebfde 100644 --- a/worldedit/primitives.lua +++ b/worldedit/primitives.lua @@ -4,6 +4,47 @@ local mh = worldedit.manip_helpers +--- Adds a cube +-- @param pos Position of ground level center of cube +-- @param width Cube width. (x) +-- @param height Cube height. (y) +-- @param length Cube length. (z) +-- @param node_name Name of node to make cube of. +-- @param hollow Whether the cube should be hollow. +-- @return The number of nodes added. +function worldedit.cube(pos, width, height, length, node_name, hollow) + -- Set up voxel manipulator + local basepos = vector.subtract(pos, {x=math.floor(width/2), y=0, z=math.floor(length/2)}) + local manip, area = mh.init(basepos, vector.add(basepos, {x=width, y=height, z=length})) + local data = mh.get_empty_data(area) + + -- Add cube + local node_id = minetest.get_content_id(node_name) + local stride = {x=1, y=area.ystride, z=area.zstride} + local offset = vector.subtract(basepos, area.MinEdge) + local count = 0 + + for z = 0, length-1 do + local index_z = (offset.z + z) * stride.z + 1 -- +1 for 1-based indexing + for y = 0, height-1 do + local index_y = index_z + (offset.y + y) * stride.y + for x = 0, width-1 do + local is_wall = z == 0 or z == length-1 + or y == 0 or y == height-1 + or x == 0 or x == width-1 + if not hollow or is_wall then + local i = index_y + (offset.x + x) + data[i] = node_id + count = count + 1 + end + end + end + end + + mh.finish(manip, data) + return count +end + --- Adds a sphere of `node_name` centered at `pos`. -- @param pos Position to center sphere at. -- @param radius Sphere radius. @@ -92,49 +133,60 @@ end -- @param pos Position to center base of cylinder at. -- @param axis Axis ("x", "y", or "z") -- @param length Cylinder length. --- @param radius Cylinder radius. +-- @param radius1 Cylinder base radius. +-- @param radius2 Cylinder top radius. -- @param node_name Name of node to make cylinder of. -- @param hollow Whether the cylinder should be hollow. -- @return The number of nodes added. -function worldedit.cylinder(pos, axis, length, radius, node_name, hollow) +function worldedit.cylinder(pos, axis, length, radius1, radius2, node_name, hollow) local other1, other2 = worldedit.get_axis_others(axis) + -- Backwards compatibility + if type(radius2) == "string" then + hollow = node_name + node_name = radius2 + radius2 = radius1 -- straight cylinder + end + -- Handle negative lengths local current_pos = {x=pos.x, y=pos.y, z=pos.z} if length < 0 then length = -length current_pos[axis] = current_pos[axis] - length + radius1, radius2 = radius2, radius1 end -- Set up voxel manipulator - local manip, area = mh.init_axis_radius_length(current_pos, axis, radius, length) + local manip, area = mh.init_axis_radius_length(current_pos, axis, math.max(radius1, radius2), length) local data = mh.get_empty_data(area) - -- Add cylinder + -- Add desired shape (anything inbetween cylinder & cone) local node_id = minetest.get_content_id(node_name) - local min_radius, max_radius = radius * (radius - 1), radius * (radius + 1) local stride = {x=1, y=area.ystride, z=area.zstride} local offset = { x = current_pos.x - area.MinEdge.x, y = current_pos.y - area.MinEdge.y, z = current_pos.z - area.MinEdge.z, } - local min_slice, max_slice = offset[axis], offset[axis] + length - 1 local count = 0 - for index2 = -radius, radius do - -- Offset contributed by other axis 1 plus 1 to make it 1-indexed - local new_index2 = (index2 + offset[other1]) * stride[other1] + 1 - for index3 = -radius, radius do - local new_index3 = new_index2 + (index3 + offset[other2]) * stride[other2] - local squared = index2 * index2 + index3 * index3 - if squared <= max_radius and (not hollow or squared >= min_radius) then - -- Position is in cylinder - -- Add column along axis - for index1 = min_slice, max_slice do - local vi = new_index3 + index1 * stride[axis] + for i = 0, length - 1 do + -- Calulate radius for this "height" in the cylinder + local radius = radius1 + (radius2 - radius1) * (i + 1) / length + radius = math.floor(radius + 0.5) -- round + local min_radius, max_radius = radius * (radius - 1), radius * (radius + 1) + + for index2 = -radius, radius do + -- Offset contributed by other axis 1 plus 1 to make it 1-indexed + local new_index2 = (index2 + offset[other1]) * stride[other1] + 1 + for index3 = -radius, radius do + local new_index3 = new_index2 + (index3 + offset[other2]) * stride[other2] + local squared = index2 * index2 + index3 * index3 + if squared <= max_radius and (not hollow or squared >= min_radius) then + -- Position is in cylinder, add node here + local vi = new_index3 + (offset[axis] + i) * stride[axis] data[vi] = node_id + count = count + 1 end - count = count + length end end end diff --git a/worldedit_commands/init.lua b/worldedit_commands/init.lua index 325a31c..6b6d2a7 100644 --- a/worldedit_commands/init.lua +++ b/worldedit_commands/init.lua @@ -23,6 +23,7 @@ local function get_position(name) --position 1 retrieval function for when not u return pos1 end +-- normalize_nodename wrapper for convenience purposes local function get_node(name, nodename) local node = worldedit.normalize_nodename(nodename) if not node then @@ -36,26 +37,46 @@ function worldedit.player_notify(name, message) minetest.chat_send_player(name, "WorldEdit -!- " .. message, false) end ---determines whether `nodename` is a valid node name, returning a boolean +local function string_endswith(full, part) + return full:find(part, 1, true) == #full - #part + 1 +end + +-- normalizes node "description" `nodename`, returning a string (or nil) worldedit.normalize_nodename = function(nodename) - nodename = nodename:gsub("^%s*(.-)%s*$", "%1") + nodename = nodename:gsub("^%s*(.-)%s*$", "%1") -- strip spaces if nodename == "" then return nil end - local fullname = ItemStack({name=nodename}):get_name() --resolve aliases of node names to full names - if minetest.registered_nodes[fullname] or fullname == "air" then --directly found node name or alias of nodename + + local fullname = ItemStack({name=nodename}):get_name() -- resolve aliases + if minetest.registered_nodes[fullname] or fullname == "air" then -- full name return fullname end for key, value in pairs(minetest.registered_nodes) do - if key:find(":" .. nodename, 1, true) then --found in mod + if string_endswith(key, ":" .. nodename) then -- matches name (w/o mod part) return key end end - nodename = nodename:lower() --lowercase both for case insensitive comparison + nodename = nodename:lower() -- lowercase both for case insensitive comparison for key, value in pairs(minetest.registered_nodes) do - if value.description:lower() == nodename then --found in description + local desc = value.description:lower() + if desc == nodename then -- matches description return key end + if string_endswith(desc, " block") and desc == nodename.." block" then + -- fuzzy description match (e.g. "Steel" == "Steel Block") + return key + end + end + + local match = nil + for key, value in pairs(minetest.registered_nodes) do + if value.description:lower():find(nodename, 1, true) ~= nil then + if match ~= nil then + return nil + end + match = key -- substring description match (only if no ambiguities) + end end - return nil + return match end -- Determines the axis in which a player is facing, returning an axis ("x", "y", or "z") and the sign (1 or -1) @@ -377,16 +398,32 @@ minetest.register_chatcommand("/set", { privs = {worldedit=true}, func = safe_region(function(name, param) local node = get_node(name, param) - if not node then - worldedit.player_notify(name, "Could not identify node \"" .. param .. "\"") - return - end + if not node then return end local count = worldedit.set(worldedit.pos1[name], worldedit.pos2[name], node) worldedit.player_notify(name, count .. " nodes set") end, check_region), }) +minetest.register_chatcommand("/param2", { + params = "", + description = "Set param2 of all nodes in the current WorldEdit region to ", + privs = {worldedit=true}, + func = safe_region(function(name, param) + local param2 = tonumber(param) + if not param2 then + worldedit.player_notify(name, "Invalid or missing param2 argument") + return + elseif param2 < 0 or param2 > 255 then + worldedit.player_notify(name, "Param2 is out of range (must be between 0 and 255 inclusive)!") + return + end + + local count = worldedit.set_param2(worldedit.pos1[name], worldedit.pos2[name], param2) + worldedit.player_notify(name, count .. " nodes altered") + end, check_region), +}) + minetest.register_chatcommand("/mix", { params = " ...", description = "Fill the current WorldEdit region with a random mix of , ...", @@ -395,10 +432,7 @@ minetest.register_chatcommand("/mix", { local nodes = {} for nodename in param:gmatch("[^%s]+") do local node = get_node(name, nodename) - if not node then - worldedit.player_notify(name, "Could not identify node \"" .. name .. "\"") - return - end + if not node then return end nodes[#nodes + 1] = node end @@ -455,6 +489,45 @@ minetest.register_chatcommand("/replaceinverse", { end, check_replace), }) +local check_cube = function(name, param) + if worldedit.pos1[name] == nil then + worldedit.player_notify(name, "no position 1 selected") + return nil + end + local found, _, w, h, l, nodename = param:find("^(%d+)%s+(%d+)%s+(%d+)%s+(.+)$") + if found == nil then + worldedit.player_notify(name, "invalid usage: " .. param) + return nil + end + local node = get_node(name, nodename) + if not node then return nil end + return tonumber(w) * tonumber(h) * tonumber(l) +end + +minetest.register_chatcommand("/hollowcube", { + params = " ", + description = "Add a hollow cube with its ground level centered at WorldEdit position 1 with dimensions x x , composed of .", + privs = {worldedit=true}, + func = safe_region(function(name, param) + local found, _, w, h, l, nodename = param:find("^(%d+)%s+(%d+)%s+(%d+)%s+(.+)$") + local node = get_node(name, nodename) + local count = worldedit.cube(worldedit.pos1[name], tonumber(w), tonumber(h), tonumber(l), node, true) + worldedit.player_notify(name, count .. " nodes added") + end, check_cube), +}) + +minetest.register_chatcommand("/cube", { + params = " ", + description = "Add a cube with its ground level centered at WorldEdit position 1 with dimensions x x , composed of .", + privs = {worldedit=true}, + func = safe_region(function(name, param) + local found, _, w, h, l, nodename = param:find("^(%d+)%s+(%d+)%s+(%d+)%s+(.+)$") + local node = get_node(name, nodename) + local count = worldedit.cube(worldedit.pos1[name], tonumber(w), tonumber(h), tonumber(l), node) + worldedit.player_notify(name, count .. " nodes added") + end, check_cube), +}) + local check_sphere = function(name, param) if worldedit.pos1[name] == nil then worldedit.player_notify(name, "no position 1 selected") @@ -538,46 +611,65 @@ local check_cylinder = function(name, param) worldedit.player_notify(name, "no position 1 selected") return nil end - local found, _, axis, length, radius, nodename = param:find("^([xyz%?])%s+([+-]?%d+)%s+(%d+)%s+(.+)$") + -- two radii + local found, _, axis, length, radius1, radius2, nodename = param:find("^([xyz%?])%s+([+-]?%d+)%s+(%d+)%s+(%d+)%s+(.+)$") + if found == nil then + -- single radius + found, _, axis, length, radius1, nodename = param:find("^([xyz%?])%s+([+-]?%d+)%s+(%d+)%s+(.+)$") + radius2 = radius1 + end if found == nil then worldedit.player_notify(name, "invalid usage: " .. param) return nil end local node = get_node(name, nodename) if not node then return nil end - return math.ceil(math.pi * (tonumber(radius) ^ 2) * tonumber(length)) + local radius = math.max(tonumber(radius1), tonumber(radius2)) + return math.ceil(math.pi * (radius ^ 2) * tonumber(length)) end minetest.register_chatcommand("/hollowcylinder", { - params = "x/y/z/? ", - description = "Add hollow cylinder at WorldEdit position 1 along the x/y/z/? axis with length and radius , composed of ", + params = "x/y/z/? [radius2] ", + description = "Add hollow cylinder at WorldEdit position 1 along the x/y/z/? axis with length , base radius (and top radius [radius2]), composed of ", privs = {worldedit=true}, func = safe_region(function(name, param) - local found, _, axis, length, radius, nodename = param:find("^([xyz%?])%s+([+-]?%d+)%s+(%d+)%s+(.+)$") + -- two radii + local found, _, axis, length, radius1, radius2, nodename = param:find("^([xyz%?])%s+([+-]?%d+)%s+(%d+)%s+(%d+)%s+(.+)$") + if found == nil then + -- single radius + found, _, axis, length, radius1, nodename = param:find("^([xyz%?])%s+([+-]?%d+)%s+(%d+)%s+(.+)$") + radius2 = radius1 + end length = tonumber(length) if axis == "?" then axis, sign = worldedit.player_axis(name) length = length * sign end local node = get_node(name, nodename) - local count = worldedit.cylinder(worldedit.pos1[name], axis, length, tonumber(radius), node, true) + local count = worldedit.cylinder(worldedit.pos1[name], axis, length, tonumber(radius1), tonumber(radius2), node, true) worldedit.player_notify(name, count .. " nodes added") end, check_cylinder), }) minetest.register_chatcommand("/cylinder", { - params = "x/y/z/? ", - description = "Add cylinder at WorldEdit position 1 along the x/y/z/? axis with length and radius , composed of ", + params = "x/y/z/? [radius2] ", + description = "Add cylinder at WorldEdit position 1 along the x/y/z/? axis with length , base radius (and top radius [radius2]), composed of ", privs = {worldedit=true}, func = safe_region(function(name, param) - local found, _, axis, length, radius, nodename = param:find("^([xyz%?])%s+([+-]?%d+)%s+(%d+)%s+(.+)$") + -- two radii + local found, _, axis, length, radius1, radius2, nodename = param:find("^([xyz%?])%s+([+-]?%d+)%s+(%d+)%s+(%d+)%s+(.+)$") + if found == nil then + -- single radius + found, _, axis, length, radius1, nodename = param:find("^([xyz%?])%s+([+-]?%d+)%s+(%d+)%s+(.+)$") + radius2 = radius1 + end length = tonumber(length) if axis == "?" then axis, sign = worldedit.player_axis(name) length = length * sign end local node = get_node(name, nodename) - local count = worldedit.cylinder(worldedit.pos1[name], axis, length, tonumber(radius), node) + local count = worldedit.cylinder(worldedit.pos1[name], axis, length, tonumber(radius1), tonumber(radius2), node) worldedit.player_notify(name, count .. " nodes added") end, check_cylinder), }) @@ -696,6 +788,7 @@ minetest.register_chatcommand("/move", { end amount = tonumber(amount) if axis == "?" then + local sign axis, sign = worldedit.player_axis(name) amount = amount * sign end diff --git a/worldedit_commands/safe.lua b/worldedit_commands/safe.lua index a93e393..0bd30d7 100644 --- a/worldedit_commands/safe.lua +++ b/worldedit_commands/safe.lua @@ -1,6 +1,8 @@ local safe_region_callback = {} local safe_region_param = {} +worldedit._override_safe_regions = false -- internal use ONLY! + local function check_region(name, param) local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name] --obtain positions if pos1 == nil or pos2 == nil then @@ -20,7 +22,7 @@ local function safe_region(callback, nodes_needed) --check if the operation applies to a safe number of nodes local count = nodes_needed(name, param) if count == nil then return end --invalid command - if count < 10000 then + if worldedit._override_safe_regions or count < 10000 then return callback(name, param) end @@ -44,20 +46,21 @@ minetest.register_chatcommand("/y", { return end - safe_region_callback[name], safe_region_param[name] = nil, nil --reset pending operation + reset_pending(name) callback(name, param) end, }) minetest.register_chatcommand("/n", { params = "", - description = "Confirm a pending operation", + description = "Abort a pending operation", func = function(name) if not safe_region_callback[name] then worldedit.player_notify(name, "no operation pending") return end - safe_region_callback[name], safe_region_param[name] = nil, nil + + reset_pending(name) end, }) diff --git a/worldedit_gui/functionality.lua b/worldedit_gui/functionality.lua index 17a8a79..912fd59 100644 --- a/worldedit_gui/functionality.lua +++ b/worldedit_gui/functionality.lua @@ -1,6 +1,6 @@ --saved state for each player -local gui_nodename1 = {} --mapping of player names to node names (arbitrary strings may also appear as values) -local gui_nodename2 = {} --mapping of player names to node names (arbitrary strings may also appear as values) +local gui_nodename1 = {} --mapping of player names to node names +local gui_nodename2 = {} --mapping of player names to node names local gui_axis1 = {} --mapping of player names to axes (one of 1, 2, 3, or 4, representing the axes in the `axis_indices` table below) local gui_axis2 = {} --mapping of player names to axes (one of 1, 2, 3, or 4, representing the axes in the `axis_indices` table below) local gui_distance1 = {} --mapping of player names to a distance (arbitrary strings may also appear as values) @@ -10,9 +10,7 @@ local gui_count1 = {} --mapping of player names to a quantity (arbitrary strings local gui_count2 = {} --mapping of player names to a quantity (arbitrary strings may also appear as values) local gui_count3 = {} --mapping of player names to a quantity (arbitrary strings may also appear as values) local gui_angle = {} --mapping of player names to an angle (one of 90, 180, 270, representing the angle in degrees clockwise) -local gui_filename = {} --mapping of player names to file names (arbitrary strings may also appear as values) -local gui_formspec = {} --mapping of player names to formspecs -local gui_code = {} --mapping of player names to formspecs +local gui_filename = {} --mapping of player names to file names --set default values setmetatable(gui_nodename1, {__index = function() return "Cobblestone" end}) @@ -27,8 +25,6 @@ setmetatable(gui_count2, {__index = function() return "6" end}) setmetatable(gui_count3, {__index = function() return "4" end}) setmetatable(gui_angle, {__index = function() return 90 end}) setmetatable(gui_filename, {__index = function() return "building" end}) -setmetatable(gui_formspec, {__index = function() return "size[5,5]\nlabel[0,0;Hello, world!]" end}) -setmetatable(gui_code, {__index = function() return "minetest.chat_send_player(\"singleplayer\", \"Hello, world!\")" end}) local axis_indices = {["X axis"]=1, ["Y axis"]=2, ["Z axis"]=3, ["Look direction"]=4} local axis_values = {"x", "y", "z", "?"} @@ -292,17 +288,21 @@ worldedit.register_gui_function("worldedit_gui_cylinder", { name = "Cylinder", privs = combine_we_privs({"hollowcylinder", "cylinder"}), get_formspec = function(name) - local node, axis, length, radius = gui_nodename1[name], gui_axis1[name], gui_distance1[name], gui_distance2[name] + local node, axis, length = gui_nodename1[name], gui_axis1[name], gui_distance1[name] + local radius1, radius2 = gui_distance2[name], gui_distance3[name] local nodename = worldedit.normalize_nodename(node) - return "size[6.5,5]" .. worldedit.get_formspec_header("worldedit_gui_cylinder") .. + return "size[6.5,6]" .. worldedit.get_formspec_header("worldedit_gui_cylinder") .. string.format("field[0.5,1.5;4,0.8;worldedit_gui_cylinder_node;Name;%s]", minetest.formspec_escape(node)) .. "button[4,1.18;1.5,0.8;worldedit_gui_cylinder_search;Search]" .. formspec_node("5.5,1.1", nodename) .. string.format("field[0.5,2.5;4,0.8;worldedit_gui_cylinder_length;Length;%s]", minetest.formspec_escape(length)) .. string.format("dropdown[4,2.18;2.5;worldedit_gui_cylinder_axis;X axis,Y axis,Z axis,Look direction;%d]", axis) .. - string.format("field[0.5,3.5;4,0.8;worldedit_gui_cylinder_radius;Radius;%s]", minetest.formspec_escape(radius)) .. - "button_exit[0,4.5;3,0.8;worldedit_gui_cylinder_submit_hollow;Hollow Cylinder]" .. - "button_exit[3.5,4.5;3,0.8;worldedit_gui_cylinder_submit_solid;Solid Cylinder]" + string.format("field[0.5,3.5;2,0.8;worldedit_gui_cylinder_radius1;Base Radius;%s]", minetest.formspec_escape(radius1)) .. + string.format("field[2.5,3.5;2,0.8;worldedit_gui_cylinder_radius2;Top Radius;%s]", minetest.formspec_escape(radius2)) .. + "label[0.25,4;Equal base and top radius creates a cylinder,\n".. + "zero top radius creates a cone.\nConsult documentation for more information.]".. + "button_exit[0,5.5;3,0.8;worldedit_gui_cylinder_submit_hollow;Hollow Cylinder]" .. + "button_exit[3.5,5.5;3,0.8;worldedit_gui_cylinder_submit_solid;Solid Cylinder]" end, }) @@ -312,7 +312,8 @@ worldedit.register_gui_handler("worldedit_gui_cylinder", function(name, fields) gui_nodename1[name] = tostring(fields.worldedit_gui_cylinder_node) gui_axis1[name] = axis_indices[fields.worldedit_gui_cylinder_axis] gui_distance1[name] = tostring(fields.worldedit_gui_cylinder_length) - gui_distance2[name] = tostring(fields.worldedit_gui_cylinder_radius) + gui_distance2[name] = tostring(fields.worldedit_gui_cylinder_radius1) + gui_distance3[name] = tostring(fields.worldedit_gui_cylinder_radius2) worldedit.show_page(name, "worldedit_gui_cylinder") local submit = nil @@ -324,7 +325,8 @@ worldedit.register_gui_handler("worldedit_gui_cylinder", function(name, fields) if submit then local n = worldedit.normalize_nodename(gui_nodename1[name]) if n then - minetest.chatcommands["/"..submit].func(name, string.format("%s %s %s %s", axis_values[gui_axis1[name]], gui_distance1[name], gui_distance2[name], n)) + local args = string.format("%s %s %s %s %s", axis_values[gui_axis1[name]], gui_distance1[name], gui_distance2[name], gui_distance3[name], n) + minetest.chatcommands["/"..submit].func(name, args) end end return true @@ -733,26 +735,46 @@ worldedit.register_gui_handler("worldedit_gui_save_load", function(name, fields) return false end) -worldedit.register_gui_function("worldedit_gui_lua", { - name = "Run Lua", - privs = we_privs("lua"), +worldedit.register_gui_function("worldedit_gui_cube", { + name = "Cuboid", -- technically the command is misnamed, I know... + privs = combine_we_privs({"hollowcube", "cube"}), get_formspec = function(name) - local code = gui_code[name] - return "size[8,6.5]" .. worldedit.get_formspec_header("worldedit_gui_lua") .. - string.format("textarea[0.5,1;7.5,5.5;worldedit_gui_lua_code;Lua Code;%s]", minetest.formspec_escape(code)) .. - "button_exit[0,6;3,0.8;worldedit_gui_lua_run;Run Lua]" .. - "button_exit[5,6;3,0.8;worldedit_gui_lua_transform;Lua Transform]" + local width, height, length = gui_distance1[name], gui_distance2[name], gui_distance3[name] + local node = gui_nodename1[name] + local nodename = worldedit.normalize_nodename(node) + return "size[6.5,4]" .. worldedit.get_formspec_header("worldedit_gui_cube") .. + string.format("field[0.5,1.5;4,0.8;worldedit_gui_cube_node;Name;%s]", minetest.formspec_escape(node)) .. + "button[4,1.18;1.5,0.8;worldedit_gui_cube_search;Search]" .. + formspec_node("5.5,1.1", nodename) .. + string.format("field[0.5,2.5;1,0.8;worldedit_gui_cube_width;Width;%s]", minetest.formspec_escape(width)) .. + string.format("field[1.5,2.5;1,0.8;worldedit_gui_cube_height;Height;%s]", minetest.formspec_escape(height)) .. + string.format("field[2.5,2.5;1,0.8;worldedit_gui_cube_length;Length;%s]", minetest.formspec_escape(length)) .. + "button_exit[0,3.5;3,0.8;worldedit_gui_cube_submit_hollow;Hollow Cuboid]" .. + "button_exit[3.5,3.5;3,0.8;worldedit_gui_cube_submit_solid;Solid Cuboid]" end, }) -worldedit.register_gui_handler("worldedit_gui_lua", function(name, fields) - if fields.worldedit_gui_lua_run or fields.worldedit_gui_lua_transform then - gui_code[name] = fields.worldedit_gui_lua_code - worldedit.show_page(name, "worldedit_gui_lua") - if fields.worldedit_gui_lua_run then - minetest.chatcommands["/lua"].func(name, gui_code[name]) - else --fields.worldedit_gui_lua_transform - minetest.chatcommands["/luatransform"].func(name, gui_code[name]) +worldedit.register_gui_handler("worldedit_gui_cube", function(name, fields) + if fields.worldedit_gui_cube_search + or fields.worldedit_gui_cube_submit_hollow or fields.worldedit_gui_cube_submit_solid then + gui_nodename1[name] = tostring(fields.worldedit_gui_cube_node) + gui_distance1[name] = tostring(fields.worldedit_gui_cube_width) + gui_distance2[name] = tostring(fields.worldedit_gui_cube_height) + gui_distance3[name] = tostring(fields.worldedit_gui_cube_length) + worldedit.show_page(name, "worldedit_gui_cube") + + local submit = nil + if fields.worldedit_gui_cube_submit_hollow then + submit = "hollowcube" + elseif fields.worldedit_gui_cube_submit_solid then + submit = "cube" + end + if submit then + local n = worldedit.normalize_nodename(gui_nodename1[name]) + if n then + local args = string.format("%s %s %s %s", gui_distance1[name], gui_distance2[name], gui_distance3[name], n) + minetest.chatcommands["/"..submit].func(name, args) + end end return true end diff --git a/worldedit_gui/init.lua b/worldedit_gui/init.lua index dafd7c2..137a057 100644 --- a/worldedit_gui/init.lua +++ b/worldedit_gui/init.lua @@ -145,13 +145,21 @@ elseif rawget(_G, "sfinv") then --sfinv installed (part of minetest_game since 0 end }) + --compatibility with pre-0.4.16 sfinv + local set_page = sfinv.set_page or function(player, name) + --assumptions: src pg has no leave callback, dst pg has no enter callback + local ctx = {page=name} + sfinv.contexts[player:get_player_name()] = ctx + sfinv.set_player_inventory_formspec(player, ctx) + end + --show the form when the button is pressed and hide it when done minetest.register_on_player_receive_fields(function(player, formname, fields) if fields.worldedit_gui then --main page worldedit.show_page(player:get_player_name(), "worldedit_gui") return true elseif fields.worldedit_gui_exit then --return to original page - sfinv.set_page(player, "sfinv:crafting") + set_page(player, "sfinv:crafting") return true end return false @@ -163,82 +171,14 @@ elseif rawget(_G, "sfinv") then --sfinv installed (part of minetest_game since 0 player:set_inventory_formspec(get_formspec(name, page)) end end -else --fallback button - -- FIXME: this is a huge clusterfuck and the back button is broken - local player_formspecs = {} - - local update_main_formspec = function(name) - local formspec = player_formspecs[name] - if not formspec then - return - end - local player = minetest.get_player_by_name(name) - if not player then --this is in case the player signs off while the media is loading - return - end - if (minetest.check_player_privs(name, {creative=true}) or - minetest.setting_getbool("creative_mode")) and - creative then --creative is active, add button to modified formspec - local creative_formspec = player:get_inventory_formspec() - local tab_id = tonumber(creative_formspec:match("tabheader%[.-;(%d+)%;")) - - if tab_id == 1 then - formspec = creative_formspec .. - "image_button[0,1;1,1;inventory_plus_worldedit_gui.png;worldedit_gui;]" - elseif not tab_id then - formspec = creative_formspec .. - "image_button[6,0;1,1;inventory_plus_worldedit_gui.png;worldedit_gui;]" - else - return - end - else - formspec = formspec .. "image_button[0,0;1,1;inventory_plus_worldedit_gui.png;worldedit_gui;]" - end - player:set_inventory_formspec(formspec) - end - - minetest.register_on_joinplayer(function(player) - local name = player:get_player_name() - minetest.after(1, function() - if minetest.get_player_by_name(name) then --ensure the player is still signed in - player_formspecs[name] = player:get_inventory_formspec() - minetest.after(0.01, function() - update_main_formspec(name) - end) - end - end) - end) - - minetest.register_on_leaveplayer(function(player) - player_formspecs[player:get_player_name()] = nil - end) - - local gui_player_formspecs = {} - minetest.register_on_player_receive_fields(function(player, formname, fields) - local name = player:get_player_name() - if fields.worldedit_gui then --main page - gui_player_formspecs[name] = player:get_inventory_formspec() - worldedit.show_page(name, "worldedit_gui") - return true - elseif fields.worldedit_gui_exit then --return to original page - if gui_player_formspecs[name] then - player:set_inventory_formspec(gui_player_formspecs[name]) - end - return true - else --deal with creative_inventory setting the formspec on every single message - minetest.after(0.01,function() - update_main_formspec(name) - end) - return false --continue processing in creative inventory - end - end) - - worldedit.show_page = function(name, page) - local player = minetest.get_player_by_name(name) - if player then - player:set_inventory_formspec(get_formspec(name, page)) - end - end +else + error( + "worldedit_gui requires a supported \"gui management\" mod to be installed\n".. + "To use the GUI you need to either\n".. + "* Use minetest_game (at least 0.4.15) or a subgame with compatible sfinv\n".. + "* Install Unified Inventory or Inventory++\n".. + "If you do not want to use worldedit_gui, disable it by editing world.mt or from the Main Menu" + ) end worldedit.register_gui_function("worldedit_gui", { diff --git a/worldedit_gui/textures/inventory_plus_worldedit_gui.png b/worldedit_gui/textures/inventory_plus_worldedit_gui.png index fbc1abc..ff9404b 100644 Binary files a/worldedit_gui/textures/inventory_plus_worldedit_gui.png and b/worldedit_gui/textures/inventory_plus_worldedit_gui.png differ diff --git a/worldedit_shortcommands/init.lua b/worldedit_shortcommands/init.lua index a4350ae..da02b75 100644 --- a/worldedit_shortcommands/init.lua +++ b/worldedit_shortcommands/init.lua @@ -25,6 +25,7 @@ worldedit.alias_chatcommand("/v", "/volume") worldedit.alias_chatcommand("/s", "/set") worldedit.alias_chatcommand("/r", "/replace") worldedit.alias_chatcommand("/ri", "/replaceinverse") +worldedit.alias_chatcommand("/hcube", "/hollowcube") worldedit.alias_chatcommand("/hspr", "/hollowsphere") worldedit.alias_chatcommand("/spr", "/sphere") worldedit.alias_chatcommand("/hdo", "/hollowdome") -- cgit v1.2.3