From f11fa6e6fe12bde9c964c20e0e87906f8149485d Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Fri, 14 Aug 2015 09:18:14 -0400 Subject: [PATCH] This mod has been mostly obsoleted by 0.4.13's mushrooms so simplify and revise it to act as a "3d-ify" mod for them. Unidenfied spores aliased to the regular default equivalents poison and essence aliased back to their originating mushrooms identifier aliased to mese crystal (most expensive component of it) everything else aliased to their default counterparts spores are not dropped from digging dirt with grass anymore --- 3dmushrooms/depends.txt | 2 + 3dmushrooms/init.lua | 68 +++++ .../models/3dmushrooms.obj | 0 .../textures/3dmushrooms_brown.png | Bin .../textures/3dmushrooms_brown_inv.png | Bin .../textures/3dmushrooms_red.png | Bin .../textures/3dmushrooms_red_inv.png | Bin mushroom/compat.lua | 41 --- mushroom/crafting.lua | 91 ------ mushroom/depends.txt | 3 - mushroom/init.lua | 261 ------------------ mushroom/textures/mushroom_essence.png | Bin 188 -> 0 bytes mushroom/textures/mushroom_identifier.png | Bin 123 -> 0 bytes mushroom/textures/mushroom_poison.png | Bin 183 -> 0 bytes mushroom/textures/mushroom_spore.png | Bin 92 -> 0 bytes mushroom/textures/mushroom_spore_brown.png | Bin 94 -> 0 bytes mushroom/textures/mushroom_spore_red.png | Bin 92 -> 0 bytes 17 files changed, 70 insertions(+), 396 deletions(-) create mode 100644 3dmushrooms/depends.txt create mode 100644 3dmushrooms/init.lua rename mushroom/models/plantlife_mushroom.obj => 3dmushrooms/models/3dmushrooms.obj (100%) rename mushroom/textures/mushroom_brown_3d.png => 3dmushrooms/textures/3dmushrooms_brown.png (100%) rename mushroom/textures/mushroom_brown_inv.png => 3dmushrooms/textures/3dmushrooms_brown_inv.png (100%) rename mushroom/textures/mushroom_red_3d.png => 3dmushrooms/textures/3dmushrooms_red.png (100%) rename mushroom/textures/mushroom_red_inv.png => 3dmushrooms/textures/3dmushrooms_red_inv.png (100%) delete mode 100644 mushroom/compat.lua delete mode 100644 mushroom/crafting.lua delete mode 100644 mushroom/depends.txt delete mode 100644 mushroom/init.lua delete mode 100644 mushroom/textures/mushroom_essence.png delete mode 100644 mushroom/textures/mushroom_identifier.png delete mode 100644 mushroom/textures/mushroom_poison.png delete mode 100644 mushroom/textures/mushroom_spore.png delete mode 100644 mushroom/textures/mushroom_spore_brown.png delete mode 100644 mushroom/textures/mushroom_spore_red.png diff --git a/3dmushrooms/depends.txt b/3dmushrooms/depends.txt new file mode 100644 index 0000000..abb01ae --- /dev/null +++ b/3dmushrooms/depends.txt @@ -0,0 +1,2 @@ +default +flowers diff --git a/3dmushrooms/init.lua b/3dmushrooms/init.lua new file mode 100644 index 0000000..369da9c --- /dev/null +++ b/3dmushrooms/init.lua @@ -0,0 +1,68 @@ + +-- 3D Mushroom mod by VanessaE +-- +-- License: WTFPL for everything. + +mushroom = {} + +minetest.override_item("flowers:mushroom_fertile_brown", { + drawtype = "mesh", + mesh = "3dmushrooms.obj", + tiles = {"3dmushrooms_brown.png"}, + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0, 0.3} + }, + inventory_image = "3dmushrooms_brown_inv.png" +}) + +minetest.override_item("flowers:mushroom_brown", { + drawtype = "mesh", + mesh = "3dmushrooms.obj", + tiles = {"3dmushrooms_brown.png"}, + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0, 0.3} + }, + inventory_image = "3dmushrooms_brown_inv.png" +}) + +minetest.override_item("flowers:mushroom_fertile_red", { + drawtype = "mesh", + mesh = "3dmushrooms.obj", + tiles = {"3dmushrooms_red.png"}, + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0, 0.3} + }, + inventory_image = "3dmushrooms_red_inv.png" +}) + +minetest.override_item("flowers:mushroom_red", { + drawtype = "mesh", + mesh = "3dmushrooms.obj", + tiles = {"3dmushrooms_red.png"}, + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0, 0.3} + }, + inventory_image = "3dmushrooms_red_inv.png" +}) + +-- aliases to the default mushrooms + +minetest.register_alias("mushroom:brown", "flowers:mushroom_brown") +minetest.register_alias("mushroom:brown_natural", "flowers:mushroom_fertile_brown") +minetest.register_alias("mushroom:spore_brown", "flowers:mushroom_spores_brown") +minetest.register_alias("mushroom:spore2", "flowers:mushroom_spores_brown") +minetest.register_alias("mushroom:brown_essence", "flowers:mushroom_brown") + +minetest.register_alias("mushroom:red", "flowers:mushroom_red") +minetest.register_alias("mushroom:red_natural", "flowers:mushroom_fertile_red") +minetest.register_alias("mushroom:spore_red", "flowers:mushroom_spores_red") +minetest.register_alias("mushroom:spore1", "flowers:mushroom_spores_red") +minetest.register_alias("mushroom:poison", "flowers:mushroom_red") + +minetest.register_alias("mushroom:identifier", "default:mese_crystal_fragment") + +print("[3D Mushrooms] loaded.") diff --git a/mushroom/models/plantlife_mushroom.obj b/3dmushrooms/models/3dmushrooms.obj similarity index 100% rename from mushroom/models/plantlife_mushroom.obj rename to 3dmushrooms/models/3dmushrooms.obj diff --git a/mushroom/textures/mushroom_brown_3d.png b/3dmushrooms/textures/3dmushrooms_brown.png similarity index 100% rename from mushroom/textures/mushroom_brown_3d.png rename to 3dmushrooms/textures/3dmushrooms_brown.png diff --git a/mushroom/textures/mushroom_brown_inv.png b/3dmushrooms/textures/3dmushrooms_brown_inv.png similarity index 100% rename from mushroom/textures/mushroom_brown_inv.png rename to 3dmushrooms/textures/3dmushrooms_brown_inv.png diff --git a/mushroom/textures/mushroom_red_3d.png b/3dmushrooms/textures/3dmushrooms_red.png similarity index 100% rename from mushroom/textures/mushroom_red_3d.png rename to 3dmushrooms/textures/3dmushrooms_red.png diff --git a/mushroom/textures/mushroom_red_inv.png b/3dmushrooms/textures/3dmushrooms_red_inv.png similarity index 100% rename from mushroom/textures/mushroom_red_inv.png rename to 3dmushrooms/textures/3dmushrooms_red_inv.png diff --git a/mushroom/compat.lua b/mushroom/compat.lua deleted file mode 100644 index c7a1009..0000000 --- a/mushroom/compat.lua +++ /dev/null @@ -1,41 +0,0 @@ - --- Redefine grass and dirt nodes - -minetest.override_item("default:dirt", { - drop = { - max_items = 2, - items = { - { - items = {"mushroom:spore1"}, - rarity = 40, - }, - { - items = {"mushroom:spore2"}, - rarity = 40, - }, - { - items = {"default:dirt"}, - } - } - } -}) - -minetest.override_item("default:dirt_with_grass", { - drop = { - max_items = 2, - items = { - { - items = {"mushroom:spore1"}, - rarity = 40, - }, - { - items = {"mushroom:spore2"}, - rarity = 40, - }, - { - items = {"default:dirt"}, - } - } - } -}) - diff --git a/mushroom/crafting.lua b/mushroom/crafting.lua deleted file mode 100644 index b05762b..0000000 --- a/mushroom/crafting.lua +++ /dev/null @@ -1,91 +0,0 @@ --- craft items - -minetest.register_craftitem("mushroom:spore1",{ - description = "Unidentified Mushroom Spore", - inventory_image = "mushroom_spore.png", - wield_image = "mushroom_spore.png", -}) - -minetest.register_craftitem("mushroom:spore2",{ - description = "Unidentified Mushroom Spore", - inventory_image = "mushroom_spore.png", - wield_image = "mushroom_spore.png", -}) - -minetest.register_craftitem("mushroom:identifier",{ - description = "Mushroom Spore Identifier/Spore Extractor", - inventory_image = "mushroom_identifier.png", - wield_image = "mushroom_identifier.png", -}) - -minetest.register_craftitem("mushroom:brown_essence",{ - description = "Healthy Brown Mushroom Essence", - inventory_image = "mushroom_essence.png", - wield_image = "mushroom_essence.png", - on_use = minetest.item_eat(10), -}) - -minetest.register_craftitem("mushroom:poison",{ - description = "Red Mushroom Poison", - inventory_image = "mushroom_poison.png", - wield_image = "mushroom_poison.png", - on_use = minetest.item_eat(-10), -}) - --- recipes - -minetest.register_craft( { - output = "mushroom:identifier", - recipe = { - { "", "default:torch", "" }, - { "default:steel_ingot", "default:mese_crystal_fragment", "default:steel_ingot" }, - } -}) - -minetest.register_craft( { - type = "shapeless", - output = "mushroom:brown_essence", - recipe = { "mushroom:brown" , "vessels:glass_bottle" }, -}) - -minetest.register_craft( { - type = "shapeless", - output = "mushroom:poison", - recipe = { "mushroom:red" , "vessels:glass_bottle" }, -}) - -minetest.register_craft( { - type = "shapeless", - output = "mushroom:spore_brown", - recipe = { "mushroom:identifier" , "mushroom:spore1" }, - replacements = { - { 'mushroom:identifier', 'mushroom:identifier' } - } -}) - -minetest.register_craft( { - type = "shapeless", - output = "mushroom:spore_red", - recipe = { "mushroom:identifier" , "mushroom:spore2" }, - replacements = { - { 'mushroom:identifier', 'mushroom:identifier' } - } -}) - -minetest.register_craft( { - type = "shapeless", - output = "mushroom:spore_red 2", - recipe = { "mushroom:identifier" , "mushroom:red" }, - replacements = { - { 'mushroom:identifier', 'mushroom:identifier' } - } -}) - -minetest.register_craft( { - type = "shapeless", - output = "mushroom:spore_brown 2", - recipe = { "mushroom:identifier" , "mushroom:brown" }, - replacements = { - { 'mushroom:identifier', 'mushroom:identifier' } - } -}) diff --git a/mushroom/depends.txt b/mushroom/depends.txt deleted file mode 100644 index 0a3c3f8..0000000 --- a/mushroom/depends.txt +++ /dev/null @@ -1,3 +0,0 @@ -default -vessels? -woodsoils? diff --git a/mushroom/init.lua b/mushroom/init.lua deleted file mode 100644 index 8c5b9ee..0000000 --- a/mushroom/init.lua +++ /dev/null @@ -1,261 +0,0 @@ - --- Mushroom mod by DanDuncombe and VanessaE --- --- License: CC-By-SA for texures derived from Minetest defaults, --- WTFPL for all code and everything else. - -mushroom = {} - -minetest.register_node("mushroom:brown",{ - description = "Brown Mushroom", - drawtype = "mesh", - mesh = "plantlife_mushroom.obj", - tiles = {"mushroom_brown_3d.png"}, - sunlight_propagates = true, - inventory_image = "mushroom_brown_inv.png", - groups = {oddly_breakable_by_hand=3,attached_node=1}, - paramtype = "light", - walkable = false, - on_use = minetest.item_eat(5), - selection_box = { - type = "fixed", - fixed = {-0.3, -0.5, -0.3, 0.3, 0, 0.3} - }, - drop = "mushroom:brown", -}) - -minetest.register_node("mushroom:red",{ - description = "Red Mushroom", - drawtype = "mesh", - mesh = "plantlife_mushroom.obj", - tiles = {"mushroom_red_3d.png"}, - sunlight_propagates = true, - inventory_image = "mushroom_red_inv.png", - groups = {oddly_breakable_by_hand=3,attached_node=1}, - paramtype = "light", - walkable = false, - on_use = minetest.item_eat(-5), - selection_box = { - type = "fixed", - fixed = {-0.3, -0.5, -0.3, 0.3, 0, 0.3} - }, - drop = "mushroom:red", -}) - -minetest.register_node("mushroom:spore_brown",{ - description = "Brown Mushroom Spore", - drawtype = "raillike", - paramtype = "light", - tiles = {"mushroom_spore_brown.png"}, - sunlight_propagates = true, - walkable = false, - groups = {oddly_breakable_by_hand=3,attached_node=1}, - inventory_image = "mushroom_spore_brown.png", - wield_image = "mushroom_spore_brown.png", - selection_box = { - type = "fixed", - fixed = {-0.5, -0.5, -0.5, 0.5, -0.4, 0.5} - }, -}) - -minetest.register_node("mushroom:spore_red",{ - description = "Red Mushroom Spore", - drawtype = "raillike", - paramtype = "light", - tiles = {"mushroom_spore_red.png"}, - sunlight_propagates = true, - walkable = false, - groups = {oddly_breakable_by_hand=3,attached_node=1}, - inventory_image = "mushroom_spore_red.png", - wield_image = "mushroom_spore_red.png", - selection_box = { - type = "fixed", - fixed = {-0.5, -0.5, -0.5, 0.5, -0.4, 0.5} - }, -}) - ---Natural Mushrooms - -minetest.register_node("mushroom:brown_natural",{ - description = "Brown Mushroom (Naturally Spawned)", - drawtype = "mesh", - mesh = "plantlife_mushroom.obj", - tiles = {"mushroom_brown_3d.png"}, - sunlight_propagates = true, - inventory_image = "mushroom_brown_inv.png", - groups = {oddly_breakable_by_hand=3, not_in_creative_inventory=1}, - paramtype = "light", - walkable = false, - selection_box = { - type = "fixed", - fixed = {-0.3, -0.5, -0.3, 0.3, 0, 0.3} - }, - drop = "mushroom:brown", -}) - -minetest.register_node("mushroom:red_natural",{ - description = "Red Mushroom (Naturally Spawned)", - drawtype = "mesh", - mesh = "plantlife_mushroom.obj", - tiles = {"mushroom_red_3d.png"}, - sunlight_propagates = true, - inventory_image = "mushroom_red_inv.png", - groups = {oddly_breakable_by_hand=3, not_in_creative_inventory=1}, - paramtype = "light", - walkable = false, - selection_box = { - type = "fixed", - fixed = {-0.3, -0.5, -0.3, 0.3, 0, 0.3} - }, - drop = "mushroom:red", -}) - --- Spore Growing ABMs - -minetest.register_abm({ - nodenames = {"mushroom:spore_brown"}, - neighbors = {"air"}, - interval = 120, - chance = 4, - action = function(pos, node) - local soil = minetest.get_node({x=pos.x,y=pos.y-1,z=pos.z}) - if (soil.name == "farming:soil_wet" or string.find(soil.name, "homedecor:flower_pot_")) - and minetest.get_node_light(pos, nil) < 8 then - minetest.set_node({x=pos.x,y=pos.y,z=pos.z}, {name="mushroom:brown"}) - end - end -}) - -minetest.register_abm({ - nodenames = {"mushroom:spore_red"}, - neighbors = {"air"}, - interval = 120, - chance = 4, - action = function(pos, node) - local soil = minetest.get_node({x=pos.x,y=pos.y-1,z=pos.z}) - if (soil.name == "farming:soil_wet" or string.find(soil.name, "homedecor:flower_pot_")) - and minetest.get_node_light(pos, nil) < 8 then - minetest.set_node({x=pos.x,y=pos.y,z=pos.z}, {name="mushroom:red"}) - end - end -}) - --- list of trees that mushrooms can grow next to - -local trees_list = { - "default:tree", - "default:jungletree", - "moretrees:apple_tree_trunk", - "moretrees:beech_trunk", - "moretrees:birch_trunk", - "moretrees:fir_trunk", - "moretrees:oak_trunk", - "moretrees:pine_trunk", - "moretrees:rubber_tree_trunk", - "moretrees:rubber_tree_trunk_empty", - "moretrees:sequoia_trunk", - "moretrees:spruce_trunk", - "moretrees:willow_trunk", -} - --- Natural Spawning ABM - -minetest.register_abm({ - nodenames = { - "default:dirt_with_grass", - "default:dirt", - "woodsoils:dirt_with_leaves_1", - "woodsoils:dirt_with_leaves_2", - "woodsoils:grass_with_leaves_1", - "woodsoils:grass_with_leaves_2", - "farming:soil_wet" - }, - neighbors = {"air"}, - interval = 300, - chance = 100, - action = function(pos, node) - local top_pos = {x=pos.x, y=pos.y+1, z=pos.z} - if minetest.get_node(top_pos).name == "air" and minetest.get_node_light(top_pos, nil) < 8 - and minetest.find_node_near(pos, 1, trees_list) - and minetest.find_node_near(pos, 3, "default:water_source") then - if math.random(0, 1) == 0 then - minetest.set_node(top_pos, {name="mushroom:brown_natural"}) - else - minetest.set_node(top_pos, {name="mushroom:red_natural"}) - end - end - end -}) - -minetest.register_abm({ - nodenames = {"default:stone"}, - neighbors = {"air"}, - interval = 300, - chance = 100, - action = function(pos, node) - local top_pos = {x=pos.x, y=pos.y+1, z=pos.z} - if minetest.get_node(top_pos).name == "air" and minetest.get_node_light(top_pos, nil) < 8 - and minetest.find_node_near(pos, 1, {"default:water_source"}) then - if math.random(0,1) == 0 then - minetest.set_node(top_pos, {name="mushroom:brown_natural"}) - else - minetest.set_node(top_pos, {name="mushroom:red_natural"}) - end - end - end -}) - --- Spreading ABM - -minetest.register_abm({ - nodenames = { - "mushroom:brown_natural", - "mushroom:red_natural" - }, - neighbors = {"air"}, - interval = 120, - chance = 100, - action = function(pos, node) - local soil_pos = {x=pos.x, y=pos.y-1, z=pos.z} - local soil = minetest.get_node(soil_pos) - local woodsoil_str = "woodsoils:.+_with_leaves_?" - if minetest.get_node_light(pos, nil) < 8 - and minetest.find_node_near(pos, 1, trees_list) then - local spread_x = math.random(-1, 1) - local spread_z = math.random(-1, 1) - local newpos = {x=pos.x+spread_x, y=pos.y, z=pos.z+spread_z} - local newsoil = minetest.get_node({x=newpos.x, y=newpos.y-1, z=newpos.z}) - if minetest.get_node(newpos).name == "air" - and (newsoil.name == "default:dirt_with_grass" - or newsoil.name == "default:dirt" - or string.match(newsoil.name, woodsoil_str)) - and minetest.find_node_near(newpos, 3, "default:water_source") then - minetest.set_node(newpos, {name=node.name}) - end - end - end -}) - --- Dying ABM - -minetest.register_abm({ - nodenames = { - "mushroom:brown", - "mushroom:red", - }, - neighbors = {"air"}, - interval = 120, - chance = 50, - action = function(pos, node) - local soil = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}) - if soil.name ~= "farming:soil_wet" - and not string.find(soil.name, "homedecor:flower_pot_") then - minetest.remove_node(pos) - end - end -}) - -dofile(minetest.get_modpath("mushroom").."/crafting.lua") -dofile(minetest.get_modpath("mushroom").."/compat.lua") - -print("[Mushrooms] loaded.") diff --git a/mushroom/textures/mushroom_essence.png b/mushroom/textures/mushroom_essence.png deleted file mode 100644 index b192a309a9fd69cb6d5c294b0121c2270b90419d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 188 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`&7LlfAr`04PB!E^pupp5>%@Qi z@>dqC<2UbGMqX0QWjPoW5~3mc@4*N8lm1C(^y4`klX{$74xMrGcxlg~$?KwVICKib z99Eg%(_Ab#F7Rx!%+_dDZD9Xzl&-mhn}Po`!}FZ0b66QJG3?NDh+f0|hFvtn?X5ug m@((s@B6g7}n{Qv)diDqA4 z-#>qzV_62flxF|u;o#-rk!X8x)ko);0mBpFqz?*a4$;xGHGHNvsLW9N@UdNzf#LD2 W{cqOyewYk2jlt8^&t;ucLK6Vylq%8y diff --git a/mushroom/textures/mushroom_poison.png b/mushroom/textures/mushroom_poison.png deleted file mode 100644 index 76337f0b3f6aca8060334e4502c54ce7a99aa846..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 183 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`b)GJcAr`04Uf#%c*no#6;P3zG zM?Ys?TNfF1<*AXS#S{yR#-PK!-vu`5ewu##%!_wte8NPHC%rqTnxd1!HhsB7V+B`0 zi%8-zrGzy1o#~nE>ls?>rdFSMBiH!I^1`jM$ajnfI4|Tew)!=^WfyiZyw7~^-l3ny itgnN6I!>2wU_M#+Yu}-^_j7?RVeoYIb6Mw<&;$T9AxmBW diff --git a/mushroom/textures/mushroom_spore.png b/mushroom/textures/mushroom_spore.png deleted file mode 100644 index 3c950d5bb0813b92d971484467a5ce0d28c83a65..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 92 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`%APKcAr_~T6D00Euot*+-(l5l qD;MS|5=WbD)?Aot-m_SYg`tp3{^7HOcF%#z89ZJ6T-G@yGywo6n;WG7 diff --git a/mushroom/textures/mushroom_spore_brown.png b/mushroom/textures/mushroom_spore_brown.png deleted file mode 100644 index a0818d23f0a2f7a3f2c25f61b44e34a002d3e9dc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 94 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`s-7;6Ar_~T6D00EsA4)?|4Z7V rG`c;bL1=Nsgm%$gpW6zrG%+wN?-JbD?;~yp)WG2B>gTe~DWM4fXE7Wj diff --git a/mushroom/textures/mushroom_spore_red.png b/mushroom/textures/mushroom_spore_red.png deleted file mode 100644 index 1f1d3a4592af275bb1dd00dcfea73cd3094ca8c6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 92 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`%APKcAr_~T6D00Eu$Q=a+hNsh qD;MS|5=WbD)?Aot-m_SYg~6(q|KstWS9pQS89ZJ6T-G@yGywoBP#ent