sda97:pandaro wrote:someone has already done an anvil? I find in that mod?
http://forum.minetest.net/viewtopic.php ... 981#p35981
sda97:pandaro wrote:someone has already done an anvil? I find in that mod?
Wouldn't it be about time to send a pull request then?VanessaE wrote:You can't. Those are not currently texturable.
I'm not sure what you are talking about, but if you are wondering how minetest does it, it's a hardcoded rendering.Likwid H-Craft wrote:Oh why they not then how come, they box looking but texture zero.
Yeah what have a pull request.
Maybe you could file an issue (under the "enhancement" tag) to the minetest github page?Likwid H-Craft wrote:Well, I hope on 0.4.5 we have the rights to change the moon and, sun and have add something minecraft don't have.
--how to a block NOT explode?on_blast = func(pos, intensity),
^ intensity: 1.0 = mid range of regular TNT
^ If defined, called when an explosion touches the node, instead of
removing the node
Code: Select all
local print_hello=function()
print("hello")
end
local dtime=10.0
minetest.register_globalstep(function(dtime)
hello()
end)
Code: Select all
minetest.register_globalstep(function(dtime)
ifnot time then time = dtime end
if time >= 10 then
hello()
time = 0
end
time = time + dtime
end
it works, thanksCasimir wrote:Just a guess, there might be a better solution.Code: Select all
minetest.register_globalstep(function(dtime) ifnot time then time = dtime end if time >= 10 then hello() time = 0 end time = time + dtime end
Code: Select all
stairs.register_stair_and_slab("birch", "birch:wood",
{cracky=3},
{"birch_wood.png"},
"Birch Wood stair",
"Birch Wood slab")
The error is caused by a bug in the stable version of stairs. Copy the code in stars and change the prefix "Stairs:" to the prefix for your plugin.Evergreen wrote:I have a question about stairs and slabs. I'm making a birch tree mod, and I need to make stairs and slabs from it. Here is the code I used to add stairs and slabs:But I get a run error. How do I fix?Code: Select all
stairs.register_stair_and_slab("birch", "birch:wood", {cracky=3}, {"birch_wood.png"}, "Birch Wood stair", "Birch Wood slab")
Thanks 0gb.us!0gb.us wrote:The error is caused by a bug in the stable version of stairs. Copy the code in stars and change the prefix "Stairs:" to the prefix for your plugin.Evergreen wrote:I have a question about stairs and slabs. I'm making a birch tree mod, and I need to make stairs and slabs from it. Here is the code I used to add stairs and slabs:But I get a run error. How do I fix?Code: Select all
stairs.register_stair_and_slab("birch", "birch:wood", {cracky=3}, {"birch_wood.png"}, "Birch Wood stair", "Birch Wood slab")
Code: Select all
stairs = {}
function birch.register_stair(subname, recipeitem, groups, images, description)
minetest.register_node("stairs:stair_" .. subname, {
description = description,
drawtype = "nodebox",
tiles = images,
paramtype = "light",
paramtype2 = "facedir",
is_ground_content = true,
groups = groups,
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, 0, 0.5},
{-0.5, 0, 0, 0.5, 0.5, 0.5},
},
},
})
minetest.register_craft({
output = 'stairs:stair_' .. subname .. ' 4',
recipe = {
{recipeitem, "", ""},
{recipeitem, recipeitem, ""},
{recipeitem, recipeitem, recipeitem},
},
})
-- Flipped recipe for the silly minecrafters
minetest.register_craft({
output = 'stairs:stair_' .. subname .. ' 4',
recipe = {
{"", "", recipeitem},
{"", recipeitem, recipeitem},
{recipeitem, recipeitem, recipeitem},
},
})
end
-- Node will be called stairs:slab_<subname>
function birch.register_slab(subname, recipeitem, groups, images, description)
minetest.register_node("stairs:slab_" .. subname, {
description = description,
drawtype = "nodebox",
tiles = images,
paramtype = "light",
is_ground_content = true,
groups = groups,
node_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
},
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
},
on_place = function(itemstack, placer, pointed_thing)
if pointed_thing.type ~= "node" then
return itemstack
end
-- If it's being placed on an another similar one, replace it with
-- a full block
local slabpos = nil
local slabnode = nil
local p0 = pointed_thing.under
local p1 = pointed_thing.above
local n0 = minetest.env:get_node(p0)
if n0.name == "stairs:slab_" .. subname and
p0.y+1 == p1.y then
slabpos = p0
slabnode = n0
end
if slabpos then
-- Remove the slab at slabpos
minetest.env:remove_node(slabpos)
-- Make a fake stack of a single item and try to place it
local fakestack = ItemStack(recipeitem)
pointed_thing.above = slabpos
fakestack = minetest.item_place(fakestack, placer, pointed_thing)
-- If the item was taken from the fake stack, decrement original
if not fakestack or fakestack:is_empty() then
itemstack:take_item(1)
-- Else put old node back
else
minetest.env:set_node(slabpos, slabnode)
end
return itemstack
end
-- Otherwise place regularly
return minetest.item_place(itemstack, placer, pointed_thing)
end,
})
minetest.register_craft({
output = 'stairs:slab_' .. subname .. ' 3',
recipe = {
{recipeitem, recipeitem, recipeitem},
},
})
end
-- Nodes will be called stairs:{stair,slab}_<subname>
function birch.register_stair_and_slab(subname, recipeitem, groups, images, desc_stair, desc_slab)
birch.register_stair(subname, recipeitem, groups, images, desc_stair)
birch.register_slab(subname, recipeitem, groups, images, desc_slab)
end
birch.register_stair_and_slab("birch", "birch:wood",
{snappy=2,choppy=2,oddly_breakable_by_hand=2},
{"birch_wood.png"},
"Birch Wood stair",
"Birch Wood slab")
Nvm, I fixed it.Evergreen wrote:Still get a ModError.
I stuck this code inside the same init.luaWhat am I doing wrong?Code: Select all
stairs = {} function birch.register_stair(subname, recipeitem, groups, images, description) minetest.register_node("stairs:stair_" .. subname, { description = description, drawtype = "nodebox", tiles = images, paramtype = "light", paramtype2 = "facedir", is_ground_content = true, groups = groups, node_box = { type = "fixed", fixed = { {-0.5, -0.5, -0.5, 0.5, 0, 0.5}, {-0.5, 0, 0, 0.5, 0.5, 0.5}, }, }, }) minetest.register_craft({ output = 'stairs:stair_' .. subname .. ' 4', recipe = { {recipeitem, "", ""}, {recipeitem, recipeitem, ""}, {recipeitem, recipeitem, recipeitem}, }, }) -- Flipped recipe for the silly minecrafters minetest.register_craft({ output = 'stairs:stair_' .. subname .. ' 4', recipe = { {"", "", recipeitem}, {"", recipeitem, recipeitem}, {recipeitem, recipeitem, recipeitem}, }, }) end -- Node will be called stairs:slab_<subname> function birch.register_slab(subname, recipeitem, groups, images, description) minetest.register_node("stairs:slab_" .. subname, { description = description, drawtype = "nodebox", tiles = images, paramtype = "light", is_ground_content = true, groups = groups, node_box = { type = "fixed", fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5}, }, selection_box = { type = "fixed", fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5}, }, on_place = function(itemstack, placer, pointed_thing) if pointed_thing.type ~= "node" then return itemstack end -- If it's being placed on an another similar one, replace it with -- a full block local slabpos = nil local slabnode = nil local p0 = pointed_thing.under local p1 = pointed_thing.above local n0 = minetest.env:get_node(p0) if n0.name == "stairs:slab_" .. subname and p0.y+1 == p1.y then slabpos = p0 slabnode = n0 end if slabpos then -- Remove the slab at slabpos minetest.env:remove_node(slabpos) -- Make a fake stack of a single item and try to place it local fakestack = ItemStack(recipeitem) pointed_thing.above = slabpos fakestack = minetest.item_place(fakestack, placer, pointed_thing) -- If the item was taken from the fake stack, decrement original if not fakestack or fakestack:is_empty() then itemstack:take_item(1) -- Else put old node back else minetest.env:set_node(slabpos, slabnode) end return itemstack end -- Otherwise place regularly return minetest.item_place(itemstack, placer, pointed_thing) end, }) minetest.register_craft({ output = 'stairs:slab_' .. subname .. ' 3', recipe = { {recipeitem, recipeitem, recipeitem}, }, }) end -- Nodes will be called stairs:{stair,slab}_<subname> function birch.register_stair_and_slab(subname, recipeitem, groups, images, desc_stair, desc_slab) birch.register_stair(subname, recipeitem, groups, images, desc_stair) birch.register_slab(subname, recipeitem, groups, images, desc_slab) end birch.register_stair_and_slab("birch", "birch:wood", {snappy=2,choppy=2,oddly_breakable_by_hand=2}, {"birch_wood.png"}, "Birch Wood stair", "Birch Wood slab")
Users browsing this forum: No registered users and 18 guests