From d9523dc015e17355a3b262b1fe3869ae33f613db Mon Sep 17 00:00:00 2001 From: trans_soup <> Date: Tue, 17 Oct 2023 15:07:04 +0200 Subject: [PATCH] remove unused mod `bg_funnel`. --- mods/bg_funnel/api.lua | 57 ------------ mods/bg_funnel/funnel.lua | 82 ------------------ mods/bg_funnel/init.lua | 6 -- mods/bg_funnel/mod.conf | 3 - mods/bg_funnel/node.lua | 27 ------ mods/bg_funnel/recipe.lua | 16 ---- mods/bg_funnel/textures/bg_funnel_funnel.png | Bin 5505 -> 0 bytes .../textures/bg_funnel_funnel_top.png | Bin 766 -> 0 bytes 8 files changed, 191 deletions(-) delete mode 100644 mods/bg_funnel/api.lua delete mode 100644 mods/bg_funnel/funnel.lua delete mode 100644 mods/bg_funnel/init.lua delete mode 100644 mods/bg_funnel/mod.conf delete mode 100644 mods/bg_funnel/node.lua delete mode 100644 mods/bg_funnel/recipe.lua delete mode 100644 mods/bg_funnel/textures/bg_funnel_funnel.png delete mode 100644 mods/bg_funnel/textures/bg_funnel_funnel_top.png diff --git a/mods/bg_funnel/api.lua b/mods/bg_funnel/api.lua deleted file mode 100644 index 51be302..0000000 --- a/mods/bg_funnel/api.lua +++ /dev/null @@ -1,57 +0,0 @@ -local function get_inventory (pos) - local meta = minetest.get_meta(pos) - return minetest.deserialize(meta:get_string("inventory")) -end - -local function set_inventory (pos, inventory) - local meta = minetest.get_meta(pos) - meta:set_string("inventory", minetest.serialize(inventory)) -end - - - -local function push (pos, value) - local inventory = get_inventory(pos) - if not inventory then return false end - - table.insert(inventory, value) - set_inventory(pos, inventory) - return true -end - -local function pop (pos) - local inventory = get_inventory(pos) - if not inventory then return nil end - - local value = table.remove(inventory, 1) - set_inventory(pos, inventory) - return value -end - - - -local function place_funnel (itemstack, placed, pointed) - local result = minetest.item_place(itemstack, placer, pointed) - - local pos = pointed.above - local meta = minetest.get_meta(pos) - set_inventory(pos, {}) - - return result -end - -local function dig_funnel (pos, ...) - local result = minetest.node_dig(pos, ...) - return result -end - - - -return { - get_inventory = get_inventory, - set_inventory = set_inventory, - place_funnel = place_funnel, - dig_funnel = dig_funnel, - push = push, - pop = pop, -} diff --git a/mods/bg_funnel/funnel.lua b/mods/bg_funnel/funnel.lua deleted file mode 100644 index 3af1384..0000000 --- a/mods/bg_funnel/funnel.lua +++ /dev/null @@ -1,82 +0,0 @@ -local modname = minetest.get_current_modname() - -local api = load_file("api") - -local function get_meta_table (pos) - return minetest.get_meta(pos):to_table() -end - -local function set_meta (pos, meta_table) - local meta = minetest.get_meta(pos) - for key, value in pairs(meta_table) do - local fn = nil - if type(value) == "string" then fn = "set_string" end - if type(value) == "int" then fn = "set_int" end - if type(value) == "float" then fn = "set_float" end - if fn then - meta[fn](key, value) - end - end -end - -local function attempt_input (pos) - -- TODO: add max limit for amount of nodes inside funnel inventory. - local above = pos + blockgame.vector.dirs.up - if minetest.get_node(above).name == "air" then return false end - - local node = minetest.get_node(above) - local meta = get_meta_table(above) - local value = { - node = node, - meta = meta, - } - - local success = api.push(pos, value) - if not success then return false end - minetest.remove_node(above) - return true -end - -local function attempt_output (pos) - local below = pos + blockgame.vector.dirs.down - if minetest.get_node(below).name ~= "air" then return false end - - local value = api.pop(pos) - if not value then return nil end - - local node = value.node - local meta = value.meta - minetest.set_node(below, node) - set_meta(below, meta) - - return true -end - -blockgame.register_abm({ - label = "funnel nodes", - nodenames = {modname .. ":funnel"}, - interval = 1, - chance = 1, - catch_up = false, - action = function (pos) - -- NOTE: metadata storage might not work, and funnels might not be able to pick up other funnels successfully. - attempt_input(pos) - attempt_output(pos) - end, -}) - - - --- NOTE: the documentation says `register_on_placenode` is "not recommended"; what else could be used for this? -minetest.register_on_placenode(function (pos) - local below = pos + blockgame.vector.dirs.down - if minetest.get_node(below).name ~= modname .. ":funnel" then return end - attempt_input(below) -end) - --- NOTE: the documentation says `register_on_dignode` is "not recommended"; what else could be used for this? -minetest.register_on_dignode(function (pos) - local above = pos + blockgame.vector.dirs.up - if minetest.get_node(above).name ~= modname .. ":funnel" then return end - attempt_output(above) -end) diff --git a/mods/bg_funnel/init.lua b/mods/bg_funnel/init.lua deleted file mode 100644 index 5e12982..0000000 --- a/mods/bg_funnel/init.lua +++ /dev/null @@ -1,6 +0,0 @@ --- this mod is disabled for now. ---[[ -load_file("node") -load_file("recipe") -load_file("funnel") -]]-- diff --git a/mods/bg_funnel/mod.conf b/mods/bg_funnel/mod.conf deleted file mode 100644 index 80b9366..0000000 --- a/mods/bg_funnel/mod.conf +++ /dev/null @@ -1,3 +0,0 @@ -name = bg_funnel -description = adds a funnel node to blockgame. -depends = bg_terrain, bg_api, bg_tree, bg_woodworking diff --git a/mods/bg_funnel/node.lua b/mods/bg_funnel/node.lua deleted file mode 100644 index 602df66..0000000 --- a/mods/bg_funnel/node.lua +++ /dev/null @@ -1,27 +0,0 @@ -local modname = minetest.get_current_modname() - -local api = load_file("api") - -blockgame.register_node(modname .. ":funnel", { - description = "Funnel", - tiles = { - modname .. "_funnel_top.png", - modname .. "_funnel_top.png", - modname .. "_funnel.png", - }, - groups = { - woody = 1, - }, - on_place = function (...) - return api.place_funnel(...) - end, - on_dig = function (...) - return api.dig_funnel(...) - end, - preserve_metadata = function (pos, node, meta, drops) - -- TODO: store funnel contents inside dropped item. - end, - after_place_node = function (pos, placer, item_stack) - -- TODO: recreate funnel contents from placed item. - end, -}) diff --git a/mods/bg_funnel/recipe.lua b/mods/bg_funnel/recipe.lua deleted file mode 100644 index 15a9039..0000000 --- a/mods/bg_funnel/recipe.lua +++ /dev/null @@ -1,16 +0,0 @@ -local modname = minetest.get_current_modname() - -blockgame.crafting.register_pummel_recipe({ - label = "pummel logs into funnel", - used_item = "woodworking:plank", - target_node = "bg_tree:log", - check = function (pos, used_node, target_node) - local below = pos + blockgame.vector.dirs.down - return minetest.get_node(below).name == "bg_tree:log" - end, - on_success = function (pos, used_node, target_node) - local below = pos + blockgame.vector.dirs.down - minetest.remove_node(pos) - minetest.set_node(below, {name = modname .. ":funnel"}) - end, -}) diff --git a/mods/bg_funnel/textures/bg_funnel_funnel.png b/mods/bg_funnel/textures/bg_funnel_funnel.png deleted file mode 100644 index 5e5ffca84089a1912fc88a2a708174e2af88acc2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5505 zcmeHKdpJ~U7oSpya@3J~8Ka1r`+b;P#yxi`@=1GU?_t8sm>G;xC)ZLZsgo`omCH$- zQYuVQAxTk*T#`zuqbtQhLVbINZqIlA>3P2MU;BCX%--+&Tfeo|?_GQCcc*%JIL%Sh zS3@8Wb6lM5ec*ph`KhW5{~8T`1Q3WBmp1tMOMHMBq);T_^1>mcBvuF^At{fGKu9}J ztO_hkGSwUpnIACy{tYo*Rpb$!{41$pz$0q!jo z^EqR~{D&zljnz&jN;xK{F+ItToTVU`HfBW-;op@vyDr>)1D8A)QhVl1T4i zjY?rX@gcm_w#E|6(<(D6qs?5)iMUMqj6(QB|EZ`5X$ z;pUx&1KY>BSYEQO?uDkHuvw)#J1zD^R@Lmx<(h9wi3((uTzV?p@LJ2y0LKfd)sr;q zWm+)uS}2Vscv>-d%q!P*qY)9x50!@O+D%`&k3Sn}F4||R+~QI6YO(8X1n{KT*rZaF zvyd_@JeYuS)v56@rI}O?ob()ONiHp0i)sdds`tElLY>6D{Ce+Go9=B}zSFqwz`O)gsfW}O zuyr*MoIZGi&mRoz$nEq=i93CbQt?V$k1wckP}8rJJzlY-BtJXanMbX-f4^_!)K%t6 z=M%2v)>W%76y?-qYKJAZ-5XVJ3q4hrU0BwHZCf|A`TUWx?2bA;T@DM`l}N@Z1Js)m zBu9pCr(GUV4FdFBIvqW7>U4EUmL(_7$_yIKkG#9|=4jlr%D2Bj9^@CB>$|ecJ&$J$ zXVhnxfXN$XP{b%lSs~$cj-1MvcQ+D@NGl`oYh5K?A!7s97-T91_ zCsRh78*NYcmxo`p3YhD8=>^?DFI|>ueunv`WmMVdPrUli_5U&L5PL_qxBEUnlK^V>tO-5k(~qD1wk?f3kX+ey5i#cf|Bc2kY& zx=ve>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}h~rS_O&3a3#t)@i+`|l2^Vg3^*BBSU_HH~9#J^AuA^q@rvY0B6#P7>I^Ig(KK*a*7iQ z@IxT@`JO7MPvg9QS}YEiOrk+#GzG$O(Ig6vgQihQ0GdvKK#)cU*aQmkTXwO4D~SO_ zkZlN@DVz;lK#FXTOB7O?e~XR@h2%Qn2t+g$?>A zF7S`)`XSeMDezt3AJz4LlS}Q(2M@%DcR?}m=gi*Uep&^83MsQ!IN2kXArcWrzsUa$u7&PW$Z|g^E$na_4D;aANEp2kwc9K%H%zMW_3RbQ!TCzV>$*p`V zq^jPs-?KtnYE}1_q|5DPt6D-qsR|;0FSkb5AGL_Z>c$o*U5qa+>zOCM zik?xKcNLtAvUq50F&$&{Cha`0w_(1Z-zYo1YVHjUS*Ct-@8RPO*|uj2f{xMY1_!e= z3tT)&gF~5nSqo9((c1|v-LFqIb{9+pdY|ipnzWx&YkyCT+8z|ks2&x~L>LYS=I`C! zG7m+4N`FJj%wx+y76k(s61 f^|>#Wj_U*;c9vd<&V17V%Yblk@USnoTbJ-(XWDvJ diff --git a/mods/bg_funnel/textures/bg_funnel_funnel_top.png b/mods/bg_funnel/textures/bg_funnel_funnel_top.png deleted file mode 100644 index 0a44dd143fee4bc281c27d57f7880a8d92c19ead..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 766 zcmVEX>4Tx04R}tkv&MmKpe$iQ;Vfk9qb_LkfAzR5EXIMDionYsTEpvFuC*#nlvOS zE{=k0!NHHks)LKOt`4q(Aou~|>f)s6A|?JWDYS_3;J6>}?mh0_0Yam~RI_UwP&La) zC*oo@w<>nOB7|N9F@%7`OnokuO2Tt|-NVP%yBN>%KKJM7QSv4Od?N8I(+!JwgLrz= z(mC%FM_5Txh|h_~47wokBiCh@-#8Z?7Ib`7 zkz)Z>sE`~#_#gc4)+|g;xJltS5O}fej}f4I7iiXP`}^3onsZeT624A?c?+T$WT|w8{ps& z7%fuvy2rbNoxS~grq$mM5$eSad^gZEa<4bO1wgWnpw> zWFU8GbZ8()Nlj2!fese{007oWL_t(I%av2n4#F@9#6nZMrAvJF+5i7HmzbDB^kGsd z>CC*R26|UG=;?O7yx@a~s7F8|000nX@Tel~OiDx|5avd-LRQ4)tH>sxK_r6vy239k zr8Loq2&83OVr3bUBVoHY=lpG9M0`AJN1jq_`AFD%VBv{AKBd_C5%!!uir~j`6l#3% zWBUifyj5@%w*Rh$b4rIrbOP#I@CHsP4qvjdrIha`S_4(RvJ6H1>unFJ2+TRRRkn-b wp&K|{Bw_9@?EOevb+AEAAW`@0{13Ev0};Jq9|I#EV*mgE07*qoM6N<$f?iWfRR910