From d0a1798b0bdbe71f33f0bacafa9286005e9de4b1 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Wed, 22 May 2019 11:30:48 +0200 Subject: [PATCH 1/9] Use `carts` mod functions to register copper rails This makes them behave similarly to default rails. --- CHANGELOG.md | 3 +++ init.lua | 51 +++++++++++++-------------------------------------- mod.conf | 2 +- 3 files changed, 17 insertions(+), 39 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1363aba..e07b99e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Changed - The minimum supported Minetest version is now 5.0.0. +- Copper rails are now registered using functions from the `carts` mod, + making them interoperate seamlessly with default rails. + - Copper rails can no longer be placed in the air. ## [1.1.0] - 2019-03-23 diff --git a/init.lua b/init.lua index d3b1cc0..839c370 100644 --- a/init.lua +++ b/init.lua @@ -329,45 +329,20 @@ else end -- Copper rail (unique node) -minetest.register_node("moreores:copper_rail", { - description = S("Copper Rail"), - drawtype = "raillike", - tiles = { - "moreores_copper_rail.png", - "moreores_copper_rail_curved.png", - "moreores_copper_rail_t_junction.png", - "moreores_copper_rail_crossing.png", - }, - inventory_image = "moreores_copper_rail.png", - wield_image = "moreores_copper_rail.png", - paramtype = "light", - sunlight_propagates = true, - walkable = false, - selection_box = { - type = "fixed", - fixed = { - -1/2, - -1/2, - -1/2, - 1/2, - -1/2 + 1/16, - 1/2, +if minetest.get_modpath("carts") then + carts:register_rail("moreores:copper_rail", { + description = S("Copper Rail"), + tiles = { + "moreores_copper_rail.png", + "moreores_copper_rail_curved.png", + "moreores_copper_rail_t_junction.png", + "moreores_copper_rail_crossing.png", }, - }, - sounds = default_metal_sounds, - groups = {bendy = 2, snappy = 1, dig_immediate = 2, rail = 1, connect_to_raillike = 1}, - mesecons = { - effector = { - action_on = function(pos, node) - minetest.get_meta(pos):set_string("cart_acceleration", "0.5") - end, - - action_off = function(pos, node) - minetest.get_meta(pos):set_string("cart_acceleration", "0") - end, - }, - }, -}) + inventory_image = "moreores_copper_rail.png", + wield_image = "moreores_copper_rail.png", + groups = carts:get_rail_groups(), + }, {}) +end minetest.register_craft({ output = "moreores:copper_rail 24", diff --git a/mod.conf b/mod.conf index 2b96161..04a353a 100644 --- a/mod.conf +++ b/mod.conf @@ -1,4 +1,4 @@ name = moreores description = Adds new ore types. depends = default -optional_depends = farming,intllib,mg +optional_depends = carts,farming,intllib,mg From 42c4c7ab04459db9a8e328ed11b71ee4bf1dcf07 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Wed, 19 Jun 2019 21:20:41 +0200 Subject: [PATCH 2/9] Optimize PNG images losslessly Commands used: - `parallel optipng -o7 -zm1-9 -strip all ::: **/*.png` - `parallel advpng -z4 -i5000 ::: **/*.png` --- textures/moreores_copper_rail.png | Bin 267 -> 264 bytes textures/moreores_copper_rail_crossing.png | Bin 246 -> 245 bytes textures/moreores_copper_rail_curved.png | Bin 263 -> 263 bytes textures/moreores_copper_rail_t_junction.png | Bin 306 -> 272 bytes textures/moreores_mineral_mithril.png | Bin 141 -> 140 bytes textures/moreores_mineral_silver.png | Bin 151 -> 149 bytes textures/moreores_mineral_tin.png | Bin 171 -> 171 bytes textures/moreores_mithril_block.png | Bin 225 -> 213 bytes textures/moreores_silver_block.png | Bin 261 -> 247 bytes textures/moreores_silver_ingot.png | Bin 198 -> 197 bytes textures/moreores_tin_block.png | Bin 267 -> 266 bytes textures/moreores_tin_ingot.png | Bin 198 -> 198 bytes textures/moreores_tool_mithrilpick.png | Bin 199 -> 196 bytes textures/moreores_tool_mithrilshovel.png | Bin 195 -> 194 bytes textures/moreores_tool_silveraxe.png | Bin 193 -> 193 bytes textures/moreores_tool_silverpick.png | Bin 196 -> 193 bytes textures/moreores_tool_silvershovel.png | Bin 200 -> 199 bytes 17 files changed, 0 insertions(+), 0 deletions(-) diff --git a/textures/moreores_copper_rail.png b/textures/moreores_copper_rail.png index 31f2999a7112070bea7c87fa53483b6115ba88ef..da7f5cfae456235b5a12846601a26a4085069c4c 100644 GIT binary patch delta 139 zcmV;60CfM00*C^Tg@0~IL_t(|+Ko=N0R%x10@m$Z`mgjodB4d92SDL*A^;?+8t=0S zn`i(GRJX+5I@?5tSIZ~BQ=yD0WHX5gK%?RiFCnuN+tG|-YDmSb_Z^mUahO|gtvDRY t2-N7!lyfa&1<+Hrvt8%hBJS^&GtbrohOn+#vj6}907*qoLJ<9+9 delta 142 zcmV;90CE3_0*eBWg@18LL_t(|0ga9~5(6<1!$@kC;|1IQ|EUYRQ*$gi0}KFA_)i3Y zOf?rmaq%rW0E-%Tn&z#G9@vrX2vn>`j>Vl~2GFUrQkr&ou|IWG*J7^j_3JRor*-vd wCay=0NFBkQrL-zG0F$y|V|agypB?!E&(;HmMCY?v00000Ne4wvM6N<$g1a(3FaQ7m diff --git a/textures/moreores_copper_rail_crossing.png b/textures/moreores_copper_rail_crossing.png index cf8032080fa8640df1fe0f79a2f623f46bfa9926..ca68539a4db4faaab5f1f76288ae60ff54be870b 100644 GIT binary patch delta 138 zcmV;50CoTN0rdfpbAN3~L_t(|+GS6J6-7}DOLfithy8d)4vPo?6E+Y7>%t4rWL+>b z@djdM&;u)_8Q{XEAxue1j3o(i0N|L0ineS@>^B!T0kw;*M!=<0Lo7;9wG!K^k#q1a s*Kuli19Y{01$#$dDIL(VQl9m{VRizfMJt^g00000NkvXXt^-0~f@q01X#fBK delta 139 zcmV;60CfNL0rmlqbAN70L_t(|+GS6J0Yxzo%cN|H2E<oz-pB8>oZ_8F)ry(ObBU4U`$5yW$Y=a(~5InwN~Jn+hJ obcx&|g3k3KvGq4#>NGLJ00X!Jv#+%+tpET307*qoM6N<$g7pAAOaK4? delta 134 zcmV;10D1q10*3;Sh<^bEz=v_dKmY{5y?Z4<39#LNsU83T0PtA>0CSQ6AZc3wNjoNh z>yei20dS{qO#tb!!1)4F^FCqz0aEVc$(TS2-}A-TIgb>KeYL%~(`9|b_)IO*ac#@{ o!M6!gY=86eY<^dyz&x6#e*?GzvrZ(7umAu607*qoM6N<$f(H_y7O^ delta 182 zcmV;n07?Il0-BoYa5NLh0L01FcU01FcV0GgZ_ks)M%0b)x>L;#2d9Y_EG0Cq`4 zK~#9!Wlw_v0|5|Aa(G+&Pg=WY0|12wh*w!rt!36$?4kh}seUa75AQ_sqlFZ8wI7nw zeMVAhri-vytN?V>6$f8J>~Nn!z1RK+^4?N4w%zY=O67PF?&665wf~0|)RZ>Yb=%xe kA1Lp=?;}|vZB!O6kQz`&rP%O5;ZQPs`R)5S5Q;?~q2S4IW{2ByY;bDzK4E#Ia3q}iL% uOYVC2Wp3r76z{&rMq-w`{w3}H>8+#a#b9p`enJCi2!p4qpUXO@geCw9XdX=f delta 91 zcmeBS>}8xF!O6tTz`&3+SNzjNMOAkrPZ!4!j_b({4GadFOhPn& zBp=W;qF|zkkCDuK2-VqK>Z22eeMD96J-?V1FJS;#%x(9`00000NkvXXu0mjfPG2P* delta 95 zcmV-l0HFVs0ha-g7zqRe0002(-QrS_AuCHZNkl0*N{TxtM@$0!UM! zppcRxNM6MVRhm&yfPoQaw79YWid6|n999bi8vygy1DJizBV+&o002ovPDHLkV1oUx BARqt$ diff --git a/textures/moreores_mithril_block.png b/textures/moreores_mithril_block.png index dd7a246da75fad8bacce52b20b83e1e428d32dea..7eda9cce70a89992fd26a6ba925f8f224a7b0dc7 100644 GIT binary patch delta 156 zcmV;N0Av5*0o4JJ7zqdi0000eEe}(XAuWG$Nkl3xXJaL5 za1<^PZ9ze_wb*Rr(&pAG*aJBAyutT!9){aHaUe6nniC%c8`^QqFbb{!Sk7b)wtBGO zV42w-q<6cG_pXP6-DD5R^Sw3Xq3qte+LMeQl= r3=13u_qTQMN}yOnq3?g@y)>*00000NkvXXu0mjfj3Y~! diff --git a/textures/moreores_silver_ingot.png b/textures/moreores_silver_ingot.png index 86dd54e76c82c72ef731ea8ea0304cc66c3bf470..5af8d372d0300c8f2f8e8750431f427ffacea320 100644 GIT binary patch delta 111 zcmV-#0FeL20mT837zqdi0000eEe}(XAxT?CNklBygGf$8KKL7x>kqsVJ S2i=_j00002C_ zxoMIEtc6L?Oa{vqEI>et({6(qqR9pc8hgxrQed}rjEL%HU_=06sv^m>&WK%0G(w9h z4v3hv=w_M#*7Fwbn>6epL_$K{2b=qfuD|Mkl8;bTe}}j6K_&4>d!KusEp}$^967W8 af8-A)Ap|Xn%8si50000>00000NkvXXu0mjfxO_wb diff --git a/textures/moreores_tin_ingot.png b/textures/moreores_tin_ingot.png index eed536105bf934d6274d31c28e6e98360f1cc5c1..4e8c4f5d371528d17c1143be56fd353fe77e5ca7 100644 GIT binary patch delta 107 zcmV-x0F?j60mcE47zqdi0000eEe}(XAx>9#+MUR?0f0aN#n7K~-+x8a*JHpA7zLoTkfH#DR#F18z_i{}0Whsz z8e+)6m~#k7HybjDEX&>sqy-p+O_ogo(m=JsCQ~j#bPF58%oAk54*<|@4X(VTeyRWf N002ovPDHLkV1jk`C?fy> diff --git a/textures/moreores_tool_mithrilpick.png b/textures/moreores_tool_mithrilpick.png index efe94439b14b2e389c9750758931f9bf90d6b8ab..7f7c3a2b0325485324ec9fb38be2c5006839d573 100644 GIT binary patch delta 112 zcmV-$0FVF20mK227zqdi0000eEe}(XAxB(CNklwGI3*Mm^2W8BP(5ieNazWZ++DDAszttpQPR SHwZca000007zqdi0000eEe}(XAxu?3Nkl-I?UMlyO#+)vx(NFVCT(nX+BtT of=R}y1dBCrF46U~J3$>CyT%UzD(baWiU0rr07*qoM6N<$f+&L|00000 diff --git a/textures/moreores_tool_silverpick.png b/textures/moreores_tool_silverpick.png index 4194c6ec060df97c0eb4df15907d4c8f4bfd75a4..a291d3fc7a7df5e5d2e1559f1eee273f05706c9b 100644 GIT binary patch delta 112 zcmV-$0FVE~0l@)~7zqdi0000eEe}(XAw*n9NklSa&KaGGLN6vJU=1OH0Pu+;~;q5(}) S)*0{s0000hZz5%2jL9?V@D+su>b%707*qoM6N<$g6F{~ AUjP6A delta 95 zcmV-l0HFWJ0muQ6a9Bf0L_t(|+O5d90Rk}q#n3P3Z0|oU6>zyabx(T80eh!J*?1%> z^=AvYXE*gftrxQWj~E+n>lN+RJ{aj}y=NJt$3Ec=0b}V%QeFT6002ovPDHLkV1m3h BC;$Ke From f7a757c71698791606df73964022627787699efd Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Mon, 29 Jul 2019 00:48:21 +0200 Subject: [PATCH 3/9] Travis CI: Use the `bionic` distribution --- .travis.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index a032acb..32a776a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,16 +1,16 @@ -language: generic +dist: bionic +language: python -addons: - apt: - packages: - - luarocks +python: + - 3.7.1 install: - - pyenv global 3.6.3 - - pip3 install --user pre-commit + - sudo apt-get update -qq + - sudo apt-get install -qqq luarocks + - pip3 install pre-commit - luarocks install --local luacheck script: # All linters are run with pre-commit hooks - export PATH="$HOME/.luarocks/bin:$PATH" - - $HOME/.local/bin/pre-commit run --all-files + - pre-commit run --all-files From a1f6897e520f2a166b0cd3a1b216fa7e9a62aae5 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Sun, 8 Sep 2019 22:56:57 +0200 Subject: [PATCH 4/9] Document the Minetest 5.0.0 version requirement --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 255ca60..229357b 100644 --- a/README.md +++ b/README.md @@ -60,9 +60,9 @@ on that line. ## Version compatibility -More Ores is currently primarily tested with Minetest 0.4.17. +More Ores is currently primarily tested with Minetest 5.0.1. It may or may not work with newer or older versions. Issues arising in older -versions than 0.4.17 will generally not be fixed. +versions than 5.0.0 will generally not be fixed. ## License From 8aa3cbd1914e74a200a0d483f8094cb17b4672bc Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Wed, 25 Sep 2019 23:18:34 +0200 Subject: [PATCH 5/9] Update pre-commit hooks to 2.3.0 --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 22f1dbe..04507b4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v2.1.0 + rev: v2.3.0 hooks: - id: end-of-file-fixer - id: trailing-whitespace From d7ac127d24f45b0eb942ba8acfa49c7731c93ee0 Mon Sep 17 00:00:00 2001 From: Louis Royer <55180044+louisroyer@users.noreply.github.com> Date: Sun, 13 Oct 2019 13:04:00 +0200 Subject: [PATCH 6/9] Add compatibility with mod frame - [mod frame](https://github.com/minetest-mods/frame) --- .luacheckrc | 2 ++ init.lua | 19 +++++++++++++++++++ mod.conf | 2 +- 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/.luacheckrc b/.luacheckrc index b1eb1c9..fb340e5 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -25,7 +25,9 @@ stds.minetest = { } read_globals = { + "carts", "farming", + "frame", "intllib", "mg", } diff --git a/init.lua b/init.lua index 839c370..33b2a82 100644 --- a/init.lua +++ b/init.lua @@ -23,6 +23,9 @@ if minetest.get_modpath("mg") then dofile(modpath .. "/mg.lua") end +-- `frame` support +local use_frame = minetest.get_modpath("frame") + local default_stone_sounds = default.node_sound_stone_defaults() local default_metal_sounds = default.node_sound_metal_defaults() @@ -89,6 +92,10 @@ local function add_ore(modname, description, mineral_name, oredef) sounds = default_stone_sounds, drop = lump_item, }) + + if use_frame then + frame.register(modname .. ":mineral_" .. mineral_name) + end end if oredef.makes.block then @@ -112,6 +119,9 @@ local function add_ore(modname, description, mineral_name, oredef) } }) end + if use_frame then + frame.register(block_item) + end end if oredef.makes.lump then @@ -127,6 +137,9 @@ local function add_ore(modname, description, mineral_name, oredef) recipe = lump_item, }) end + if use_frame then + frame.register(lump_item) + end end if oredef.makes.ingot then @@ -135,6 +148,9 @@ local function add_ore(modname, description, mineral_name, oredef) inventory_image = img_base .. "_ingot.png", }) minetest.register_alias(mineral_name .. "_ingot", ingot) + if use_frame then + frame.register(ingot) + end end if oredef.makes.chest then @@ -217,6 +233,9 @@ local function add_ore(modname, description, mineral_name, oredef) end minetest.register_alias(tool_name .. tool_post, fulltool_name) + if use_frame then + frame.register(fulltool_name) + end end end diff --git a/mod.conf b/mod.conf index 04a353a..9b71bfb 100644 --- a/mod.conf +++ b/mod.conf @@ -1,4 +1,4 @@ name = moreores description = Adds new ore types. depends = default -optional_depends = carts,farming,intllib,mg +optional_depends = carts,farming,frame,intllib,mg From 308c6732a842c72e748013ff8184504f85818708 Mon Sep 17 00:00:00 2001 From: mat9117 Date: Wed, 10 Apr 2019 12:13:58 +0200 Subject: [PATCH 7/9] Polish translation fix --- locale/pl.txt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/locale/pl.txt b/locale/pl.txt index fb65804..e6c585e 100644 --- a/locale/pl.txt +++ b/locale/pl.txt @@ -2,14 +2,14 @@ [moreores] loaded. = [moreores] załadowano. -%s Ore = %Ruda -%s Lump = %Bryłka -%s Ingot = %Sztabka -%s Block = %sBlok -%s Pickaxe = %sKilof -%s Shovel = %sŁopatka -%s Axe = %sSiekiera -%s Sword = %sMiecz +%s Ore = %s Ruda +%s Lump = %s Bryłka +%s Ingot = %s Sztabka +%s Block = %s Blok +%s Pickaxe = %s Kilof +%s Shovel = %s Łopatka +%s Axe = %s Siekiera +%s Sword = %s Miecz Copper = Miedź Tin = Cyna From 4d5fe50dfd01ce5d028820ba31edf89ab9bbd92d Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Sun, 13 Oct 2019 14:25:56 +0200 Subject: [PATCH 8/9] Update the changelog to mention the `frame` mod support --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e07b99e..5b77830 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Added +- More Ores nodes/items/tools can now be placed in item frames + from the [`frame`](https://github.com/minetest-mods/frame) mod. - Polish translation. ### Changed From 7ea70d559570218658a2c9a8b64e7c0c3948b21d Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Mon, 25 Nov 2019 13:49:42 +0100 Subject: [PATCH 9/9] Bump to version 2.0.0 --- CHANGELOG.md | 5 ++++- README.md | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b77830..aaffdc5 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] +## [2.0.0] - 2019-11-25 + ### Added - More Ores nodes/items/tools can now be placed in item frames @@ -49,5 +51,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Initial versioned release. -[Unreleased]: https://github.com/minetest-mods/moreores/compare/v1.1.0...HEAD +[Unreleased]: https://github.com/minetest-mods/moreores/compare/v2.0.0...HEAD +[2.0.0]: https://github.com/minetest-mods/moreores/compare/v1.1.0...v2.0.0 [1.1.0]: https://github.com/minetest-mods/moreores/compare/v1.0.0...v1.1.0 diff --git a/README.md b/README.md index 229357b..540ca56 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ on that line. ## Version compatibility -More Ores is currently primarily tested with Minetest 5.0.1. +More Ores is currently primarily tested with Minetest 5.1.0. It may or may not work with newer or older versions. Issues arising in older versions than 5.0.0 will generally not be fixed.