From aa1b2f1b085e43d63e0de2aabd72c7a7c34144b1 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Wed, 20 Feb 2019 19:53:06 +0100 Subject: [PATCH 01/17] Optimize all images using `oxipng -Zs` --- textures/fire_basic_flame_animated.png | Bin 1233 -> 1191 bytes textures/maptools_adminpick.png | Bin 285 -> 283 bytes textures/maptools_copper_coin.png | Bin 214 -> 213 bytes textures/maptools_gold_coin.png | Bin 215 -> 213 bytes textures/maptools_infinitefuel.png | Bin 388 -> 381 bytes textures/maptools_silver_coin.png | Bin 215 -> 213 bytes textures/maptools_smoke.png | Bin 303 -> 296 bytes textures/maptools_superapple.png | Bin 231 -> 230 bytes 8 files changed, 0 insertions(+), 0 deletions(-) diff --git a/textures/fire_basic_flame_animated.png b/textures/fire_basic_flame_animated.png index 6f5f8ac67eda013e74380df86343b0172c95fd88..17b4cebd68157f0146deb4891e3ec3490ab7816a 100644 GIT binary patch delta 672 zcmV;R0$=^n38x9L6as&KNkl1(3%PYs zP!8Tji3|nJlFnFg0seGF)J(F{*bam?9f#yGz8KTOYGyHzTDgDT5x2cIIDB>F_m~6J zw@&%YaM2vQ(|J2uNH#R=M?=b9cUbLHcoh}%B=o`Zgs0oUox9Zmhc`fc$@#Re!)EEd zV-lBMC)Z0o4;yEv8NL0s#(G%pwrwSk0EPyTt>4qL$9zIxG~&^{6L$A>P{<+di$}?XuiJpTyHyp3m-8o3 zGX2qG3Gvv-FzoF|@i>uYV*>*N_&i?&?D!OoxBD>v=HY*&PnrgN^a%XHBT@CpRXws^ zJfu-Q246gK{_;3_^Jr2%uI@4w4`sc0?9_(2KUImxJkcLKq`2hdIi#K1tB|KlLH{1`1iM$3=U@?#jZ`~UzK4}wHW_iFb50000o4boVtkdZOFz0aDJKSB){LbtEg>g(=OENnZTgvHE z-$=_58ESAGI6>F7XDg3NXHEi5Whhmwo&!!_l5(AFxo^>_ZR~$y@D|<(54(W7fabOt zb8WA26R+AGxQOv95Bvy?KBHs$v5))!7S{}qv0-&l;>OVCbK~|q-+VHr-S4Nw$dly@ zEBNZY8hPttNnakuy&z1}z}uzs&9f;^xrgX?y6c+zOQ5x3>(0+J zJxH{~zpYRH3V(n8)HgMAs=5MoJ5S$Ve@UmRAseYB}V4wMxi6G3Qu~zbc=+Q(T z^_A@RntTsS_JKkf^UyI5^Bmd;ND#Ulpk}0d`Ay!Ww5l;t~9wv_0l9)j(Zh whxG@M$mNu&z@aG44;1G|aefr%$A8X`-xm*pM57vkvj6}907*qoM6N<$g3cva%>V!Z diff --git a/textures/maptools_adminpick.png b/textures/maptools_adminpick.png index 04824eb0f6082ee34d333538c964b26f811656ab..171437872069c6e32708aec5ac12921635555c2a 100644 GIT binary patch delta 115 zcmV-(0F3{g0-FMmuWVOIL_t(|+HA*z6$3#4K*67EY@E&hOFU~akAp$gL6&D_St3c2 zxTul%br7=kx%_S^8~gLsb6JTUe4R)-{4M!B-tysT%jb9pc%4`rwx0;)v|~i$0|3eS V1LHsMvZnw5002ovPDHLkV1hM;HU|Iz delta 117 zcmV-*0E+*c0-XYouWngML_t&-S7pjY4!|%FLs6HRnIX;nuUJ@Ab?U`P?`wenj%!NV zRv`qZd7gI3sgwOcA$4go2KlXERHN2d^JzRsUL1JR7lKvdVCN~A=7d#<`$$TN! kivz?@I0$$Pq_Czopr0JzW^cmMzZ delta 82 zcmcc0c#UyFu0)8Zi(?2!baKK0rXTycxEfy0-yW{f6!B+bi;_OW)H#_fMlI(YM2(+0 mY&GU8b>vA&5NU~Mgo2KlXESHN2GHK3$uuL1JR7lD<7NORGcM1<4gj$0Syi lxh>S1(5Ns?;RKft1B0@y-1=`@_wQx^0#8>zmvv4FO#lmY9$^3g delta 83 zcmcc0c%5-Vu0*J(i(?2!baKK0rXTw`xf))|Z=bH+6!B+bi;@AmmSr$U3P+=a!qFbX mfVVwPp#sd360C}03z!*{ZROTq+MU$R00f?{elF{r5}E+raU1gh diff --git a/textures/maptools_infinitefuel.png b/textures/maptools_infinitefuel.png index 163f1715ed325421b2f4854ce117e47cb02f9176..de4b43e1bca173d4029262c44b4f35fc4115a9be 100644 GIT binary patch delta 182 zcmV;n07?IZ1N{P!Bmu6GC76-G8h@?eQMbYm>ZcUS00A82oCBNGV4~8FEUMYz#7r!FTw;WX1OL>Pv#K za}Qm1oXS;C5}X_1_|0+f+#f7Su;yyFZ_#vzT}WF~uq?Kz%+X qp_C7;5ea3?rtcC{uIpHU3jF~my$A)TJ|2Jo0000go27PDAc50pHA{j`fo;n>7hMT3vV4gnk~9CI7B(#}{i mUp%J~!fGUNM2ID_k(1%Nx}5VP+2(5uK;Y@>=d#Wzp$PynQyuvL delta 84 zcmcc0c%5-Vu0*J(i(?2!baKK0CW~3DtOrV-zkb@KAa;CWi=tuSf=R}$4s91CS0o*q oV=VBt$0<~RSyF;kF>C=d!*z8z=PUcN*cgDo)78&qol`;+09$h&R{#J2 diff --git a/textures/maptools_smoke.png b/textures/maptools_smoke.png index c50b7e3446b962de73f3955dbe230025ee09f8a8..192a7ce349481127e08933f44257df8bcc9f9def 100644 GIT binary patch delta 157 zcmV;O0Al~I0;mFzBms4iC3An7nVFoNoTOxWZ2$lO2Xs delta 164 zcmV;V09*g401ZR{GFxVMoNCVj@Nv9700000< KMNUMnLSTYBu`UGw delta 105 zcmV-v0G9ve0p|gbg zKUPu*aqk{DFKLnhIQ$F5RoDtpWUjDgK%%MOmn;%(1Lf>IneO{;Wk>_rPey-d00000 LNkvXXu0mjfZP+ZE From 74da77fb8cde503955a196d76c6547fc1bf47b2d Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Wed, 20 Feb 2019 23:56:20 +0100 Subject: [PATCH 02/17] Add a Luacheck configuration file and tweak code style --- .luacheckrc | 29 +++++++++++++++++++++++++++++ default_nodes.lua | 43 ++++++++++++++++++++++++++++++++++++------- nodes.lua | 28 +++++++++++++++++++++------- tools.lua | 17 ++++++++++++++--- 4 files changed, 100 insertions(+), 17 deletions(-) create mode 100644 .luacheckrc diff --git a/.luacheckrc b/.luacheckrc new file mode 100644 index 0000000..4bfca2a --- /dev/null +++ b/.luacheckrc @@ -0,0 +1,29 @@ +std = "lua51+minetest" +unused_args = false +allow_defined_top = true +max_line_length = 90 + +stds.minetest = { + read_globals = { + "DIR_DELIM", + "minetest", + "core", + "dump", + "vector", + "nodeupdate", + "VoxelManip", + "VoxelArea", + "PseudoRandom", + "ItemStack", + "default", + table = { + fields = { + "copy", + }, + }, + } +} + +read_globals = { + "intllib", +} diff --git a/default_nodes.lua b/default_nodes.lua index eb74b4c..c751e0b 100644 --- a/default_nodes.lua +++ b/default_nodes.lua @@ -47,7 +47,11 @@ minetest.register_node("maptools:jungletree", { description = S("Unbreakable Jungle Tree"), range = 12, stack_max = 10000, - tiles = {"default_jungletree_top.png", "default_jungletree_top.png", "default_jungletree.png"}, + tiles = { + "default_jungletree_top.png", + "default_jungletree_top.png", + "default_jungletree.png", + }, drop = "", groups = {unbreakable = 1, not_in_creative_inventory = maptools.creative}, sounds = default.node_sound_wood_defaults(), @@ -254,7 +258,11 @@ minetest.register_node("maptools:grass", { description = S("Unbreakable Dirt with Grass"), range = 12, stack_max = 10000, - tiles = {"default_grass.png", "default_dirt.png", "default_dirt.png^default_grass_side.png"}, + tiles = { + "default_grass.png", + "default_dirt.png", + "default_dirt.png^default_grass_side.png", + }, paramtype2 = "facedir", drop = "", groups = {unbreakable = 1, not_in_creative_inventory = maptools.creative}, @@ -282,7 +290,11 @@ for slab_num = 1,3,1 do description = S("Grass Slab"), range = 12, stack_max = 10000, - tiles = {"default_grass.png", "default_dirt.png", "default_dirt.png^maptools_grass_side_" .. slab_num * 4 .. ".png"}, + tiles = { + "default_grass.png", + "default_dirt.png", + "default_dirt.png^maptools_grass_side_" .. slab_num * 4 .. ".png", + }, drawtype = "nodebox", node_box = { type = "fixed", @@ -293,7 +305,9 @@ for slab_num = 1,3,1 do paramtype2 = "facedir", drop = "", groups = {unbreakable = 1, not_in_creative_inventory = maptools.creative}, - sounds = default.node_sound_dirt_defaults({footstep = {name="default_grass_footstep", gain = 0.4}}), + sounds = default.node_sound_dirt_defaults( + {footstep = {name="default_grass_footstep", gain = 0.4}} + ), on_drop = maptools.drop_msg }) end @@ -404,9 +418,18 @@ minetest.register_node("maptools:soil_wet", { description = "Wet Soil", range = 12, stack_max = 10000, - tiles = {"default_dirt.png^farming_soil_wet.png", "default_dirt.png^farming_soil_wet_side.png"}, + tiles = { + "default_dirt.png^farming_soil_wet.png", + "default_dirt.png^farming_soil_wet_side.png", + }, drop = "", - groups = {unbreakable = 1, not_in_creative_inventory = maptools.creative, soil = 3, wet = 1, grassland = 1}, + groups = { + unbreakable = 1, + not_in_creative_inventory = maptools.creative, + soil = 3, + wet = 1, + grassland = 1, + }, sounds = default.node_sound_dirt_defaults(), on_drop = maptools.drop_msg }) @@ -417,7 +440,13 @@ minetest.register_node("maptools:desert_sand_soil_wet", { stack_max = 10000, drop = "", tiles = {"farming_desert_sand_soil_wet.png", "farming_desert_sand_soil_wet_side.png"}, - groups = {unbreakable = 1, not_in_creative_inventory = maptools.creative, soil = 3, wet = 1, desert = 1}, + groups = { + unbreakable = 1, + not_in_creative_inventory = maptools.creative, + soil = 3, + wet = 1, + desert = 1, + }, sounds = default.node_sound_sand_defaults(), on_drop = maptools.drop_msg }) diff --git a/nodes.lua b/nodes.lua index d8e4212..1b6dfb8 100644 --- a/nodes.lua +++ b/nodes.lua @@ -62,7 +62,6 @@ minetest.register_node("maptools:playerclip", { minetest.register_node("maptools:fake_walkable", { description = S("Player Clip"), - drawtype = "nodebox", range = 12, stack_max = 10000, inventory_image = "default_steel_block.png^dye_green.png", @@ -96,7 +95,6 @@ minetest.register_node("maptools:fullclip", { minetest.register_node("maptools:fake_walkable_pointable", { description = S("Player Clip"), - drawtype = "nodebox", range = 12, stack_max = 10000, inventory_image = "default_steel_block.png^dye_green.png", @@ -186,7 +184,11 @@ minetest.register_node("maptools:fullclip_face", { fixed = {-0.5, -0.5, -0.5, 0.5, -0.4999, 0.5}, }, drop = "", - groups = {unbreakable = 1, not_in_creative_inventory = maptools.creative, fall_damage_add_percent=-100}, + groups = { + unbreakable = 1, + not_in_creative_inventory = maptools.creative, + fall_damage_add_percent = -100, + }, on_drop = maptools.drop_msg }) @@ -205,7 +207,11 @@ minetest.register_node("maptools:playerclip_bottom", { fixed = {-0.5, -0.5, -0.5, 0.5, -0.4999, 0.5}, }, drop = "", - groups = {unbreakable = 1, not_in_creative_inventory = maptools.creative, fall_damage_add_percent=-100}, + groups = { + unbreakable = 1, + not_in_creative_inventory = maptools.creative, + fall_damage_add_percent = -100, + }, on_drop = maptools.drop_msg }) @@ -224,7 +230,11 @@ minetest.register_node("maptools:playerclip_top", { fixed = {-0.5, 0.4999, -0.5, 0.5, 0.5, 0.5}, }, drop = "", - groups = {unbreakable = 1, not_in_creative_inventory = maptools.creative, fall_damage_add_percent=-100}, + groups = { + unbreakable = 1, + not_in_creative_inventory = maptools.creative, + fall_damage_add_percent = -100, + }, on_drop = maptools.drop_msg }) @@ -244,7 +254,12 @@ minetest.register_node("maptools:pusher_" .. pusher_num, { fixed = {-0.5, -0.5, -0.5, 0.5, -0.4999, 0.5}, }, drop = "", - groups = {unbreakable = 1, not_in_creative_inventory = maptools.creative, fall_damage_add_percent=-100, bouncy=pusher_num*100}, + groups = { + unbreakable = 1, + not_in_creative_inventory = maptools.creative, + fall_damage_add_percent = -100, + bouncy = pusher_num * 100, + }, on_drop = maptools.drop_msg }) end @@ -422,7 +437,6 @@ minetest.register_node("maptools:igniter", { drawtype = "airlike", range = 12, stack_max = 10000, - inventory_image = "default_steel_block.png^crosshair.png", description = S("Igniter"), paramtype = "light", inventory_image = "fire_basic_flame.png", diff --git a/tools.lua b/tools.lua index a5c5933..48f7855 100644 --- a/tools.lua +++ b/tools.lua @@ -56,8 +56,19 @@ minetest.register_tool("maptools:pick_admin_with_drops", { minetest.register_on_punchnode(function(pos, node, puncher) if puncher:get_wielded_item():get_name() == "maptools:pick_admin" and minetest.get_node(pos).name ~= "air" then - minetest.log("action", puncher:get_player_name() .. " digs " .. minetest.get_node(pos).name .. " at " .. minetest.pos_to_string(pos) .. " using an Admin Pickaxe.") - minetest.remove_node(pos) -- The node is removed directly, which means it even works on non-empty containers and group-less nodes. - minetest.check_for_falling(pos) -- Run node update actions like falling nodes. + minetest.log( + "action", + puncher:get_player_name() .. + " digs " .. + minetest.get_node(pos).name .. + " at " .. + minetest.pos_to_string(pos) .. + " using an Admin Pickaxe." + ) + -- The node is removed directly, which means it even works + -- on non-empty containers and group-less nodes. + minetest.remove_node(pos) + -- Run node update actions like falling nodes. + minetest.check_for_falling(pos) end end) From aeafa56b8932ba5f512e35b73e332f87d47a92d2 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Thu, 21 Feb 2019 23:11:06 +0100 Subject: [PATCH 03/17] Add pre-commit hooks See https://pre-commit.com/ for more information. --- .pre-commit-config.yaml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..c682766 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,6 @@ +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v2.0.0 + hooks: + - id: end-of-file-fixer + - id: mixed-line-ending + - id: trailing-whitespace From fd361016bd90afb028b90c299ff9abce14b4d349 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Thu, 21 Feb 2019 23:12:35 +0100 Subject: [PATCH 04/17] Add an EditorConfig file See https://editorconfig.org/ for more information. --- .editorconfig | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..552d0a0 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,13 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_style = space +indent_size = 2 +insert_final_newline = true +trim_trailing_whitespace = true + +[*.lua] +indent_style = tab +indent_size = 4 From 905ecb003849bac7d6180d93133632fa8b554b91 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Fri, 22 Feb 2019 00:49:15 +0100 Subject: [PATCH 05/17] Set EditorConfig to use tabs in .luacheckrc --- .editorconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.editorconfig b/.editorconfig index 552d0a0..a41c697 100644 --- a/.editorconfig +++ b/.editorconfig @@ -8,6 +8,6 @@ indent_size = 2 insert_final_newline = true trim_trailing_whitespace = true -[*.lua] +[*.{lua,luacheckrc}] indent_style = tab indent_size = 4 From 14f9397a4e33c72ed3249b8506265c63fff091ca Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Mon, 25 Feb 2019 12:16:01 +0100 Subject: [PATCH 06/17] Update copyright statements to 2019 --- LICENSE.md | 2 +- aliases.lua | 2 +- config.lua | 2 +- craftitems.lua | 2 +- default_nodes.lua | 2 +- init.lua | 74 +++++++++++++++++++++++------------------------ nodes.lua | 2 +- tools.lua | 2 +- 8 files changed, 44 insertions(+), 44 deletions(-) diff --git a/LICENSE.md b/LICENSE.md index 2188fe4..a5a3df9 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ # zlib license -Copyright (c) 2012-2017 Hugo Locurcio and contributors +Copyright © 2012-2019 Hugo Locurcio 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/aliases.lua b/aliases.lua index 5a0e0bb..13ec59f 100644 --- a/aliases.lua +++ b/aliases.lua @@ -1,7 +1,7 @@ --[[ Map Tools: alias definitions -Copyright (c) 2012-2017 Hugo Locurcio and contributors. +Copyright © 2012-2019 Hugo Locurcio and contributors. Licensed under the zlib license. See LICENSE.md for more information. --]] diff --git a/config.lua b/config.lua index f59be03..56d0e2d 100644 --- a/config.lua +++ b/config.lua @@ -1,7 +1,7 @@ --[[ Map Tools: configuration handling -Copyright (c) 2012-2017 Hugo Locurcio and contributors. +Copyright © 2012-2019 Hugo Locurcio and contributors. Licensed under the zlib license. See LICENSE.md for more information. --]] diff --git a/craftitems.lua b/craftitems.lua index fca7e13..aa2330b 100644 --- a/craftitems.lua +++ b/craftitems.lua @@ -1,7 +1,7 @@ --[[ Map Tools: item definitions -Copyright (c) 2012-2017 Hugo Locurcio and contributors. +Copyright © 2012-2019 Hugo Locurcio and contributors. Licensed under the zlib license. See LICENSE.md for more information. --]] diff --git a/default_nodes.lua b/default_nodes.lua index c751e0b..89409f0 100644 --- a/default_nodes.lua +++ b/default_nodes.lua @@ -1,7 +1,7 @@ --[[ Map Tools: unbreakable default nodes -Copyright (c) 2012-2017 Hugo Locurcio and contributors. +Copyright © 2012-2019 Hugo Locurcio and contributors. Licensed under the zlib license. See LICENSE.md for more information. --]] diff --git a/init.lua b/init.lua index 17d5e37..a329f62 100644 --- a/init.lua +++ b/init.lua @@ -1,37 +1,37 @@ ---[[ -===================================================================== -** Map Tools ** -By Calinou. - -Copyright (c) 2012-2017 Hugo Locurcio and contributors. -Licensed under the zlib license. See LICENSE.md for more information. -===================================================================== ---]] - -maptools = {} - -local S -if minetest.get_modpath("intllib") then - S = intllib.Getter() -else - S = function(s) return s end -end -maptools.intllib = S - -local modpath = minetest.get_modpath("maptools") - -maptools.drop_msg = function(itemstack, player) - local name = player:get_player_name() - minetest.chat_send_player(name, S("[maptools] tools/nodes do not drop!")) -end - -dofile(modpath .. "/config.lua") -dofile(modpath .. "/aliases.lua") -dofile(modpath .. "/craftitems.lua") -dofile(modpath .. "/default_nodes.lua") -dofile(modpath .. "/nodes.lua") -dofile(modpath .. "/tools.lua") - -if minetest.setting_getbool("log_mods") then - minetest.log("action", S("[maptools] loaded.")) -end +--[[ +===================================================================== +** Map Tools ** +By Calinou. + +Copyright © 2012-2019 Hugo Locurcio and contributors. +Licensed under the zlib license. See LICENSE.md for more information. +===================================================================== +--]] + +maptools = {} + +local S +if minetest.get_modpath("intllib") then + S = intllib.Getter() +else + S = function(s) return s end +end +maptools.intllib = S + +local modpath = minetest.get_modpath("maptools") + +maptools.drop_msg = function(itemstack, player) + local name = player:get_player_name() + minetest.chat_send_player(name, S("[maptools] tools/nodes do not drop!")) +end + +dofile(modpath .. "/config.lua") +dofile(modpath .. "/aliases.lua") +dofile(modpath .. "/craftitems.lua") +dofile(modpath .. "/default_nodes.lua") +dofile(modpath .. "/nodes.lua") +dofile(modpath .. "/tools.lua") + +if minetest.setting_getbool("log_mods") then + minetest.log("action", S("[maptools] loaded.")) +end diff --git a/nodes.lua b/nodes.lua index 1b6dfb8..3a2ebf5 100644 --- a/nodes.lua +++ b/nodes.lua @@ -1,7 +1,7 @@ --[[ Map Tools: node definitions -Copyright (c) 2012-2017 Hugo Locurcio and contributors. +Copyright © 2012-2019 Hugo Locurcio and contributors. Licensed under the zlib license. See LICENSE.md for more information. --]] diff --git a/tools.lua b/tools.lua index 48f7855..9e784ae 100644 --- a/tools.lua +++ b/tools.lua @@ -1,7 +1,7 @@ --[[ Map Tools: tool definitions -Copyright (c) 2012-2017 Hugo Locurcio and contributors. +Copyright © 2012-2019 Hugo Locurcio and contributors. Licensed under the zlib license. See LICENSE.md for more information. --]] From 8f5f6613876e6b2988a10cca4c880999bc2cf9e7 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Fri, 1 Mar 2019 15:27:29 +0100 Subject: [PATCH 07/17] Enforce LF line endings in pre-commit - Update pre-commit hooks to 2.1.0 --- .pre-commit-config.yaml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c682766..9c72498 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,9 @@ -- repo: https://github.com/pre-commit/pre-commit-hooks - rev: v2.0.0 - hooks: - - id: end-of-file-fixer - - id: mixed-line-ending - - id: trailing-whitespace +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v2.1.0 + hooks: + - id: end-of-file-fixer + - id: trailing-whitespace + + - id: mixed-line-ending + args: [--fix=lf] From 8bb6f0fece4bc8c4bf25f93f3cea9c73cf1b3225 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Sat, 2 Mar 2019 18:18:12 +0100 Subject: [PATCH 08/17] Improve wording in README --- README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 7a14122..9474ce5 100644 --- a/README.md +++ b/README.md @@ -12,15 +12,15 @@ world block sandbox game. To install Map Tools, clone this Git repository into your Minetest's `mods/` directory: -``` +```bash git clone https://github.com/minetest-mods/maptools.git ``` You can also [download a ZIP archive](https://github.com/minetest-mods/maptools/archive/master.zip) -of Map Tools. If you do so, you will need to extract the archive, then rename +of Map Tools. If you do so, you will need to extract the archive then rename the resulting folder from `maptools-master` to `maptools` – this is -**absolutely** necessary to do, else, it won't work! +**absolutely** required, as the mod won't work otherwise. ### Enable the mod @@ -43,16 +43,17 @@ This is the easiest way to enable Map Tools when playing in singleplayer This is the recommended way to enable the mod on a server without using a GUI. -1. Make sure Minetest is not currently running (else, it will overwrite +1. Make sure Minetest is not currently running (otherwise, it will overwrite the changes when exiting). 2. Open the world's `world.mt` file using a text editor. 3. Add the following line at the end of the file: -``` +```text load_mod_maptools = true ``` -If the line is already present in the file, then replace `false` with `true` on that line. +If the line is already present in the file, then replace `false` with `true` +on that line. 4. Save the file, then start a game on the world you enabled Map Tools on. 5. Map Tools should now be running on your world. From 199180ee808273b16ee5ba02a403b8c1b9579b11 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Sun, 3 Mar 2019 20:11:10 +0100 Subject: [PATCH 09/17] Update intllib support to avoid using deprecated functions --- CHANGELOG.md | 4 ++++ craftitems.lua | 2 +- default_nodes.lua | 2 +- init.lua | 20 ++++++++----------- intllib.lua | 44 ++++++++++++++++++++++++++++++++++++++++ nodes.lua | 51 +++++++++++++++++++++++------------------------ tools.lua | 6 +++--- 7 files changed, 86 insertions(+), 43 deletions(-) create mode 100644 intllib.lua diff --git a/CHANGELOG.md b/CHANGELOG.md index 0830e62..9e8d098 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Changed + +- Update intllib support to avoid using deprecated functions. + ## 1.0.0 - 2017-02-19 - Initial versioned release. diff --git a/craftitems.lua b/craftitems.lua index aa2330b..00f09f2 100644 --- a/craftitems.lua +++ b/craftitems.lua @@ -5,7 +5,7 @@ Copyright © 2012-2019 Hugo Locurcio and contributors. Licensed under the zlib license. See LICENSE.md for more information. --]] -local S = maptools.intllib +local S = maptools.S maptools.creative = maptools.config["hide_from_creative_inventory"] diff --git a/default_nodes.lua b/default_nodes.lua index 89409f0..15ce925 100644 --- a/default_nodes.lua +++ b/default_nodes.lua @@ -5,7 +5,7 @@ Copyright © 2012-2019 Hugo Locurcio and contributors. Licensed under the zlib license. See LICENSE.md for more information. --]] -local S = maptools.intllib +local S = maptools.S maptools.creative = maptools.config["hide_from_creative_inventory"] diff --git a/init.lua b/init.lua index a329f62..a7ae4a5 100644 --- a/init.lua +++ b/init.lua @@ -10,20 +10,11 @@ Licensed under the zlib license. See LICENSE.md for more information. maptools = {} -local S -if minetest.get_modpath("intllib") then - S = intllib.Getter() -else - S = function(s) return s end -end -maptools.intllib = S - local modpath = minetest.get_modpath("maptools") -maptools.drop_msg = function(itemstack, player) - local name = player:get_player_name() - minetest.chat_send_player(name, S("[maptools] tools/nodes do not drop!")) -end +local S, NS = dofile(modpath .. "/intllib.lua") +maptools.S = S +maptools.NS = NS dofile(modpath .. "/config.lua") dofile(modpath .. "/aliases.lua") @@ -32,6 +23,11 @@ dofile(modpath .. "/default_nodes.lua") dofile(modpath .. "/nodes.lua") dofile(modpath .. "/tools.lua") +maptools.drop_msg = function(itemstack, player) + local name = player:get_player_name() + minetest.chat_send_player(name, S("[maptools] tools/nodes do not drop!")) +end + if minetest.setting_getbool("log_mods") then minetest.log("action", S("[maptools] loaded.")) end diff --git a/intllib.lua b/intllib.lua new file mode 100644 index 0000000..c7af2c2 --- /dev/null +++ b/intllib.lua @@ -0,0 +1,44 @@ +-- 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/nodes.lua b/nodes.lua index 3a2ebf5..200107f 100644 --- a/nodes.lua +++ b/nodes.lua @@ -5,11 +5,11 @@ Copyright © 2012-2019 Hugo Locurcio and contributors. Licensed under the zlib license. See LICENSE.md for more information. --]] -local S = maptools.intllib +local S = maptools.S maptools.creative = maptools.config["hide_from_creative_inventory"] --- Redefine cloud so that the admin pickaxe can mine it: +-- Redefine cloud so that the admin pickaxe can mine it minetest.register_node(":default:cloud", { description = S("Cloud"), tiles = {"default_cloud.png"}, @@ -20,7 +20,6 @@ minetest.register_node(":default:cloud", { }) -- Nodes --- ===== minetest.register_node("maptools:black", { description = S("Black"), @@ -239,29 +238,29 @@ minetest.register_node("maptools:playerclip_top", { }) for pusher_num=1,10,1 do -minetest.register_node("maptools:pusher_" .. pusher_num, { - description = S("Pusher (%s)"):format(pusher_num), - range = 12, - stack_max = 10000, - inventory_image = "default_steel_block.png^default_apple.png", - drawtype = "nodebox", - tiles = {"invisible.png"}, - paramtype = "light", - paramtype2 = "facedir", - sunlight_propagates = true, - node_box = { - type = "fixed", - fixed = {-0.5, -0.5, -0.5, 0.5, -0.4999, 0.5}, - }, - drop = "", - groups = { - unbreakable = 1, - not_in_creative_inventory = maptools.creative, - fall_damage_add_percent = -100, - bouncy = pusher_num * 100, - }, - on_drop = maptools.drop_msg -}) + minetest.register_node("maptools:pusher_" .. pusher_num, { + description = S("Pusher (%s)"):format(pusher_num), + range = 12, + stack_max = 10000, + inventory_image = "default_steel_block.png^default_apple.png", + drawtype = "nodebox", + tiles = {"invisible.png"}, + paramtype = "light", + paramtype2 = "facedir", + sunlight_propagates = true, + node_box = { + type = "fixed", + fixed = {-0.5, -0.5, -0.5, 0.5, -0.4999, 0.5}, + }, + drop = "", + groups = { + unbreakable = 1, + not_in_creative_inventory = maptools.creative, + fall_damage_add_percent = -100, + bouncy = pusher_num * 100, + }, + on_drop = maptools.drop_msg + }) end minetest.register_node("maptools:lightbulb", { diff --git a/tools.lua b/tools.lua index 9e784ae..dc81a59 100644 --- a/tools.lua +++ b/tools.lua @@ -5,7 +5,7 @@ Copyright © 2012-2019 Hugo Locurcio and contributors. Licensed under the zlib license. See LICENSE.md for more information. --]] -local S = maptools.intllib +local S = maptools.S maptools.creative = maptools.config["hide_from_creative_inventory"] @@ -66,9 +66,9 @@ minetest.register_on_punchnode(function(pos, node, puncher) " using an Admin Pickaxe." ) -- The node is removed directly, which means it even works - -- on non-empty containers and group-less nodes. + -- on non-empty containers and group-less nodes minetest.remove_node(pos) - -- Run node update actions like falling nodes. + -- Run node update actions like falling nodes minetest.check_for_falling(pos) end end) From cca390e9eaf886196b5ef61e7ae001868a52787f Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Sun, 3 Mar 2019 23:22:33 +0100 Subject: [PATCH 10/17] Increase the range of the Admin Pickaxe from 12 to 20 nodes --- CHANGELOG.md | 3 ++- tools.lua | 53 +++++++++++++++++++++------------------------------- 2 files changed, 23 insertions(+), 33 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e8d098..6e022a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Changed -- Update intllib support to avoid using deprecated functions. +- Increased the range of the Admin Pickaxe from 12 to 20 nodes. +- Updated intllib support to avoid using deprecated functions. ## 1.0.0 - 2017-02-19 diff --git a/tools.lua b/tools.lua index dc81a59..550ab6b 100644 --- a/tools.lua +++ b/tools.lua @@ -9,48 +9,37 @@ local S = maptools.S maptools.creative = maptools.config["hide_from_creative_inventory"] +local pick_admin_toolcaps = { + full_punch_interval = 0.1, + max_drop_level = 3, + groupcaps = { + unbreakable = {times = {[1] = 0, [2] = 0, [3] = 0}, uses = 0, maxlevel = 3}, + fleshy = {times = {[1] = 0, [2] = 0, [3] = 0}, uses = 0, maxlevel = 3}, + choppy = {times = {[1] = 0, [2] = 0, [3] = 0}, uses = 0, maxlevel = 3}, + bendy = {times = {[1] = 0, [2] = 0, [3] = 0}, uses = 0, maxlevel = 3}, + cracky = {times = {[1] = 0, [2] = 0, [3] = 0}, uses = 0, maxlevel = 3}, + crumbly = {times = {[1] = 0, [2] = 0, [3] = 0}, uses = 0, maxlevel = 3}, + snappy = {times = {[1] = 0, [2] = 0, [3] = 0}, uses = 0, maxlevel = 3}, + }, + damage_groups = {fleshy = 1000}, +} + minetest.register_tool("maptools:pick_admin", { description = S("Admin Pickaxe"), - range = 12, + range = 20, inventory_image = "maptools_adminpick.png", groups = {not_in_creative_inventory = maptools.creative}, - tool_capabilities = { - full_punch_interval = 0.1, - max_drop_level = 3, - groupcaps= { - unbreakable = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 0, maxlevel = 3}, - fleshy = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 0, maxlevel = 3}, - choppy = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 0, maxlevel = 3}, - bendy = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 0, maxlevel = 3}, - cracky = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 0, maxlevel = 3}, - crumbly = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 0, maxlevel = 3}, - snappy = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 0, maxlevel = 3}, - }, - damage_groups = {fleshy = 1000}, - }, - on_drop = maptools.drop_msg + tool_capabilities = pick_admin_toolcaps, + on_drop = maptools.drop_msg, }) minetest.register_tool("maptools:pick_admin_with_drops", { description = S("Admin Pickaxe with Drops"), - range = 12, + range = 20, inventory_image = "maptools_adminpick_with_drops.png", groups = {not_in_creative_inventory = maptools.creative}, - tool_capabilities = { - full_punch_interval = 0.35, - max_drop_level = 3, - groupcaps = { - unbreakable = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 0, maxlevel = 3}, - fleshy = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 0, maxlevel = 3}, - choppy = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 0, maxlevel = 3}, - bendy = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 0, maxlevel = 3}, - cracky = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 0, maxlevel = 3}, - crumbly = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 0, maxlevel = 3}, - snappy = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 0, maxlevel = 3}, - }, - damage_groups = {fleshy = 1000}, - }, - on_drop = maptools.drop_msg + tool_capabilities = pick_admin_toolcaps, + on_drop = maptools.drop_msg, }) minetest.register_on_punchnode(function(pos, node, puncher) From 83083dc98dcc38d9ddf7df6f1dbf70731549f199 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Wed, 6 Mar 2019 10:28:16 +0100 Subject: [PATCH 11/17] Set up Travis CI --- .travis.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..1c4c0d8 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,15 @@ +language: generic + +addons: + apt: + packages: + - luarocks + +install: + - pyenv global 3.6.3 + - pip3 install --user pre-commit + - luarocks install --local luacheck + +script: + - $HOME/.local/bin/pre-commit run --all-files + - $HOME/.luarocks/bin/luacheck . From 81b988d631660ea6c6afd0132a2b5bcbce1e50c8 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Sat, 23 Mar 2019 15:19:47 +0100 Subject: [PATCH 12/17] Bump to version 1.1.0 --- CHANGELOG.md | 5 ++++- README.md | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e022a4..2892512 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +## [1.1.0] - 2019-03-23 + ### Changed - Increased the range of the Admin Pickaxe from 12 to 20 nodes. @@ -16,4 +18,5 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Initial versioned release. -[Unreleased]: https://github.com/minetest-mods/maptools/compare/v1.0.0...HEAD +[Unreleased]: https://github.com/minetest-mods/maptools/compare/v1.1.0...HEAD +[1.1.0]: https://github.com/minetest-mods/maptools/compare/v1.0.0...v1.1.0 diff --git a/README.md b/README.md index 9474ce5..30e846c 100644 --- a/README.md +++ b/README.md @@ -60,13 +60,13 @@ on that line. ## Version compatibility -Map Tools is currently primarily tested with Minetest 0.4.16. +Map Tools is currently primarily tested with Minetest 0.4.17. It may or may not work with newer or older versions. Issues arising in older -versions than 0.4.16 will generally not be fixed. +versions than 0.4.17 will generally not be fixed. ## License -Copyright © 2012-2017 Hugo Locurcio and contributors +Copyright © 2012-2019 Hugo Locurcio and contributors - Map Tools code is licensed under the zlib license, see [`LICENSE.md`](LICENSE.md) for details. From a2a54396bb79ceb1fd467eac11882fd1048b2ea1 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Sat, 30 Mar 2019 00:56:56 +0100 Subject: [PATCH 13/17] Add intllib as an optional dependency --- depends.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/depends.txt b/depends.txt index 4ad96d5..9207dab 100644 --- a/depends.txt +++ b/depends.txt @@ -1 +1,2 @@ default +intllib? From 1ff1b355bc96bd30734742abb4c8b997cffb0c8f Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Sat, 30 Mar 2019 19:34:55 +0100 Subject: [PATCH 14/17] Improve writing style and formatting in the nodes and items list This closes #12. --- NODES.md | 26 -------------------------- NODES_ITEMS.md | 39 +++++++++++++++++++++++++++++++++++++++ README.md | 5 ++++- 3 files changed, 43 insertions(+), 27 deletions(-) delete mode 100644 NODES.md create mode 100644 NODES_ITEMS.md diff --git a/NODES.md b/NODES.md deleted file mode 100644 index 5e0c079..0000000 --- a/NODES.md +++ /dev/null @@ -1,26 +0,0 @@ -# Item names for spawning the items using /give or /giveme - -## Items - -- `admin_pick`: magenta pickaxe, infinite durability, mines everything including unbreakable blocks instantly. No drops. Don't put this pickaxe in the hands of a griefer, of course. -- `admin_pick_with_drops`: same as admin pickaxe, but drops stuff. -- `infinite_fuel`: fuel lasting for a (near)-infinite time. Don't worry about the "near" * it lasts for about 50 in-real-life years. -- `super_apple`: a yellow apple which heals 20 HP. -- `copper_coin`, -- `silver_coin`, -- `gold_coin`: these have nothing to do with the More Ores mod; they can be used as a currency for trading, or as an universal currency for mods that add shops. - -## Blocks - -**[!]** denotes an unpointable, unbreakable block; be very careful with them, they cannot be removed by hand (they can only be removed with WorldEdit or similar). -- `(block)_u` : unbreakable, non-flammable, non-falling, non-decaying blocks, most common blocks have their unbreakable form (examples: maptools:stone or maptools:wood for unbreakable stone/wood). Examples: `stone_u`, `wood_u`, `glass_u`, … -- `full_grass`: unbreakable block with the grass texture on all sides. -- `player_clip`: **[!]** invisible block, not pointable. -- `full_clip`: invisible block, pointable. Also available as a thin face: full_clip_face. -- `smoke_block`: some smoke (does not harm players or entities). -- `no_build`: **[!]** very basic building prevention. -- `no_interact`: prevents interacting through the block (opening chests, furnaces, attacking entities, …). -- `damage_(1…5)`: **[!]** damaging blocks. The damage is in half hearts and ranges from 1 to 5 (0.5 to 2.5 hearts damage every second). -- `kill`: **[!]** instant kill (deals 10 heart damage) blocks. -- `light_block`: **[!]** invisible non-solid block, prevents light from passing through. -- `light_bulb`: **[!]** invisible non-solid block, emitting a good amount of light. diff --git a/NODES_ITEMS.md b/NODES_ITEMS.md new file mode 100644 index 0000000..3e0f1f0 --- /dev/null +++ b/NODES_ITEMS.md @@ -0,0 +1,39 @@ +# List of nodes/items + +To use an item, make sure you have the `give` privilege, then use +`/give [amount]` or `/giveme [amount]`. + +**Tip:** To give yourself a large amount of items quickly (65535 as of writing), +use `-1` as the amount. + +## Nodes + +:warning: denotes an unpointable, unbreakable block; be very careful with them, +as they cannot be removed by hand (they can only be removed with WorldEdit or +similar). + +| Item code | Description | +| ----------------------: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `maptools:{block}_u` | Unbreakable, non-flammable, non-falling, non-decaying blocks. Most common default blocks have an unbreakable form available (`maptools:stone_u`, `maptools:wood_u`, …) | +| `maptools:full_grass` | Unbreakable block with the grass texture on all sides. | +| `maptools:player_clip` | :warning: Invisible, non-pointable block that blocks players and entities. | +| `maptools:full_clip` | Invisible, pointable block that blocks players and entities. Also available as a thin face (`maptools:full_clip_face`). | +| `maptools:smoke_block` | Some smoke (doesn't damage players or entities). | +| `maptools:no_build` | :warning: Very basic building prevention. | +| `maptools:no_interact` | Prevents interacting through the block (opening chests, furnaces, attacking entities, …), but can still be walked through. | +| `maptools:damage_{1…5}` | :warning: Damaging blocks which damage players by 1 to 5 HP per second. | +| `maptools:kill` | :warning: Instant kill blocks (damages players by 20 HP per second). | +| `maptools:light_block` | :warning: Invisible non-solid block, prevents light from passing through. | +| `maptools:light_bulb` | :warning: Invisible non-solid block, emitting the maximum amount of light. | + +## Items + +| Item code | Description | +| -------------------------------: | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `maptools:admin_pick` | A bright magenta pickaxe with infinite durability, digs everything including unbreakable blocks instantly. No drops are given when digging nodes. | +| `maptools:admin_pick_with_drops` | Same as the admin pickaxe, but drops are given when digging nodes. | +| `maptools:infinite_fuel` | Fuel lasting for a near-infinite time (about 50 real-life years). | +| `maptools:super_apple` | A yellow apple which heals the player by 20 HP when used. | +| `maptools:copper_coin` | Decorative item (can be used in mini-games). | +| `maptools:silver_coin` | Decorative item (can be used in mini-games). | +| `maptools:gold_coin` | Decorative item (can be used in mini-games). | diff --git a/README.md b/README.md index 30e846c..3f89750 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,10 @@ Map Tools for [Minetest](https://www.minetest.net/), a free and open source infinite world block sandbox game. -[**Forum topic**](https://forum.minetest.net/viewtopic.php?f=11&t=1882) +## Resources + +- [Forum topic](https://forum.minetest.net/viewtopic.php?f=11&t=1882) +- [List of nodes and items available](NODES_ITEMS.md) ## Installation From e6723e516b4b3fb254c114bb39c1c426aff38cea Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Wed, 3 Apr 2019 00:14:44 +0200 Subject: [PATCH 15/17] Fix `minetest.setting_getbool()` deprecation warning --- config.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.lua b/config.lua index 56d0e2d..a85e5b3 100644 --- a/config.lua +++ b/config.lua @@ -8,7 +8,7 @@ Licensed under the zlib license. See LICENSE.md for more information. maptools.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 From 0dfadcf43a74daa0ffdb930a5a194d708f6e1c7a Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Wed, 3 Apr 2019 00:14:52 +0200 Subject: [PATCH 16/17] Remove the optional mod loading message --- config.lua | 2 +- init.lua | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/config.lua b/config.lua index a85e5b3..466491e 100644 --- a/config.lua +++ b/config.lua @@ -21,7 +21,7 @@ local function setting(settingtype, name, default) getbool_default("maptools." .. name, default) else maptools.config[name] = - minetest.setting_get("maptools." .. name) or default + minetest.settings:get("maptools." .. name) or default end end diff --git a/init.lua b/init.lua index a7ae4a5..c8d5336 100644 --- a/init.lua +++ b/init.lua @@ -27,7 +27,3 @@ maptools.drop_msg = function(itemstack, player) local name = player:get_player_name() minetest.chat_send_player(name, S("[maptools] tools/nodes do not drop!")) end - -if minetest.setting_getbool("log_mods") then - minetest.log("action", S("[maptools] loaded.")) -end From 2f34184047706395515eec1dfd069d258444fc55 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Tue, 23 Apr 2019 21:54:27 +0200 Subject: [PATCH 17/17] Add description and dependencies to `mod.conf` The legacy `depends.txt` and `description.txt` files are no longer needed since Minetest 5.0.0 or later will read everything from `mod.conf`. This raises the minimum supported Minetest version to 5.0.0. --- CHANGELOG.md | 4 ++++ depends.txt | 2 -- description.txt | 1 - mod.conf | 3 +++ 4 files changed, 7 insertions(+), 3 deletions(-) delete mode 100644 depends.txt delete mode 100644 description.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index 2892512..900458e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Changed + +- The minimum supported Minetest version is now 5.0.0. + ## [1.1.0] - 2019-03-23 ### Changed diff --git a/depends.txt b/depends.txt deleted file mode 100644 index 9207dab..0000000 --- a/depends.txt +++ /dev/null @@ -1,2 +0,0 @@ -default -intllib? diff --git a/description.txt b/description.txt deleted file mode 100644 index 43bbfde..0000000 --- a/description.txt +++ /dev/null @@ -1 +0,0 @@ -Adds various special versions of normal blocks, tools, and other map maintainer tools. diff --git a/mod.conf b/mod.conf index a77ffe2..363f651 100644 --- a/mod.conf +++ b/mod.conf @@ -1 +1,4 @@ name = maptools +description = Adds various special versions of normal blocks, tools, and other map maintainer tools. +depends = default +optional_depends = intllib