From ff3c34cb2f380e78c51cc81098d552f07cbada54 Mon Sep 17 00:00:00 2001 From: Auke Kok Date: Tue, 18 Oct 2016 14:09:34 -0700 Subject: Convert to meshoptions plantlike. - remove custom model for corn! - corn model stays the same shape, param2 = 3 - tomato now is + shaped, not x, param2 = 1 --- tomato.lua | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'tomato.lua') diff --git a/tomato.lua b/tomato.lua index a659961..48b75b9 100644 --- a/tomato.lua +++ b/tomato.lua @@ -19,6 +19,7 @@ minetest.register_node("crops:tomato_seed", { wield_image = "crops_tomato_seed.png", tiles = { "crops_tomato_plant_1.png" }, drawtype = "plantlike", + paramtype2 = "meshoptions", waving = 1, sunlight_propagates = true, use_texture_alpha = true, @@ -34,7 +35,7 @@ minetest.register_node("crops:tomato_seed", { if minetest.get_item_group(under.name, "soil") <= 1 then return end - crops.plant(pointed_thing.above, {name="crops:tomato_plant_1"}) + crops.plant(pointed_thing.above, {name="crops:tomato_plant_1", param2 = 1}) if not minetest.setting_getbool("creative_mode") then itemstack:take_item() end @@ -47,6 +48,7 @@ minetest.register_node("crops:tomato_plant_" .. stage , { description = S("Tomato plant"), tiles = { "crops_tomato_plant_" .. stage .. ".png" }, drawtype = "plantlike", + paramtype2 = "meshoptions", waving = 1, sunlight_propagates = true, use_texture_alpha = true, @@ -66,6 +68,7 @@ minetest.register_node("crops:tomato_plant_5" , { description = S("Tomato plant"), tiles = { "crops_tomato_plant_5.png" }, drawtype = "plantlike", + paramtype2 = "meshoptions", waving = 1, sunlight_propagates = true, use_texture_alpha = true, @@ -88,7 +91,7 @@ minetest.register_node("crops:tomato_plant_5" , { local meta = minetest.get_meta(pos) local ttl = meta:get_int("crops_tomato_ttl") if ttl > 1 then - minetest.swap_node(pos, { name = "crops:tomato_plant_4"}) + minetest.swap_node(pos, { name = "crops:tomato_plant_4", param2 = 1}) meta:set_int("crops_tomato_ttl", ttl - 1) else crops.die(pos) @@ -100,6 +103,7 @@ minetest.register_node("crops:tomato_plant_6", { description = S("Tomato plant"), tiles = { "crops_tomato_plant_6.png" }, drawtype = "plantlike", + paramtype2 = "meshoptions", waving = 1, sunlight_propagates = true, use_texture_alpha = true, @@ -142,7 +146,7 @@ minetest.register_abm({ n = string.gsub(n, "3", "4") n = string.gsub(n, "2", "3") n = string.gsub(n, "1", "2") - minetest.swap_node(pos, { name = n }) + minetest.swap_node(pos, { name = n, param2 = 1 }) end }) @@ -168,7 +172,7 @@ minetest.register_abm({ ttl = math.random(4 - (4 * (damage / 100)), 6 - (5 * (damage / 100))) end if ttl > 1 then - minetest.swap_node(pos, { name = "crops:tomato_plant_5" }) + minetest.swap_node(pos, { name = "crops:tomato_plant_5", param2 = 1 }) meta:set_int("crops_tomato_ttl", ttl) else crops.die(pos) @@ -177,7 +181,7 @@ minetest.register_abm({ }) crops.tomato_die = function(pos) - minetest.set_node(pos, { name = "crops:tomato_plant_6" }) + minetest.set_node(pos, { name = "crops:tomato_plant_6", param2 = 1 }) end local properties = { -- cgit v1.2.3