Cylindrical trunk

This commit is contained in:
DanDuncombe 2013-11-10 20:08:42 +00:00
parent e45e71d2e0
commit bd9dfcedd1
2 changed files with 37 additions and 13 deletions

View File

@ -326,14 +326,6 @@ minetest.register_craftitem("farming:soy", {
--Cake --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", { minetest.register_node("farming:cake", {
drawtype = "nodebox", drawtype = "nodebox",
description = "CAKE!!!", description = "CAKE!!!",
@ -343,8 +335,13 @@ minetest.register_node("farming:cake", {
drop = "farming:cake", drop = "farming:cake",
on_use=minetest.item_eat(16), on_use=minetest.item_eat(16),
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = cakebox, 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 = { selection_box = {
type = "fixed", type = "fixed",

View File

@ -152,8 +152,17 @@ function realtest.register_tree(name, TreeDef)
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
drop = tree.name.."_plank 4", drop = tree.name.."_plank 4",
drop_on_dropping = tree.name.."_log", drop_on_dropping = tree.name.."_log",
drawtype = "normal", drawtype = "nodebox",
paramtype = "light", 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) on_dig = function(pos, node, digger)
minetest.debug("node_dig") 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}, groups = {tree=1,snappy=1,choppy=2,flammable=2,dropping_node=1,drop_on_dig=1},
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
drop = tree.name.."_log", drop = tree.name.."_log",
drawtype = "normal", drawtype = "nodebox",
paramtype = "light", 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", { 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}, groups = {tree=1,snappy=1,choppy=2,flammable=2,dropping_node=1,drop_on_dig=1},
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
drop = tree.name.."_log", drop = tree.name.."_log",
drawtype = "normal", drawtype = "nodebox",
paramtype = "light", paramtype = "light",
after_dig_node = function(pos, oldnode, oldmetadata, digger) after_dig_node = function(pos, oldnode, oldmetadata, digger)
for i = 1,#tree.leaves do for i = 1,#tree.leaves do
@ -328,6 +346,15 @@ function realtest.register_tree(name, TreeDef)
end end
end 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", { minetest.register_node(tree.name.."_ladder", {