Made all leaves draw as cubes in the inventory regardless of whether

they are plantlike or not in the world.  This has the side effect that a
dropped leaf block will look like a flat sprite.  Oh well, no other way
to fix it.

Adjusted the offset of the textures so that leaves place more accurately
in the world (blame this on the engine, it has no option for me to
adjust the precise vertical visual scale independently from the
horizontal scale, so I have to fake it with the textures).
This commit is contained in:
Vanessa Ezekowitz 2013-11-14 20:39:07 -05:00
parent 2a85996d00
commit d3e68b3149
18 changed files with 16 additions and 4 deletions

View File

@ -33,6 +33,9 @@ new_default_leaves = moretrees:clone_node("default:leaves")
if moretrees.enable_default_leafdecay then if moretrees.enable_default_leafdecay then
new_default_leaves.groups = {snappy=3, flammable=2, leaves=1} new_default_leaves.groups = {snappy=3, flammable=2, leaves=1}
end end
if moretrees.plantlike_leaves then
new_default_leaves.inventory_image = minetest.inventorycube("default_leaves.png")
end
new_default_leaves.drawtype = moretrees_new_leaves_drawtype new_default_leaves.drawtype = moretrees_new_leaves_drawtype
new_default_leaves.visual_scale = moretrees_new_leaves_visual_scale new_default_leaves.visual_scale = moretrees_new_leaves_visual_scale
new_default_leaves.tiles = {"default_leaves"..moretrees_new_leaves_extension} new_default_leaves.tiles = {"default_leaves"..moretrees_new_leaves_extension}
@ -42,7 +45,9 @@ new_default_jungle_leaves = moretrees:clone_node("default:jungleleaves")
if moretrees.enable_default_jungle_leafdecay then if moretrees.enable_default_jungle_leafdecay then
new_default_jungle_leaves.groups = {snappy=3, flammable=2, leaves=1} new_default_jungle_leaves.groups = {snappy=3, flammable=2, leaves=1}
end end
new_default_jungle_leaves = moretrees:clone_node("default:jungleleaves") if moretrees.plantlike_leaves then
new_default_jungle_leaves.inventory_image = minetest.inventorycube("default_jungleleaves.png")
end
new_default_jungle_leaves.drawtype = moretrees_new_leaves_drawtype new_default_jungle_leaves.drawtype = moretrees_new_leaves_drawtype
new_default_jungle_leaves.visual_scale = moretrees_new_leaves_visual_scale new_default_jungle_leaves.visual_scale = moretrees_new_leaves_visual_scale
new_default_jungle_leaves.tiles = {"default_jungleleaves"..moretrees_new_leaves_extension} new_default_jungle_leaves.tiles = {"default_jungleleaves"..moretrees_new_leaves_extension}
@ -130,11 +135,17 @@ for i in ipairs(moretrees.treelist) do
droprarity = 20 droprarity = 20
end end
moretrees_render_inventory_image = nil
if moretrees.plantlike_leaves then
moretrees_render_inventory_image = minetest.inventorycube
end
minetest.register_node("moretrees:"..treename.."_leaves", { minetest.register_node("moretrees:"..treename.."_leaves", {
description = treedesc.." Leaves", description = treedesc.." Leaves",
drawtype = moretrees_new_leaves_drawtype, drawtype = moretrees_new_leaves_drawtype,
visual_scale = moretrees_new_leaves_visual_scale, visual_scale = moretrees_new_leaves_visual_scale,
tiles = { "moretrees_"..treename.."_leaves"..moretrees_new_leaves_extension }, tiles = { "moretrees_"..treename.."_leaves"..moretrees_new_leaves_extension },
inventory_image = moretrees_render_inventory_image("moretrees_"..treename.."_leaves.png"),
paramtype = "light", paramtype = "light",
groups = {snappy=3, flammable=2, leaves=1, moretrees_leaves=1}, groups = {snappy=3, flammable=2, leaves=1, moretrees_leaves=1},
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
@ -341,6 +352,7 @@ for color = 1, 3 do
drawtype = moretrees_new_leaves_drawtype, drawtype = moretrees_new_leaves_drawtype,
visual_scale = moretrees_new_leaves_visual_scale, visual_scale = moretrees_new_leaves_visual_scale,
tiles = {"moretrees_jungletree_leaves_"..jungleleaves[color]..moretrees_new_leaves_extension}, tiles = {"moretrees_jungletree_leaves_"..jungleleaves[color]..moretrees_new_leaves_extension},
inventory_image = moretrees_render_inventory_image("moretrees_jungletree_leaves_"..jungleleaves[color]..".png"),
paramtype = "light", paramtype = "light",
groups = {snappy=3, flammable=2, leaves=1, moretrees_leaves=1}, groups = {snappy=3, flammable=2, leaves=1, moretrees_leaves=1},
drop = { drop = {
@ -360,9 +372,9 @@ minetest.register_node("moretrees:fir_leaves_bright", {
drawtype = moretrees_new_leaves_drawtype, drawtype = moretrees_new_leaves_drawtype,
visual_scale = moretrees_new_leaves_visual_scale, visual_scale = moretrees_new_leaves_visual_scale,
description = "Douglas Fir Leaves (Bright)", description = "Douglas Fir Leaves (Bright)",
tile_images = { "moretrees_fir_leaves_bright"..moretrees_new_leaves_extension }, tiles = { "moretrees_fir_leaves_bright"..moretrees_new_leaves_extension },
inventory_image = moretrees_render_inventory_image("moretrees_fir_leaves_bright.png"),
paramtype = "light", paramtype = "light",
groups = {snappy=3, flammable=2, leaves=1, moretrees_leaves=1 }, groups = {snappy=3, flammable=2, leaves=1, moretrees_leaves=1 },
drop = { drop = {
max_items = 1, max_items = 1,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 387 B

After

Width:  |  Height:  |  Size: 390 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 401 B

After

Width:  |  Height:  |  Size: 404 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 336 B

After

Width:  |  Height:  |  Size: 338 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 401 B

After

Width:  |  Height:  |  Size: 404 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 429 B

After

Width:  |  Height:  |  Size: 433 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 208 B

After

Width:  |  Height:  |  Size: 212 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 208 B

After

Width:  |  Height:  |  Size: 212 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 202 B

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 202 B

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 202 B

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 621 B

After

Width:  |  Height:  |  Size: 620 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 762 B

After

Width:  |  Height:  |  Size: 766 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 208 B

After

Width:  |  Height:  |  Size: 212 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 202 B

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 208 B

After

Width:  |  Height:  |  Size: 212 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 208 B

After

Width:  |  Height:  |  Size: 212 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 384 B

After

Width:  |  Height:  |  Size: 388 B