Use hardware coloring for tallgrass and friends
|
@ -447,20 +447,10 @@ function mcl_util.generate_on_place_plant_function(condition)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Check placement rules
|
-- Check placement rules
|
||||||
local result = condition(place_pos, node, itemstack)
|
local result, param2 = condition(place_pos, node, itemstack)
|
||||||
if result == true or type(result) == "string" then
|
if result == true then
|
||||||
local itemstack_place
|
local idef = itemstack:get_definition()
|
||||||
if type(result) == "string" then
|
local new_itemstack, success = minetest.item_place_node(itemstack, placer, pointed_thing, param2)
|
||||||
-- Let's pretend we place a different item
|
|
||||||
itemstack_place = ItemStack(itemstack)
|
|
||||||
itemstack_place:set_name(result)
|
|
||||||
else
|
|
||||||
itemstack_place = itemstack
|
|
||||||
end
|
|
||||||
local idef = itemstack_place:get_definition()
|
|
||||||
local new_itemstack, success = minetest.item_place_node(itemstack_place, placer, pointed_thing)
|
|
||||||
-- Restore old itemstack name
|
|
||||||
new_itemstack:set_name(itemstack:get_name())
|
|
||||||
|
|
||||||
if success then
|
if success then
|
||||||
if idef.sounds and idef.sounds.place then
|
if idef.sounds and idef.sounds.place then
|
||||||
|
|
|
@ -152,7 +152,6 @@ mobs_mc.override.replace = {
|
||||||
{ "mcl_core:dirt_with_grass", "mcl_core:dirt", -1 },
|
{ "mcl_core:dirt_with_grass", "mcl_core:dirt", -1 },
|
||||||
{ "mcl_core:dirt_with_dry_grass", "mcl_core:dirt", -1 },
|
{ "mcl_core:dirt_with_dry_grass", "mcl_core:dirt", -1 },
|
||||||
{ "mcl_flowers:tallgrass", "air", 0 },
|
{ "mcl_flowers:tallgrass", "air", 0 },
|
||||||
{ "mcl_flowers:tallgrass_dry", "air", 0 },
|
|
||||||
},
|
},
|
||||||
-- Silverfish populate stone, etc. with monster eggs
|
-- Silverfish populate stone, etc. with monster eggs
|
||||||
silverfish = {
|
silverfish = {
|
||||||
|
|
|
@ -316,6 +316,7 @@ minetest.register_node("mcl_core:dirt_with_grass", {
|
||||||
return mcl_core.on_snowable_construct(pos)
|
return mcl_core.on_snowable_construct(pos)
|
||||||
end,
|
end,
|
||||||
_mcl_snowed = "mcl_core:dirt_with_grass_snow",
|
_mcl_snowed = "mcl_core:dirt_with_grass_snow",
|
||||||
|
_mcl_grass_palette_index = 0,
|
||||||
_mcl_blast_resistance = 3,
|
_mcl_blast_resistance = 3,
|
||||||
_mcl_hardness = 0.6,
|
_mcl_hardness = 0.6,
|
||||||
})
|
})
|
||||||
|
@ -334,6 +335,7 @@ minetest.register_node("mcl_core:dirt_with_dry_grass", {
|
||||||
}),
|
}),
|
||||||
on_construct = mcl_core.on_snowable_construct,
|
on_construct = mcl_core.on_snowable_construct,
|
||||||
_mcl_snowed = "mcl_core:dirt_with_dry_grass_snow",
|
_mcl_snowed = "mcl_core:dirt_with_dry_grass_snow",
|
||||||
|
_mcl_grass_palette_index = 1,
|
||||||
_mcl_blast_resistance = 3,
|
_mcl_blast_resistance = 3,
|
||||||
_mcl_hardness = 0.6,
|
_mcl_hardness = 0.6,
|
||||||
})
|
})
|
||||||
|
|
After Width: | Height: | Size: 93 B |
|
@ -220,16 +220,13 @@ mcl_dye.apply_bone_meal = function(pointed_thing)
|
||||||
n = minetest.get_node(pos)
|
n = minetest.get_node(pos)
|
||||||
local n2 = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z})
|
local n2 = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z})
|
||||||
|
|
||||||
if n.name ~= "" and n.name == "air" and (minetest.get_item_group(n2.name, "grass_block") == 1) and (minetest.get_item_group(n2.name, "snowed") == 0) then
|
if n.name ~= "" and n.name == "air" and (minetest.get_item_group(n2.name, "grass_block_no_snow") == 1) then
|
||||||
-- Randomly generate flowers, tall grass or nothing
|
-- Randomly generate flowers, tall grass or nothing
|
||||||
if math.random(1,100) <= 90 then
|
if math.random(1,100) <= 90 then
|
||||||
-- 90% tall grass, 10% flower
|
-- 90% tall grass, 10% flower
|
||||||
if math.random(1,100) <= 90 then
|
if math.random(1,100) <= 90 then
|
||||||
if n2.name == "mcl_core:dirt_with_dry_grass" then
|
local col = minetest.registered_nodes[n2.name]._mcl_grass_palette_index
|
||||||
minetest.add_node(pos, {name="mcl_flowers:tallgrass_dry"})
|
minetest.add_node(pos, {name="mcl_flowers:tallgrass", param2=col})
|
||||||
else
|
|
||||||
minetest.add_node(pos, {name="mcl_flowers:tallgrass"})
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
if n2.name == "mcl_core:dirt_with_dry_grass" then
|
if n2.name == "mcl_core:dirt_with_dry_grass" then
|
||||||
minetest.add_node(pos, {name=flowers_table_dry[math.random(1, #flowers_table_dry)]})
|
minetest.add_node(pos, {name=flowers_table_dry[math.random(1, #flowers_table_dry)]})
|
||||||
|
@ -262,16 +259,8 @@ mcl_dye.apply_bone_meal = function(pointed_thing)
|
||||||
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
|
||||||
minetest.set_node(pos, { name = "mcl_flowers:double_grass" })
|
minetest.set_node(pos, { name = "mcl_flowers:double_grass", param2 = n.param2 })
|
||||||
minetest.set_node(toppos, { name = "mcl_flowers:double_grass_top" })
|
minetest.set_node(toppos, { name = "mcl_flowers:double_grass_top", param2 = n.param2 })
|
||||||
return true
|
|
||||||
end
|
|
||||||
elseif n.name == "mcl_flowers:tallgrass_dry" then
|
|
||||||
local toppos = { x=pos.x, y=pos.y+1, z=pos.z }
|
|
||||||
local topnode = minetest.get_node(toppos)
|
|
||||||
if minetest.registered_nodes[topnode.name].buildable_to then
|
|
||||||
minetest.set_node(pos, { name = "mcl_flowers:double_grass_dry" })
|
|
||||||
minetest.set_node(toppos, { name = "mcl_flowers:double_grass_dry_top" })
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -280,16 +269,8 @@ mcl_dye.apply_bone_meal = function(pointed_thing)
|
||||||
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
|
||||||
minetest.set_node(pos, { name = "mcl_flowers:double_fern" })
|
minetest.set_node(pos, { name = "mcl_flowers:double_fern", param2 = n.param2 })
|
||||||
minetest.set_node(toppos, { name = "mcl_flowers:double_fern_top" })
|
minetest.set_node(toppos, { name = "mcl_flowers:double_fern_top", param2 = n.param2 })
|
||||||
return true
|
|
||||||
end
|
|
||||||
elseif n.name == "mcl_flowers:fern_dry" then
|
|
||||||
local toppos = { x=pos.x, y=pos.y+1, z=pos.z }
|
|
||||||
local topnode = minetest.get_node(toppos)
|
|
||||||
if minetest.registered_nodes[topnode.name].buildable_to then
|
|
||||||
minetest.set_node(pos, { name = "mcl_flowers:double_fern_dry" })
|
|
||||||
minetest.set_node(toppos, { name = "mcl_flowers:double_fern_dry_top" })
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -12,10 +12,10 @@ local on_place_flower = mcl_util.generate_on_place_plant_function(function(pos,
|
||||||
local soil_node = minetest.get_node_or_nil(below)
|
local soil_node = minetest.get_node_or_nil(below)
|
||||||
if not soil_node then return false end
|
if not soil_node then return false end
|
||||||
|
|
||||||
local dry = minetest.registered_nodes[itemstack:get_name()]._mcl_dry_override
|
local has_palette = minetest.registered_nodes[itemstack:get_name()].palette ~= nil
|
||||||
local replace
|
local colorize = 0
|
||||||
if dry and (soil_node.name == "mcl_core:dirt_with_dry_grass" or soil_node.name == "mcl_core:dirt_with_dry_grass_snow") then
|
if has_palette and (soil_node.name == "mcl_core:dirt_with_dry_grass" or soil_node.name == "mcl_core:dirt_with_dry_grass_snow") then
|
||||||
replace = dry
|
colorize = 1
|
||||||
end
|
end
|
||||||
|
|
||||||
--[[ Placement requirements:
|
--[[ Placement requirements:
|
||||||
|
@ -31,10 +31,7 @@ local on_place_flower = mcl_util.generate_on_place_plant_function(function(pos,
|
||||||
end
|
end
|
||||||
local is_flower = minetest.get_item_group(itemstack:get_name(), "flower") == 1
|
local is_flower = minetest.get_item_group(itemstack:get_name(), "flower") == 1
|
||||||
local ok = (soil_node.name == "mcl_core:dirt" or minetest.get_item_group(soil_node.name, "grass_block") == 1 or (not is_flower and (soil_node.name == "mcl_core:coarse_dirt" or soil_node.name == "mcl_core:podzol" or soil_node.name == "mcl_core:podzol_snow"))) and light_ok
|
local ok = (soil_node.name == "mcl_core:dirt" or minetest.get_item_group(soil_node.name, "grass_block") == 1 or (not is_flower and (soil_node.name == "mcl_core:coarse_dirt" or soil_node.name == "mcl_core:podzol" or soil_node.name == "mcl_core:podzol_snow"))) and light_ok
|
||||||
if ok and replace then
|
return ok, colorize
|
||||||
return replace
|
|
||||||
end
|
|
||||||
return ok
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
local function add_simple_flower(name, desc, image, simple_selection_box)
|
local function add_simple_flower(name, desc, image, simple_selection_box)
|
||||||
|
@ -84,100 +81,61 @@ local wheat_seed_drop = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Tall Grass and Fern
|
-- CHECKME: How does tall grass behave when pushed by a piston?
|
||||||
for i=1,2 do
|
|
||||||
-- CHECKME: How does tall grass behave when pushed by a piston?
|
|
||||||
local tgf_groups = {dig_immediate=3, flammable=3,attached_node=1,plant=1,place_flowerlike=2,non_mycelium_plant=1,dig_by_water=1,destroy_by_lava_flow=1,deco_block=1}
|
|
||||||
|
|
||||||
local id, idf, longdesc, longdesc_fern, create_entry, shears_drop, shears_drop_fern
|
--- Tall Grass ---
|
||||||
if i==1 then
|
local def_tallgrass = {
|
||||||
id = "tallgrass"
|
|
||||||
idf = "fern"
|
|
||||||
longdesc = "Tall grass is a small plant which often occours on the surface of grasslands. It can be harvested for wheat seeds. By using bone meal, tall grass can be turned into double tallgrass which is two blocks high."
|
|
||||||
longdesc_fern = "Ferns are small plants which occour naturally in grasslands. They can be harvested for wheat seeds. By using bone meal, a fern can be turned into a large fern which is two blocks high."
|
|
||||||
hidden = false
|
|
||||||
shears_drop = true
|
|
||||||
shears_drop_fern = true
|
|
||||||
else
|
|
||||||
id = "tallgrass_dry"
|
|
||||||
idf = "fern_dry"
|
|
||||||
tgf_groups.not_in_creative_inventory = 1
|
|
||||||
create_entry = false
|
|
||||||
shears_drop = {"mcl_flowers:tallgrass"}
|
|
||||||
shears_drop_fern = {"mcl_flowers:fern"}
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Tall Grass ---
|
|
||||||
minetest.register_node("mcl_flowers:"..id, {
|
|
||||||
description = "Tall Grass",
|
description = "Tall Grass",
|
||||||
drawtype = "plantlike",
|
drawtype = "plantlike",
|
||||||
_doc_items_longdesc = longdesc,
|
_doc_items_longdesc = "Tall grass is a small plant which often occours on the surface of grasslands. It can be harvested for wheat seeds. By using bone meal, tall grass can be turned into double tallgrass which is two blocks high.",
|
||||||
_doc_items_usagehelp = plant_usage_help,
|
_doc_items_usagehelp = plant_usage_help,
|
||||||
_doc_items_hidden = hidden,
|
_doc_items_hidden = false,
|
||||||
_doc_items_create_entry = create_entry,
|
|
||||||
waving = 1,
|
waving = 1,
|
||||||
tiles = {"mcl_flowers_"..id..".png"},
|
tiles = {"mcl_flowers_tallgrass.png"},
|
||||||
inventory_image = "mcl_flowers_"..id..".png",
|
inventory_image = "mcl_flowers_tallgrass_inv.png",
|
||||||
wield_image = "mcl_flowers_"..id..".png",
|
wield_image = "mcl_flowers_tallgrass_inv.png",
|
||||||
selection_box = {
|
selection_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {{ -6/16, -8/16, -6/16, 6/16, 4/16, 6/16 }},
|
fixed = {{ -6/16, -8/16, -6/16, 6/16, 4/16, 6/16 }},
|
||||||
},
|
},
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
|
paramtype2 = "color",
|
||||||
|
palette = "mcl_core_palette_grass.png",
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
walkable = false,
|
walkable = false,
|
||||||
buildable_to = true,
|
buildable_to = true,
|
||||||
is_ground_content = true,
|
is_ground_content = true,
|
||||||
groups = tgf_groups,
|
groups = {dig_immediate=3, flammable=3,attached_node=1,plant=1,place_flowerlike=2,non_mycelium_plant=1,dig_by_water=1,destroy_by_lava_flow=1,deco_block=1},
|
||||||
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
||||||
drop = wheat_seed_drop,
|
drop = wheat_seed_drop,
|
||||||
_mcl_shears_drop = shears_drop,
|
_mcl_shears_drop = true,
|
||||||
_mcl_dry_override = "mcl_flowers:tallgrass_dry",
|
|
||||||
node_placement_prediction = "",
|
node_placement_prediction = "",
|
||||||
on_place = on_place_flower,
|
on_place = on_place_flower,
|
||||||
_mcl_blast_resistance = 0,
|
_mcl_blast_resistance = 0,
|
||||||
_mcl_hardness = 0,
|
_mcl_hardness = 0,
|
||||||
})
|
}
|
||||||
|
minetest.register_node("mcl_flowers:tallgrass", def_tallgrass)
|
||||||
|
|
||||||
--- Fern ---
|
--- Fern ---
|
||||||
minetest.register_node("mcl_flowers:"..idf, {
|
-- The fern is very similar to tall grass, so we can copy a lot from it.
|
||||||
description = "Fern",
|
local def_fern = table.copy(def_tallgrass)
|
||||||
_doc_items_longdesc = longdesc_fern,
|
def_fern.description = "Fern"
|
||||||
_doc_items_usagehelp = plant_usage_help,
|
def_fern._doc_items_longdesc = "Ferns are small plants which occour naturally in grasslands. They can be harvested for wheat seeds. By using bone meal, a fern can be turned into a large fern which is two blocks high."
|
||||||
_doc_items_create_entry = create_entry,
|
def_fern.tiles = { "mcl_flowers_fern.png" }
|
||||||
_doc_items_hidden = hidden,
|
def_fern.inventory_image = "mcl_flowers_fern_inv.png"
|
||||||
drawtype = "plantlike",
|
def_fern.wield_image = "mcl_flowers_fern_inv.png"
|
||||||
waving = 1,
|
def_fern.selection_box = {
|
||||||
tiles = { "mcl_flowers_"..idf..".png" },
|
|
||||||
inventory_image = "mcl_flowers_"..idf..".png",
|
|
||||||
wield_image = "mcl_flowers_"..idf..".png",
|
|
||||||
sunlight_propagates = true,
|
|
||||||
paramtype = "light",
|
|
||||||
walkable = false,
|
|
||||||
stack_max = 64,
|
|
||||||
groups = tgf_groups,
|
|
||||||
buildable_to = true,
|
|
||||||
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
|
||||||
node_placement_prediction = "",
|
|
||||||
on_place = on_place_flower,
|
|
||||||
drop = wheat_seed_drop,
|
|
||||||
_mcl_shears_drop = shears_drop_fern,
|
|
||||||
_mcl_dry_override = "mcl_flowers:fern_dry",
|
|
||||||
selection_box = {
|
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = { -6/16, -0.5, -6/16, 6/16, 5/16, 6/16 },
|
fixed = { -6/16, -0.5, -6/16, 6/16, 5/16, 6/16 },
|
||||||
},
|
}
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
doc.add_entry_alias("nodes", "mcl_flowers:tallgrass", "nodes", "mcl_flowers:tallgrass_dry")
|
minetest.register_node("mcl_flowers:fern", def_fern)
|
||||||
doc.add_entry_alias("nodes", "mcl_flowers:fern", "nodes", "mcl_flowers:fern_dry")
|
|
||||||
|
|
||||||
local function add_large_plant(name, desc, longdesc, bottom_img, top_img, inv_img, selbox_radius, selbox_top_height, drop, shears_drop, is_flower, dry_override)
|
local function add_large_plant(name, desc, longdesc, bottom_img, top_img, inv_img, selbox_radius, selbox_top_height, drop, shears_drop, is_flower, grass_color)
|
||||||
if not inv_img then
|
if not inv_img then
|
||||||
inv_img = top_img
|
inv_img = top_img
|
||||||
end
|
end
|
||||||
local flowergroup, place_flowerlike, usagehelp, noncreative, create_entry
|
local flowergroup, place_flowerlike, usagehelp, noncreative, create_entry, paramtype2, palette
|
||||||
if is_flower == nil then
|
if is_flower == nil then
|
||||||
is_flower = true
|
is_flower = true
|
||||||
end
|
end
|
||||||
|
@ -187,6 +145,10 @@ local function add_large_plant(name, desc, longdesc, bottom_img, top_img, inv_im
|
||||||
else
|
else
|
||||||
place_flowerlike = 2
|
place_flowerlike = 2
|
||||||
end
|
end
|
||||||
|
if grass_color then
|
||||||
|
paramtype2 = "color"
|
||||||
|
palette = "mcl_core_palette_grass.png"
|
||||||
|
end
|
||||||
if longdesc == nil then
|
if longdesc == nil then
|
||||||
noncreative = 1
|
noncreative = 1
|
||||||
create_entry = false
|
create_entry = false
|
||||||
|
@ -210,11 +172,12 @@ local function add_large_plant(name, desc, longdesc, bottom_img, top_img, inv_im
|
||||||
wield_image = inv_img,
|
wield_image = inv_img,
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
|
paramtype2 = paramtype2,
|
||||||
|
palette = palette,
|
||||||
walkable = false,
|
walkable = false,
|
||||||
buildable_to = true,
|
buildable_to = true,
|
||||||
drop = drop_bottom,
|
drop = drop_bottom,
|
||||||
_mcl_shears_drop = shears_drop,
|
_mcl_shears_drop = shears_drop,
|
||||||
_mcl_dry_override = dry_override,
|
|
||||||
node_placement_prediction = "",
|
node_placement_prediction = "",
|
||||||
selection_box = {
|
selection_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
|
@ -271,14 +234,14 @@ local function add_large_plant(name, desc, longdesc, bottom_img, top_img, inv_im
|
||||||
-- * Only with light level >= 8
|
-- * Only with light level >= 8
|
||||||
-- * Only if two enough space
|
-- * Only if two enough space
|
||||||
if (floorname == "mcl_core:dirt" or minetest.get_item_group(floorname, "grass_block") == 1 or (not is_flower and (floorname == "mcl_core:coarse_dirt" or floorname == "mcl_core:podzol" or floorname == "mcl_core:podzol_snow"))) and bottom_buildable and top_buildable and light_ok then
|
if (floorname == "mcl_core:dirt" or minetest.get_item_group(floorname, "grass_block") == 1 or (not is_flower and (floorname == "mcl_core:coarse_dirt" or floorname == "mcl_core:podzol" or floorname == "mcl_core:podzol_snow"))) and bottom_buildable and top_buildable and light_ok then
|
||||||
local dry_override = minetest.registered_nodes[itemstring]._mcl_dry_override
|
local param2
|
||||||
if dry_override and (floorname == "mcl_core:dirt_with_dry_grass" or floorname == "mcl_core:dirt_with_dry_grass_snow") then
|
if grass_color and (floorname == "mcl_core:dirt_with_dry_grass" or floorname == "mcl_core:dirt_with_dry_grass_snow") then
|
||||||
itemstring = dry_override
|
param2 = 1
|
||||||
end
|
end
|
||||||
-- Success! We can now place the flower
|
-- Success! We can now place the flower
|
||||||
minetest.sound_play(minetest.registered_nodes[itemstring].sounds.place, {pos = bottom, gain=1})
|
minetest.sound_play(minetest.registered_nodes[itemstring].sounds.place, {pos = bottom, gain=1})
|
||||||
minetest.set_node(bottom, {name=itemstring})
|
minetest.set_node(bottom, {name=itemstring, param2=param2})
|
||||||
minetest.set_node(top, {name=itemstring.."_top"})
|
minetest.set_node(top, {name=itemstring.."_top", param2=param2})
|
||||||
if not minetest.settings:get_bool("creative_mode") then
|
if not minetest.settings:get_bool("creative_mode") then
|
||||||
itemstack:take_item()
|
itemstack:take_item()
|
||||||
end
|
end
|
||||||
|
@ -305,6 +268,8 @@ local function add_large_plant(name, desc, longdesc, bottom_img, top_img, inv_im
|
||||||
tiles = { top_img },
|
tiles = { top_img },
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
|
paramtype2 = paramtype2,
|
||||||
|
palette = palette,
|
||||||
walkable = false,
|
walkable = false,
|
||||||
buildable_to = true,
|
buildable_to = true,
|
||||||
selection_box = {
|
selection_box = {
|
||||||
|
@ -339,26 +304,11 @@ add_large_plant("lilac", "Lilac", "A lilac is a large plant which occupies two b
|
||||||
-- TODO: Make the sunflower face East. Requires a mesh for the top node.
|
-- TODO: Make the sunflower face East. Requires a mesh for the top node.
|
||||||
add_large_plant("sunflower", "Sunflower", "A sunflower is a large plant which occupies two blocks. It is mainly used in dye production.", "mcl_flowers_double_plant_sunflower_bottom.png", "mcl_flowers_double_plant_sunflower_top.png^mcl_flowers_double_plant_sunflower_front.png", "mcl_flowers_double_plant_sunflower_front.png", 6/16, 6/16)
|
add_large_plant("sunflower", "Sunflower", "A sunflower is a large plant which occupies two blocks. It is mainly used in dye production.", "mcl_flowers_double_plant_sunflower_bottom.png", "mcl_flowers_double_plant_sunflower_top.png^mcl_flowers_double_plant_sunflower_front.png", "mcl_flowers_double_plant_sunflower_front.png", 6/16, 6/16)
|
||||||
|
|
||||||
for i=1, 2 do
|
local longdesc_grass = "Double tallgrass a variant of tall grass and occupies two blocks. It can be harvested for wheat seeds."
|
||||||
local longdesc_grass, longdesc_fern, dry, dry_override_grass, dry_override_fern
|
local longdesc_fern = "Large fern is a variant of fern and occupies two blocks. It can be harvested for wheat seeds."
|
||||||
if i==1 then
|
|
||||||
longdesc_grass = "Double tallgrass a variant of tall grass and occupies two blocks. It can be harvested for wheat seeds."
|
|
||||||
longdesc_fern = "Large fern is a variant of fern and occupies two blocks. It can be harvested for wheat seeds."
|
|
||||||
dry = ""
|
|
||||||
dry_override_grass = "mcl_flowers:double_grass_dry"
|
|
||||||
dry_override_fern = "mcl_flowers:double_fern_dry"
|
|
||||||
else
|
|
||||||
-- ID/texture name modifier
|
|
||||||
dry = "_dry"
|
|
||||||
end
|
|
||||||
add_large_plant("double_grass"..dry, "Double Tallgrass", longdesc_grass, "mcl_flowers_double_plant_grass_bottom"..dry..".png", "mcl_flowers_double_plant_grass_top"..dry..".png", nil, 6/16, 4/16, wheat_seed_drop, {"mcl_flowers:tallgrass 2"}, false, dry_override_grass)
|
|
||||||
add_large_plant("double_fern"..dry, "Large Fern", longdesc_fern, "mcl_flowers_double_plant_fern_bottom"..dry..".png", "mcl_flowers_double_plant_fern_top"..dry..".png", nil, 5/16, 5/16, wheat_seed_drop, {"mcl_flowers:fern 2"}, false, dry_override_fern)
|
|
||||||
end
|
|
||||||
|
|
||||||
doc.add_entry_alias("nodes", "mcl_flowers:double_grass", "nodes", "mcl_flowers:double_grass_dry")
|
add_large_plant("double_grass", "Double Tallgrass", longdesc_grass, "mcl_flowers_double_plant_grass_bottom.png", "mcl_flowers_double_plant_grass_top.png", "mcl_flowers_double_plant_grass_inv.png", 6/16, 4/16, wheat_seed_drop, {"mcl_flowers:tallgrass 2"}, false, true)
|
||||||
doc.add_entry_alias("nodes", "mcl_flowers:double_grass", "nodes", "mcl_flowers:double_grass_dry_top")
|
add_large_plant("double_fern", "Large Fern", longdesc_fern, "mcl_flowers_double_plant_fern_bottom.png", "mcl_flowers_double_plant_fern_top.png", "mcl_flowers_double_plant_fern_inv.png", 5/16, 5/16, wheat_seed_drop, {"mcl_flowers:fern 2"}, false, true)
|
||||||
doc.add_entry_alias("nodes", "mcl_flowers:double_fern", "nodes", "mcl_flowers:double_fern_dry")
|
|
||||||
doc.add_entry_alias("nodes", "mcl_flowers:double_fern", "nodes", "mcl_flowers:double_fern_dry_top")
|
|
||||||
|
|
||||||
minetest.register_abm({
|
minetest.register_abm({
|
||||||
label = "Pop out flowers",
|
label = "Pop out flowers",
|
||||||
|
|
Before Width: | Height: | Size: 192 B After Width: | Height: | Size: 348 B |
Before Width: | Height: | Size: 192 B |
After Width: | Height: | Size: 178 B |
Before Width: | Height: | Size: 178 B After Width: | Height: | Size: 324 B |
Before Width: | Height: | Size: 178 B |
Before Width: | Height: | Size: 224 B After Width: | Height: | Size: 412 B |
Before Width: | Height: | Size: 224 B |
After Width: | Height: | Size: 166 B |
Before Width: | Height: | Size: 166 B After Width: | Height: | Size: 315 B |
Before Width: | Height: | Size: 166 B |
Before Width: | Height: | Size: 202 B After Width: | Height: | Size: 353 B |
Before Width: | Height: | Size: 202 B After Width: | Height: | Size: 202 B |
Before Width: | Height: | Size: 196 B After Width: | Height: | Size: 323 B |
Before Width: | Height: | Size: 196 B After Width: | Height: | Size: 196 B |
|
@ -21,9 +21,7 @@ wieldview.transform = {
|
||||||
["mcl_flowers:blue_orchid"]="R270",
|
["mcl_flowers:blue_orchid"]="R270",
|
||||||
["mcl_flowers:oxeye_daisy"]="R270",
|
["mcl_flowers:oxeye_daisy"]="R270",
|
||||||
["mcl_flowers:fern"]="R270",
|
["mcl_flowers:fern"]="R270",
|
||||||
["mcl_flowers:fern_dry"]="R270",
|
|
||||||
["mcl_flowers:tallgrass"]="R270",
|
["mcl_flowers:tallgrass"]="R270",
|
||||||
["mcl_flowers:tallgrass_dry"]="R270",
|
|
||||||
["mcl_buckets:bucket_empty"]="R270",
|
["mcl_buckets:bucket_empty"]="R270",
|
||||||
["mcl_buckets:bucket_water"]="R270",
|
["mcl_buckets:bucket_water"]="R270",
|
||||||
["mcl_buckets:bucket_lava"]="R270",
|
["mcl_buckets:bucket_lava"]="R270",
|
||||||
|
|
|
@ -1600,7 +1600,7 @@ end
|
||||||
-- All mapgens except mgv6
|
-- All mapgens except mgv6
|
||||||
|
|
||||||
-- Template to register a grass or fern decoration
|
-- Template to register a grass or fern decoration
|
||||||
local function register_grass_decoration(grasstype, offset, scale, biomes)
|
local function register_grass_decoration(grasstype, offset, scale, biomes, param2)
|
||||||
local place_on, seed, node
|
local place_on, seed, node
|
||||||
if grasstype == "fern" then
|
if grasstype == "fern" then
|
||||||
node = "mcl_flowers:fern"
|
node = "mcl_flowers:fern"
|
||||||
|
@ -1610,10 +1610,6 @@ local function register_grass_decoration(grasstype, offset, scale, biomes)
|
||||||
node = "mcl_flowers:tallgrass"
|
node = "mcl_flowers:tallgrass"
|
||||||
place_on = {"group:grass_block_no_snow"}
|
place_on = {"group:grass_block_no_snow"}
|
||||||
seed = 420
|
seed = 420
|
||||||
elseif grasstype == "tallgrass_dry" then
|
|
||||||
node = "mcl_flowers:tallgrass_dry"
|
|
||||||
place_on = {"group:grass_block_no_snow"}
|
|
||||||
seed = 420
|
|
||||||
end
|
end
|
||||||
local noise = {
|
local noise = {
|
||||||
offset = offset,
|
offset = offset,
|
||||||
|
@ -1632,6 +1628,7 @@ local function register_grass_decoration(grasstype, offset, scale, biomes)
|
||||||
y_min = 1,
|
y_min = 1,
|
||||||
y_max = mcl_vars.mg_overworld_max,
|
y_max = mcl_vars.mg_overworld_max,
|
||||||
decoration = node,
|
decoration = node,
|
||||||
|
param2 = param2,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -2399,19 +2396,10 @@ local function register_decorations()
|
||||||
num_spawn_by = 1,
|
num_spawn_by = 1,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Doubletall grass
|
local dry_index = minetest.registered_nodes["mcl_core:dirt_with_dry_grass"]._mcl_grass_palette_index
|
||||||
local register_doubletall_grass = function(offset, scale, biomes, is_dry)
|
|
||||||
|
|
||||||
local bottom, top, tallgrass
|
-- Doubletall grass
|
||||||
if is_dry then
|
local register_doubletall_grass = function(offset, scale, biomes, param2)
|
||||||
bottom = "mcl_flowers:double_grass_dry"
|
|
||||||
top = "mcl_flowers:double_grass_dry_top"
|
|
||||||
tallgrass = "mcl_flowers:tallgrass_dry"
|
|
||||||
else
|
|
||||||
bottom = "mcl_flowers:double_grass"
|
|
||||||
top = "mcl_flowers:double_grass_top"
|
|
||||||
tallgrass = "mcl_flowers:tallgrass"
|
|
||||||
end
|
|
||||||
|
|
||||||
minetest.register_decoration({
|
minetest.register_decoration({
|
||||||
deco_type = "schematic",
|
deco_type = "schematic",
|
||||||
|
@ -2419,12 +2407,12 @@ local function register_decorations()
|
||||||
size = { x=1, y=3, z=1 },
|
size = { x=1, y=3, z=1 },
|
||||||
data = {
|
data = {
|
||||||
{ name = "air", prob = 0 },
|
{ name = "air", prob = 0 },
|
||||||
{ name = bottom, param1=255, },
|
{ name = "mcl_flowers:double_grass", param1=255, param2=param2 },
|
||||||
{ name = top, param1=255, },
|
{ name = "mcl_flowers:double_grass_top", param1=255, param2=param2 },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
replacements = {
|
replacements = {
|
||||||
[tallgrass] = bottom,
|
["mcl_flowers:tallgrass"] = "mcl_flowers:double_grass",
|
||||||
},
|
},
|
||||||
place_on = {"group:grass_block_no_snow"},
|
place_on = {"group:grass_block_no_snow"},
|
||||||
sidelen = 16,
|
sidelen = 16,
|
||||||
|
@ -2444,7 +2432,7 @@ local function register_decorations()
|
||||||
|
|
||||||
register_doubletall_grass(-0.01, 0.03, {"Taiga", "Forest", "FlowerForest", "BirchForest", "BirchForestM", "RoofedForest"})
|
register_doubletall_grass(-0.01, 0.03, {"Taiga", "Forest", "FlowerForest", "BirchForest", "BirchForestM", "RoofedForest"})
|
||||||
register_doubletall_grass(-0.002, 0.03, {"Plains", "SunflowerPlains"})
|
register_doubletall_grass(-0.002, 0.03, {"Plains", "SunflowerPlains"})
|
||||||
register_doubletall_grass(-0.0005, -0.03, {"Savanna", "SavannaM"}, true)
|
register_doubletall_grass(-0.0005, -0.03, {"Savanna", "SavannaM"}, dry_index)
|
||||||
|
|
||||||
-- Large ferns
|
-- Large ferns
|
||||||
local register_double_fern = function(offset, scale, biomes)
|
local register_double_fern = function(offset, scale, biomes)
|
||||||
|
@ -2900,16 +2888,16 @@ local function register_decorations()
|
||||||
register_grass_decoration("tallgrass", 0, 0.06, grass_forest)
|
register_grass_decoration("tallgrass", 0, 0.06, grass_forest)
|
||||||
register_grass_decoration("tallgrass", 0.015, 0.045, grass_forest)
|
register_grass_decoration("tallgrass", 0.015, 0.045, grass_forest)
|
||||||
register_grass_decoration("tallgrass", 0.03, 0.03, grass_forest)
|
register_grass_decoration("tallgrass", 0.03, 0.03, grass_forest)
|
||||||
register_grass_decoration("tallgrass_dry", -0.03, 0.09, grass_mpf)
|
register_grass_decoration("tallgrass", -0.03, 0.09, grass_mpf, dry_index)
|
||||||
register_grass_decoration("tallgrass_dry", -0.015, 0.075, grass_mpf)
|
register_grass_decoration("tallgrass", -0.015, 0.075, grass_mpf, dry_index)
|
||||||
register_grass_decoration("tallgrass_dry", 0, 0.06, grass_mpf)
|
register_grass_decoration("tallgrass", 0, 0.06, grass_mpf, dry_index)
|
||||||
register_grass_decoration("tallgrass_dry", 0.01, 0.045, grass_mpf)
|
register_grass_decoration("tallgrass", 0.01, 0.045, grass_mpf, dry_index)
|
||||||
register_grass_decoration("tallgrass", 0.01, 0.05, grass_forest)
|
register_grass_decoration("tallgrass", 0.01, 0.05, grass_forest)
|
||||||
register_grass_decoration("tallgrass", 0.03, 0.03, grass_plains)
|
register_grass_decoration("tallgrass", 0.03, 0.03, grass_plains)
|
||||||
register_grass_decoration("tallgrass", 0.05, 0.01, grass_plains)
|
register_grass_decoration("tallgrass", 0.05, 0.01, grass_plains)
|
||||||
register_grass_decoration("tallgrass", 0.07, -0.01, grass_plains)
|
register_grass_decoration("tallgrass", 0.07, -0.01, grass_plains)
|
||||||
register_grass_decoration("tallgrass", 0.09, -0.03, grass_plains)
|
register_grass_decoration("tallgrass", 0.09, -0.03, grass_plains)
|
||||||
register_grass_decoration("tallgrass_dry", 0.18, -0.03, grass_savanna)
|
register_grass_decoration("tallgrass", 0.18, -0.03, grass_savanna, dry_index)
|
||||||
register_grass_decoration("tallgrass", 0.05, -0.03, grass_sparse)
|
register_grass_decoration("tallgrass", 0.05, -0.03, grass_sparse)
|
||||||
|
|
||||||
local fern_minimal = { "Jungle", "JungleM", "JungleEdge", "JungleEdgeM", "Taiga", "MegaTaiga", "MegaSpruceTaiga", "ColdTaiga" }
|
local fern_minimal = { "Jungle", "JungleM", "JungleEdge", "JungleEdgeM", "Taiga", "MegaTaiga", "MegaSpruceTaiga", "ColdTaiga" }
|
||||||
|
|
|
@ -383,6 +383,12 @@ Source path,Source file,Target path,Target file,xs,ys,xl,yl,xt,yt
|
||||||
/assets/minecraft/textures/blocks,double_plant_sunflower_top.png,/mods/ITEMS/mcl_flowers/textures,mcl_flowers_double_plant_sunflower_top.png,,,,,,
|
/assets/minecraft/textures/blocks,double_plant_sunflower_top.png,/mods/ITEMS/mcl_flowers/textures,mcl_flowers_double_plant_sunflower_top.png,,,,,,
|
||||||
/assets/minecraft/textures/blocks,double_plant_syringa_bottom.png,/mods/ITEMS/mcl_flowers/textures,mcl_flowers_double_plant_syringa_bottom.png,,,,,,
|
/assets/minecraft/textures/blocks,double_plant_syringa_bottom.png,/mods/ITEMS/mcl_flowers/textures,mcl_flowers_double_plant_syringa_bottom.png,,,,,,
|
||||||
/assets/minecraft/textures/blocks,double_plant_syringa_top.png,/mods/ITEMS/mcl_flowers/textures,mcl_flowers_double_plant_syringa_top.png,,,,,,
|
/assets/minecraft/textures/blocks,double_plant_syringa_top.png,/mods/ITEMS/mcl_flowers/textures,mcl_flowers_double_plant_syringa_top.png,,,,,,
|
||||||
|
/assets/minecraft/textures/blocks,double_plant_grass_bottom.png,/mods/ITEMS/mcl_flowers/textures,mcl_flowers_double_plant_grass_bottom.png,,,,,,
|
||||||
|
/assets/minecraft/textures/blocks,double_plant_grass_top.png,/mods/ITEMS/mcl_flowers/textures,mcl_flowers_double_plant_grass_top.png,,,,,,
|
||||||
|
/assets/minecraft/textures/blocks,double_plant_fern_bottom.png,/mods/ITEMS/mcl_flowers/textures,mcl_flowers_double_plant_fern_bottom.png,,,,,,
|
||||||
|
/assets/minecraft/textures/blocks,double_plant_fern_top.png,/mods/ITEMS/mcl_flowers/textures,mcl_flowers_double_plant_fern_top.png,,,,,,
|
||||||
|
/assets/minecraft/textures/blocks,tallgrass.png,/mods/ITEMS/mcl_flowers/textures,mcl_flowers_tallgrass.png,,,,,,
|
||||||
|
/assets/minecraft/textures/blocks,fern.png,/mods/ITEMS/mcl_flowers/textures,mcl_flowers_fern.png,,,,,,
|
||||||
/assets/minecraft/textures/blocks,flower_oxeye_daisy.png,/mods/ITEMS/mcl_flowers/textures,mcl_flowers_oxeye_daisy.png,,,,,,
|
/assets/minecraft/textures/blocks,flower_oxeye_daisy.png,/mods/ITEMS/mcl_flowers/textures,mcl_flowers_oxeye_daisy.png,,,,,,
|
||||||
/assets/minecraft/textures/blocks,flower_rose.png,/mods/ITEMS/mcl_flowers/textures,mcl_flowers_poppy.png,,,,,,
|
/assets/minecraft/textures/blocks,flower_rose.png,/mods/ITEMS/mcl_flowers/textures,mcl_flowers_poppy.png,,,,,,
|
||||||
/assets/minecraft/textures/blocks,flower_tulip_pink.png,/mods/ITEMS/mcl_flowers/textures,mcl_flowers_tulip_pink.png,,,,,,
|
/assets/minecraft/textures/blocks,flower_tulip_pink.png,/mods/ITEMS/mcl_flowers/textures,mcl_flowers_tulip_pink.png,,,,,,
|
||||||
|
|
|
|
@ -146,18 +146,20 @@ def convert_textures():
|
||||||
# Vines
|
# Vines
|
||||||
convert_alphatex(FOLIAG, tex_dir+"/blocks/vine.png", "16+32", str(PXSIZE), target_dir("/mods/ITEMS/mcl_core/textures")+"/mcl_core_vine.png")
|
convert_alphatex(FOLIAG, tex_dir+"/blocks/vine.png", "16+32", str(PXSIZE), target_dir("/mods/ITEMS/mcl_core/textures")+"/mcl_core_vine.png")
|
||||||
|
|
||||||
# Tall grass, fern
|
# Tall grass, fern (inventory images)
|
||||||
|
col = "49+172" # Plains grass color
|
||||||
|
convert_alphatex(GRASS, tex_dir+"/blocks/tallgrass.png", col, str(PXSIZE), target_dir("/mods/ITEMS/mcl_flowers/textures")+"/mcl_flowers_tallgrass_inv.png")
|
||||||
|
convert_alphatex(GRASS, tex_dir+"/blocks/fern.png", col, str(PXSIZE), target_dir("/mods/ITEMS/mcl_flowers/textures")+"/mcl_flowers_fern_inv.png")
|
||||||
|
convert_alphatex(GRASS, tex_dir+"/blocks/double_plant_fern_top.png", col, str(PXSIZE), target_dir("/mods/ITEMS/mcl_flowers/textures")+"/mcl_flowers_double_plant_fern_inv.png")
|
||||||
|
convert_alphatex(GRASS, tex_dir+"/blocks/double_plant_grass_top.png", col, str(PXSIZE), target_dir("/mods/ITEMS/mcl_flowers/textures")+"/mcl_flowers_double_plant_grass_inv.png")
|
||||||
|
|
||||||
|
# TODO: Convert grass palette
|
||||||
|
|
||||||
offset = [
|
offset = [
|
||||||
[ "49+172", "", "grass" ], # Default
|
[ "49+172", "", "grass" ], # Default grass: Plains
|
||||||
[ "0+255", "_dry", "dry_grass" ], # Dry grass: Savanna, Mesa Plateau F, Nether, …
|
[ "0+255", "_dry", "dry_grass" ], # Dry grass: Savanna, Mesa Plateau F, Nether, …
|
||||||
]
|
]
|
||||||
for o in offset:
|
for o in offset:
|
||||||
convert_alphatex(GRASS, tex_dir+"/blocks/tallgrass.png", o[0], str(PXSIZE), target_dir("/mods/ITEMS/mcl_flowers/textures")+"/mcl_flowers_tallgrass"+o[1]+".png")
|
|
||||||
convert_alphatex(GRASS, tex_dir+"/blocks/fern.png", o[0], str(PXSIZE), target_dir("/mods/ITEMS/mcl_flowers/textures")+"/mcl_flowers_fern"+o[1]+".png")
|
|
||||||
convert_alphatex(GRASS, tex_dir+"/blocks/double_plant_fern_bottom.png", o[0], str(PXSIZE), target_dir("/mods/ITEMS/mcl_flowers/textures")+"/mcl_flowers_double_plant_fern_bottom"+o[1]+".png")
|
|
||||||
convert_alphatex(GRASS, tex_dir+"/blocks/double_plant_fern_top.png", o[0], str(PXSIZE), target_dir("/mods/ITEMS/mcl_flowers/textures")+"/mcl_flowers_double_plant_fern_top"+o[1]+".png")
|
|
||||||
convert_alphatex(GRASS, tex_dir+"/blocks/double_plant_grass_bottom.png", o[0], str(PXSIZE), target_dir("/mods/ITEMS/mcl_flowers/textures")+"/mcl_flowers_double_plant_grass_bottom"+o[1]+".png")
|
|
||||||
convert_alphatex(GRASS, tex_dir+"/blocks/double_plant_grass_top.png", o[0], str(PXSIZE), target_dir("/mods/ITEMS/mcl_flowers/textures")+"/mcl_flowers_double_plant_grass_top"+o[1]+".png")
|
|
||||||
|
|
||||||
os.system("convert "+GRASS+" -crop 1x1+"+o[0]+" -depth 8 -resize "+str(PXSIZE)+"x"+str(PXSIZE)+" "+tempfile1.name)
|
os.system("convert "+GRASS+" -crop 1x1+"+o[0]+" -depth 8 -resize "+str(PXSIZE)+"x"+str(PXSIZE)+" "+tempfile1.name)
|
||||||
os.system("composite -compose Multiply "+tempfile1.name+" "+tex_dir+"/blocks/grass_top.png "+target_dir("/mods/ITEMS/mcl_core/textures")+"/default_"+o[2]+".png")
|
os.system("composite -compose Multiply "+tempfile1.name+" "+tex_dir+"/blocks/grass_top.png "+target_dir("/mods/ITEMS/mcl_core/textures")+"/default_"+o[2]+".png")
|
||||||
|
|