put spindlestems with goblin caps, make them always grow red when near those

This commit is contained in:
FaceDeer
2019-08-04 19:53:13 -06:00
parent c20e3918ef
commit 271a9441f4
4 changed files with 17 additions and 7 deletions

View File

@ -9,7 +9,7 @@ minetest.register_node("df_trees:goblin_cap_stem", {
_doc_items_usagehelp = df_trees.doc.goblin_cap_usage,
tiles = {"dfcaverns_goblin_cap_stem.png"},
is_ground_content = true,
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2, goblin_cap = 1},
sounds = default.node_sound_wood_defaults(),
})
@ -20,7 +20,7 @@ minetest.register_node("df_trees:goblin_cap", {
_doc_items_usagehelp = df_trees.doc.goblin_cap_usage,
tiles = {"dfcaverns_goblin_cap.png"},
is_ground_content = true,
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2, goblin_cap = 1},
sounds = default.node_sound_wood_defaults(),
})
@ -31,7 +31,7 @@ minetest.register_node("df_trees:goblin_cap_gills", {
_doc_items_usagehelp = df_trees.doc.goblin_cap_usage,
tiles = {"dfcaverns_goblin_cap_gills.png"},
is_ground_content = true,
groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1, goblin_cap = 1},
sounds = default.node_sound_leaves_defaults(),
drawtype = "plantlike",
paramtype = "light",

View File

@ -37,8 +37,8 @@ local stem_on_place = function(itemstack, placer, pointed_thing)
end
local new_param2
-- check if pointing at an existing stalactite
if minetest.get_item_group(under.name, "spindlestem") ~= 0 then
-- check if pointing at an existing spindlestem
if minetest.get_item_group(under.name, "spindlestem") > 0 then
new_param2 = under.param2
else
new_param2 = math.random(0,3)
@ -143,7 +143,7 @@ local register_spindlestem_type = function(item_suffix, colour_name, colour_code
},
},
on_place = stal_on_place,
on_place = stem_on_place,
on_timer = function(pos, elapsed)
local above = vector.add(pos, {x=0,y=1,z=0})
local node_above = minetest.get_node(above)
@ -244,7 +244,7 @@ minetest.register_node("df_trees:spindlestem_seedling", {
}
},
on_place = stal_on_place,
on_place = stem_on_place,
on_construct = seedling_construct,
on_timer = function(pos, elapsed)
@ -310,6 +310,10 @@ get_spindlestem_cap_type = function(pos)
if pos.y > -100 then
return c_white
end
if minetest.find_node_near(pos, 15, "group:goblin_cap") then
return c_red
end
local iron = minetest.find_node_near(pos, 5, {"default:stone_with_iron", "default:steelblock"})
local copper = minetest.find_node_near(pos, 5, {"default:stone_with_copper", "default:copperblock"})
local mese = minetest.find_node_near(pos, 5, {"default:stone_with_mese", "default:mese"})