1
0
Fork 0

Move tall grass to mcl_flowers mod

Alias registered
objects
Wuzzy 2017-03-14 20:05:07 +01:00
parent bcdb3978cd
commit d0b1f843ee
8 changed files with 47 additions and 44 deletions

View File

@ -77,7 +77,7 @@ mobs:register_mob("mobs_mc:sheep", {
view_range = 5, view_range = 5,
replace_rate = 10, replace_rate = 10,
replace_what = {"mcl_core:dirt_with_grass", "mcl_core:tallgrass"}, replace_what = {"mcl_core:dirt_with_grass", "mcl_flowers:tallgrass"},
replace_with = "air", replace_with = "air",
do_custom = function(self) do_custom = function(self)
if not self.initial_color_set then if not self.initial_color_set then

View File

@ -1691,38 +1691,6 @@ minetest.register_node("mcl_core:deadbush", {
_mcl_hardness = 0, _mcl_hardness = 0,
}) })
minetest.register_node("mcl_core:tallgrass", {
description = "Tall Grass",
_doc_items_longdesc = "Tall grass is a small plant which often occours on the surface of grasslands. It can be harvested for wheat seeds.",
drawtype = "plantlike",
tiles = {"default_tallgrass.png"},
inventory_image = "default_tallgrass.png",
wield_image = "default_tallgrass.png",
drop = {
max_items = 1,
items = {
{
items = {'mcl_farming:wheat_seeds'},
rarity = 8,
},
}
},
paramtype = "light",
walkable = false,
buildable_to = true,
is_ground_content = true,
groups = {dig_immediate=3, flammable=3,attached_node=1,dig_by_water=1,deco_block=1},
sounds = mcl_sounds.node_sound_leaves_defaults(),
after_dig_node = function(pos, oldnode, oldmetadata, user)
local item = user:get_wielded_item()
if item:get_name() == "mcl_tools:shears" then
minetest.add_item(pos, oldnode.name)
end
end,
_mcl_blast_resistance = 0,
_mcl_hardness = 0,
})
minetest.register_node("mcl_core:ice", { minetest.register_node("mcl_core:ice", {
description = "Ice", description = "Ice",
_doc_items_longdesc = "Ice is a translucent solid block usually found in cold areas.", _doc_items_longdesc = "Ice is a translucent solid block usually found in cold areas.",

View File

@ -107,11 +107,11 @@ end
mcl_dye.apply_bone_meal = function(pointed_thing) mcl_dye.apply_bone_meal = function(pointed_thing)
local plant_tab = { local plant_tab = {
"air", "air",
"mcl_core:tallgrass", "mcl_flowers:tallgrass",
"mcl_core:tallgrass", "mcl_flowers:tallgrass",
"mcl_core:tallgrass", "mcl_flowers:tallgrass",
"mcl_core:tallgrass", "mcl_flowers:tallgrass",
"mcl_core:tallgrass", "mcl_flowers:tallgrass",
"mcl_flowers:dandelion", "mcl_flowers:dandelion",
"mcl_flowers:blue_orchid", "mcl_flowers:blue_orchid",
"mcl_flowers:oxeye_daisy", "mcl_flowers:oxeye_daisy",
@ -230,7 +230,7 @@ mcl_dye.apply_bone_meal = function(pointed_thing)
return true return true
-- Grow tall grass into double tallgrass -- Grow tall grass into double tallgrass
elseif n.name == "mcl_core:tallgrass" then elseif n.name == "mcl_flowers:tallgrass" then
local toppos = { x=pos.x, y=pos.y+1, z=pos.z } local toppos = { x=pos.x, y=pos.y+1, z=pos.z }
local topnode = minetest.get_node(toppos) local topnode = minetest.get_node(toppos)
if minetest.registered_nodes[topnode.name].buildable_to then if minetest.registered_nodes[topnode.name].buildable_to then

View File

@ -52,6 +52,31 @@ local wheat_seed_drop = {
} }
}, },
-- Tall Grass
minetest.register_node("mcl_flowers:tallgrass", {
description = "Tall Grass",
_doc_items_longdesc = "Tall grass is a small plant which often occours on the surface of grasslands. It can be harvested for wheat seeds.",
drawtype = "plantlike",
tiles = {"mcl_flowers_tallgrass.png"},
inventory_image = "mcl_flowers_tallgrass.png",
wield_image = "mcl_flowers_tallgrass.png",
paramtype = "light",
walkable = false,
buildable_to = true,
is_ground_content = true,
groups = {dig_immediate=3, flammable=3,attached_node=1,dig_by_water=1,deco_block=1},
sounds = mcl_sounds.node_sound_leaves_defaults(),
drop = wheat_seed_drop,
after_dig_node = function(pos, oldnode, oldmetadata, user)
local item = user:get_wielded_item()
if item:get_name() == "mcl_tools:shears" then
minetest.add_item(pos, oldnode.name)
end
end,
_mcl_blast_resistance = 0,
_mcl_hardness = 0,
})
--- Fern --- --- Fern ---
minetest.register_node("mcl_flowers:fern", { minetest.register_node("mcl_flowers:fern", {
description = "Fern", description = "Fern",
@ -67,6 +92,12 @@ minetest.register_node("mcl_flowers:fern", {
groups = {dig_immediate=3,flammable=2,attached_node=1,dig_by_water=1,deco_block=1}, groups = {dig_immediate=3,flammable=2,attached_node=1,dig_by_water=1,deco_block=1},
buildable_to = true, buildable_to = true,
sounds = mcl_sounds.node_sound_leaves_defaults(), sounds = mcl_sounds.node_sound_leaves_defaults(),
after_dig_node = function(pos, oldnode, oldmetadata, user)
local item = user:get_wielded_item()
if item:get_name() == "mcl_tools:shears" then
minetest.add_item(pos, oldnode.name)
end
end,
drop = wheat_seed_drop, drop = wheat_seed_drop,
selection_box = { selection_box = {
type = "fixed", type = "fixed",
@ -224,5 +255,9 @@ minetest.register_node("mcl_flowers:waterlily", {
end end
}) })
-- Legacy support
minetest.register_alias("mcl_core:tallgrass", "mcl_flowers:tallgrass")
-- Show loading time
local time_to_load= os.clock() - init local time_to_load= os.clock() - init
print(string.format("[MOD] "..minetest.get_current_modname().." loaded in %.4f s", time_to_load)) print(string.format("[MOD] "..minetest.get_current_modname().." loaded in %.4f s", time_to_load))

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -153,7 +153,7 @@ local function register_grass_decoration(offset, scale)
biomes = {"plains"}, biomes = {"plains"},
y_min = 1, y_min = 1,
y_max = 31000, y_max = 31000,
decoration = "mcl_core:tallgrass", decoration = "mcl_flowers:tallgrass",
}) })
end end

View File

@ -24,7 +24,7 @@ minetest.register_alias("mapgen_clay", "mcl_core:clay")
minetest.register_alias("mapgen_lava_source", "mcl_core:lava_source") minetest.register_alias("mapgen_lava_source", "mcl_core:lava_source")
minetest.register_alias("mapgen_cobble", "mcl_core:cobble") minetest.register_alias("mapgen_cobble", "mcl_core:cobble")
minetest.register_alias("mapgen_mossycobble", "mcl_core:mossycobble") minetest.register_alias("mapgen_mossycobble", "mcl_core:mossycobble")
minetest.register_alias("mapgen_junglegrass", "mcl_core:tallgrass") minetest.register_alias("mapgen_junglegrass", "mcl_flowers:tallgrass")
minetest.register_alias("mapgen_stone_with_coal", "mcl_core:stone_with_coal") minetest.register_alias("mapgen_stone_with_coal", "mcl_core:stone_with_coal")
minetest.register_alias("mapgen_stone_with_iron", "mcl_core:stone_with_iron") minetest.register_alias("mapgen_stone_with_iron", "mcl_core:stone_with_iron")
minetest.register_alias("mapgen_desert_sand", "mcl_core:sand") minetest.register_alias("mapgen_desert_sand", "mcl_core:sand")
@ -563,7 +563,7 @@ local function register_mgv6_decorations()
}, },
y_min = 1, y_min = 1,
y_max = 30, y_max = 30,
decoration = "mcl_core:tallgrass", decoration = "mcl_flowers:tallgrass",
}) })
-- Dead bushes -- Dead bushes

View File

@ -41,7 +41,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
if nn == "mcl_core:dirt_with_grass" then if nn == "mcl_core:dirt_with_grass" then
--local flower_choice = pr:next(1, 11) --local flower_choice = pr:next(1, 11)
local flower_choice = math.random(0, 10) local flower_choice = math.random(0, 10)
local flower = "mcl_core:tallgrass" local flower = "mcl_flowers:tallgrass"
if flower_choice == 1 then if flower_choice == 1 then
flower = "mcl_flowers:dandelion" flower = "mcl_flowers:dandelion"
minetest.set_node(p, {name=flower}) minetest.set_node(p, {name=flower})
@ -76,7 +76,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
flower = "mcl_flowers:blue_orchid" flower = "mcl_flowers:blue_orchid"
minetest.set_node(p, {name=flower}) minetest.set_node(p, {name=flower})
else else
flower = "mcl_core:tallgrass" flower = "mcl_flowers:tallgrass"
minetest.set_node(p, {name=flower}) minetest.set_node(p, {name=flower})
end end