From e67cc361e9a496ff3c82a54a6e369fccd3b26436 Mon Sep 17 00:00:00 2001 From: FaceDeer Date: Fri, 10 Feb 2017 14:43:25 -0700 Subject: [PATCH 1/6] Adding settings, optional override of default bronze recipe, update internationalization All configurable settings are moved into settingtypes. The three minerals can be independently enabled/disabled. Also, the unrealistic default crafting recipe for bronze can be disabled so that only the tin+copper recipe is available. Updating the internationalization mod to current version. --- _config.txt | 27 ------ init.lua | 198 +++++++++++++++++++++++--------------------- intllib.lua | 45 ++++++++++ locale/de.po | 82 ++++++++++++++++++ locale/de.txt | 22 ----- locale/es.po | 82 ++++++++++++++++++ locale/es.txt | 21 ----- locale/fr.po | 82 ++++++++++++++++++ locale/fr.txt | 21 ----- locale/it.po | 82 ++++++++++++++++++ locale/it.txt | 21 ----- locale/template.pot | 82 ++++++++++++++++++ locale/tr.po | 82 ++++++++++++++++++ locale/tr.txt | 25 ------ mg.lua | 6 ++ readsettings.lua | 42 ++++++++++ settingtypes.txt | 39 +++++++++ 17 files changed, 729 insertions(+), 230 deletions(-) delete mode 100644 _config.txt create mode 100644 intllib.lua create mode 100644 locale/de.po delete mode 100644 locale/de.txt create mode 100644 locale/es.po delete mode 100644 locale/es.txt create mode 100644 locale/fr.po delete mode 100644 locale/fr.txt create mode 100644 locale/it.po delete mode 100644 locale/it.txt create mode 100644 locale/template.pot create mode 100644 locale/tr.po delete mode 100644 locale/tr.txt create mode 100644 readsettings.lua create mode 100644 settingtypes.txt diff --git a/_config.txt b/_config.txt deleted file mode 100644 index 42e7b37..0000000 --- a/_config.txt +++ /dev/null @@ -1,27 +0,0 @@ ------------------------------------------------------------------------------- ------------------------------- CONFIGURATION --------------------------------- ------------------------------------------------------------------------------- - ------------------------------------------------------------------------------- --------- Change settings by changing the values after the "=". --------------- ------------------------------------------------------------------------------- - --- Chunk sizes for ore generation (bigger = ore deposits are more scattered around) -moreores.tin_chunk_size = 7 -moreores.silver_chunk_size = 11 -moreores.mithril_chunk_size = 11 - --- Amount of ore per chunk (higher = bigger ore deposits) -moreores.tin_ore_per_chunk = 3 -moreores.silver_ore_per_chunk = 4 -moreores.mithril_ore_per_chunk = 1 - --- Minimal depths of ore generation (Y coordinate, 0 being sea level by default) -moreores.tin_min_depth = -31000 -moreores.silver_min_depth = -31000 -moreores.mithril_min_depth = -31000 - --- Maximal depths of ore generation (Y coordinate, 0 being sea level by default) -moreores.tin_max_depth = 8 -moreores.silver_max_depth = -2 -moreores.mithril_max_depth = -512 diff --git a/init.lua b/init.lua index 7af91bc..5ef7569 100644 --- a/init.lua +++ b/init.lua @@ -3,23 +3,18 @@ ** More Ores ** By Calinou, with the help of Nore. -Copyright (c) 2011-2015 Calinou and contributors. +Copyright (c) 2011-2017 Calinou and contributors. Licensed under the zlib license. See LICENSE.md for more information. ===================================================================== --]] moreores = {} -local S -if minetest.get_modpath("intllib") then - S = intllib.Getter() -else - S = function(s) return s end -end - +-- internationalization boilerplate local modpath = minetest.get_modpath("moreores") +local S, NS = dofile(modpath.."/intllib.lua") -dofile(modpath .. "/_config.txt") +dofile(modpath .. "/readsettings.lua") -- `mg` support: if minetest.get_modpath("mg") then @@ -233,83 +228,91 @@ end -- Add everything: local modname = "moreores" -local oredefs = { - silver = { - description = "Silver", - makes = {ore = true, block = true, lump = true, ingot = true, chest = true}, - oredef = {clust_scarcity = moreores.silver_chunk_size * moreores.silver_chunk_size * moreores.silver_chunk_size, - clust_num_ores = moreores.silver_ore_per_chunk, - clust_size = moreores.silver_chunk_size, - y_min = moreores.silver_min_depth, - y_max = moreores.silver_max_depth - }, - tools = { - pick = { - cracky = {times = {[1] = 2.60, [2] = 1.00, [3] = 0.60}, uses = 100, maxlevel= 1} - }, - hoe = { - uses = 300 - }, - shovel = { - crumbly = {times = {[1] = 1.10, [2] = 0.40, [3] = 0.25}, uses = 100, maxlevel= 1} - }, - axe = { - choppy = {times = {[1] = 2.50, [2] = 0.80, [3] = 0.50}, uses = 100, maxlevel= 1}, - fleshy = {times = {[2] = 1.10, [3] = 0.60}, uses = 100, maxlevel= 1} - }, - sword = { - fleshy = {times = {[2] = 0.70, [3] = 0.30}, uses = 100, maxlevel= 1}, - snappy = {times = {[2] = 0.70, [3] = 0.30}, uses = 100, maxlevel= 1}, - choppy = {times = {[3] = 0.80}, uses = 100, maxlevel= 0} - }, +local oredefs = {} + +if moreores.silver_enabled then +oredefs.silver = { + description = S("Silver"), + makes = {ore = true, block = true, lump = true, ingot = true, chest = true}, + oredef = {clust_scarcity = moreores.silver_chunk_size * moreores.silver_chunk_size * moreores.silver_chunk_size, + clust_num_ores = moreores.silver_ore_per_chunk, + clust_size = moreores.silver_chunk_size, + y_min = moreores.silver_min_depth, + y_max = moreores.silver_max_depth }, - full_punch_interval = 1.0, - damage_groups = {fleshy = 6}, - }, - tin = { - description = "Tin", - makes = {ore = true, block = true, lump = true, ingot = true, chest = false}, - oredef = {clust_scarcity = moreores.tin_chunk_size * moreores.tin_chunk_size * moreores.tin_chunk_size, - clust_num_ores = moreores.tin_ore_per_chunk, - clust_size = moreores.tin_chunk_size, - y_min = moreores.tin_min_depth, - y_max = moreores.tin_max_depth - }, - tools = {}, - }, - mithril = { - description = "Mithril", - makes = {ore = true, block = true, lump = true, ingot = true, chest = false}, - oredef = {clust_scarcity = moreores.mithril_chunk_size * moreores.mithril_chunk_size * moreores.mithril_chunk_size, - clust_num_ores = moreores.mithril_ore_per_chunk, - clust_size = moreores.mithril_chunk_size, - y_min = moreores.mithril_min_depth, - y_max = moreores.mithril_max_depth - }, - tools = { - pick = { - cracky = {times = {[1] = 2.25, [2] = 0.55, [3] = 0.35}, uses = 200, maxlevel= 1} - }, - hoe = { - uses = 1000 - }, - shovel = { - crumbly = {times = {[1] = 0.70, [2] = 0.35, [3] = 0.20}, uses = 200, maxlevel= 1} - }, - axe = { - choppy = {times = {[1] = 1.75, [2] = 0.45, [3] = 0.45}, uses = 200, maxlevel= 1}, - fleshy = {times = {[2] = 0.95, [3] = 0.30}, uses = 200, maxlevel= 1} - }, - sword = { - fleshy = {times = {[2] = 0.65, [3] = 0.25}, uses = 200, maxlevel= 1}, - snappy = {times = {[2] = 0.70, [3] = 0.25}, uses = 200, maxlevel= 1}, - choppy = {times = {[3] = 0.65}, uses = 200, maxlevel= 0} - } + tools = { + pick = { + cracky = {times = {[1] = 2.60, [2] = 1.00, [3] = 0.60}, uses = 100, maxlevel= 1} }, - full_punch_interval = 0.45, - damage_groups = {fleshy = 9}, - } + hoe = { + uses = 300 + }, + shovel = { + crumbly = {times = {[1] = 1.10, [2] = 0.40, [3] = 0.25}, uses = 100, maxlevel= 1} + }, + axe = { + choppy = {times = {[1] = 2.50, [2] = 0.80, [3] = 0.50}, uses = 100, maxlevel= 1}, + fleshy = {times = {[2] = 1.10, [3] = 0.60}, uses = 100, maxlevel= 1} + }, + sword = { + fleshy = {times = {[2] = 0.70, [3] = 0.30}, uses = 100, maxlevel= 1}, + snappy = {times = {[2] = 0.70, [3] = 0.30}, uses = 100, maxlevel= 1}, + choppy = {times = {[3] = 0.80}, uses = 100, maxlevel= 0} + }, + }, + full_punch_interval = 1.0, + damage_groups = {fleshy = 6}, } +end + +if moreores.tin_enabled then +oredefs.tin = { + description = S("Tin"), + makes = {ore = true, block = true, lump = true, ingot = true, chest = false}, + oredef = {clust_scarcity = moreores.tin_chunk_size * moreores.tin_chunk_size * moreores.tin_chunk_size, + clust_num_ores = moreores.tin_ore_per_chunk, + clust_size = moreores.tin_chunk_size, + y_min = moreores.tin_min_depth, + y_max = moreores.tin_max_depth + }, + tools = {}, +} +end + +if moreores.mithril_enabled then +oredefs.mithril = { + description = S("Mithril"), + makes = {ore = true, block = true, lump = true, ingot = true, chest = false}, + oredef = {clust_scarcity = moreores.mithril_chunk_size * moreores.mithril_chunk_size * moreores.mithril_chunk_size, + clust_num_ores = moreores.mithril_ore_per_chunk, + clust_size = moreores.mithril_chunk_size, + y_min = moreores.mithril_min_depth, + y_max = moreores.mithril_max_depth + }, + tools = { + pick = { + cracky = {times = {[1] = 2.25, [2] = 0.55, [3] = 0.35}, uses = 200, maxlevel= 1} + }, + hoe = { + uses = 1000 + }, + shovel = { + crumbly = {times = {[1] = 0.70, [2] = 0.35, [3] = 0.20}, uses = 200, maxlevel= 1} + }, + axe = { + choppy = {times = {[1] = 1.75, [2] = 0.45, [3] = 0.45}, uses = 200, maxlevel= 1}, + fleshy = {times = {[2] = 0.95, [3] = 0.30}, uses = 200, maxlevel= 1} + }, + sword = { + fleshy = {times = {[2] = 0.65, [3] = 0.25}, uses = 200, maxlevel= 1}, + snappy = {times = {[2] = 0.70, [3] = 0.25}, uses = 200, maxlevel= 1}, + choppy = {times = {[3] = 0.65}, uses = 200, maxlevel= 0} + } + }, + full_punch_interval = 0.45, + damage_groups = {fleshy = 9}, +} +end for orename,def in pairs(oredefs) do add_ore(modname, def.description, orename, def) @@ -325,16 +328,26 @@ minetest.register_craft({ } }) +if moreores.tin_enabled then -- Bronze has some special cases, because it is made from copper and tin: -minetest.register_craft( { - type = "shapeless", - output = "default:bronze_ingot 3", - recipe = { - "moreores:tin_ingot", - "default:copper_ingot", - "default:copper_ingot", - } -}) + minetest.register_craft( { + type = "shapeless", + output = "default:bronze_ingot 3", + recipe = { + "moreores:tin_ingot", + "default:copper_ingot", + "default:copper_ingot", + } + }) + + if moreores.override_default_bronze_recipe then + minetest.register_craft({ + type = "shapeless", + output = "default:bronze_ingot 0", + recipe = {"default:steel_ingot", "default:copper_ingot"}, + }) + end +end -- Unique node: minetest.register_node("moreores:copper_rail", { @@ -365,7 +378,6 @@ minetest.register_node("moreores:copper_rail", { }, }) - if minetest.setting_getbool("log_mods") then minetest.log("action", S("[moreores] loaded.")) end diff --git a/intllib.lua b/intllib.lua new file mode 100644 index 0000000..6669d72 --- /dev/null +++ b/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/locale/de.po b/locale/de.po new file mode 100644 index 0000000..90fb5a1 --- /dev/null +++ b/locale/de.po @@ -0,0 +1,82 @@ +# 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-10 13:36-0700\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: Xanthin\n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: init.lua:97 +#, c-format +msgid "%s Ore" +msgstr "%serz" + +#: init.lua:108 +#, c-format +msgid "%s Block" +msgstr "%sblock" + +#: init.lua:130 +#, c-format +msgid "%s Lump" +msgstr "%sklumpen" + +#: init.lua:145 +#, c-format +msgid "%s Ingot" +msgstr "%sbarren" + +#: init.lua:185 +#, c-format +msgid "%s Sword" +msgstr "%sschwert" + +#: init.lua:191 +#, c-format +msgid "%s Pickaxe" +msgstr "%sspitzhacke" + +#: init.lua:197 +#, c-format +msgid "%s Axe" +msgstr "%saxt" + +#: init.lua:203 +#, c-format +msgid "%s Shovel" +msgstr "%sschaufel" + +#: init.lua:208 +#, c-format +msgid "%s Hoe" +msgstr "" + +#: init.lua:235 +msgid "Silver" +msgstr "Silber" + +#: init.lua:270 +msgid "Tin" +msgstr "Zinn" + +#: init.lua:284 +msgid "Mithril" +msgstr "Mithril" + +#: init.lua:346 +msgid "Copper Rail" +msgstr "Kupferschiene" + +#: init.lua:374 +msgid "[moreores] loaded." +msgstr "[moreores] geladen." diff --git a/locale/de.txt b/locale/de.txt deleted file mode 100644 index 2eb6075..0000000 --- a/locale/de.txt +++ /dev/null @@ -1,22 +0,0 @@ -# Translation by Xanthin - -[moreores] loaded. = [moreores] geladen. - -%s Ore = %serz -%s Lump = %sklumpen -%s Ingot = %sbarren -%s Block = %sblock -%s Pickaxe = %sspitzhacke -%s Shovel = %sschaufel -%s Axe = %saxt -%s Sword = %sschwert -%s Hoe = %shacke - -Copper = Kupfer -Tin = Zinn -Bronze = Bronze -Silver = Silber -Gold = Gold -Mithril = Mithril - -Copper Rail = Kupferschiene diff --git a/locale/es.po b/locale/es.po new file mode 100644 index 0000000..28cf726 --- /dev/null +++ b/locale/es.po @@ -0,0 +1,82 @@ +# 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-10 13:36-0700\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: kaeza\n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: init.lua:97 +#, c-format +msgid "%s Ore" +msgstr "Mineral de %s" + +#: init.lua:108 +#, c-format +msgid "%s Block" +msgstr "Bloque de %s" + +#: init.lua:130 +#, c-format +msgid "%s Lump" +msgstr "Pepita de %s" + +#: init.lua:145 +#, c-format +msgid "%s Ingot" +msgstr "Lingote de %s" + +#: init.lua:185 +#, c-format +msgid "%s Sword" +msgstr "Espada de %s" + +#: init.lua:191 +#, c-format +msgid "%s Pickaxe" +msgstr "Pico de %s" + +#: init.lua:197 +#, c-format +msgid "%s Axe" +msgstr "Hacha de %s" + +#: init.lua:203 +#, c-format +msgid "%s Shovel" +msgstr "Pala de %s" + +#: init.lua:208 +#, c-format +msgid "%s Hoe" +msgstr "" + +#: init.lua:235 +msgid "Silver" +msgstr "plata" + +#: init.lua:270 +msgid "Tin" +msgstr "estaño" + +#: init.lua:284 +msgid "Mithril" +msgstr "mitrilo" + +#: init.lua:346 +msgid "Copper Rail" +msgstr "Riel de Cobre" + +#: init.lua:374 +msgid "[moreores] loaded." +msgstr "[moreores] cargado." diff --git a/locale/es.txt b/locale/es.txt deleted file mode 100644 index 1344a5a..0000000 --- a/locale/es.txt +++ /dev/null @@ -1,21 +0,0 @@ -# Translation by kaeza - -[moreores] loaded. = [moreores] cargado. - -%s Ore = Mineral de %s -%s Lump = Pepita de %s -%s Ingot = Lingote de %s -%s Block = Bloque de %s -%s Pickaxe = Pico de %s -%s Shovel = Pala de %s -%s Axe = Hacha de %s -%s Sword = Espada de %s - -Copper = cobre -Tin = estaño -Bronze = bronce -Silver = plata -Gold = oro -Mithril = mitrilo - -Copper Rail = Riel de Cobre diff --git a/locale/fr.po b/locale/fr.po new file mode 100644 index 0000000..3ec0eea --- /dev/null +++ b/locale/fr.po @@ -0,0 +1,82 @@ +# 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-10 13:36-0700\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: Calinou\n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: init.lua:97 +#, c-format +msgid "%s Ore" +msgstr "Minerai en %s" + +#: init.lua:108 +#, c-format +msgid "%s Block" +msgstr "Bloc en %s" + +#: init.lua:130 +#, c-format +msgid "%s Lump" +msgstr "Roche en %s" + +#: init.lua:145 +#, c-format +msgid "%s Ingot" +msgstr "Lingot en %s" + +#: init.lua:185 +#, c-format +msgid "%s Sword" +msgstr "Épée en %s" + +#: init.lua:191 +#, c-format +msgid "%s Pickaxe" +msgstr "Pioche en %s" + +#: init.lua:197 +#, c-format +msgid "%s Axe" +msgstr "Hache en %s" + +#: init.lua:203 +#, c-format +msgid "%s Shovel" +msgstr "Pelle en %s" + +#: init.lua:208 +#, c-format +msgid "%s Hoe" +msgstr "" + +#: init.lua:235 +msgid "Silver" +msgstr "argent" + +#: init.lua:270 +msgid "Tin" +msgstr "étain" + +#: init.lua:284 +msgid "Mithril" +msgstr "mithril" + +#: init.lua:346 +msgid "Copper Rail" +msgstr "Rail en cuivre" + +#: init.lua:374 +msgid "[moreores] loaded." +msgstr "[moreores] a été chargé." diff --git a/locale/fr.txt b/locale/fr.txt deleted file mode 100644 index 65687fa..0000000 --- a/locale/fr.txt +++ /dev/null @@ -1,21 +0,0 @@ -# Translation by Calinou - -[moreores] loaded. = [moreores] a été chargé. - -%s Ore = Minerai en %s -%s Lump = Roche en %s -%s Ingot = Lingot en %s -%s Block = Bloc en %s -%s Pickaxe = Pioche en %s -%s Shovel = Pelle en %s -%s Axe = Hache en %s -%s Sword = Épée en %s - -Copper = cuivre -Tin = étain -Bronze = bronze -Silver = argent -Gold = or -Mithril = mithril - -Copper Rail = Rail en cuivre diff --git a/locale/it.po b/locale/it.po new file mode 100644 index 0000000..c05e780 --- /dev/null +++ b/locale/it.po @@ -0,0 +1,82 @@ +# 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-10 13:36-0700\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: Pagliaccio\n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: init.lua:97 +#, c-format +msgid "%s Ore" +msgstr "Minerale di %s" + +#: init.lua:108 +#, c-format +msgid "%s Block" +msgstr "Blocco di %s" + +#: init.lua:130 +#, c-format +msgid "%s Lump" +msgstr "%s grezzo" + +#: init.lua:145 +#, c-format +msgid "%s Ingot" +msgstr "Lingotto di %s" + +#: init.lua:185 +#, c-format +msgid "%s Sword" +msgstr "Spada di %s" + +#: init.lua:191 +#, c-format +msgid "%s Pickaxe" +msgstr "Piccone di %s" + +#: init.lua:197 +#, c-format +msgid "%s Axe" +msgstr "Ascia di %s" + +#: init.lua:203 +#, c-format +msgid "%s Shovel" +msgstr "Badile di %s" + +#: init.lua:208 +#, c-format +msgid "%s Hoe" +msgstr "" + +#: init.lua:235 +msgid "Silver" +msgstr "Argento" + +#: init.lua:270 +msgid "Tin" +msgstr "Stagno" + +#: init.lua:284 +msgid "Mithril" +msgstr "Mithril" + +#: init.lua:346 +msgid "Copper Rail" +msgstr "Binario di rame" + +#: init.lua:374 +msgid "[moreores] loaded." +msgstr "[moreores] caricato." diff --git a/locale/it.txt b/locale/it.txt deleted file mode 100644 index dcd8c52..0000000 --- a/locale/it.txt +++ /dev/null @@ -1,21 +0,0 @@ -# Translation by Pagliaccio - -[moreores] loaded. = [moreores] caricato. - -%s Ore = Minerale di %s -%s Lump = %s grezzo -%s Ingot = Lingotto di %s -%s Block = Blocco di %s -%s Pickaxe = Piccone di %s -%s Shovel = Badile di %s -%s Axe = Ascia di %s -%s Sword = Spada di %s - -Copper = Rame -Tin = Stagno -Bronze = Bronzo -Silver = Argento -Gold = Oro -Mithril = Mithril - -Copper Rail = Binario di rame \ No newline at end of file diff --git a/locale/template.pot b/locale/template.pot new file mode 100644 index 0000000..a5af4cb --- /dev/null +++ b/locale/template.pot @@ -0,0 +1,82 @@ +# 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-10 13:36-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" + +#: init.lua:97 +#, c-format +msgid "%s Ore" +msgstr "" + +#: init.lua:108 +#, c-format +msgid "%s Block" +msgstr "" + +#: init.lua:130 +#, c-format +msgid "%s Lump" +msgstr "" + +#: init.lua:145 +#, c-format +msgid "%s Ingot" +msgstr "" + +#: init.lua:185 +#, c-format +msgid "%s Sword" +msgstr "" + +#: init.lua:191 +#, c-format +msgid "%s Pickaxe" +msgstr "" + +#: init.lua:197 +#, c-format +msgid "%s Axe" +msgstr "" + +#: init.lua:203 +#, c-format +msgid "%s Shovel" +msgstr "" + +#: init.lua:208 +#, c-format +msgid "%s Hoe" +msgstr "" + +#: init.lua:235 +msgid "Silver" +msgstr "" + +#: init.lua:270 +msgid "Tin" +msgstr "" + +#: init.lua:284 +msgid "Mithril" +msgstr "" + +#: init.lua:346 +msgid "Copper Rail" +msgstr "" + +#: init.lua:374 +msgid "[moreores] loaded." +msgstr "" diff --git a/locale/tr.po b/locale/tr.po new file mode 100644 index 0000000..2e63e8a --- /dev/null +++ b/locale/tr.po @@ -0,0 +1,82 @@ +# 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-10 13:36-0700\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: Mahmutelmas06 mahmutelmas06@hotmail.com\n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: init.lua:97 +#, c-format +msgid "%s Ore" +msgstr "%s madeni" + +#: init.lua:108 +#, c-format +msgid "%s Block" +msgstr "%s blok" + +#: init.lua:130 +#, c-format +msgid "%s Lump" +msgstr "%s yığını" + +#: init.lua:145 +#, c-format +msgid "%s Ingot" +msgstr "%s külçesi" + +#: init.lua:185 +#, c-format +msgid "%s Sword" +msgstr "%s kılıç" + +#: init.lua:191 +#, c-format +msgid "%s Pickaxe" +msgstr "%s kazma" + +#: init.lua:197 +#, c-format +msgid "%s Axe" +msgstr "%s balta" + +#: init.lua:203 +#, c-format +msgid "%s Shovel" +msgstr "%s kürek" + +#: init.lua:208 +#, c-format +msgid "%s Hoe" +msgstr "" + +#: init.lua:235 +msgid "Silver" +msgstr "Gümüş" + +#: init.lua:270 +msgid "Tin" +msgstr "Kalay" + +#: init.lua:284 +msgid "Mithril" +msgstr "Mithril" + +#: init.lua:346 +msgid "Copper Rail" +msgstr "Bakır ray" + +#: init.lua:374 +msgid "[moreores] loaded." +msgstr "[moreores] yüklendi." diff --git a/locale/tr.txt b/locale/tr.txt deleted file mode 100644 index 4f20286..0000000 --- a/locale/tr.txt +++ /dev/null @@ -1,25 +0,0 @@ -# Translation by Mahmutelmas06 -# mahmutelmas06@hotmail.com -# Türkçe Çeviri -# Turkish translation -# Language 2 letter iso code is "tr" - -[moreores] loaded. = [moreores] yüklendi. - -%s Ore = %s madeni -%s Lump = %s yığını -%s Ingot = %s külçesi -%s Block = %s blok -%s Pickaxe = %s kazma -%s Shovel = %s kürek -%s Axe = %s balta -%s Sword = %s kılıç - -Copper = Bakır -Tin = Kalay -Bronze = Bronz -Silver = Gümüş -Gold = Altın -Mithril = Mithril - -Copper Rail = Bakır ray diff --git a/mg.lua b/mg.lua index e323b74..e23934a 100644 --- a/mg.lua +++ b/mg.lua @@ -5,6 +5,7 @@ Copyright (c) 2011-2015 Calinou and contributors. Licensed under the zlib license. See LICENSE.md for more information. --]] +if moreores.tin_enabled then mg.register_ore({ name = "moreores:mineral_tin", wherein = "default:stone", @@ -19,7 +20,9 @@ mg.register_ore({ forkturnangle = 57, numperblock = 2 }) +end +if moreores.silver_enabled then mg.register_ore({ name = "moreores:mineral_silver", wherein = "default:stone", @@ -36,7 +39,9 @@ mg.register_ore({ forkturnangle = 57, numperblock = 2 }) +end +if moreores.mithril_enabled then mg.register_ore({ name = "moreores:mineral_mithril", wherein = "default:stone", @@ -51,3 +56,4 @@ mg.register_ore({ segincldev = 0.6, turnangle = 57, }) +end \ No newline at end of file diff --git a/readsettings.lua b/readsettings.lua new file mode 100644 index 0000000..ee90e62 --- /dev/null +++ b/readsettings.lua @@ -0,0 +1,42 @@ +------------------------------------------------------------------------------ +------------------------------ CONFIGURATION --------------------------------- +------------------------------------------------------------------------------ + +-- Chunk sizes for ore generation (bigger = ore deposits are more scattered around) +-- Amount of ore per chunk (higher = bigger ore deposits) +-- Minimal depths of ore generation (Y coordinate, 0 being sea level by default) +-- Maximal depths of ore generation (Y coordinate, 0 being sea level by default) + +-- Tin +moreores.tin_enabled = minetest.setting_getbool("moreores_tin_enabled") +if moreores.tin_enabled == nil then moreores.tin_enabled = true end -- defaults to true +moreores.tin_chunk_size = tonumber(minetest.setting_get("moreores_tin_chunk_size")) or 7 +moreores.tin_ore_per_chunk = tonumber(minetest.setting_get("moreores_tin_ore_per_chunk")) or 3 +moreores.tin_min_depth = tonumber(minetest.setting_get("moreores_tin_min_depth")) or -31000 +moreores.tin_max_depth = tonumber(minetest.setting_get("moreores_tin_max_depth")) or 8 + +moreores.override_default_bronze_recipe = minetest.setting_getbool("moreores_override_default_bronze_recipe") -- defaults to false + +minetest.debug("tin", tostring(moreores.tin_enabled), moreores.tin_chunk_size, moreores.tin_ore_per_chunk, moreores.tin_min_depth, moreores.tin_max_depth) + +-- Silver + +moreores.silver_enabled = minetest.setting_getbool("moreores_silver_enabled") +if moreores.silver_enabled == nil then moreores.silver_enabled = true end -- defaults to true +moreores.silver_chunk_size = tonumber(minetest.setting_get("moreores_silver_chunk_size")) or 11 +moreores.silver_ore_per_chunk = tonumber(minetest.setting_get("moreores_silver_ore_per_chunk")) or 4 +moreores.silver_min_depth = tonumber(minetest.setting_get("moreores_silver_min_depth")) or -31000 +moreores.silver_max_depth = tonumber(minetest.setting_get("moreores_silver_max_depth")) or -2 + +minetest.debug("silver", tostring(moreores.silver_enabled), moreores.silver_chunk_size, moreores.silver_ore_per_chunk, moreores.silver_min_depth, moreores.silver_max_depth) + +-- Mithril + +moreores.mithril_enabled = minetest.setting_getbool("moreores_mithril_enabled") +if moreores.mithril_enabled == nil then moreores.mithril_enabled = true end -- defaults to true +moreores.mithril_chunk_size = tonumber(minetest.setting_get("moreores_mithril_chunk_size")) or 11 +moreores.mithril_ore_per_chunk = tonumber(minetest.setting_get("moreores_mithril_ore_per_chunk")) or 1 +moreores.mithril_min_depth = tonumber(minetest.setting_get("moreores_mithril_min_depth")) or -31000 +moreores.mithril_max_depth = tonumber(minetest.setting_get("moreores_mithril_max_depth")) or -512 + +minetest.debug("mithril", tostring(moreores.mithril_enabled), moreores.mithril_chunk_size, moreores.mithril_ore_per_chunk, moreores.mithril_min_depth, moreores.mithril_max_depth) diff --git a/settingtypes.txt b/settingtypes.txt new file mode 100644 index 0000000..44ddcc7 --- /dev/null +++ b/settingtypes.txt @@ -0,0 +1,39 @@ +[Tin] +# Enables/disables tin generation +moreores_tin_enabled (Generate) bool true +#Chunk sizes for ore generation (bigger = ore deposits are more scattered around) +moreores_tin_chunk_size (Chunk size) int 7 1 100 +#Amount of ore per chunk (higher = bigger ore deposits) +moreores_tin_ore_per_chunk (Ore per chunk) int 3 1 100 +#Minimal depths of ore generation (Y coordinate, 0 being sea level by default) +moreores_tin_min_depth (Min depth) int -31000 -31000 31000 +#Maximal depths of ore generation (Y coordinate, 0 being sea level by default) +moreores_tin_max_depth (Max depth) int 8 -31000 31000 + +#When tin is enabled and this is true, removes the default bronze recipe +#(steel + copper) in favor of the tin + copper recipe included in this mod. +moreores_override_default_bronze_recipe (Override default bronze recipe) bool false + +[Silver] +# Enables/disables silver generation +moreores_silver_enabled (Generate) bool true +#Chunk sizes for ore generation (bigger = ore deposits are more scattered around) +moreores_silver_chunk_size (Chunk size) int 11 1 100 +#Amount of ore per chunk (higher = bigger ore deposits) +moreores_silver_ore_per_chunk (Ore per chunk) int 4 1 100 +#Minimal depths of ore generation (Y coordinate, 0 being sea level by default) +moreores_silver_min_depth (Min depth) int -31000 -31000 31000 +#Maximal depths of ore generation (Y coordinate, 0 being sea level by default) +moreores_silver_max_depth (Max depth) int -2 -31000 31000 + +[Mithril] +# Enables/disables mithril generation +moreores_mithril_enabled (Generate) bool true +#Chunk sizes for ore generation (bigger = ore deposits are more scattered around) +moreores_mithril_chunk_size (Chunk size) int 11 1 100 +#Amount of ore per chunk (higher = bigger ore deposits) +moreores_mithril_ore_per_chunk (Ore per chunk) int 1 1 100 +#Minimal depths of ore generation (Y coordinate, 0 being sea level by default) +moreores_mithril_min_depth (Min depth) int -31000 -31000 31000 +#Maximal depths of ore generation (Y coordinate, 0 being sea level by default) +moreores_mithril_max_depth (Max depth) int -512 -31000 31000 \ No newline at end of file From c81e3baeaf3cf31292b6910350ec63cf512e78a5 Mon Sep 17 00:00:00 2001 From: FaceDeer Date: Fri, 10 Feb 2017 14:47:06 -0700 Subject: [PATCH 2/6] remove debugs --- readsettings.lua | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/readsettings.lua b/readsettings.lua index ee90e62..dd17878 100644 --- a/readsettings.lua +++ b/readsettings.lua @@ -17,8 +17,6 @@ moreores.tin_max_depth = tonumber(minetest.setting_get("moreores_tin_max_depth") moreores.override_default_bronze_recipe = minetest.setting_getbool("moreores_override_default_bronze_recipe") -- defaults to false -minetest.debug("tin", tostring(moreores.tin_enabled), moreores.tin_chunk_size, moreores.tin_ore_per_chunk, moreores.tin_min_depth, moreores.tin_max_depth) - -- Silver moreores.silver_enabled = minetest.setting_getbool("moreores_silver_enabled") @@ -28,8 +26,6 @@ moreores.silver_ore_per_chunk = tonumber(minetest.setting_get("moreores_silver_o moreores.silver_min_depth = tonumber(minetest.setting_get("moreores_silver_min_depth")) or -31000 moreores.silver_max_depth = tonumber(minetest.setting_get("moreores_silver_max_depth")) or -2 -minetest.debug("silver", tostring(moreores.silver_enabled), moreores.silver_chunk_size, moreores.silver_ore_per_chunk, moreores.silver_min_depth, moreores.silver_max_depth) - -- Mithril moreores.mithril_enabled = minetest.setting_getbool("moreores_mithril_enabled") @@ -37,6 +33,4 @@ if moreores.mithril_enabled == nil then moreores.mithril_enabled = true end -- d moreores.mithril_chunk_size = tonumber(minetest.setting_get("moreores_mithril_chunk_size")) or 11 moreores.mithril_ore_per_chunk = tonumber(minetest.setting_get("moreores_mithril_ore_per_chunk")) or 1 moreores.mithril_min_depth = tonumber(minetest.setting_get("moreores_mithril_min_depth")) or -31000 -moreores.mithril_max_depth = tonumber(minetest.setting_get("moreores_mithril_max_depth")) or -512 - -minetest.debug("mithril", tostring(moreores.mithril_enabled), moreores.mithril_chunk_size, moreores.mithril_ore_per_chunk, moreores.mithril_min_depth, moreores.mithril_max_depth) +moreores.mithril_max_depth = tonumber(minetest.setting_get("moreores_mithril_max_depth")) or -512 \ No newline at end of file From 638de461c1827eaeeb90c9cf79b03d0bdec16413 Mon Sep 17 00:00:00 2001 From: FaceDeer Date: Fri, 10 Feb 2017 14:51:32 -0700 Subject: [PATCH 3/6] update readme --- README.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f54dda7..35c88ee 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,17 @@ -More Ores -========= +## More Ores More Ores for Minetest , a free/libre infinite world block sandbox game. +It adds three new ores: silver, tin, and mithril. The ores can be enabled independently +in the mod's settings. + +Silver and mithril can be used to make various tools and weapons. + +Tin cannot be used to make tools, but can be mixed with copper to produce bronze. +There is an optional setting that removes the default game's bronze recipe +(steel + copper) to make this the only way to produce bronze. + To install, just clone this repository into your "mods" directory. More Ores code is licensed under the zlib license, textures are by Calinou and are licensed under CC BY-SA 3.0 Unported. From 6a56592eccae0c4a84d9e7e53d13c1d5ccd46f23 Mon Sep 17 00:00:00 2001 From: FaceDeer Date: Sat, 11 Feb 2017 10:01:14 -0700 Subject: [PATCH 4/6] add intllib to depends --- depends.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/depends.txt b/depends.txt index 0219052..983fe4e 100644 --- a/depends.txt +++ b/depends.txt @@ -1,2 +1,3 @@ default mg? +intllib? \ No newline at end of file From 3355729f06c3d108a37078a8f1daac39715e5f72 Mon Sep 17 00:00:00 2001 From: FaceDeer Date: Sat, 11 Feb 2017 12:02:30 -0700 Subject: [PATCH 5/6] add optional loot mod support --- depends.txt | 3 ++- init.lua | 7 ++---- loot.lua | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++ mg.lua | 4 ++++ 4 files changed, 71 insertions(+), 6 deletions(-) create mode 100644 loot.lua diff --git a/depends.txt b/depends.txt index 983fe4e..0410c8b 100644 --- a/depends.txt +++ b/depends.txt @@ -1,3 +1,4 @@ default mg? -intllib? \ No newline at end of file +intllib? +loot? \ No newline at end of file diff --git a/init.lua b/init.lua index 5ef7569..37a8b60 100644 --- a/init.lua +++ b/init.lua @@ -15,11 +15,8 @@ local modpath = minetest.get_modpath("moreores") local S, NS = dofile(modpath.."/intllib.lua") dofile(modpath .. "/readsettings.lua") - --- `mg` support: -if minetest.get_modpath("mg") then - dofile(modpath .. "/mg.lua") -end +dofile(modpath .. "/loot.lua") +dofile(modpath .. "/mg.lua") -- Utility functions -- ================= diff --git a/loot.lua b/loot.lua new file mode 100644 index 0000000..9b2b87e --- /dev/null +++ b/loot.lua @@ -0,0 +1,63 @@ +if not minetest.get_modpath("loot") then + return +end + +if moreores.tin_enabled then + loot.register_loot({ + weights = { generic = 500 }, + payload = { + stack = ItemStack("moreores:tin_ingot"), + min_size = 1, + max_size = 10, + }, + }) + + loot.register_loot({ + weights = { generic = 500 }, + payload = { + stack = ItemStack("moreores:tin_lump"), + min_size = 1, + max_size = 10, + }, + }) +end + +if moreores.silver_enabled then + loot.register_loot({ + weights = { generic = 200, valuable = 200, }, + payload = { + stack = ItemStack("moreores:silver_ingot"), + min_size = 1, + max_size = 10, + }, + }) + + loot.register_loot({ + weights = { generic = 200, valuable = 200, }, + payload = { + stack = ItemStack("moreores:silver_lump"), + min_size = 1, + max_size = 10, + }, + }) +end + +if moreores.mithril_enabled then + loot.register_loot({ + weights = { generic = 25, valuable = 25, }, + payload = { + stack = ItemStack("moreores:mithril_ingot"), + min_size = 1, + max_size = 5, + }, + }) + + loot.register_loot({ + weights = { generic = 25, valuable = 25, }, + payload = { + stack = ItemStack("moreores:mithril_lump"), + min_size = 1, + max_size = 5, + }, + }) +end \ No newline at end of file diff --git a/mg.lua b/mg.lua index e23934a..4ff93f3 100644 --- a/mg.lua +++ b/mg.lua @@ -4,6 +4,10 @@ More Ores: `mg` mod support Copyright (c) 2011-2015 Calinou and contributors. Licensed under the zlib license. See LICENSE.md for more information. --]] +if not minetest.get_modpath("mg") then + return +end + if moreores.tin_enabled then mg.register_ore({ From de28eb24861dff524821d22a741a81183525d9f7 Mon Sep 17 00:00:00 2001 From: FaceDeer Date: Tue, 2 May 2017 00:37:52 -0600 Subject: [PATCH 6/6] Revert "Merge remote-tracking branch 'refs/remotes/minetest-mods/master'" This reverts commit dd68bb7994acf55d0fb8dbc72e19cfa51b046dc2, reversing changes made to 3355729f06c3d108a37078a8f1daac39715e5f72. --- CHANGELOG.md | 10 ---------- CONTRIBUTING.md | 10 ---------- LICENSE.md | 5 +++-- README.md | 4 ++-- init.lua | 10 +++------- mg.lua | 2 +- 6 files changed, 9 insertions(+), 32 deletions(-) delete mode 100644 CHANGELOG.md delete mode 100644 CONTRIBUTING.md diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index e3c422f..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,10 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](http://keepachangelog.com/) -and this project adheres to [Semantic Versioning](http://semver.org/). - -## [1.0.0] - 2017-02-19 - -- Initial versioned release. \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 56fb504..0000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,10 +0,0 @@ -# Contribution Guide - -Thank you for your interest in this mod! Before contributing, be sure to know -about these few guidelines: - -- Contributions have to be under the zlib license (or compatible) for code, - and CC BY-SA 3.0 license (or compatible) for assets. -- Make sure to update the change log, keeping the - [change log format](http://keepachangelog.com/) we use. -- Don't bump the version yourself. Maintainers will do this when necessary. diff --git a/LICENSE.md b/LICENSE.md index a3511ad..45c5ff5 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,7 @@ -# zlib license +zlib license +============ -Copyright (c) 2011-2017 Hugo Locurcio and contributors +Copyright (c) 2011-2015 Calinou and contributors **This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.** diff --git a/README.md b/README.md index 2980031..35c88ee 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# More Ores +## More Ores -More Ores for [Minetest](http://minetest.net), a free and open source infinite +More Ores for Minetest , a free/libre infinite world block sandbox game. It adds three new ores: silver, tin, and mithril. The ores can be enabled independently diff --git a/init.lua b/init.lua index cef6875..37a8b60 100644 --- a/init.lua +++ b/init.lua @@ -3,7 +3,7 @@ ** More Ores ** By Calinou, with the help of Nore. -Copyright (c) 2011-2017 Hugo Locurcio and contributors. +Copyright (c) 2011-2017 Calinou and contributors. Licensed under the zlib license. See LICENSE.md for more information. ===================================================================== --]] @@ -14,13 +14,9 @@ moreores = {} local modpath = minetest.get_modpath("moreores") local S, NS = dofile(modpath.."/intllib.lua") -dofile(modpath .. "/loot.lua") dofile(modpath .. "/readsettings.lua") - --- `mg` support: -if minetest.get_modpath("mg") then - dofile(modpath .. "/mg.lua") -end +dofile(modpath .. "/loot.lua") +dofile(modpath .. "/mg.lua") -- Utility functions -- ================= diff --git a/mg.lua b/mg.lua index 94244c3..4ff93f3 100644 --- a/mg.lua +++ b/mg.lua @@ -1,7 +1,7 @@ --[[ More Ores: `mg` mod support -Copyright (c) 2011-2017 Hugo Locurcio and contributors. +Copyright (c) 2011-2015 Calinou and contributors. Licensed under the zlib license. See LICENSE.md for more information. --]] if not minetest.get_modpath("mg") then