From baa7b8875bf475e2b018cdfc1c14c3bc25d13b5b Mon Sep 17 00:00:00 2001 From: LeMagnesium Date: Fri, 1 May 2015 14:38:17 +0200 Subject: [PATCH] Updated minetestforfun_game - Added default:meselamps - Added shelf:vessel - Merged cactus/papyrus override possibility --- minetestforfun_game/mods/default/README.txt | 2 + minetestforfun_game/mods/default/crafting.lua | 8 ++ .../mods/default/functions.lua | 99 ++++++++++-------- minetestforfun_game/mods/default/nodes.lua | 16 +++ .../default/textures/default_meselamp.png | Bin 0 -> 3399 bytes minetestforfun_game/mods/vessels/init.lua | 81 ++++++++++++++ .../mods/vessels/textures/vessels_shelf.png | Bin 0 -> 354 bytes 7 files changed, 163 insertions(+), 43 deletions(-) create mode 100644 minetestforfun_game/mods/default/textures/default_meselamp.png create mode 100644 minetestforfun_game/mods/vessels/textures/vessels_shelf.png diff --git a/minetestforfun_game/mods/default/README.txt b/minetestforfun_game/mods/default/README.txt index 888aae46..9a7e1930 100755 --- a/minetestforfun_game/mods/default/README.txt +++ b/minetestforfun_game/mods/default/README.txt @@ -131,6 +131,8 @@ BlockMen (CC BY-SA 3.0): default_chest_lock.png default_chest_side.png default_chest_top.png + default_mineral_mese.png + default_meselamp.png bubble.png heart.png gui_*.png diff --git a/minetestforfun_game/mods/default/crafting.lua b/minetestforfun_game/mods/default/crafting.lua index e1050445..b9da9a4f 100644 --- a/minetestforfun_game/mods/default/crafting.lua +++ b/minetestforfun_game/mods/default/crafting.lua @@ -667,6 +667,14 @@ minetest.register_craft({ recipe = {{"default:mese_crystal"}}, }) +minetest.register_craft({ + output = 'default:meselamp 1', + recipe = { + {'', 'default:mese_crystal',''}, + {'default:mese_crystal', 'default:glass', 'default:mese_crystal'}, + } +}) + minetest.register_craft({ output = "default:obsidian_shard 9", recipe = {{"default:obsidian"}}, diff --git a/minetestforfun_game/mods/default/functions.lua b/minetestforfun_game/mods/default/functions.lua index 44c8896d..ec4ebcd3 100644 --- a/minetestforfun_game/mods/default/functions.lua +++ b/minetestforfun_game/mods/default/functions.lua @@ -225,8 +225,8 @@ minetest.register_abm({ neighbors = {"group:water"}, interval = 2, chance = 1, - action = function(pos, node, active_object_count, active_object_count_wider) - default.cool_lava_flowing(pos, node, active_object_count, active_object_count_wider) + action = function(...) + default.cool_lava_flowing(...) end, }) @@ -235,8 +235,8 @@ minetest.register_abm({ neighbors = {"group:water"}, interval = 2, chance = 1, - action = function(pos, node, active_object_count, active_object_count_wider) - default.cool_lava_source(pos, node, active_object_count, active_object_count_wider) + action = function(...) + default.cool_lava_source(...) end, }) @@ -244,27 +244,61 @@ minetest.register_abm({ -- Papyrus and cactus growing -- +function default.grow_cactus(pos, node) + if node.param2 ~= 0 then + return + end + pos.y = pos.y-1 + if minetest.get_item_group(minetest.get_node(pos).name, "sand") == 0 then + return + end + pos.y = pos.y+1 + local height = 0 + while node.name == "default:cactus" and height < 4 and node.param2 == 0 do + height = height+1 + pos.y = pos.y+1 + node = minetest.get_node(pos) + end + if height == 4 + or node.name ~= "air" then + return + end + minetest.set_node(pos, {name="default:cactus"}) + return true +end + +function default.grow_papyrus(pos, node) + pos.y = pos.y-1 + local name = minetest.get_node(pos).name + if name ~= "default:dirt_with_grass" + and name ~= "default:dirt" then + return + end + if not minetest.find_node_near(pos, 3, {"group:water"}) then + return + end + pos.y = pos.y+1 + local height = 0 + while node.name == "default:papyrus" and height < 4 do + height = height+1 + pos.y = pos.y+1 + node = minetest.get_node(pos) + end + if height == 4 + or node.name ~= "air" then + return + end + minetest.set_node(pos, {name="default:papyrus"}) + return true +end + minetest.register_abm({ nodenames = {"default:cactus"}, neighbors = {"group:sand"}, interval = 60, chance = 25, - action = function(pos, node) - pos.y = pos.y - 1 - local name = minetest.get_node(pos).name - if minetest.get_item_group(name, "sand") ~= 0 then - pos.y = pos.y + 1 - local height = 0 - while minetest.get_node(pos).name == "default:cactus" and height < 4 do - height = height + 1 - pos.y = pos.y + 1 - end - if height < 4 then - if minetest.get_node(pos).name == "air" then - minetest.set_node(pos, {name = "default:cactus"}) - end - end - end + action = function(...) + default.grow_cactus(...) end, }) @@ -273,29 +307,8 @@ minetest.register_abm({ neighbors = {"default:dirt", "default:dirt_with_grass", "default:dirt_with_snow", "default:sand", "default:desert_sand"}, interval = 60, chance = 25, - action = function(pos, node) - pos.y = pos.y - 1 - local name = minetest.get_node(pos).name - if name == "default:dirt" - or name == "default:dirt_with_grass" - or name == "default:dirt_with_snow" - or name == "default:sand" - or name == "default:desert_sand" then - if minetest.find_node_near(pos, 3, {"group:water"}) == nil then - return - end - pos.y = pos.y + 1 - local height = 0 - while minetest.get_node(pos).name == "default:papyrus" and height < 4 do - height = height + 1 - pos.y = pos.y + 1 - end - if height < 4 then - if minetest.get_node(pos).name == "air" then - minetest.set_node(pos, {name = "default:papyrus"}) - end - end - end + action = function(...) + default.grow_papyrus(...) end, }) diff --git a/minetestforfun_game/mods/default/nodes.lua b/minetestforfun_game/mods/default/nodes.lua index 9f68bc93..0da09368 100644 --- a/minetestforfun_game/mods/default/nodes.lua +++ b/minetestforfun_game/mods/default/nodes.lua @@ -264,6 +264,7 @@ minetest.register_node("default:desert_stone_with_copper", { minetest.register_node("default:stone_with_mese", { description = "Mese Ore", tiles = {"default_stone.png^default_mineral_mese.png"}, + paramtype = "light", is_ground_content = true, groups = {cracky = 3}, drop = { @@ -274,6 +275,7 @@ minetest.register_node("default:stone_with_mese", { }, }, sounds = default.node_sound_stone_defaults(), + light_source = 1, }) minetest.register_node("default:stone_with_gold", { @@ -507,6 +509,18 @@ minetest.register_node("default:brick", { sounds = default.node_sound_stone_defaults(), }) +minetest.register_node("default:meselamp", { + description = "Mese Lamp", + drawtype = "glasslike", + tiles = {"default_meselamp.png"}, + paramtype = "light", + sunlight_propagates = true, + is_ground_content = false, + groups = {cracky = 3, oddly_breakable_by_hand = 3}, + sounds = default.node_sound_glass_defaults(), + light_source = 12, +}) + minetest.register_node("default:tree", { description = "Tree", tiles = {"default_tree_top.png", "default_tree_top.png", "default_tree.png"}, @@ -1511,6 +1525,7 @@ minetest.register_node("default:bronzeblock", { minetest.register_node("default:mese", { description = "Mese Block", tiles = {"default_mese_block.png"}, + paramtype = "light", is_ground_content = true, drop = { items = { @@ -1520,6 +1535,7 @@ minetest.register_node("default:mese", { }, groups = {cracky = 1, level = 2, fall_damage_add_percent = -75}, sounds = default.node_sound_wood_defaults(), -- Intended. + light_source = 3, }) local function die_later(digger) diff --git a/minetestforfun_game/mods/default/textures/default_meselamp.png b/minetestforfun_game/mods/default/textures/default_meselamp.png new file mode 100644 index 0000000000000000000000000000000000000000..b227a2549a5a318153e2bf8c094c3dec905892b5 GIT binary patch literal 3399 zcmV-N4Y=}&P)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd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FP>U*_J`Tc!X2002ovPDHLkV1m)DRE+=t literal 0 HcmV?d00001 diff --git a/minetestforfun_game/mods/vessels/init.lua b/minetestforfun_game/mods/vessels/init.lua index 6ca8771b..d5bef81a 100644 --- a/minetestforfun_game/mods/vessels/init.lua +++ b/minetestforfun_game/mods/vessels/init.lua @@ -1,6 +1,87 @@ -- Minetest 0.4 mod: vessels -- See README.txt for licensing and other information. +local vessels_shelf_formspec = + "size[8,7;]".. + default.gui_bg.. + default.gui_bg_img.. + default.gui_slots.. + "list[context;vessels;0,0.3;8,2;]".. + "list[current_player;main;0,2.85;8,1;]".. + "list[current_player;main;0,4.08;8,3;8]".. + default.get_hotbar_bg(0,2.85) + +minetest.register_node("vessels:shelf", { + description = "Vessels shelf", + tiles = {"default_wood.png", "default_wood.png", "default_wood.png^vessels_shelf.png"}, + is_ground_content = false, + groups = {choppy=3,oddly_breakable_by_hand=2,flammable=3}, + sounds = default.node_sound_wood_defaults(), + + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("formspec", vessels_shelf_formspec) + local inv = meta:get_inventory() + inv:set_size("vessels", 8*2) + end, + can_dig = function(pos,player) + local meta = minetest.get_meta(pos); + local inv = meta:get_inventory() + return inv:is_empty("vessels") + end, + + allow_metadata_inventory_put = function(pos, listname, index, stack, player) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + local to_stack = inv:get_stack(listname, index) + if listname == "vessels" then + if minetest.get_item_group(stack:get_name(), "vessel") ~= 0 + and to_stack:is_empty() then + return 1 + else + return 0 + end + end + end, + + allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + local stack = inv:get_stack(from_list, from_index) + local to_stack = inv:get_stack(to_list, to_index) + if to_list == "vessels" then + if minetest.get_item_group(stack:get_name(), "vessel") ~= 0 + and to_stack:is_empty() then + return 1 + else + return 0 + end + end + end, + + on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) + minetest.log("action", player:get_player_name().. + " moves stuff in vessels shelf at "..minetest.pos_to_string(pos)) + end, + on_metadata_inventory_put = function(pos, listname, index, stack, player) + minetest.log("action", player:get_player_name().. + " moves stuff to vessels shelf at "..minetest.pos_to_string(pos)) + end, + on_metadata_inventory_take = function(pos, listname, index, stack, player) + minetest.log("action", player:get_player_name().. + " takes stuff from vessels shelf at "..minetest.pos_to_string(pos)) + end, +}) + +minetest.register_craft({ + output = 'vessels:shelf', + recipe = { + {'group:wood', 'group:wood', 'group:wood'}, + {'group:vessel', 'group:vessel', 'group:vessel'}, + {'group:wood', 'group:wood', 'group:wood'}, + } +}) + minetest.register_node("vessels:glass_bottle", { description = "Glass Bottle (empty)", drawtype = "plantlike", diff --git a/minetestforfun_game/mods/vessels/textures/vessels_shelf.png b/minetestforfun_game/mods/vessels/textures/vessels_shelf.png new file mode 100644 index 0000000000000000000000000000000000000000..87c69b28954009b8d719d477168a53fd91cde343 GIT binary patch literal 354 zcmV-o0iFJdP)advkbhYH?&!Om$f;UqURgvB+>{^q3-MBCadP1 z+#F25()H5Nw7VTJV{GHXa@$=T1hXynEHexD1+yRvcurvH-T(jq07*qoM6N<$f|F^B AV*mgE literal 0 HcmV?d00001