1
0
mirror of https://github.com/mt-mods/plantlife_modpack.git synced 2024-12-24 17:40:19 +01:00

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
This commit is contained in:
Vanessa Ezekowitz 2015-08-14 09:18:14 -04:00
parent 42732b0636
commit f11fa6e6fe
17 changed files with 70 additions and 396 deletions

2
3dmushrooms/depends.txt Normal file
View File

@ -0,0 +1,2 @@
default
flowers

68
3dmushrooms/init.lua Normal file
View File

@ -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.")

View File

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

View File

@ -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"},
}
}
}
})

View File

@ -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' }
}
})

View File

@ -1,3 +0,0 @@
default
vessels?
woodsoils?

View File

@ -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.")

Binary file not shown.

Before

Width:  |  Height:  |  Size: 188 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 183 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 B