From 773c760727847134c5e09a7402cf0300bdb894ee Mon Sep 17 00:00:00 2001 From: Michieal Date: Wed, 14 Dec 2022 23:02:08 -0500 Subject: [PATCH] Added Bamboo Mosaic. Added Tiki Lamp (extras) - Requires mcl_lanterns to be fixed to allow API to be called from other mods. Moved Side Scaffolding to bambootoo.lua --- mods/ITEMS/mcl_bamboo/bambootoo.lua | 122 ++++++++++++++++++ mods/ITEMS/mcl_bamboo/extras.lua | 40 ++++++ mods/ITEMS/mcl_bamboo/init.lua | 55 ++------ mods/ITEMS/mcl_bamboo/mod.conf | 2 +- .../extras/mcl_bamboo_extras_tikilamp.png | Bin 0 -> 231 bytes .../extras/mcl_bamboo_extras_tikilamp_inv.png | Bin 0 -> 175 bytes .../mcl_bamboo_bamboo_plank_mosaic.png | Bin 0 -> 520 bytes 7 files changed, 171 insertions(+), 48 deletions(-) create mode 100644 mods/ITEMS/mcl_bamboo/bambootoo.lua create mode 100644 mods/ITEMS/mcl_bamboo/extras.lua create mode 100644 mods/ITEMS/mcl_bamboo/textures/extras/mcl_bamboo_extras_tikilamp.png create mode 100644 mods/ITEMS/mcl_bamboo/textures/extras/mcl_bamboo_extras_tikilamp_inv.png create mode 100644 mods/ITEMS/mcl_bamboo/textures/mcl_bamboo_bamboo_plank_mosaic.png diff --git a/mods/ITEMS/mcl_bamboo/bambootoo.lua b/mods/ITEMS/mcl_bamboo/bambootoo.lua new file mode 100644 index 000000000..11b47b83c --- /dev/null +++ b/mods/ITEMS/mcl_bamboo/bambootoo.lua @@ -0,0 +1,122 @@ +--- +--- Generated by EmmyLua(https://github.com/EmmyLua) +--- Created by michieal. +--- DateTime: 12/14/22 10:11 PM +--- + +-- LOCALS +local modname = minetest.get_current_modname() +local S = minetest.get_translator(modname) +local bamboo = "mcl_bamboo:bamboo" +local adj_nodes = { + vector.new(0, 0, 1), + vector.new(0, 0, -1), + vector.new(1, 0, 0), + vector.new(-1, 0, 0), +} +local SIDE_SCAFFOLDING = false + + +local function bambootoo_create_nodes() + local bamboo_mosaic = minetest.registered_nodes[bamboo .. "_plank"] + bamboo_mosaic.tiles = {"mcl_bamboo_bamboo_plank.png"} + bamboo_mosaic.groups = {handy = 1, axey = 1, flammable = 3, fire_encouragement = 5, fire_flammability = 20} + bamboo_mosaic.description = S("Bamboo Mosaic Plank") + bamboo_mosaic._doc_items_longdesc = S("Bamboo Mosaic Plank") + minetest.register_node("mcl_bamboo:bamboo_mosaic",bamboo_mosaic) + -- crafted by "mcl_stair:slab_bamboo_plank", "mcl_stair:slab_bamboo_block", "mcl_stair:slab_bamboo_stripped" + if minetest.get_modpath("mcl_stairs") then + if mcl_stairs ~= nil then + mcl_stairs.register_stair_and_slab_simple( + "bamboo_mosaic", + "mcl_bamboo:bamboo_mosaic", + S("Bamboo Stair"), + S("Bamboo Slab"), + S("Double Bamboo Slab") + ) + end + end + + if SIDE_SCAFFOLDING then + --currently, disabled. + minetest.register_node("mcl_bamboo:scaffolding_horizontal", { + description = S("Scaffolding (horizontal)"), + doc_items_longdesc = S("Scaffolding block used to climb up or out across areas."), + doc_items_hidden = false, + tiles = {"mcl_bamboo_scaffolding_top.png", "mcl_bamboo_scaffolding_top.png", "mcl_bamboo_scaffolding_bottom.png"}, + drawtype = "nodebox", + paramtype = "light", + use_texture_alpha = "clip", + node_box = { + type = "fixed", + fixed = { + {-0.5, 0.375, -0.5, 0.5, 0.5, 0.5}, + {-0.5, -0.5, -0.5, -0.375, 0.5, -0.375}, + {0.375, -0.5, -0.5, 0.5, 0.5, -0.375}, + {0.375, -0.5, 0.375, 0.5, 0.5, 0.5}, + {-0.5, -0.5, 0.375, -0.375, 0.5, 0.5}, + {-0.5, -0.5, -0.5, 0.5, -0.375, 0.5}, + } + }, + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, + }, + }, + groups = {handy = 1, axey = 1, flammable = 3, building_block = 1, material_wood = 1, fire_encouragement = 5, fire_flammability = 20, not_in_creative_inventory = 1, falling_node = 1}, + _mcl_after_falling = function(pos) + if minetest.get_node(pos).name == "mcl_bamboo:scaffolding_horizontal" then + if minetest.get_node(vector.offset(pos, 0, 0, 0)).name ~= "mcl_bamboo:scaffolding" then + minetest.remove_node(pos) + minetest.add_item(pos, "mcl_bamboo:scaffolding") + else + minetest.set_node(vector.offset(pos, 0, 1, 0), {name = "mcl_bamboo:scaffolding"}) + end + end + end + }) + end + + +end + +local function bambootoo_register_craftings() + + minetest.register_craft({ + output = bamboo .. "_mosaic", + recipe = { + {"mcl_stair:slab_bamboo_plank"}, + {"mcl_stair:slab_bamboo_plank"}, + } + }) + + minetest.register_craft({ + output = bamboo .. "_mosaic", + recipe = { + {"mcl_stair:slab_bamboo_block"}, + {"mcl_stair:slab_bamboo_block"}, + } + }) + + minetest.register_craft({ + output = bamboo .. "_mosaic", + recipe = { + {"mcl_stair:slab_bamboo_stripped"}, + {"mcl_stair:slab_bamboo_stripped"}, + } + }) + + -- Fuels... + + minetest.register_craft({ + type = "fuel", + recipe = bamboo .. "_mosaic", + burntime = 7.5, + }) + +end + + +bambootoo_create_nodes() +bambootoo_register_craftings() \ No newline at end of file diff --git a/mods/ITEMS/mcl_bamboo/extras.lua b/mods/ITEMS/mcl_bamboo/extras.lua new file mode 100644 index 000000000..199760bc2 --- /dev/null +++ b/mods/ITEMS/mcl_bamboo/extras.lua @@ -0,0 +1,40 @@ +--- +--- Generated by EmmyLua(https://github.com/EmmyLua) +--- Created by michieal. +--- DateTime: 12/14/22 10:14 PM +--- + + +local modname = minetest.get_current_modname() +local S = minetest.get_translator(modname) +local bamboo = "mcl_bamboo:bamboo" + +local function tiki_lamp() + if minetest.get_modpath("mcl_lanterns") then + if mcl_lanterns ~= nil then + mcl_lanterns.register_lantern("tikilamp", { + description = S("Tiki Lamp"), + longdesc = S("Tiki Lamps are light sources which can be placed on the top or the bottom of most blocks."), + texture = "mcl_bamboo_extras_tikilamp.png", + texture_inv = "mcl_bamboo_extras_tikilamp_inv.png", + light_level = 14, + }) + + minetest.register_craft({ + output = "mcl_lanterns:tikilamp_floor", + recipe = { + {bamboo, bamboo,bamboo}, + {bamboo, "mcl_torches:torch", bamboo}, + {bamboo, bamboo,bamboo}, + }, + }) + end + end +end + + + + + +-- ------------------------------------ +tiki_lamp() \ No newline at end of file diff --git a/mods/ITEMS/mcl_bamboo/init.lua b/mods/ITEMS/mcl_bamboo/init.lua index fcadd8bba..2728c1a0e 100644 --- a/mods/ITEMS/mcl_bamboo/init.lua +++ b/mods/ITEMS/mcl_bamboo/init.lua @@ -8,12 +8,6 @@ local modname = minetest.get_current_modname() local S = minetest.get_translator(modname) local bamboo = "mcl_bamboo:bamboo" -local adj_nodes = { - vector.new(0, 0, 1), - vector.new(0, 0, -1), - vector.new(1, 0, 0), - vector.new(-1, 0, 0), -} local node_sound = mcl_sounds.node_sound_wood_defaults() -- CONSTS @@ -558,46 +552,6 @@ local function create_nodes() }) - if SIDE_SCAFFOLDING then - --currently, disabled. - minetest.register_node("mcl_bamboo:scaffolding_horizontal", { - description = S("Scaffolding (horizontal)"), - doc_items_longdesc = S("Scaffolding block used to climb up or out across areas."), - doc_items_hidden = false, - tiles = {"mcl_bamboo_scaffolding_top.png", "mcl_bamboo_scaffolding_top.png", "mcl_bamboo_scaffolding_bottom.png"}, - drawtype = "nodebox", - paramtype = "light", - use_texture_alpha = "clip", - node_box = { - type = "fixed", - fixed = { - {-0.5, 0.375, -0.5, 0.5, 0.5, 0.5}, - {-0.5, -0.5, -0.5, -0.375, 0.5, -0.375}, - {0.375, -0.5, -0.5, 0.5, 0.5, -0.375}, - {0.375, -0.5, 0.375, 0.5, 0.5, 0.5}, - {-0.5, -0.5, 0.375, -0.375, 0.5, 0.5}, - {-0.5, -0.5, -0.5, 0.5, -0.375, 0.5}, - } - }, - selection_box = { - type = "fixed", - fixed = { - {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, - }, - }, - groups = {handy = 1, axey = 1, flammable = 3, building_block = 1, material_wood = 1, fire_encouragement = 5, fire_flammability = 20, not_in_creative_inventory = 1, falling_node = 1}, - _mcl_after_falling = function(pos) - if minetest.get_node(pos).name == "mcl_bamboo:scaffolding_horizontal" then - if minetest.get_node(vector.offset(pos, 0, 0, 0)).name ~= "mcl_bamboo:scaffolding" then - minetest.remove_node(pos) - minetest.add_item(pos, "mcl_bamboo:scaffolding") - else - minetest.set_node(vector.offset(pos, 0, 1, 0), {name = "mcl_bamboo:scaffolding"}) - end - end - end - }) - end end local function register_craftings() @@ -701,6 +655,12 @@ register_craftings() -- MAPGEN dofile(minetest.get_modpath(modname) .. "/mapgen.lua") +-- BAMBOO_TOO (Bamboo two) +dofile(minetest.get_modpath(modname) .. "/bambootoo.lua") + +-- BAMBOO EXTRAS +dofile(minetest.get_modpath(modname) .. "/extras.lua") + --ABMs minetest.register_abm({ nodenames = {"mcl_bamboo:bamboo"}, @@ -753,6 +713,7 @@ minetest.register_alias("bamboo_block", "mcl_bamboo:bamboo_block") minetest.register_alias("bamboo_strippedblock", "mcl_bamboo:bamboo_block_stripped") minetest.register_alias("bamboo", "mcl_bamboo:bamboo") minetest.register_alias("bamboo_plank", "mcl_bamboo:bamboo_plank") +minetest.register_alias("bamboo_mosaic", "mcl_bamboo:bamboo_mosaic") minetest.register_alias("mcl_stairs:stair_bamboo", "mcl_stairs:stair_bamboo_block") minetest.register_alias("bamboo:bamboo", "mcl_bamboo:bamboo") @@ -760,7 +721,7 @@ minetest.register_alias("bamboo:bamboo", "mcl_bamboo:bamboo") --[[ todo -- make scaffolds do side scaffold blocks, so that they jut out. todo -- Also, make those blocks collapse (break) when a nearby connected scaffold breaks. -todo -- add in alternative bamboo styles to simulate random placement. (see commented out nde box definitions. +todo -- add in alternative bamboo styles to simulate random placement. (see commented out node box definitions. todo -- make endcap node for bamboo, so that they can be 12-16 nodes high and stop growing. todo -- mash all of that together so that it drops as one item, and chooses what version to be, in on_place. todo -- Raft diff --git a/mods/ITEMS/mcl_bamboo/mod.conf b/mods/ITEMS/mcl_bamboo/mod.conf index d4b93a7d9..57f97a5a4 100644 --- a/mods/ITEMS/mcl_bamboo/mod.conf +++ b/mods/ITEMS/mcl_bamboo/mod.conf @@ -1,4 +1,4 @@ name = mcl_bamboo depends = mcl_core, mcl_sounds, mcl_tools -optional_depends = mcl_flowerpots, mclx_stairs, mcl_doors, mcl_signs, mesecons_pressureplates, mcl_fences, mesecons_button +optional_depends = mcl_flowerpots, mclx_stairs, mcl_doors, mcl_signs, mesecons_pressureplates, mcl_fences, mesecons_button, mcl_lanterns author = Michieal \ No newline at end of file diff --git a/mods/ITEMS/mcl_bamboo/textures/extras/mcl_bamboo_extras_tikilamp.png b/mods/ITEMS/mcl_bamboo/textures/extras/mcl_bamboo_extras_tikilamp.png new file mode 100644 index 0000000000000000000000000000000000000000..1595b587cef723b0c32a369113be94ec3a7a611d GIT binary patch literal 231 zcmVT%~}0000dP)t-s00000 z0078KGUabM@`gJ9rA+^^O#jk)|LUM4BO@#Eal|aXmS~fh{v& zRxhvGBnII|!%fo;UU3rLyf%t;Vsda;lfjO#rMe9UF~JLXwkL2jpFLv97%DEs!0`7p UPoh$z?^=+>p00i_>zopr0KfD&P5=M^ literal 0 HcmV?d00001 diff --git a/mods/ITEMS/mcl_bamboo/textures/mcl_bamboo_bamboo_plank_mosaic.png b/mods/ITEMS/mcl_bamboo/textures/mcl_bamboo_bamboo_plank_mosaic.png new file mode 100644 index 0000000000000000000000000000000000000000..97c5cb58f331742c650200888f9fc7d2efd1c655 GIT binary patch literal 520 zcmV+j0{8uiP)Q=HChU7pawg(aU3g>?xsJ^QSvWcIF7lUU52@_ zZ{N{l&s3!cXV8rq-^^~O-tXlv79XLo832dln$XlU%IcZYJi>!DnD;1cAvsbUaoPh= z1i%|Zdgx$WQQ#TPlU%!eu9-+OeK+Vao2g29IEsPs*HKLqyKY9RZ;fk-Gq((;v>` zC85X)oW19P)tIeOdZo$lP|Dxdjo<*1U64k-&ZRxh9WWP>U4d2b;)D#6%LfRlKVmMg zT5h&1uD%fM8C0;^{GDdzO}^LL4#*xAKp=QdLXbgJf$V<5pV~QMMc|H`77{;kc7}5u zQbDjNWLe(4fe;!L?@su~yD@PCdyF2VXLW#Ke43i819;9b-D19CRKi&c@fr>15I+zK z*J2j4d4k|JB<&`=+}=+ftPc4Nwr@O8huPsxbZeY{2~x+Roq;P+5;vDU=1Pn$acnVP z5{!{Jw$p&I$6Uw%RuCTZcIYiDd!9Y);8mT$`!oWX}EYv;aFa|9E0000< KMNUMnLSTXzE$L_g literal 0 HcmV?d00001