Use hardware coloring for tallgrass and friends

This commit is contained in:
Wuzzy 2017-11-16 03:13:19 +01:00
parent 8db574d30e
commit a9d95dea23
22 changed files with 113 additions and 197 deletions

View File

@ -447,20 +447,10 @@ function mcl_util.generate_on_place_plant_function(condition)
end
-- Check placement rules
local result = condition(place_pos, node, itemstack)
if result == true or type(result) == "string" then
local itemstack_place
if type(result) == "string" then
-- 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())
local result, param2 = condition(place_pos, node, itemstack)
if result == true then
local idef = itemstack:get_definition()
local new_itemstack, success = minetest.item_place_node(itemstack, placer, pointed_thing, param2)
if success then
if idef.sounds and idef.sounds.place then

View File

@ -152,7 +152,6 @@ mobs_mc.override.replace = {
{ "mcl_core:dirt_with_grass", "mcl_core:dirt", -1 },
{ "mcl_core:dirt_with_dry_grass", "mcl_core:dirt", -1 },
{ "mcl_flowers:tallgrass", "air", 0 },
{ "mcl_flowers:tallgrass_dry", "air", 0 },
},
-- Silverfish populate stone, etc. with monster eggs
silverfish = {

View File

@ -316,6 +316,7 @@ minetest.register_node("mcl_core:dirt_with_grass", {
return mcl_core.on_snowable_construct(pos)
end,
_mcl_snowed = "mcl_core:dirt_with_grass_snow",
_mcl_grass_palette_index = 0,
_mcl_blast_resistance = 3,
_mcl_hardness = 0.6,
})
@ -334,6 +335,7 @@ minetest.register_node("mcl_core:dirt_with_dry_grass", {
}),
on_construct = mcl_core.on_snowable_construct,
_mcl_snowed = "mcl_core:dirt_with_dry_grass_snow",
_mcl_grass_palette_index = 1,
_mcl_blast_resistance = 3,
_mcl_hardness = 0.6,
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 B

View File

@ -220,16 +220,13 @@ mcl_dye.apply_bone_meal = function(pointed_thing)
n = minetest.get_node(pos)
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
if math.random(1,100) <= 90 then
-- 90% tall grass, 10% flower
if math.random(1,100) <= 90 then
if n2.name == "mcl_core:dirt_with_dry_grass" then
minetest.add_node(pos, {name="mcl_flowers:tallgrass_dry"})
else
minetest.add_node(pos, {name="mcl_flowers:tallgrass"})
end
local col = minetest.registered_nodes[n2.name]._mcl_grass_palette_index
minetest.add_node(pos, {name="mcl_flowers:tallgrass", param2=col})
else
if n2.name == "mcl_core:dirt_with_dry_grass" then
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 topnode = minetest.get_node(toppos)
if minetest.registered_nodes[topnode.name].buildable_to then
minetest.set_node(pos, { name = "mcl_flowers:double_grass" })
minetest.set_node(toppos, { name = "mcl_flowers:double_grass_top" })
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" })
minetest.set_node(pos, { name = "mcl_flowers:double_grass", param2 = n.param2 })
minetest.set_node(toppos, { name = "mcl_flowers:double_grass_top", param2 = n.param2 })
return true
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 topnode = minetest.get_node(toppos)
if minetest.registered_nodes[topnode.name].buildable_to then
minetest.set_node(pos, { name = "mcl_flowers:double_fern" })
minetest.set_node(toppos, { name = "mcl_flowers:double_fern_top" })
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" })
minetest.set_node(pos, { name = "mcl_flowers:double_fern", param2 = n.param2 })
minetest.set_node(toppos, { name = "mcl_flowers:double_fern_top", param2 = n.param2 })
return true
end
end

View File

@ -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)
if not soil_node then return false end
local dry = minetest.registered_nodes[itemstack:get_name()]._mcl_dry_override
local replace
if dry and (soil_node.name == "mcl_core:dirt_with_dry_grass" or soil_node.name == "mcl_core:dirt_with_dry_grass_snow") then
replace = dry
local has_palette = minetest.registered_nodes[itemstack:get_name()].palette ~= nil
local colorize = 0
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
colorize = 1
end
--[[ Placement requirements:
@ -31,10 +31,7 @@ local on_place_flower = mcl_util.generate_on_place_plant_function(function(pos,
end
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
if ok and replace then
return replace
end
return ok
return ok, colorize
end)
local function add_simple_flower(name, desc, image, simple_selection_box)
@ -84,100 +81,61 @@ local wheat_seed_drop = {
}
}
-- Tall Grass and Fern
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}
-- CHECKME: How does tall grass behave when pushed by a piston?
local id, idf, longdesc, longdesc_fern, create_entry, shears_drop, shears_drop_fern
if i==1 then
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 ---
local def_tallgrass = {
description = "Tall Grass",
drawtype = "plantlike",
_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_hidden = false,
waving = 1,
tiles = {"mcl_flowers_tallgrass.png"},
inventory_image = "mcl_flowers_tallgrass_inv.png",
wield_image = "mcl_flowers_tallgrass_inv.png",
selection_box = {
type = "fixed",
fixed = {{ -6/16, -8/16, -6/16, 6/16, 4/16, 6/16 }},
},
paramtype = "light",
paramtype2 = "color",
palette = "mcl_core_palette_grass.png",
sunlight_propagates = true,
walkable = false,
buildable_to = true,
is_ground_content = true,
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(),
drop = wheat_seed_drop,
_mcl_shears_drop = true,
node_placement_prediction = "",
on_place = on_place_flower,
_mcl_blast_resistance = 0,
_mcl_hardness = 0,
}
minetest.register_node("mcl_flowers:tallgrass", def_tallgrass)
--- Tall Grass ---
minetest.register_node("mcl_flowers:"..id, {
description = "Tall Grass",
drawtype = "plantlike",
_doc_items_longdesc = longdesc,
_doc_items_usagehelp = plant_usage_help,
_doc_items_hidden = hidden,
_doc_items_create_entry = create_entry,
waving = 1,
tiles = {"mcl_flowers_"..id..".png"},
inventory_image = "mcl_flowers_"..id..".png",
wield_image = "mcl_flowers_"..id..".png",
selection_box = {
type = "fixed",
fixed = {{ -6/16, -8/16, -6/16, 6/16, 4/16, 6/16 }},
},
paramtype = "light",
sunlight_propagates = true,
walkable = false,
buildable_to = true,
is_ground_content = true,
groups = tgf_groups,
sounds = mcl_sounds.node_sound_leaves_defaults(),
drop = wheat_seed_drop,
_mcl_shears_drop = shears_drop,
_mcl_dry_override = "mcl_flowers:tallgrass_dry",
node_placement_prediction = "",
on_place = on_place_flower,
_mcl_blast_resistance = 0,
_mcl_hardness = 0,
})
--- Fern ---
-- The fern is very similar to tall grass, so we can copy a lot from it.
local def_fern = table.copy(def_tallgrass)
def_fern.description = "Fern"
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."
def_fern.tiles = { "mcl_flowers_fern.png" }
def_fern.inventory_image = "mcl_flowers_fern_inv.png"
def_fern.wield_image = "mcl_flowers_fern_inv.png"
def_fern.selection_box = {
type = "fixed",
fixed = { -6/16, -0.5, -6/16, 6/16, 5/16, 6/16 },
}
--- Fern ---
minetest.register_node("mcl_flowers:"..idf, {
description = "Fern",
_doc_items_longdesc = longdesc_fern,
_doc_items_usagehelp = plant_usage_help,
_doc_items_create_entry = create_entry,
_doc_items_hidden = hidden,
drawtype = "plantlike",
waving = 1,
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",
fixed = { -6/16, -0.5, -6/16, 6/16, 5/16, 6/16 },
},
})
end
minetest.register_node("mcl_flowers:fern", def_fern)
doc.add_entry_alias("nodes", "mcl_flowers:tallgrass", "nodes", "mcl_flowers:tallgrass_dry")
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
inv_img = top_img
end
local flowergroup, place_flowerlike, usagehelp, noncreative, create_entry
local flowergroup, place_flowerlike, usagehelp, noncreative, create_entry, paramtype2, palette
if is_flower == nil then
is_flower = true
end
@ -187,6 +145,10 @@ local function add_large_plant(name, desc, longdesc, bottom_img, top_img, inv_im
else
place_flowerlike = 2
end
if grass_color then
paramtype2 = "color"
palette = "mcl_core_palette_grass.png"
end
if longdesc == nil then
noncreative = 1
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,
sunlight_propagates = true,
paramtype = "light",
paramtype2 = paramtype2,
palette = palette,
walkable = false,
buildable_to = true,
drop = drop_bottom,
_mcl_shears_drop = shears_drop,
_mcl_dry_override = dry_override,
node_placement_prediction = "",
selection_box = {
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 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
local dry_override = minetest.registered_nodes[itemstring]._mcl_dry_override
if dry_override and (floorname == "mcl_core:dirt_with_dry_grass" or floorname == "mcl_core:dirt_with_dry_grass_snow") then
itemstring = dry_override
local param2
if grass_color and (floorname == "mcl_core:dirt_with_dry_grass" or floorname == "mcl_core:dirt_with_dry_grass_snow") then
param2 = 1
end
-- Success! We can now place the flower
minetest.sound_play(minetest.registered_nodes[itemstring].sounds.place, {pos = bottom, gain=1})
minetest.set_node(bottom, {name=itemstring})
minetest.set_node(top, {name=itemstring.."_top"})
minetest.set_node(bottom, {name=itemstring, param2=param2})
minetest.set_node(top, {name=itemstring.."_top", param2=param2})
if not minetest.settings:get_bool("creative_mode") then
itemstack:take_item()
end
@ -305,6 +268,8 @@ local function add_large_plant(name, desc, longdesc, bottom_img, top_img, inv_im
tiles = { top_img },
sunlight_propagates = true,
paramtype = "light",
paramtype2 = paramtype2,
palette = palette,
walkable = false,
buildable_to = true,
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.
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, longdesc_fern, dry, dry_override_grass, dry_override_fern
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
local longdesc_grass = "Double tallgrass a variant of tall grass and occupies two blocks. It can be harvested for wheat seeds."
local longdesc_fern = "Large fern is a variant of fern and occupies two blocks. It can be harvested for wheat seeds."
doc.add_entry_alias("nodes", "mcl_flowers:double_grass", "nodes", "mcl_flowers:double_grass_dry")
doc.add_entry_alias("nodes", "mcl_flowers:double_grass", "nodes", "mcl_flowers:double_grass_dry_top")
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")
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)
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)
minetest.register_abm({
label = "Pop out flowers",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 192 B

After

Width:  |  Height:  |  Size: 348 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 192 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 178 B

After

Width:  |  Height:  |  Size: 178 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 178 B

After

Width:  |  Height:  |  Size: 324 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 224 B

After

Width:  |  Height:  |  Size: 412 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 224 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 166 B

After

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 166 B

After

Width:  |  Height:  |  Size: 315 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 202 B

After

Width:  |  Height:  |  Size: 353 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 202 B

After

Width:  |  Height:  |  Size: 202 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 196 B

After

Width:  |  Height:  |  Size: 323 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 196 B

After

Width:  |  Height:  |  Size: 196 B

View File

@ -21,9 +21,7 @@ wieldview.transform = {
["mcl_flowers:blue_orchid"]="R270",
["mcl_flowers:oxeye_daisy"]="R270",
["mcl_flowers:fern"]="R270",
["mcl_flowers:fern_dry"]="R270",
["mcl_flowers:tallgrass"]="R270",
["mcl_flowers:tallgrass_dry"]="R270",
["mcl_buckets:bucket_empty"]="R270",
["mcl_buckets:bucket_water"]="R270",
["mcl_buckets:bucket_lava"]="R270",

View File

@ -1600,7 +1600,7 @@ end
-- All mapgens except mgv6
-- 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
if grasstype == "fern" then
node = "mcl_flowers:fern"
@ -1610,10 +1610,6 @@ local function register_grass_decoration(grasstype, offset, scale, biomes)
node = "mcl_flowers:tallgrass"
place_on = {"group:grass_block_no_snow"}
seed = 420
elseif grasstype == "tallgrass_dry" then
node = "mcl_flowers:tallgrass_dry"
place_on = {"group:grass_block_no_snow"}
seed = 420
end
local noise = {
offset = offset,
@ -1632,6 +1628,7 @@ local function register_grass_decoration(grasstype, offset, scale, biomes)
y_min = 1,
y_max = mcl_vars.mg_overworld_max,
decoration = node,
param2 = param2,
})
end
@ -2399,19 +2396,10 @@ local function register_decorations()
num_spawn_by = 1,
})
-- Doubletall grass
local register_doubletall_grass = function(offset, scale, biomes, is_dry)
local dry_index = minetest.registered_nodes["mcl_core:dirt_with_dry_grass"]._mcl_grass_palette_index
local bottom, top, tallgrass
if is_dry then
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
-- Doubletall grass
local register_doubletall_grass = function(offset, scale, biomes, param2)
minetest.register_decoration({
deco_type = "schematic",
@ -2419,12 +2407,12 @@ local function register_decorations()
size = { x=1, y=3, z=1 },
data = {
{ name = "air", prob = 0 },
{ name = bottom, param1=255, },
{ name = top, param1=255, },
{ name = "mcl_flowers:double_grass", param1=255, param2=param2 },
{ name = "mcl_flowers:double_grass_top", param1=255, param2=param2 },
},
},
replacements = {
[tallgrass] = bottom,
["mcl_flowers:tallgrass"] = "mcl_flowers:double_grass",
},
place_on = {"group:grass_block_no_snow"},
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.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
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.015, 0.045, 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_dry", -0.015, 0.075, grass_mpf)
register_grass_decoration("tallgrass_dry", 0, 0.06, grass_mpf)
register_grass_decoration("tallgrass_dry", 0.01, 0.045, grass_mpf)
register_grass_decoration("tallgrass", -0.03, 0.09, grass_mpf, dry_index)
register_grass_decoration("tallgrass", -0.015, 0.075, grass_mpf, dry_index)
register_grass_decoration("tallgrass", 0, 0.06, grass_mpf, dry_index)
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.03, 0.03, 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.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)
local fern_minimal = { "Jungle", "JungleM", "JungleEdge", "JungleEdgeM", "Taiga", "MegaTaiga", "MegaSpruceTaiga", "ColdTaiga" }

View File

@ -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_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_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_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,,,,,,

1 Source path Source file Target path Target file xs ys xl yl xt yt
383 /assets/minecraft/textures/blocks double_plant_sunflower_top.png /mods/ITEMS/mcl_flowers/textures mcl_flowers_double_plant_sunflower_top.png
384 /assets/minecraft/textures/blocks double_plant_syringa_bottom.png /mods/ITEMS/mcl_flowers/textures mcl_flowers_double_plant_syringa_bottom.png
385 /assets/minecraft/textures/blocks double_plant_syringa_top.png /mods/ITEMS/mcl_flowers/textures mcl_flowers_double_plant_syringa_top.png
386 /assets/minecraft/textures/blocks double_plant_grass_bottom.png /mods/ITEMS/mcl_flowers/textures mcl_flowers_double_plant_grass_bottom.png
387 /assets/minecraft/textures/blocks double_plant_grass_top.png /mods/ITEMS/mcl_flowers/textures mcl_flowers_double_plant_grass_top.png
388 /assets/minecraft/textures/blocks double_plant_fern_bottom.png /mods/ITEMS/mcl_flowers/textures mcl_flowers_double_plant_fern_bottom.png
389 /assets/minecraft/textures/blocks double_plant_fern_top.png /mods/ITEMS/mcl_flowers/textures mcl_flowers_double_plant_fern_top.png
390 /assets/minecraft/textures/blocks tallgrass.png /mods/ITEMS/mcl_flowers/textures mcl_flowers_tallgrass.png
391 /assets/minecraft/textures/blocks fern.png /mods/ITEMS/mcl_flowers/textures mcl_flowers_fern.png
392 /assets/minecraft/textures/blocks flower_oxeye_daisy.png /mods/ITEMS/mcl_flowers/textures mcl_flowers_oxeye_daisy.png
393 /assets/minecraft/textures/blocks flower_rose.png /mods/ITEMS/mcl_flowers/textures mcl_flowers_poppy.png
394 /assets/minecraft/textures/blocks flower_tulip_pink.png /mods/ITEMS/mcl_flowers/textures mcl_flowers_tulip_pink.png

View File

@ -146,18 +146,20 @@ def convert_textures():
# Vines
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 = [
[ "49+172", "", "grass" ], # Default
[ "49+172", "", "grass" ], # Default grass: Plains
[ "0+255", "_dry", "dry_grass" ], # Dry grass: Savanna, Mesa Plateau F, Nether, …
]
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("composite -compose Multiply "+tempfile1.name+" "+tex_dir+"/blocks/grass_top.png "+target_dir("/mods/ITEMS/mcl_core/textures")+"/default_"+o[2]+".png")