From bd9dfcedd1b6bb4610701c9207deaea90dae6d5a Mon Sep 17 00:00:00 2001 From: DanDuncombe Date: Sun, 10 Nov 2013 20:08:42 +0000 Subject: [PATCH] Cylindrical trunk --- mods/farming/init.lua | 17 +++++++---------- mods/trees/registration.lua | 33 ++++++++++++++++++++++++++++++--- 2 files changed, 37 insertions(+), 13 deletions(-) diff --git a/mods/farming/init.lua b/mods/farming/init.lua index 25f0b66..66452aa 100644 --- a/mods/farming/init.lua +++ b/mods/farming/init.lua @@ -326,14 +326,6 @@ minetest.register_craftitem("farming:soy", { --Cake -- -local cakebox = {} -local detail = 16 -local sehne -for i = 1, detail-1 do - sehne = math.sqrt(0.25 - (((i/detail)-0.5)^2)) - cakebox[i]={(i/detail)-0.5, -0.5, -sehne, (i/detail)+(1/detail)-0.5, 0.0, sehne} -end - minetest.register_node("farming:cake", { drawtype = "nodebox", description = "CAKE!!!", @@ -343,8 +335,13 @@ minetest.register_node("farming:cake", { drop = "farming:cake", on_use=minetest.item_eat(16), node_box = { - type = "fixed", - fixed = cakebox, + type = "fixed", + fixed = { + {-8/16,-8/16,-4/16,8/16,8/16,4/16}, + {-4/16,-8/16,-8/16,4/16,8/16,8/16}, + {-7/16,-8/16,-6/16,7/16,8/16,6/16}, + {-6/16,-8/16,-7/16,6/16,8/16,7/16}, + }, }, selection_box = { type = "fixed", diff --git a/mods/trees/registration.lua b/mods/trees/registration.lua index e2619a5..bf65759 100644 --- a/mods/trees/registration.lua +++ b/mods/trees/registration.lua @@ -152,8 +152,17 @@ function realtest.register_tree(name, TreeDef) sounds = default.node_sound_wood_defaults(), drop = tree.name.."_plank 4", drop_on_dropping = tree.name.."_log", - drawtype = "normal", + drawtype = "nodebox", paramtype = "light", + node_box = { + type = "fixed", + fixed = { + {-8/16,-8/16,-4/16,8/16,8/16,4/16}, + {-4/16,-8/16,-8/16,4/16,8/16,8/16}, + {-7/16,-8/16,-6/16,7/16,8/16,6/16}, + {-6/16,-8/16,-7/16,6/16,8/16,7/16}, + }, + }, on_dig = function(pos, node, digger) minetest.debug("node_dig") @@ -309,8 +318,17 @@ function realtest.register_tree(name, TreeDef) groups = {tree=1,snappy=1,choppy=2,flammable=2,dropping_node=1,drop_on_dig=1}, sounds = default.node_sound_wood_defaults(), drop = tree.name.."_log", - drawtype = "normal", + drawtype = "nodebox", paramtype = "light", + node_box = { + type = "fixed", + fixed = { + {-8/16,-8/16,-4/16,8/16,8/16,4/16}, + {-4/16,-8/16,-8/16,4/16,8/16,8/16}, + {-7/16,-8/16,-6/16,7/16,8/16,6/16}, + {-6/16,-8/16,-7/16,6/16,8/16,7/16}, + }, + }, }) minetest.register_node(tree.name.."_trunk_top", { @@ -318,7 +336,7 @@ function realtest.register_tree(name, TreeDef) groups = {tree=1,snappy=1,choppy=2,flammable=2,dropping_node=1,drop_on_dig=1}, sounds = default.node_sound_wood_defaults(), drop = tree.name.."_log", - drawtype = "normal", + drawtype = "nodebox", paramtype = "light", after_dig_node = function(pos, oldnode, oldmetadata, digger) for i = 1,#tree.leaves do @@ -328,6 +346,15 @@ function realtest.register_tree(name, TreeDef) end end end, + node_box = { + type = "fixed", + fixed = { + {-8/16,-8/16,-4/16,8/16,8/16,4/16}, + {-4/16,-8/16,-8/16,4/16,8/16,8/16}, + {-7/16,-8/16,-6/16,7/16,8/16,6/16}, + {-6/16,-8/16,-7/16,6/16,8/16,7/16}, + }, + }, }) minetest.register_node(tree.name.."_ladder", {