Make leaves wave when shaders are on and regular cubical drawtype is selected.

This commit is contained in:
Vanessa Ezekowitz 2013-11-21 18:40:55 -05:00
parent 98d76a8ea1
commit 374116bc6e

View File

@ -136,8 +136,11 @@ for i in ipairs(moretrees.treelist) do
end end
moretrees_leaves_inventory_image = nil moretrees_leaves_inventory_image = nil
moretrees_waving_leaves = nil
if moretrees.plantlike_leaves then if moretrees.plantlike_leaves then
moretrees_leaves_inventory_image = minetest.inventorycube("moretrees_"..treename.."_leaves.png") moretrees_leaves_inventory_image = minetest.inventorycube("moretrees_"..treename.."_leaves.png")
moretrees_waving_leaves = "waving"
end end
minetest.register_node("moretrees:"..treename.."_leaves", { minetest.register_node("moretrees:"..treename.."_leaves", {
@ -147,6 +150,7 @@ for i in ipairs(moretrees.treelist) do
tiles = { "moretrees_"..treename.."_leaves"..moretrees_new_leaves_extension }, tiles = { "moretrees_"..treename.."_leaves"..moretrees_new_leaves_extension },
inventory_image = moretrees_leaves_inventory_image, inventory_image = moretrees_leaves_inventory_image,
paramtype = "light", paramtype = "light",
paramtype2 = moretrees_waving_leaves,
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(),
@ -349,8 +353,10 @@ for color = 1, 3 do
local leave_name = "moretrees:jungletree_leaves_"..jungleleaves[color] local leave_name = "moretrees:jungletree_leaves_"..jungleleaves[color]
moretrees_leaves_inventory_image = nil moretrees_leaves_inventory_image = nil
moretrees_waving_leaves = nil
if moretrees.plantlike_leaves then if moretrees.plantlike_leaves then
moretrees_leaves_inventory_image = minetest.inventorycube("moretrees_jungletree_leaves_"..jungleleaves[color]..".png") moretrees_leaves_inventory_image = minetest.inventorycube("moretrees_jungletree_leaves_"..jungleleaves[color]..".png")
moretrees_waving_leaves = "waving"
end end
minetest.register_node(leave_name, { minetest.register_node(leave_name, {
@ -360,6 +366,7 @@ for color = 1, 3 do
tiles = {"moretrees_jungletree_leaves_"..jungleleaves[color]..moretrees_new_leaves_extension}, tiles = {"moretrees_jungletree_leaves_"..jungleleaves[color]..moretrees_new_leaves_extension},
inventory_image = moretrees_leaves_inventory_image, inventory_image = moretrees_leaves_inventory_image,
paramtype = "light", paramtype = "light",
paramtype2 = moretrees_waving_leaves,
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,
@ -375,8 +382,10 @@ end
-- Extra needles for firs -- Extra needles for firs
moretrees_leaves_inventory_image = nil moretrees_leaves_inventory_image = nil
moretrees_waving_leaves = nil
if moretrees.plantlike_leaves then if moretrees.plantlike_leaves then
moretrees_leaves_inventory_image = minetest.inventorycube("moretrees_fir_leaves_bright.png") moretrees_leaves_inventory_image = minetest.inventorycube("moretrees_fir_leaves_bright.png")
moretrees_waving_leaves = "waving"
end end
minetest.register_node("moretrees:fir_leaves_bright", { minetest.register_node("moretrees:fir_leaves_bright", {
@ -386,6 +395,7 @@ minetest.register_node("moretrees:fir_leaves_bright", {
tiles = { "moretrees_fir_leaves_bright"..moretrees_new_leaves_extension }, tiles = { "moretrees_fir_leaves_bright"..moretrees_new_leaves_extension },
inventory_image = moretrees_leaves_inventory_image, inventory_image = moretrees_leaves_inventory_image,
paramtype = "light", paramtype = "light",
paramtype2 = moretrees_waving_leaves,
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,