master
HybridDog 2014-05-28 20:59:13 +02:00
commit fb8ddee01d
1584 changed files with 64208 additions and 0 deletions

1
game.conf Normal file
View File

@ -0,0 +1 @@
name = zegaton_game

View File

@ -0,0 +1,179 @@
--[[
3D Forniture
Copyright 2012 Tonyka
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA.
Contributors:
InfinityProject
suggested creating bathroom kit.
cosarara97
code.
]]--
-- Deco Home
--Table
minetest.register_craft( {
output = '3dforniture:table', '3dforniture:chair 2',
recipe = {
{ 'default:wood','default:wood', 'default:wood' },
{ 'default:stick', '', 'default:stick' },
},
})
minetest.register_craft({
type = 'fuel',
recipe = '3dforniture:table',
burntime = 30,
})
--Chair
minetest.register_craft( {
output = '3dforniture:chair 2',
recipe = {
{ 'default:stick',''},
{ 'default:wood','default:wood' },
{ 'default:stick','default:stick' },
},
})
minetest.register_craft({
type = 'fuel',
recipe = '3dforniture:chair',
burntime = 15,
})
--Armchair
minetest.register_craft( {
output = '3dforniture:armchair 2',
recipe = {
{ 'default:wood',''},
{ 'default:wood','default:wood' },
{ 'default:wood','default:wood' },
},
})
minetest.register_craft({
type = 'fuel',
recipe = '3dforniture:armchair',
burntime = 30,
})
--Table Lamp
minetest.register_craft( {
output = '3dforniture:table_lamp_off',
recipe = {
{'default:paper','default:torch' ,'default:paper'},
{'','default:stick',''},
{'','stairs:slab_wood',''},
},
})
minetest.register_craft({
type = 'fuel',
recipe = '3dforniture:table_lamp_off',
burntime = 10,
})
-- Bathroom Kit
--Toilet
minetest.register_craft( {
output = '3dforniture:toilet',
recipe = {
{'','','bucket:bucket_water'},
{ 'default:cobble','default:cobble', 'default:cobble' },
{ '', 'bucket:bucket_empty', '' },
},
})
--Sink
minetest.register_craft( {
output = '3dforniture:sink',
recipe = {
{ 'default:cobble','bucket:bucket_empty', 'default:cobble' },
},
})
--Taps
minetest.register_craft( {
output = '3dforniture:taps',
recipe = {
{ 'default:steel_ingot','bucket:bucket_water', 'default:steel_ingot' },
},
})
--Shower Tray
minetest.register_craft( {
output = '3dforniture:shower_tray',
recipe = {
{ 'default:cobble','bucket:bucket_water', 'default:cobble' },
},
})
--Shower Head
minetest.register_craft( {
output = '3dforniture:shower_head',
recipe = {
{'default:steel_ingot', 'bucket:bucket_water'},
},
})
-- Medieval Forniture
--Bars
minetest.register_craft( {
output = '3dforniture:bars 10',
recipe = {
{ 'default:steel_ingot','default:steel_ingot','default:steel_ingot' },
{ 'default:steel_ingot','default:steel_ingot','default:steel_ingot' },
},
})
-- L Binding Bars
minetest.register_craft( {
output = '3dforniture:L_binding_bars 4',
recipe = {
{ '3dforniture:bars','' },
{ '3dforniture:bars','3dforniture:bars' },
},
})
--Chains
minetest.register_craft( {
output = '3dforniture:chains 4',
recipe = {
{'','default:steel_ingot',''},
{ 'default:steel_ingot','', 'default:steel_ingot' },
{ '', 'default:steel_ingot', '' },
},
})
--Torch Wall
minetest.register_craft( {
output = '3dforniture:torch_wall 10',
recipe = {
{ 'default:coal_lump' },
{ 'default:steel_ingot' },
},
})

View File

@ -0,0 +1 @@
default

92
mods/3dforniture/init.lua Normal file
View File

@ -0,0 +1,92 @@
--[[
3D Forniture
Copyright 2012 Tonyka
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA.
Contributors:
Lesliev
code
information and assistance in various aspects
InfinityProject
suggested creating bathroom kit.
cosarara97
code.
]]--
dofile(minetest.get_modpath("3dforniture").."/crafting.lua")
dofile(minetest.get_modpath("3dforniture").."/nodes.lua")
--alias
minetest.register_alias('table', '3dforniture:table')
minetest.register_alias('chair', '3dforniture:chair')
minetest.register_alias('bars', '3dforniture:bars')
minetest.register_alias('binding_bars', '3dforniture:L_binding_bars')
minetest.register_alias('chains', '3dforniture:chains')
minetest.register_alias('torch_wall', '3dforniture:torch_wall')
minetest.register_alias('toilet', '3dforniture:toilet')
minetest.register_alias('sink', '3dforniture:sink')
minetest.register_alias('taps', '3dforniture:taps')
minetest.register_alias('shower_tray', '3dforniture:shower_tray')
minetest.register_alias('shower_head', '3dforniture:shower_head')
minetest.register_alias('table_lamp', '3dforniture:table_lamp_off')
minetest.register_alias('armchair', '3dforniture:armchair')
--function
local on_lamp_puncher = function (pos, node, puncher)
if node.name == "3dforniture:table_lamp_off" then
minetest.env:add_node(pos, {name="3dforniture:table_lamp_low"})
nodeupdate(pos)
elseif node.name == "3dforniture:table_lamp_low" then
minetest.env:add_node(pos, {name="3dforniture:table_lamp_med"})
nodeupdate(pos)
elseif node.name == "3dforniture:table_lamp_med" then
minetest.env:add_node(pos, {name="3dforniture:table_lamp_hi"})
nodeupdate(pos)
elseif node.name == "3dforniture:table_lamp_hi" then
minetest.env:add_node(pos, {name="3dforniture:table_lamp_max"})
nodeupdate(pos)
elseif node.name == "3dforniture:table_lamp_max" then
minetest.env:add_node(pos, {name="3dforniture:table_lamp_off"})
nodeupdate(pos)
end
end
local on_toilet_puncher = function (pos, node, puncher)
if node.name == '3dforniture:toilet' then
local dir = node["param2"]
minetest.env:add_node(pos, {name="3dforniture:toilet_open", paramtype2='none', param2=dir})
nodeupdate(pos)
elseif node.name == '3dforniture:toilet_open' then
local dir = node["param2"]
minetest.env:add_node(pos, {name="3dforniture:toilet", paramtype2='none', param2=dir})
nodeupdate(pos)
end
end
minetest.register_on_punchnode(on_lamp_puncher)
minetest.register_on_punchnode(on_toilet_puncher)

825
mods/3dforniture/nodes.001 Normal file
View File

@ -0,0 +1,825 @@
--[[
3D Forniture
Copyright 2012 Tonyka
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA.
Contributors:
InfinityProject
suggested creating bathroom kit.
cosarara97
code.
]]--
-- replacement
--Papyrus
minetest.register_node(":default:papyrus",
{description = "Papyrus",
drawtype = "nodebox",
tiles ={
"forniture_papyrus.png",
"forniture_papyrus.png",
"forniture_papyrus_s1.png",
"forniture_papyrus_s1.png",
"forniture_papyrus_s2.png",
"forniture_papyrus_s2.png",
},
inventory_image = "default_papyrus.png",
wield_image ="default_papyrus.png",
paramtype = "light",
is_ground_content = true,
walkable = false,
node_box = {
type = "fixed",
fixed = {
--papyrus 1
{-0.03-0.1,-0.5,-0.03-0.1, 0.03-0.1,0.5,0.03-0.1},
{-0.06-0.1,-0.02-0.1,-0.06-0.1, 0.06-0.1,0.02-0.1,0.06-0.1},
--papyrus 2
{-0.03-0.4,-0.5,-0.03-0.3, 0.03-0.4,0.5,0.03-0.3},
{-0.06-0.4,-0.02-0.2,-0.06-0.3, 0.06-0.4,0.02-0.2,0.06-0.3},
--papyrus 3
{-0.03+0.4,-0.5,-0.03-0.3,0.03+0.4,0.5,0.03-0.3},
{-0.06+0.4,-0.02+0.2,-0.06-0.3, 0.06+0.4,0.02+0.2,0.06-0.3},
--papyrus 4
{-0.03-0.4,-0.5,-0.03+0.4, 0.03-0.4,0.5,0.03+0.4},
{-0.06-0.4,0.02+0.4,-0.06+0.4, 0.06-0.4,0.02+0.4,0.06+0.4},
--papyrus 5
{-0.03-0.2,-0.5,-0.03+0.2, 0.03-0.2,0.5,0.03+0.2},
{-0.06-0.2,0.02-0.4,-0.06+0.2, 0.06-0.2,0.02-0.4,0.06+0.2},
--papyrus 6
{-0.03+0.1,-0.5,-0.03+0.2, 0.03+0.1,0.5,0.03+0.2},
{-0.06+0.1,0.02+0.3,-0.06+0.2, 0.06+0.1,0.02+0.3,0.06+0.2},
},
},
groups = {snappy = 3,flammable = 2},
sounds = default.node_sound_leaves_defaults(),
})
--Tree
minetest.register_node(":default:tree",
{description = "Tree",
paramtype = "light",
tiles = {"default_tree_top.png", "default_tree_top.png", "default_tree.png"},
is_ground_content = true,
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {
{-0.35,-0.5,-0.4,0.35,0.5,0.4},
{-0.4,-0.5,-0.35, 0.4,0.5,0.35},
{-0.25,-0.5,-0.45,0.25,0.5,0.45},
{-0.45,-0.5,-0.25, 0.45,0.5,0.25},
{-0.15,-0.5,-0.5,0.15,0.5,0.5},
{-0.5,-0.5,-0.15, 0.5,0.5,0.15},
},
},
groups = {
tree = 1,
snappy = 1,
choppy = 2,
oddly_breakable_by_hand = 1,
flammable = 2
},
sounds = default.node_sound_wood_defaults(),
})
--nodes
-- Deco Home
--Table
minetest.register_node("3dforniture:table",
{description = 'Table',
tiles = {
"forniture_wood.png",
"forniture_wood.png",
"forniture_wood_s1.png",
"forniture_wood_s1.png",
"forniture_wood_s2.png",
"forniture_wood_s2.png",
},
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = 'light',
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{-0.4,-0.5,-0.4, -0.3,0.4,-0.3},
{0.3,-0.5,-0.4, 0.4,0.4,-0.3},
{-0.4,-0.5,0.3, -0.3,0.4,0.4},
{0.3,-0.5,0.3, 0.4,0.4,0.4},
{-0.5,0.4,-0.5, 0.5,0.5,0.5},
{-0.4,-0.2,-0.3, -0.3,-0.1,0.3},
{0.3,-0.2,-0.4, 0.4,-0.1,0.3},
{-0.3,-0.2,-0.4, 0.4,-0.1,-0.3},
{-0.3,-0.2,0.3, 0.3,-0.1,0.4},
},
},
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}
})
--Chair
minetest.register_node("3dforniture:chair",
{ description = 'Chair',
tiles = {
"forniture_wood.png",
"forniture_wood.png",
"forniture_wood_s1.png",
"forniture_wood_s1.png",
"forniture_wood_s2.png",
"forniture_wood_s2.png",
},
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = 'light',
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{-0.3,-0.5,0.2, -0.2,0.5,0.3},
{0.2,-0.5,0.2, 0.3,0.5,0.3},
{-0.3,-0.5,-0.3, -0.2,-0.1,-0.2},
{0.2,-0.5,-0.3, 0.3,-0.1,-0.2},
{-0.3,-0.1,-0.3, 0.3,0,0.2},
{-0.2,0.1,0.25, 0.2,0.4,0.26}
},
},
selection_box = {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3},
},
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}
})
--Armchair
minetest.register_node("3dforniture:armchair",
{ description = 'Armchair',
tiles = {
"forniture_armchair_top.png",
"forniture_armchair_top.png",
"forniture_armchair_lat1.png",
"forniture_armchair_lat1.png",
"forniture_armchair_lat2.png",
"forniture_armchair_lat2.png",
},
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = 'light',
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
--lat 1
{-0.5,-0.5,-0.45, -0.3,0.05,0.3},
{-0.45,-0.5,-0.5, -0.35,0.05,-0.45},
{-0.45,0.05,-0.45, -0.35,0.1,0.15},
--lat 2
{0.3,-0.5,-0.45, 0.5,0.05,0.3},{0.35,-0.5,-0.5,0.45,0.05,-0.45},{0.35,0.05,-0.45, 0.45,0.1,0.15},
--respaldo
{-0.5,-0.5,0.3, 0.5,0.45,0.5},{-0.45,0.45,0.35,0.45,0.5,0.45},
--base
{-0.3,-0.45,-0.35, 0.3,-0.1,0.3},{-0.3,-0.45,-0.4, 0.3,-0.15,-0.35},
--oreja 1
{-0.5,0.05,0.15, -0.3,0.45, 0.3},{-0.45,0.1,0.1, -0.35,0.45,0.15},{-0.45,0.45,0.15,-0.35,0.5,0.35},
--oreja 2
{0.3,0.05,0.15, 0.5,0.45,0.3},{0.35,0.1,0.1, 0.45,0.45,0.15},{0.35,0.45,0.15,0.45,0.5,0.35},
},
},
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}
},
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}
})
--Table Lamp
minetest.register_node("3dforniture:table_lamp_off",
{ description = 'Table Lamp',
drawtype = "nodebox",
tiles = {
"forniture_table_lamp_s.png",
"forniture_table_lamp_s.png",
"forniture_table_lamp_l.png",
},
paramtype = 'light',
paramtype2 == 'facedir',
node_box = {
type = "fixed",
fixed = {
--Lamp Base
{-0.15,-0.5,-0.15, 0.15,-0.45,0.15},
{-0.05,-0.45,-0.05, 0.05,-0.4,0.05},
{-0.025,-0.4,-0.025, 0.025,-0.1,0.025},
{-0.0125,-0.125,-0.2, 0.0125,-0.1,0.2},
{-0.2,-0.125,-0.0125, 0.2,-0.1,0.0125},
--Lamp Shade
{-0.2,-0.1,-0.2, -0.175,0.3,0.2},
{0.175,-0.1,-0.2, 0.2,0.3,0.2},
{-0.175,-0.1,-0.2, 0.175,0.3,-0.175},
{-0.175,-0.1,0.175, 0.175,0.3,0.2},
},
},
sunlight_propagates = true,
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5,0.5, 0.5},
},
groups = {cracky=2,oddly_breakable_by_hand=1,},
drop = "3dforniture:table_lamp_off",
})
minetest.register_node("3dforniture:table_lamp_low",
{ description = 'Table Lamp',
drawtype = "nodebox",
tiles = {
"forniture_table_lamp_s.png",
"forniture_table_lamp_s.png",
"forniture_table_lamp_l.png",
},
paramtype = 'light',
paramtype2 == 'facedir',
node_box = {
type = "fixed",
fixed = {
--Lamp Base
{-0.15,-0.5,-0.15, 0.15,-0.45,0.15},
{-0.05,-0.45,-0.05, 0.05,-0.4,0.05},
{-0.025,-0.4,-0.025, 0.025,-0.1,0.025},
{-0.0125,-0.125,-0.2, 0.0125,-0.1,0.2},
{-0.2,-0.125,-0.0125, 0.2,-0.1,0.0125},
--Lamp Shade
{-0.2,-0.1,-0.2, -0.175,0.3,0.2},
{0.175,-0.1,-0.2, 0.2,0.3,0.2},
{-0.175,-0.1,-0.2, 0.175,0.3,-0.175},
{-0.175,-0.1,0.175, 0.175,0.3,0.2},
},
},
sunlight_propagates = true,
walkable = false,
light_source = 4,
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5,0.5, 0.5},
},
groups = {cracky=2,oddly_breakable_by_hand=1,},
drop = "3dforniture:table_lamp_off",
})
minetest.register_node("3dforniture:table_lamp_med",
{ description = 'Table Lamp',
drawtype = "nodebox",
tiles = {
"forniture_table_lamp_s.png",
"forniture_table_lamp_s.png",
"forniture_table_lamp_l.png",
},
paramtype = 'light',
paramtype2 == 'facedir',
node_box = {
type = "fixed",
fixed = {
--Lamp Base
{-0.15,-0.5,-0.15, 0.15,-0.45,0.15},
{-0.05,-0.45,-0.05, 0.05,-0.4,0.05},
{-0.025,-0.4,-0.025, 0.025,-0.1,0.025},
{-0.0125,-0.125,-0.2, 0.0125,-0.1,0.2},
{-0.2,-0.125,-0.0125, 0.2,-0.1,0.0125},
--Lamp Shade
{-0.2,-0.1,-0.2, -0.175,0.3,0.2},
{0.175,-0.1,-0.2, 0.2,0.3,0.2},
{-0.175,-0.1,-0.2, 0.175,0.3,-0.175},
{-0.175,-0.1,0.175, 0.175,0.3,0.2},
},
},
sunlight_propagates = true,
walkable = false,
light_source = 8,
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5,0.5, 0.5},
},
groups = {cracky=2,oddly_breakable_by_hand=1,},
drop = "3dforniture:table_lamp_off",
})
minetest.register_node("3dforniture:table_lamp_hi",
{ description = 'Table Lamp',
drawtype = "nodebox",
tiles = {
"forniture_table_lamp_s.png",
"forniture_table_lamp_s.png",
"forniture_table_lamp_l.png",
},
paramtype = 'light',
paramtype2 == 'facedir',
node_box = {
type = "fixed",
fixed = {
--Lamp Base
{-0.15,-0.5,-0.15, 0.15,-0.45,0.15},
{-0.05,-0.45,-0.05, 0.05,-0.4,0.05},
{-0.025,-0.4,-0.025, 0.025,-0.1,0.025},
{-0.0125,-0.125,-0.2, 0.0125,-0.1,0.2},
{-0.2,-0.125,-0.0125, 0.2,-0.1,0.0125},
--Lamp Shade
{-0.2,-0.1,-0.2, -0.175,0.3,0.2},
{0.175,-0.1,-0.2, 0.2,0.3,0.2},
{-0.175,-0.1,-0.2, 0.175,0.3,-0.175},
{-0.175,-0.1,0.175, 0.175,0.3,0.2},
},
},
sunlight_propagates = true,
walkable = false,
light_source = 12,
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5,0.5, 0.5},
},
groups = {cracky=2},
drop = "3dforniture:table_lamp_off",
})
minetest.register_node("3dforniture:table_lamp_max",
{ description = 'Table Lamp',
drawtype = "nodebox",
tiles = {
"forniture_table_lamp_s.png",
"forniture_table_lamp_s.png",
"forniture_table_lamp_l.png",
},
paramtype = 'light',
paramtype2 == 'facedir',
node_box = {
type = "fixed",
fixed = {
--Lamp Base
{-0.15,-0.5,-0.15, 0.15,-0.45,0.15},
{-0.05,-0.45,-0.05, 0.05,-0.4,0.05},
{-0.025,-0.4,-0.025, 0.025,-0.1,0.025},
{-0.0125,-0.125,-0.2, 0.0125,-0.1,0.2},
{-0.2,-0.125,-0.0125, 0.2,-0.1,0.0125},
--Lamp Shade
{-0.2,-0.1,-0.2, -0.175,0.3,0.2},
{0.175,-0.1,-0.2, 0.2,0.3,0.2},
{-0.175,-0.1,-0.2, 0.175,0.3,-0.175},
{-0.175,-0.1,0.175, 0.175,0.3,0.2},
},
},
sunlight_propagates = true,
walkable = false,
light_source = 16,
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5,0.5, 0.5},
},
groups = {cracky=2,oddly_breakable_by_hand=1,},
drop = "3dforniture:table_lamp_off",
})
-- Bathroom Kit
--Toilet
minetest.register_node("3dforniture:toilet",
{ description = 'Toilet',
tiles = {
"forniture_marble.png", "forniture_marble.png",
"forniture_marble_s1.png", "forniture_marble_s1.png",
"forniture_marble_s2.png", "forniture_marble_s2.png",
},
drawtype = "nodebox",
sunlight_propagates = false,
paramtype = 'light',
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{-0.2,-0.5,-0.2, 0.2,-0.45,0.5},
{-0.1,-0.45,-0.1, 0.1,0,0.5},
{-0.3,-0.2,-0.3, 0.3,0,0.35},
{-0.25,0,-0.25, 0.25,0.05,0.25},
{-0.3,0,0.3, 0.3,0.4,0.5},
{-0.05,0.4,0.35, 0.05,0.45,0.45},
},
},
drop ="3dforniture:toilet",
groups = {cracky=3,}
})
minetest.register_node("3dforniture:toilet_open",
{ description = 'Toilet',
tiles = {
"forniture_marble_top_toilet.png", "forniture_marble.png",
"forniture_marble_sb1.png", "forniture_marble_sb1.png",
"forniture_marble_sb2.png", "forniture_marble_sb2.png",
},
drawtype = "nodebox",
sunlight_propagates = false,
paramtype = 'light',
paramtype2 = 'facedir',
node_box = {
type = "fixed",
fixed = {
{-0.2,-0.5,-0.2, 0.2,-0.45,0.5},
{-0.1,-0.45,-0.1, 0.1,-0.2,0.5},
{-0.1,-0.2,0.3, 0.1,0,0.5},
{-0.3,-0.2,0.1, 0.3,0,0.35},
{-0.3,-0.2,-0.3, -0.1,-0.15,0.1},
{-0.1,-0.2,-0.3, 0.1,-0.15,-0.1},
{0.1,-0.2,-0.3, 0.3,-0.15,0.1},
{-0.3,-0.15,-0.3, -0.2,0,0.1},
{-0.2,-0.15,-0.3, 0.2,0,-0.2},
{0.2,-0.15,-0.3, 0.3,0,0.1},
{-0.25,0,0.2, 0.25,0.5,0.25},
{-0.3,0,0.3, 0.3,0.4,0.5},
},
},
drop = "3dforniture:toilet",
groups = {cracky = 3,},
sounds = {dig = "3dforniture_dig_toilet", gain=0.5},
})
--Sink
minetest.register_node("3dforniture:sink",
{description = 'Sink',
tiles = {
"forniture_marble_top_sink.png", "forniture_marble.png",
"forniture_marble_sb1.png", "forniture_marble_sb1.png",
"forniture_marble_sb2.png", "forniture_marble_sb2.png",
},
inventory_image = "3dforniture_inv_sink.png",
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = 'light',
paramtype2 = 'facedir',
node_box = {
type = "fixed",
fixed = {
{-0.15,0.35,0.2,0.15,0.4,0.5},
{-0.25,0.4,0.4, 0.25,0.45,0.5},
{-0.25,0.4,0.15, -0.15,0.45,0.4},
{0.15,0.4,0.15, 0.25,0.45,0.4},
{-0.15,0.4,0.15, 0.15,0.45,0.2},
{-0.3,0.45,0.4, 0.3,0.5,0.5},
{-0.3,0.45,0.1, -0.25,0.5,0.4},
{0.25,0.45,0.1, 0.3,0.5,0.4},
{-0.25,0.45,0.1, 0.25,0.5,0.15},
},
},
selection_box = {
type = "fixed",
fixed = {-0.3,0.35,0.1, 0.3,0.5,0.5},
},
groups = {cracky=2,}
})
--Taps
minetest.register_node("3dforniture:taps",
{ description = 'Taps',
tiles = {
"forniture_metal.png", "forniture_metal.png",
"forniture_metal_s1.png", "forniture_metal_s1.png",
"forniture_metal_s2.png", "forniture_metal_s2.png",
},
inventory_image = "3dforniture_inv_taps.png",
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = 'light',
paramtype2 = 'facedir',
node_box = {
type = "fixed",
fixed = {
--Base
{-0.25,-0.45,0.49, 0.25,-0.3,0.5},
{-0.05,-0.4,0.25, 0.05,-0.35,0.5},
{-0.05,-0.425,0.25,0.05,-0.4,0.3},
--taps 1
{-0.2,-0.4,0.45, -0.15,-0.35,0.5},
{-0.2,-0.45,0.4, -0.15,-0.3,0.45},
{-0.25,-0.4,0.4, -0.1,-0.35,0.45},
--taps 2
{0.15,-0.4,0.45, 0.2,-0.35,0.5},
{0.15,-0.45,0.4, 0.2,-0.3,0.45},
{0.1,-0.4,0.4, 0.25,-0.35,0.45},
},
},
selection_box = {
type = "fixed",
fixed = {-0.25,-0.45,0.25, 0.25,-0.3,0.5},
},
groups = {cracky=2,}
})
--Shower Tray
minetest.register_node("3dforniture:shower_tray",
{ description = 'Shower Tray',
tiles = {
"forniture_marble_base_ducha_top.png",
"forniture_marble_base_ducha_top.png",
"forniture_marble_sb1.png",
"forniture_marble_sb1.png",
"forniture_marble_sb2.png",
"forniture_marble_sb2.png",
},
inventory_image = "3dforniture_inv_shower_tray.png",
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = 'light',
paramtype2 = 'facedir',
legacy_facedir_simple = true,
node_box = {
type = "fixed",
fixed = {
{-0.5,-0.5,-0.5, 0.5,-0.45,0.5},
{-0.5,-0.45,-0.5, 0.5,-0.4,-0.45},
{-0.5,-0.45,0.45, 0.5,-0.4,0.5},
{-0.5,-0.45,-0.45, -0.45,-0.4,0.45},
{0.45,-0.45,-0.45, 0.5,-0.4,0.45},
},
},
selection_box = {
type = "fixed",
fixed = {-0.5,-0.5,-0.5, 0.5,-0.4,0.5},
},
groups = {cracky=2,}
})
--Shower Head
minetest.register_node("3dforniture:shower_head",
{description = 'Shower Head',
tiles = {
"forniture_metal.png",
"forniture_metal.png",
"forniture_metal_s1.png",
"forniture_metal_s1.png",
"forniture_metal_s2.png",
"forniture_metal_s2.png",
},
inventory_image = "3dforniture_inv_shower_head.png",
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = 'light',
paramtype2 = 'facedir',
node_box = {
type = "fixed",
fixed = {
{-0.1,-0.5,0.1, 0.1,-0.4,0.3},
{-0.05,-0.4,0.15, 0.05,-0.3,0.25},
{-0.05,-0.35,0.25,0.05,-0.3,0.5},
{-0.1,-0.4,0.49, 0.1,-0.25,0.5},
},
},
selection_box = {
type = "fixed",
fixed = {-0.1,-0.5,0.1, 0.1,-0.25,0.5},
},
groups = {cracky=2,}
})
-- Medieval Forniture
--Bars
minetest.register_node("3dforniture:bars",
{ description = 'Bars',
tiles = {
"forniture_black_metal.png",
"forniture_black_metal.png",
"forniture_black_metal_s1.png",
"forniture_black_metal_s1.png",
"forniture_black_metal_s2.png",
"forniture_black_metal_s2.png",
},
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = 'light',
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{-0.5,-0.5,-0.1, -0.4,0.5,0.1},
{-0.1,-0.5,-0.1, 0.1,0.5,0.1},
{0.4,-0.5,-0.1, 0.5,0.5,0.1},
{-0.5,-0.5,-0.05, 0.5,-0.45,0.05},
{-0.5,0.45,-0.05, 0.5,0.5,0.05}
},
},
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.1, 0.5, 0.5, 0.1},
},
groups = {cracky=1}
})
--L Binding Bars
minetest.register_node("3dforniture:L_binding_bars",
{ description ='Binding Bars',
tiles = {
"forniture_black_metal.png",
"forniture_black_metal.png",
"forniture_black_metal_s1.png",
"forniture_black_metal_s1.png",
"forniture_black_metal_s2.png",
"forniture_black_metal_s2.png",
},
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = 'light',
paramtype2 ="facedir",
node_box = {
type = "fixed",
fixed = {
{-0.1,-0.5,-0.5,0.1,0.5,-0.4},
{-0.15,-0.5,-0.15, 0.15,0.5,0.15},
{0.4,-0.5,-0.1, 0.5,0.5,0.1},
{0,-0.5,-0.05, 0.5,-0.45,0.05},
{-0.05,-0.5,-0.5, 0.05,-0.45,0},
{0,0.45,-0.05, 0.5,0.5,0.05},
{-0.05,0.45,-0.5, 0.05,0.5,0},
},
},
groups = {cracky=1,}
})
--Chains
minetest.register_node("3dforniture:chains",
{ description = 'Chains',
tiles = {
"forniture_black_metal.png",
"forniture_black_metal.png",
"forniture_black_metal_s1.png",
"forniture_black_metal_s1.png",
"forniture_black_metal_s2.png",
"forniture_black_metal_s2.png",
},
inventory_image = "3dforniture_inv_chains.png",
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = 'light',
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
--chain a
--supporting
{-0.45,0.25,0.45, -0.2,0.5,0.5},
{-0.35,0.4,0.35, -0.3,0.45,0.45},
{-0.35,0.3,0.35, -0.3,0.35,0.45},
{-0.35,0.35,0.3, -0.3,0.4,0.35},
--link 1
{-0.4,0.35,0.35, -0.25,0.4,0.4},
{-0.4,0.15,0.35, -0.25,0.2,0.4},
{-0.45,0.2,0.35, -0.4,0.35,0.4},
{-0.25,0.2,0.35, -0.2,0.35,0.4},
--link 2
{-0.35,0.2,0.3, -0.3,0.25,0.45},
{-0.35,0,0.3, -0.3,0.05,0.45},
{-0.35,0.05,0.25, -0.3,0.2,0.3},
{-0.35,0.05,0.45, -0.3,0.2,0.5},
--link 3
{-0.4,0.05,0.35, -0.25,0.1,0.4},
{-0.4,-0.15,0.35, -0.25,-0.1,0.4},
{-0.45,-0.1,0.35, -0.4,0.05,0.4},
{-0.25,-0.1,0.35, -0.2,0.05,0.4},
--link 4
{-0.35,-0.1,0.3, -0.3,-0.05,0.45},
{-0.35,-0.3,0.3, -0.3,-0.25,0.45},
{-0.35,-0.25,0.25, -0.3,-0.1,0.3},
{-0.35,-0.25,0.45, -0.3,-0.1,0.5},
--link 5
{-0.4,-0.25,0.35, -0.25,-0.2,0.4},
{-0.4,-0.45,0.35, -0.25,-0.4,0.4},
{-0.45,-0.4,0.35, -0.4,-0.25,0.4},
{-0.25,-0.4,0.35, -0.2,-0.25,0.4},
--chain b
--supporting
{0.2,0.25,0.45, 0.45,0.5,0.5},
{0.3,0.4,0.35,0.35,0.45,0.45},
{0.3,0.3,0.35, 0.35,0.35,0.45},
{0.3,0.35,0.3, 0.35,0.4,0.35},
--link 1
{0.25,0.35,0.35, 0.4,0.4,0.4},
{0.25,0.15,0.35, 0.4,0.2,0.4},
{0.2,0.2,0.35, 0.25,0.35,0.4},
{0.4,0.2,0.35, 0.45,0.35,0.4},
--link 2
{0.3,0.2,0.3, 0.35,0.25,0.45},
{0.3,0,0.3, 0.35,0.05,0.45},
{0.3,0.05,0.25, 0.35,0.2,0.3},
{0.3,0.05,0.45, 0.35,0.2,0.5},
--link 3
{0.25,0.05,0.35, 0.4,0.1,0.4},
{0.25,-0.15,0.35, 0.4,-0.1,0.4},
{0.2,-0.1,0.35, 0.25,0.05,0.4},
{0.4,-0.1,0.35, 0.45,0.05,0.4},
--link 4
{0.3,-0.1,0.3, 0.35,-0.05,0.45},
{0.3,-0.3,0.3, 0.35,-0.25,0.45},
{0.3,-0.25,0.25, 0.35,-0.1,0.3},
{0.3,-0.25,0.45, 0.35,-0.1,0.5},
---link 5
{0.25,-0.25,0.35, 0.4,-0.2,0.4},
{0.25,-0.45,0.35,0.4,-0.4,0.4},
{0.2,-0.4,0.35, 0.25,-0.25,0.4},
{0.4,-0.4,0.35, 0.45,-0.25,0.4},
},
},
selection_box = {
type = "fixed",
fixed = {-1/2, -1/2, 1/4, 1/2, 1/2, 1/2}, },
groups = {cracky=1}
})
--Torch Wakll
minetest.register_node("3dforniture:torch_wall",
{ description = 'Torch Wall',
drawtype = "nodebox",
tiles = {
"forniture_torch_wall_s.png",
"forniture_torch_wall_i.png",
{ name="forniture_torch_wall_anim.png",
animation={
type="vertical_frames",
aspect_w=40,
aspect_h=40,
length=1.0
}
}
},
inventory_image = "3dforniture_inv_torch_wall.png",
paramtype = 'light',
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
--torch
{-0.05,-0.45,0.45, 0.05,-0.35,0.5},
{-0.05,-0.35,0.4, 0.05,-0.25,0.5},
{-0.05,-0.25,0.35, 0.05,-0.15,0.45},
{-0.05,-0.15,0.3, 0.05,-0.05,0.4},
{-0.05,-0.05,0.25, 0.05,0,0.35},
--fire
{-0.1,0,0.2, 0.1,0.05,0.4},
{-0.15,0.05,0.15, 0.15,0.15,0.45},
{-0.1,0.15,0.2, 0.1,0.25,0.4},
{-0.05,0.25,0.25, 0.05,0.35,0.35},
},
},
sunlight_propagates = true,
walkable = false,
light_source = 18,
selection_box = {
type = "fixed",
fixed = {-0.15, -0.45, 0.15, 0.15,0.35, 0.5},
},
groups = {cracky=2}
})

798
mods/3dforniture/nodes.002 Normal file
View File

@ -0,0 +1,798 @@
--[[
3D Forniture
Copyright 2012 Tonyka
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA.
Contributors:
InfinityProject
suggested creating bathroom kit.
cosarara97
code.
]]--
-- replacement
--Papyrus
minetest.register_node(":default:papyrus",
{description = "Papyrus",
drawtype = "nodebox",
tiles ={
"forniture_papyrus.png",
"forniture_papyrus.png",
"forniture_papyrus_s1.png",
"forniture_papyrus_s1.png",
"forniture_papyrus_s2.png",
"forniture_papyrus_s2.png",
},
inventory_image = "default_papyrus.png",
wield_image ="default_papyrus.png",
paramtype = "light",
is_ground_content = true,
walkable = false,
node_box = {
type = "fixed",
fixed = {
--papyrus 1
{-0.03-0.1,-0.5,-0.03-0.1, 0.03-0.1,0.5,0.03-0.1},
{-0.06-0.1,-0.02-0.1,-0.06-0.1, 0.06-0.1,0.02-0.1,0.06-0.1},
--papyrus 2
{-0.03-0.4,-0.5,-0.03-0.3, 0.03-0.4,0.5,0.03-0.3},
{-0.06-0.4,-0.02-0.2,-0.06-0.3, 0.06-0.4,0.02-0.2,0.06-0.3},
--papyrus 3
{-0.03+0.4,-0.5,-0.03-0.3,0.03+0.4,0.5,0.03-0.3},
{-0.06+0.4,-0.02+0.2,-0.06-0.3, 0.06+0.4,0.02+0.2,0.06-0.3},
--papyrus 4
{-0.03-0.4,-0.5,-0.03+0.4, 0.03-0.4,0.5,0.03+0.4},
{-0.06-0.4,0.02+0.4,-0.06+0.4, 0.06-0.4,0.02+0.4,0.06+0.4},
--papyrus 5
{-0.03-0.2,-0.5,-0.03+0.2, 0.03-0.2,0.5,0.03+0.2},
{-0.06-0.2,0.02-0.4,-0.06+0.2, 0.06-0.2,0.02-0.4,0.06+0.2},
--papyrus 6
{-0.03+0.1,-0.5,-0.03+0.2, 0.03+0.1,0.5,0.03+0.2},
{-0.06+0.1,0.02+0.3,-0.06+0.2, 0.06+0.1,0.02+0.3,0.06+0.2},
},
},
groups = {snappy = 3,flammable = 2},
sounds = default.node_sound_leaves_defaults(),
})
--nodes
-- Deco Home
--Table
minetest.register_node("3dforniture:table",
{description = 'Table',
tiles = {
"forniture_wood.png",
"forniture_wood.png",
"forniture_wood_s1.png",
"forniture_wood_s1.png",
"forniture_wood_s2.png",
"forniture_wood_s2.png",
},
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = 'light',
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{-0.4,-0.5,-0.4, -0.3,0.4,-0.3},
{0.3,-0.5,-0.4, 0.4,0.4,-0.3},
{-0.4,-0.5,0.3, -0.3,0.4,0.4},
{0.3,-0.5,0.3, 0.4,0.4,0.4},
{-0.5,0.4,-0.5, 0.5,0.5,0.5},
{-0.4,-0.2,-0.3, -0.3,-0.1,0.3},
{0.3,-0.2,-0.4, 0.4,-0.1,0.3},
{-0.3,-0.2,-0.4, 0.4,-0.1,-0.3},
{-0.3,-0.2,0.3, 0.3,-0.1,0.4},
},
},
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}
})
--Chair
minetest.register_node("3dforniture:chair",
{ description = 'Chair',
tiles = {
"forniture_wood.png",
"forniture_wood.png",
"forniture_wood_s1.png",
"forniture_wood_s1.png",
"forniture_wood_s2.png",
"forniture_wood_s2.png",
},
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = 'light',
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{-0.3,-0.5,0.2, -0.2,0.5,0.3},
{0.2,-0.5,0.2, 0.3,0.5,0.3},
{-0.3,-0.5,-0.3, -0.2,-0.1,-0.2},
{0.2,-0.5,-0.3, 0.3,-0.1,-0.2},
{-0.3,-0.1,-0.3, 0.3,0,0.2},
{-0.2,0.1,0.25, 0.2,0.4,0.26}
},
},
selection_box = {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3},
},
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}
})
--Armchair
minetest.register_node("3dforniture:armchair",
{ description = 'Armchair',
tiles = {
"forniture_armchair_top.png",
"forniture_armchair_top.png",
"forniture_armchair_lat1.png",
"forniture_armchair_lat1.png",
"forniture_armchair_lat2.png",
"forniture_armchair_lat2.png",
},
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = 'light',
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
--lat 1
{-0.5,-0.5,-0.45, -0.3,0.05,0.3},
{-0.45,-0.5,-0.5, -0.35,0.05,-0.45},
{-0.45,0.05,-0.45, -0.35,0.1,0.15},
--lat 2
{0.3,-0.5,-0.45, 0.5,0.05,0.3},{0.35,-0.5,-0.5,0.45,0.05,-0.45},{0.35,0.05,-0.45, 0.45,0.1,0.15},
--respaldo
{-0.5,-0.5,0.3, 0.5,0.45,0.5},{-0.45,0.45,0.35,0.45,0.5,0.45},
--base
{-0.3,-0.45,-0.35, 0.3,-0.1,0.3},{-0.3,-0.45,-0.4, 0.3,-0.15,-0.35},
--oreja 1
{-0.5,0.05,0.15, -0.3,0.45, 0.3},{-0.45,0.1,0.1, -0.35,0.45,0.15},{-0.45,0.45,0.15,-0.35,0.5,0.35},
--oreja 2
{0.3,0.05,0.15, 0.5,0.45,0.3},{0.35,0.1,0.1, 0.45,0.45,0.15},{0.35,0.45,0.15,0.45,0.5,0.35},
},
},
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}
},
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}
})
--Table Lamp
minetest.register_node("3dforniture:table_lamp_off",
{ description = 'Table Lamp',
drawtype = "nodebox",
tiles = {
"forniture_table_lamp_s.png",
"forniture_table_lamp_s.png",
"forniture_table_lamp_l.png",
},
paramtype = 'light',
paramtype2 == 'facedir',
node_box = {
type = "fixed",
fixed = {
--Lamp Base
{-0.15,-0.5,-0.15, 0.15,-0.45,0.15},
{-0.05,-0.45,-0.05, 0.05,-0.4,0.05},
{-0.025,-0.4,-0.025, 0.025,-0.1,0.025},
{-0.0125,-0.125,-0.2, 0.0125,-0.1,0.2},
{-0.2,-0.125,-0.0125, 0.2,-0.1,0.0125},
--Lamp Shade
{-0.2,-0.1,-0.2, -0.175,0.3,0.2},
{0.175,-0.1,-0.2, 0.2,0.3,0.2},
{-0.175,-0.1,-0.2, 0.175,0.3,-0.175},
{-0.175,-0.1,0.175, 0.175,0.3,0.2},
},
},
sunlight_propagates = true,
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5,0.5, 0.5},
},
groups = {cracky=2,oddly_breakable_by_hand=1,},
drop = "3dforniture:table_lamp_off",
})
minetest.register_node("3dforniture:table_lamp_low",
{ description = 'Table Lamp',
drawtype = "nodebox",
tiles = {
"forniture_table_lamp_s.png",
"forniture_table_lamp_s.png",
"forniture_table_lamp_l.png",
},
paramtype = 'light',
paramtype2 == 'facedir',
node_box = {
type = "fixed",
fixed = {
--Lamp Base
{-0.15,-0.5,-0.15, 0.15,-0.45,0.15},
{-0.05,-0.45,-0.05, 0.05,-0.4,0.05},
{-0.025,-0.4,-0.025, 0.025,-0.1,0.025},
{-0.0125,-0.125,-0.2, 0.0125,-0.1,0.2},
{-0.2,-0.125,-0.0125, 0.2,-0.1,0.0125},
--Lamp Shade
{-0.2,-0.1,-0.2, -0.175,0.3,0.2},
{0.175,-0.1,-0.2, 0.2,0.3,0.2},
{-0.175,-0.1,-0.2, 0.175,0.3,-0.175},
{-0.175,-0.1,0.175, 0.175,0.3,0.2},
},
},
sunlight_propagates = true,
walkable = false,
light_source = 4,
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5,0.5, 0.5},
},
groups = {cracky=2,oddly_breakable_by_hand=1,},
drop = "3dforniture:table_lamp_off",
})
minetest.register_node("3dforniture:table_lamp_med",
{ description = 'Table Lamp',
drawtype = "nodebox",
tiles = {
"forniture_table_lamp_s.png",
"forniture_table_lamp_s.png",
"forniture_table_lamp_l.png",
},
paramtype = 'light',
paramtype2 == 'facedir',
node_box = {
type = "fixed",
fixed = {
--Lamp Base
{-0.15,-0.5,-0.15, 0.15,-0.45,0.15},
{-0.05,-0.45,-0.05, 0.05,-0.4,0.05},
{-0.025,-0.4,-0.025, 0.025,-0.1,0.025},
{-0.0125,-0.125,-0.2, 0.0125,-0.1,0.2},
{-0.2,-0.125,-0.0125, 0.2,-0.1,0.0125},
--Lamp Shade
{-0.2,-0.1,-0.2, -0.175,0.3,0.2},
{0.175,-0.1,-0.2, 0.2,0.3,0.2},
{-0.175,-0.1,-0.2, 0.175,0.3,-0.175},
{-0.175,-0.1,0.175, 0.175,0.3,0.2},
},
},
sunlight_propagates = true,
walkable = false,
light_source = 8,
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5,0.5, 0.5},
},
groups = {cracky=2,oddly_breakable_by_hand=1,},
drop = "3dforniture:table_lamp_off",
})
minetest.register_node("3dforniture:table_lamp_hi",
{ description = 'Table Lamp',
drawtype = "nodebox",
tiles = {
"forniture_table_lamp_s.png",
"forniture_table_lamp_s.png",
"forniture_table_lamp_l.png",
},
paramtype = 'light',
paramtype2 == 'facedir',
node_box = {
type = "fixed",
fixed = {
--Lamp Base
{-0.15,-0.5,-0.15, 0.15,-0.45,0.15},
{-0.05,-0.45,-0.05, 0.05,-0.4,0.05},
{-0.025,-0.4,-0.025, 0.025,-0.1,0.025},
{-0.0125,-0.125,-0.2, 0.0125,-0.1,0.2},
{-0.2,-0.125,-0.0125, 0.2,-0.1,0.0125},
--Lamp Shade
{-0.2,-0.1,-0.2, -0.175,0.3,0.2},
{0.175,-0.1,-0.2, 0.2,0.3,0.2},
{-0.175,-0.1,-0.2, 0.175,0.3,-0.175},
{-0.175,-0.1,0.175, 0.175,0.3,0.2},
},
},
sunlight_propagates = true,
walkable = false,
light_source = 12,
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5,0.5, 0.5},
},
groups = {cracky=2},
drop = "3dforniture:table_lamp_off",
})
minetest.register_node("3dforniture:table_lamp_max",
{ description = 'Table Lamp',
drawtype = "nodebox",
tiles = {
"forniture_table_lamp_s.png",
"forniture_table_lamp_s.png",
"forniture_table_lamp_l.png",
},
paramtype = 'light',
paramtype2 == 'facedir',
node_box = {
type = "fixed",
fixed = {
--Lamp Base
{-0.15,-0.5,-0.15, 0.15,-0.45,0.15},
{-0.05,-0.45,-0.05, 0.05,-0.4,0.05},
{-0.025,-0.4,-0.025, 0.025,-0.1,0.025},
{-0.0125,-0.125,-0.2, 0.0125,-0.1,0.2},
{-0.2,-0.125,-0.0125, 0.2,-0.1,0.0125},
--Lamp Shade
{-0.2,-0.1,-0.2, -0.175,0.3,0.2},
{0.175,-0.1,-0.2, 0.2,0.3,0.2},
{-0.175,-0.1,-0.2, 0.175,0.3,-0.175},
{-0.175,-0.1,0.175, 0.175,0.3,0.2},
},
},
sunlight_propagates = true,
walkable = false,
light_source = 16,
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5,0.5, 0.5},
},
groups = {cracky=2,oddly_breakable_by_hand=1,},
drop = "3dforniture:table_lamp_off",
})
-- Bathroom Kit
--Toilet
minetest.register_node("3dforniture:toilet",
{ description = 'Toilet',
tiles = {
"forniture_marble.png", "forniture_marble.png",
"forniture_marble_s1.png", "forniture_marble_s1.png",
"forniture_marble_s2.png", "forniture_marble_s2.png",
},
drawtype = "nodebox",
sunlight_propagates = false,
paramtype = 'light',
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{-0.2,-0.5,-0.2, 0.2,-0.45,0.5},
{-0.1,-0.45,-0.1, 0.1,0,0.5},
{-0.3,-0.2,-0.3, 0.3,0,0.35},
{-0.25,0,-0.25, 0.25,0.05,0.25},
{-0.3,0,0.3, 0.3,0.4,0.5},
{-0.05,0.4,0.35, 0.05,0.45,0.45},
},
},
drop ="3dforniture:toilet",
groups = {cracky=3,}
})
minetest.register_node("3dforniture:toilet_open",
{ description = 'Toilet',
tiles = {
"forniture_marble_top_toilet.png", "forniture_marble.png",
"forniture_marble_sb1.png", "forniture_marble_sb1.png",
"forniture_marble_sb2.png", "forniture_marble_sb2.png",
},
drawtype = "nodebox",
sunlight_propagates = false,
paramtype = 'light',
paramtype2 = 'facedir',
node_box = {
type = "fixed",
fixed = {
{-0.2,-0.5,-0.2, 0.2,-0.45,0.5},
{-0.1,-0.45,-0.1, 0.1,-0.2,0.5},
{-0.1,-0.2,0.3, 0.1,0,0.5},
{-0.3,-0.2,0.1, 0.3,0,0.35},
{-0.3,-0.2,-0.3, -0.1,-0.15,0.1},
{-0.1,-0.2,-0.3, 0.1,-0.15,-0.1},
{0.1,-0.2,-0.3, 0.3,-0.15,0.1},
{-0.3,-0.15,-0.3, -0.2,0,0.1},
{-0.2,-0.15,-0.3, 0.2,0,-0.2},
{0.2,-0.15,-0.3, 0.3,0,0.1},
{-0.25,0,0.2, 0.25,0.5,0.25},
{-0.3,0,0.3, 0.3,0.4,0.5},
},
},
drop = "3dforniture:toilet",
groups = {cracky = 3,},
sounds = {dig = "3dforniture_dig_toilet", gain=0.5},
})
--Sink
minetest.register_node("3dforniture:sink",
{description = 'Sink',
tiles = {
"forniture_marble_top_sink.png", "forniture_marble.png",
"forniture_marble_sb1.png", "forniture_marble_sb1.png",
"forniture_marble_sb2.png", "forniture_marble_sb2.png",
},
inventory_image = "3dforniture_inv_sink.png",
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = 'light',
paramtype2 = 'facedir',
node_box = {
type = "fixed",
fixed = {
{-0.15,0.35,0.2,0.15,0.4,0.5},
{-0.25,0.4,0.4, 0.25,0.45,0.5},
{-0.25,0.4,0.15, -0.15,0.45,0.4},
{0.15,0.4,0.15, 0.25,0.45,0.4},
{-0.15,0.4,0.15, 0.15,0.45,0.2},
{-0.3,0.45,0.4, 0.3,0.5,0.5},
{-0.3,0.45,0.1, -0.25,0.5,0.4},
{0.25,0.45,0.1, 0.3,0.5,0.4},
{-0.25,0.45,0.1, 0.25,0.5,0.15},
},
},
selection_box = {
type = "fixed",
fixed = {-0.3,0.35,0.1, 0.3,0.5,0.5},
},
groups = {cracky=2,}
})
--Taps
minetest.register_node("3dforniture:taps",
{ description = 'Taps',
tiles = {
"forniture_metal.png", "forniture_metal.png",
"forniture_metal_s1.png", "forniture_metal_s1.png",
"forniture_metal_s2.png", "forniture_metal_s2.png",
},
inventory_image = "3dforniture_inv_taps.png",
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = 'light',
paramtype2 = 'facedir',
node_box = {
type = "fixed",
fixed = {
--Base
{-0.25,-0.45,0.49, 0.25,-0.3,0.5},
{-0.05,-0.4,0.25, 0.05,-0.35,0.5},
{-0.05,-0.425,0.25,0.05,-0.4,0.3},
--taps 1
{-0.2,-0.4,0.45, -0.15,-0.35,0.5},
{-0.2,-0.45,0.4, -0.15,-0.3,0.45},
{-0.25,-0.4,0.4, -0.1,-0.35,0.45},
--taps 2
{0.15,-0.4,0.45, 0.2,-0.35,0.5},
{0.15,-0.45,0.4, 0.2,-0.3,0.45},
{0.1,-0.4,0.4, 0.25,-0.35,0.45},
},
},
selection_box = {
type = "fixed",
fixed = {-0.25,-0.45,0.25, 0.25,-0.3,0.5},
},
groups = {cracky=2,}
})
--Shower Tray
minetest.register_node("3dforniture:shower_tray",
{ description = 'Shower Tray',
tiles = {
"forniture_marble_base_ducha_top.png",
"forniture_marble_base_ducha_top.png",
"forniture_marble_sb1.png",
"forniture_marble_sb1.png",
"forniture_marble_sb2.png",
"forniture_marble_sb2.png",
},
inventory_image = "3dforniture_inv_shower_tray.png",
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = 'light',
paramtype2 = 'facedir',
legacy_facedir_simple = true,
node_box = {
type = "fixed",
fixed = {
{-0.5,-0.5,-0.5, 0.5,-0.45,0.5},
{-0.5,-0.45,-0.5, 0.5,-0.4,-0.45},
{-0.5,-0.45,0.45, 0.5,-0.4,0.5},
{-0.5,-0.45,-0.45, -0.45,-0.4,0.45},
{0.45,-0.45,-0.45, 0.5,-0.4,0.45},
},
},
selection_box = {
type = "fixed",
fixed = {-0.5,-0.5,-0.5, 0.5,-0.4,0.5},
},
groups = {cracky=2,}
})
--Shower Head
minetest.register_node("3dforniture:shower_head",
{description = 'Shower Head',
tiles = {
"forniture_metal.png",
"forniture_metal.png",
"forniture_metal_s1.png",
"forniture_metal_s1.png",
"forniture_metal_s2.png",
"forniture_metal_s2.png",
},
inventory_image = "3dforniture_inv_shower_head.png",
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = 'light',
paramtype2 = 'facedir',
node_box = {
type = "fixed",
fixed = {
{-0.1,-0.5,0.1, 0.1,-0.4,0.3},
{-0.05,-0.4,0.15, 0.05,-0.3,0.25},
{-0.05,-0.35,0.25,0.05,-0.3,0.5},
{-0.1,-0.4,0.49, 0.1,-0.25,0.5},
},
},
selection_box = {
type = "fixed",
fixed = {-0.1,-0.5,0.1, 0.1,-0.25,0.5},
},
groups = {cracky=2,}
})
-- Medieval Forniture
--Bars
minetest.register_node("3dforniture:bars",
{ description = 'Bars',
tiles = {
"forniture_black_metal.png",
"forniture_black_metal.png",
"forniture_black_metal_s1.png",
"forniture_black_metal_s1.png",
"forniture_black_metal_s2.png",
"forniture_black_metal_s2.png",
},
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = 'light',
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{-0.5,-0.5,-0.1, -0.4,0.5,0.1},
{-0.1,-0.5,-0.1, 0.1,0.5,0.1},
{0.4,-0.5,-0.1, 0.5,0.5,0.1},
{-0.5,-0.5,-0.05, 0.5,-0.45,0.05},
{-0.5,0.45,-0.05, 0.5,0.5,0.05}
},
},
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.1, 0.5, 0.5, 0.1},
},
groups = {cracky=1}
})
--L Binding Bars
minetest.register_node("3dforniture:L_binding_bars",
{ description ='Binding Bars',
tiles = {
"forniture_black_metal.png",
"forniture_black_metal.png",
"forniture_black_metal_s1.png",
"forniture_black_metal_s1.png",
"forniture_black_metal_s2.png",
"forniture_black_metal_s2.png",
},
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = 'light',
paramtype2 ="facedir",
node_box = {
type = "fixed",
fixed = {
{-0.1,-0.5,-0.5,0.1,0.5,-0.4},
{-0.15,-0.5,-0.15, 0.15,0.5,0.15},
{0.4,-0.5,-0.1, 0.5,0.5,0.1},
{0,-0.5,-0.05, 0.5,-0.45,0.05},
{-0.05,-0.5,-0.5, 0.05,-0.45,0},
{0,0.45,-0.05, 0.5,0.5,0.05},
{-0.05,0.45,-0.5, 0.05,0.5,0},
},
},
groups = {cracky=1,}
})
--Chains
minetest.register_node("3dforniture:chains",
{ description = 'Chains',
tiles = {
"forniture_black_metal.png",
"forniture_black_metal.png",
"forniture_black_metal_s1.png",
"forniture_black_metal_s1.png",
"forniture_black_metal_s2.png",
"forniture_black_metal_s2.png",
},
inventory_image = "3dforniture_inv_chains.png",
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = 'light',
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
--chain a
--supporting
{-0.45,0.25,0.45, -0.2,0.5,0.5},
{-0.35,0.4,0.35, -0.3,0.45,0.45},
{-0.35,0.3,0.35, -0.3,0.35,0.45},
{-0.35,0.35,0.3, -0.3,0.4,0.35},
--link 1
{-0.4,0.35,0.35, -0.25,0.4,0.4},
{-0.4,0.15,0.35, -0.25,0.2,0.4},
{-0.45,0.2,0.35, -0.4,0.35,0.4},
{-0.25,0.2,0.35, -0.2,0.35,0.4},
--link 2
{-0.35,0.2,0.3, -0.3,0.25,0.45},
{-0.35,0,0.3, -0.3,0.05,0.45},
{-0.35,0.05,0.25, -0.3,0.2,0.3},
{-0.35,0.05,0.45, -0.3,0.2,0.5},
--link 3
{-0.4,0.05,0.35, -0.25,0.1,0.4},
{-0.4,-0.15,0.35, -0.25,-0.1,0.4},
{-0.45,-0.1,0.35, -0.4,0.05,0.4},
{-0.25,-0.1,0.35, -0.2,0.05,0.4},
--link 4
{-0.35,-0.1,0.3, -0.3,-0.05,0.45},
{-0.35,-0.3,0.3, -0.3,-0.25,0.45},
{-0.35,-0.25,0.25, -0.3,-0.1,0.3},
{-0.35,-0.25,0.45, -0.3,-0.1,0.5},
--link 5
{-0.4,-0.25,0.35, -0.25,-0.2,0.4},
{-0.4,-0.45,0.35, -0.25,-0.4,0.4},
{-0.45,-0.4,0.35, -0.4,-0.25,0.4},
{-0.25,-0.4,0.35, -0.2,-0.25,0.4},
--chain b
--supporting
{0.2,0.25,0.45, 0.45,0.5,0.5},
{0.3,0.4,0.35,0.35,0.45,0.45},
{0.3,0.3,0.35, 0.35,0.35,0.45},
{0.3,0.35,0.3, 0.35,0.4,0.35},
--link 1
{0.25,0.35,0.35, 0.4,0.4,0.4},
{0.25,0.15,0.35, 0.4,0.2,0.4},
{0.2,0.2,0.35, 0.25,0.35,0.4},
{0.4,0.2,0.35, 0.45,0.35,0.4},
--link 2
{0.3,0.2,0.3, 0.35,0.25,0.45},
{0.3,0,0.3, 0.35,0.05,0.45},
{0.3,0.05,0.25, 0.35,0.2,0.3},
{0.3,0.05,0.45, 0.35,0.2,0.5},
--link 3
{0.25,0.05,0.35, 0.4,0.1,0.4},
{0.25,-0.15,0.35, 0.4,-0.1,0.4},
{0.2,-0.1,0.35, 0.25,0.05,0.4},
{0.4,-0.1,0.35, 0.45,0.05,0.4},
--link 4
{0.3,-0.1,0.3, 0.35,-0.05,0.45},
{0.3,-0.3,0.3, 0.35,-0.25,0.45},
{0.3,-0.25,0.25, 0.35,-0.1,0.3},
{0.3,-0.25,0.45, 0.35,-0.1,0.5},
---link 5
{0.25,-0.25,0.35, 0.4,-0.2,0.4},
{0.25,-0.45,0.35,0.4,-0.4,0.4},
{0.2,-0.4,0.35, 0.25,-0.25,0.4},
{0.4,-0.4,0.35, 0.45,-0.25,0.4},
},
},
selection_box = {
type = "fixed",
fixed = {-1/2, -1/2, 1/4, 1/2, 1/2, 1/2}, },
groups = {cracky=1}
})
--Torch Wakll
minetest.register_node("3dforniture:torch_wall",
{ description = 'Torch Wall',
drawtype = "nodebox",
tiles = {
"forniture_torch_wall_s.png",
"forniture_torch_wall_i.png",
{ name="forniture_torch_wall_anim.png",
animation={
type="vertical_frames",
aspect_w=40,
aspect_h=40,
length=1.0
}
}
},
inventory_image = "3dforniture_inv_torch_wall.png",
paramtype = 'light',
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
--torch
{-0.05,-0.45,0.45, 0.05,-0.35,0.5},
{-0.05,-0.35,0.4, 0.05,-0.25,0.5},
{-0.05,-0.25,0.35, 0.05,-0.15,0.45},
{-0.05,-0.15,0.3, 0.05,-0.05,0.4},
{-0.05,-0.05,0.25, 0.05,0,0.35},
--fire
{-0.1,0,0.2, 0.1,0.05,0.4},
{-0.15,0.05,0.15, 0.15,0.15,0.45},
{-0.1,0.15,0.2, 0.1,0.25,0.4},
{-0.05,0.25,0.25, 0.05,0.35,0.35},
},
},
sunlight_propagates = true,
walkable = false,
light_source = 18,
selection_box = {
type = "fixed",
fixed = {-0.15, -0.45, 0.15, 0.15,0.35, 0.5},
},
groups = {cracky=2}
})

753
mods/3dforniture/nodes.lua Normal file
View File

@ -0,0 +1,753 @@
--[[
3D Forniture
Copyright 2012 Tonyka
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA.
Contributors:
InfinityProject
suggested creating bathroom kit.
cosarara97
code.
]]--
-- replacement
--nodes
-- Deco Home
--Table
minetest.register_node("3dforniture:table",
{description = 'Table',
tiles = {
"forniture_wood.png",
"forniture_wood.png",
"forniture_wood_s1.png",
"forniture_wood_s1.png",
"forniture_wood_s2.png",
"forniture_wood_s2.png",
},
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = 'light',
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{-0.4,-0.5,-0.4, -0.3,0.4,-0.3},
{0.3,-0.5,-0.4, 0.4,0.4,-0.3},
{-0.4,-0.5,0.3, -0.3,0.4,0.4},
{0.3,-0.5,0.3, 0.4,0.4,0.4},
{-0.5,0.4,-0.5, 0.5,0.5,0.5},
{-0.4,-0.2,-0.3, -0.3,-0.1,0.3},
{0.3,-0.2,-0.4, 0.4,-0.1,0.3},
{-0.3,-0.2,-0.4, 0.4,-0.1,-0.3},
{-0.3,-0.2,0.3, 0.3,-0.1,0.4},
},
},
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}
})
--Chair
minetest.register_node("3dforniture:chair",
{ description = 'Chair',
tiles = {
"forniture_wood.png",
"forniture_wood.png",
"forniture_wood_s1.png",
"forniture_wood_s1.png",
"forniture_wood_s2.png",
"forniture_wood_s2.png",
},
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = 'light',
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{-0.3,-0.5,0.2, -0.2,0.5,0.3},
{0.2,-0.5,0.2, 0.3,0.5,0.3},
{-0.3,-0.5,-0.3, -0.2,-0.1,-0.2},
{0.2,-0.5,-0.3, 0.3,-0.1,-0.2},
{-0.3,-0.1,-0.3, 0.3,0,0.2},
{-0.2,0.1,0.25, 0.2,0.4,0.26}
},
},
selection_box = {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3},
},
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}
})
--Armchair
minetest.register_node("3dforniture:armchair",
{ description = 'Armchair',
tiles = {
"forniture_armchair_top.png",
"forniture_armchair_top.png",
"forniture_armchair_lat1.png",
"forniture_armchair_lat1.png",
"forniture_armchair_lat2.png",
"forniture_armchair_lat2.png",
},
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = 'light',
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
--lat 1
{-0.5,-0.5,-0.45, -0.3,0.05,0.3},
{-0.45,-0.5,-0.5, -0.35,0.05,-0.45},
{-0.45,0.05,-0.45, -0.35,0.1,0.15},
--lat 2
{0.3,-0.5,-0.45, 0.5,0.05,0.3},{0.35,-0.5,-0.5,0.45,0.05,-0.45},{0.35,0.05,-0.45, 0.45,0.1,0.15},
--respaldo
{-0.5,-0.5,0.3, 0.5,0.45,0.5},{-0.45,0.45,0.35,0.45,0.5,0.45},
--base
{-0.3,-0.45,-0.35, 0.3,-0.1,0.3},{-0.3,-0.45,-0.4, 0.3,-0.15,-0.35},
--oreja 1
{-0.5,0.05,0.15, -0.3,0.45, 0.3},{-0.45,0.1,0.1, -0.35,0.45,0.15},{-0.45,0.45,0.15,-0.35,0.5,0.35},
--oreja 2
{0.3,0.05,0.15, 0.5,0.45,0.3},{0.35,0.1,0.1, 0.45,0.45,0.15},{0.35,0.45,0.15,0.45,0.5,0.35},
},
},
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}
},
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}
})
--Table Lamp
minetest.register_node("3dforniture:table_lamp_off",
{ description = 'Table Lamp',
drawtype = "nodebox",
tiles = {
"forniture_table_lamp_s.png",
"forniture_table_lamp_s.png",
"forniture_table_lamp_l.png",
},
paramtype = 'light',
paramtype2 == 'facedir',
node_box = {
type = "fixed",
fixed = {
--Lamp Base
{-0.15,-0.5,-0.15, 0.15,-0.45,0.15},
{-0.05,-0.45,-0.05, 0.05,-0.4,0.05},
{-0.025,-0.4,-0.025, 0.025,-0.1,0.025},
{-0.0125,-0.125,-0.2, 0.0125,-0.1,0.2},
{-0.2,-0.125,-0.0125, 0.2,-0.1,0.0125},
--Lamp Shade
{-0.2,-0.1,-0.2, -0.175,0.3,0.2},
{0.175,-0.1,-0.2, 0.2,0.3,0.2},
{-0.175,-0.1,-0.2, 0.175,0.3,-0.175},
{-0.175,-0.1,0.175, 0.175,0.3,0.2},
},
},
sunlight_propagates = true,
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5,0.5, 0.5},
},
groups = {cracky=2,oddly_breakable_by_hand=1,},
drop = "3dforniture:table_lamp_off",
})
minetest.register_node("3dforniture:table_lamp_low",
{ description = 'Table Lamp',
drawtype = "nodebox",
tiles = {
"forniture_table_lamp_s.png",
"forniture_table_lamp_s.png",
"forniture_table_lamp_l.png",
},
paramtype = 'light',
paramtype2 == 'facedir',
node_box = {
type = "fixed",
fixed = {
--Lamp Base
{-0.15,-0.5,-0.15, 0.15,-0.45,0.15},
{-0.05,-0.45,-0.05, 0.05,-0.4,0.05},
{-0.025,-0.4,-0.025, 0.025,-0.1,0.025},
{-0.0125,-0.125,-0.2, 0.0125,-0.1,0.2},
{-0.2,-0.125,-0.0125, 0.2,-0.1,0.0125},
--Lamp Shade
{-0.2,-0.1,-0.2, -0.175,0.3,0.2},
{0.175,-0.1,-0.2, 0.2,0.3,0.2},
{-0.175,-0.1,-0.2, 0.175,0.3,-0.175},
{-0.175,-0.1,0.175, 0.175,0.3,0.2},
},
},
sunlight_propagates = true,
walkable = false,
light_source = 4,
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5,0.5, 0.5},
},
groups = {cracky=2,oddly_breakable_by_hand=1,},
drop = "3dforniture:table_lamp_off",
})
minetest.register_node("3dforniture:table_lamp_med",
{ description = 'Table Lamp',
drawtype = "nodebox",
tiles = {
"forniture_table_lamp_s.png",
"forniture_table_lamp_s.png",
"forniture_table_lamp_l.png",
},
paramtype = 'light',
paramtype2 == 'facedir',
node_box = {
type = "fixed",
fixed = {
--Lamp Base
{-0.15,-0.5,-0.15, 0.15,-0.45,0.15},
{-0.05,-0.45,-0.05, 0.05,-0.4,0.05},
{-0.025,-0.4,-0.025, 0.025,-0.1,0.025},
{-0.0125,-0.125,-0.2, 0.0125,-0.1,0.2},
{-0.2,-0.125,-0.0125, 0.2,-0.1,0.0125},
--Lamp Shade
{-0.2,-0.1,-0.2, -0.175,0.3,0.2},
{0.175,-0.1,-0.2, 0.2,0.3,0.2},
{-0.175,-0.1,-0.2, 0.175,0.3,-0.175},
{-0.175,-0.1,0.175, 0.175,0.3,0.2},
},
},
sunlight_propagates = true,
walkable = false,
light_source = 8,
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5,0.5, 0.5},
},
groups = {cracky=2,oddly_breakable_by_hand=1,},
drop = "3dforniture:table_lamp_off",
})
minetest.register_node("3dforniture:table_lamp_hi",
{ description = 'Table Lamp',
drawtype = "nodebox",
tiles = {
"forniture_table_lamp_s.png",
"forniture_table_lamp_s.png",
"forniture_table_lamp_l.png",
},
paramtype = 'light',
paramtype2 == 'facedir',
node_box = {
type = "fixed",
fixed = {
--Lamp Base
{-0.15,-0.5,-0.15, 0.15,-0.45,0.15},
{-0.05,-0.45,-0.05, 0.05,-0.4,0.05},
{-0.025,-0.4,-0.025, 0.025,-0.1,0.025},
{-0.0125,-0.125,-0.2, 0.0125,-0.1,0.2},
{-0.2,-0.125,-0.0125, 0.2,-0.1,0.0125},
--Lamp Shade
{-0.2,-0.1,-0.2, -0.175,0.3,0.2},
{0.175,-0.1,-0.2, 0.2,0.3,0.2},
{-0.175,-0.1,-0.2, 0.175,0.3,-0.175},
{-0.175,-0.1,0.175, 0.175,0.3,0.2},
},
},
sunlight_propagates = true,
walkable = false,
light_source = 12,
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5,0.5, 0.5},
},
groups = {cracky=2},
drop = "3dforniture:table_lamp_off",
})
minetest.register_node("3dforniture:table_lamp_max",
{ description = 'Table Lamp',
drawtype = "nodebox",
tiles = {
"forniture_table_lamp_s.png",
"forniture_table_lamp_s.png",
"forniture_table_lamp_l.png",
},
paramtype = 'light',
paramtype2 == 'facedir',
node_box = {
type = "fixed",
fixed = {
--Lamp Base
{-0.15,-0.5,-0.15, 0.15,-0.45,0.15},
{-0.05,-0.45,-0.05, 0.05,-0.4,0.05},
{-0.025,-0.4,-0.025, 0.025,-0.1,0.025},
{-0.0125,-0.125,-0.2, 0.0125,-0.1,0.2},
{-0.2,-0.125,-0.0125, 0.2,-0.1,0.0125},
--Lamp Shade
{-0.2,-0.1,-0.2, -0.175,0.3,0.2},
{0.175,-0.1,-0.2, 0.2,0.3,0.2},
{-0.175,-0.1,-0.2, 0.175,0.3,-0.175},
{-0.175,-0.1,0.175, 0.175,0.3,0.2},
},
},
sunlight_propagates = true,
walkable = false,
light_source = 16,
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5,0.5, 0.5},
},
groups = {cracky=2,oddly_breakable_by_hand=1,},
drop = "3dforniture:table_lamp_off",
})
-- Bathroom Kit
--Toilet
minetest.register_node("3dforniture:toilet",
{ description = 'Toilet',
tiles = {
"forniture_marble.png", "forniture_marble.png",
"forniture_marble_s1.png", "forniture_marble_s1.png",
"forniture_marble_s2.png", "forniture_marble_s2.png",
},
drawtype = "nodebox",
sunlight_propagates = false,
paramtype = 'light',
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{-0.2,-0.5,-0.2, 0.2,-0.45,0.5},
{-0.1,-0.45,-0.1, 0.1,0,0.5},
{-0.3,-0.2,-0.3, 0.3,0,0.35},
{-0.25,0,-0.25, 0.25,0.05,0.25},
{-0.3,0,0.3, 0.3,0.4,0.5},
{-0.05,0.4,0.35, 0.05,0.45,0.45},
},
},
drop ="3dforniture:toilet",
groups = {cracky=3,}
})
minetest.register_node("3dforniture:toilet_open",
{ description = 'Toilet',
tiles = {
"forniture_marble_top_toilet.png", "forniture_marble.png",
"forniture_marble_sb1.png", "forniture_marble_sb1.png",
"forniture_marble_sb2.png", "forniture_marble_sb2.png",
},
drawtype = "nodebox",
sunlight_propagates = false,
paramtype = 'light',
paramtype2 = 'facedir',
node_box = {
type = "fixed",
fixed = {
{-0.2,-0.5,-0.2, 0.2,-0.45,0.5},
{-0.1,-0.45,-0.1, 0.1,-0.2,0.5},
{-0.1,-0.2,0.3, 0.1,0,0.5},
{-0.3,-0.2,0.1, 0.3,0,0.35},
{-0.3,-0.2,-0.3, -0.1,-0.15,0.1},
{-0.1,-0.2,-0.3, 0.1,-0.15,-0.1},
{0.1,-0.2,-0.3, 0.3,-0.15,0.1},
{-0.3,-0.15,-0.3, -0.2,0,0.1},
{-0.2,-0.15,-0.3, 0.2,0,-0.2},
{0.2,-0.15,-0.3, 0.3,0,0.1},
{-0.25,0,0.2, 0.25,0.5,0.25},
{-0.3,0,0.3, 0.3,0.4,0.5},
},
},
drop = "3dforniture:toilet",
groups = {cracky = 3,},
sounds = {dig = "3dforniture_dig_toilet", gain=0.5},
})
--Sink
minetest.register_node("3dforniture:sink",
{description = 'Sink',
tiles = {
"forniture_marble_top_sink.png", "forniture_marble.png",
"forniture_marble_sb1.png", "forniture_marble_sb1.png",
"forniture_marble_sb2.png", "forniture_marble_sb2.png",
},
inventory_image = "3dforniture_inv_sink.png",
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = 'light',
paramtype2 = 'facedir',
node_box = {
type = "fixed",
fixed = {
{-0.15,0.35,0.2,0.15,0.4,0.5},
{-0.25,0.4,0.4, 0.25,0.45,0.5},
{-0.25,0.4,0.15, -0.15,0.45,0.4},
{0.15,0.4,0.15, 0.25,0.45,0.4},
{-0.15,0.4,0.15, 0.15,0.45,0.2},
{-0.3,0.45,0.4, 0.3,0.5,0.5},
{-0.3,0.45,0.1, -0.25,0.5,0.4},
{0.25,0.45,0.1, 0.3,0.5,0.4},
{-0.25,0.45,0.1, 0.25,0.5,0.15},
},
},
selection_box = {
type = "fixed",
fixed = {-0.3,0.35,0.1, 0.3,0.5,0.5},
},
groups = {cracky=2,}
})
--Taps
minetest.register_node("3dforniture:taps",
{ description = 'Taps',
tiles = {
"forniture_metal.png", "forniture_metal.png",
"forniture_metal_s1.png", "forniture_metal_s1.png",
"forniture_metal_s2.png", "forniture_metal_s2.png",
},
inventory_image = "3dforniture_inv_taps.png",
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = 'light',
paramtype2 = 'facedir',
node_box = {
type = "fixed",
fixed = {
--Base
{-0.25,-0.45,0.49, 0.25,-0.3,0.5},
{-0.05,-0.4,0.25, 0.05,-0.35,0.5},
{-0.05,-0.425,0.25,0.05,-0.4,0.3},
--taps 1
{-0.2,-0.4,0.45, -0.15,-0.35,0.5},
{-0.2,-0.45,0.4, -0.15,-0.3,0.45},
{-0.25,-0.4,0.4, -0.1,-0.35,0.45},
--taps 2
{0.15,-0.4,0.45, 0.2,-0.35,0.5},
{0.15,-0.45,0.4, 0.2,-0.3,0.45},
{0.1,-0.4,0.4, 0.25,-0.35,0.45},
},
},
selection_box = {
type = "fixed",
fixed = {-0.25,-0.45,0.25, 0.25,-0.3,0.5},
},
groups = {cracky=2,}
})
--Shower Tray
minetest.register_node("3dforniture:shower_tray",
{ description = 'Shower Tray',
tiles = {
"forniture_marble_base_ducha_top.png",
"forniture_marble_base_ducha_top.png",
"forniture_marble_sb1.png",
"forniture_marble_sb1.png",
"forniture_marble_sb2.png",
"forniture_marble_sb2.png",
},
inventory_image = "3dforniture_inv_shower_tray.png",
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = 'light',
paramtype2 = 'facedir',
legacy_facedir_simple = true,
node_box = {
type = "fixed",
fixed = {
{-0.5,-0.5,-0.5, 0.5,-0.45,0.5},
{-0.5,-0.45,-0.5, 0.5,-0.4,-0.45},
{-0.5,-0.45,0.45, 0.5,-0.4,0.5},
{-0.5,-0.45,-0.45, -0.45,-0.4,0.45},
{0.45,-0.45,-0.45, 0.5,-0.4,0.45},
},
},
selection_box = {
type = "fixed",
fixed = {-0.5,-0.5,-0.5, 0.5,-0.4,0.5},
},
groups = {cracky=2,}
})
--Shower Head
minetest.register_node("3dforniture:shower_head",
{description = 'Shower Head',
tiles = {
"forniture_metal.png",
"forniture_metal.png",
"forniture_metal_s1.png",
"forniture_metal_s1.png",
"forniture_metal_s2.png",
"forniture_metal_s2.png",
},
inventory_image = "3dforniture_inv_shower_head.png",
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = 'light',
paramtype2 = 'facedir',
node_box = {
type = "fixed",
fixed = {
{-0.1,-0.5,0.1, 0.1,-0.4,0.3},
{-0.05,-0.4,0.15, 0.05,-0.3,0.25},
{-0.05,-0.35,0.25,0.05,-0.3,0.5},
{-0.1,-0.4,0.49, 0.1,-0.25,0.5},
},
},
selection_box = {
type = "fixed",
fixed = {-0.1,-0.5,0.1, 0.1,-0.25,0.5},
},
groups = {cracky=2,}
})
-- Medieval Forniture
--Bars
minetest.register_node("3dforniture:bars",
{ description = 'Bars',
tiles = {
"forniture_black_metal.png",
"forniture_black_metal.png",
"forniture_black_metal_s1.png",
"forniture_black_metal_s1.png",
"forniture_black_metal_s2.png",
"forniture_black_metal_s2.png",
},
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = 'light',
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{-0.5,-0.5,-0.1, -0.4,0.5,0.1},
{-0.1,-0.5,-0.1, 0.1,0.5,0.1},
{0.4,-0.5,-0.1, 0.5,0.5,0.1},
{-0.5,-0.5,-0.05, 0.5,-0.45,0.05},
{-0.5,0.45,-0.05, 0.5,0.5,0.05}
},
},
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.1, 0.5, 0.5, 0.1},
},
groups = {cracky=1}
})
--L Binding Bars
minetest.register_node("3dforniture:L_binding_bars",
{ description ='Binding Bars',
tiles = {
"forniture_black_metal.png",
"forniture_black_metal.png",
"forniture_black_metal_s1.png",
"forniture_black_metal_s1.png",
"forniture_black_metal_s2.png",
"forniture_black_metal_s2.png",
},
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = 'light',
paramtype2 ="facedir",
node_box = {
type = "fixed",
fixed = {
{-0.1,-0.5,-0.5,0.1,0.5,-0.4},
{-0.15,-0.5,-0.15, 0.15,0.5,0.15},
{0.4,-0.5,-0.1, 0.5,0.5,0.1},
{0,-0.5,-0.05, 0.5,-0.45,0.05},
{-0.05,-0.5,-0.5, 0.05,-0.45,0},
{0,0.45,-0.05, 0.5,0.5,0.05},
{-0.05,0.45,-0.5, 0.05,0.5,0},
},
},
groups = {cracky=1,}
})
--Chains
minetest.register_node("3dforniture:chains",
{ description = 'Chains',
tiles = {
"forniture_black_metal.png",
"forniture_black_metal.png",
"forniture_black_metal_s1.png",
"forniture_black_metal_s1.png",
"forniture_black_metal_s2.png",
"forniture_black_metal_s2.png",
},
inventory_image = "3dforniture_inv_chains.png",
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = 'light',
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
--chain a
--supporting
{-0.45,0.25,0.45, -0.2,0.5,0.5},
{-0.35,0.4,0.35, -0.3,0.45,0.45},
{-0.35,0.3,0.35, -0.3,0.35,0.45},
{-0.35,0.35,0.3, -0.3,0.4,0.35},
--link 1
{-0.4,0.35,0.35, -0.25,0.4,0.4},
{-0.4,0.15,0.35, -0.25,0.2,0.4},
{-0.45,0.2,0.35, -0.4,0.35,0.4},
{-0.25,0.2,0.35, -0.2,0.35,0.4},
--link 2
{-0.35,0.2,0.3, -0.3,0.25,0.45},
{-0.35,0,0.3, -0.3,0.05,0.45},
{-0.35,0.05,0.25, -0.3,0.2,0.3},
{-0.35,0.05,0.45, -0.3,0.2,0.5},
--link 3
{-0.4,0.05,0.35, -0.25,0.1,0.4},
{-0.4,-0.15,0.35, -0.25,-0.1,0.4},
{-0.45,-0.1,0.35, -0.4,0.05,0.4},
{-0.25,-0.1,0.35, -0.2,0.05,0.4},
--link 4
{-0.35,-0.1,0.3, -0.3,-0.05,0.45},
{-0.35,-0.3,0.3, -0.3,-0.25,0.45},
{-0.35,-0.25,0.25, -0.3,-0.1,0.3},
{-0.35,-0.25,0.45, -0.3,-0.1,0.5},
--link 5
{-0.4,-0.25,0.35, -0.25,-0.2,0.4},
{-0.4,-0.45,0.35, -0.25,-0.4,0.4},
{-0.45,-0.4,0.35, -0.4,-0.25,0.4},
{-0.25,-0.4,0.35, -0.2,-0.25,0.4},
--chain b
--supporting
{0.2,0.25,0.45, 0.45,0.5,0.5},
{0.3,0.4,0.35,0.35,0.45,0.45},
{0.3,0.3,0.35, 0.35,0.35,0.45},
{0.3,0.35,0.3, 0.35,0.4,0.35},
--link 1
{0.25,0.35,0.35, 0.4,0.4,0.4},
{0.25,0.15,0.35, 0.4,0.2,0.4},
{0.2,0.2,0.35, 0.25,0.35,0.4},
{0.4,0.2,0.35, 0.45,0.35,0.4},
--link 2
{0.3,0.2,0.3, 0.35,0.25,0.45},
{0.3,0,0.3, 0.35,0.05,0.45},
{0.3,0.05,0.25, 0.35,0.2,0.3},
{0.3,0.05,0.45, 0.35,0.2,0.5},
--link 3
{0.25,0.05,0.35, 0.4,0.1,0.4},
{0.25,-0.15,0.35, 0.4,-0.1,0.4},
{0.2,-0.1,0.35, 0.25,0.05,0.4},
{0.4,-0.1,0.35, 0.45,0.05,0.4},
--link 4
{0.3,-0.1,0.3, 0.35,-0.05,0.45},
{0.3,-0.3,0.3, 0.35,-0.25,0.45},
{0.3,-0.25,0.25, 0.35,-0.1,0.3},
{0.3,-0.25,0.45, 0.35,-0.1,0.5},
---link 5
{0.25,-0.25,0.35, 0.4,-0.2,0.4},
{0.25,-0.45,0.35,0.4,-0.4,0.4},
{0.2,-0.4,0.35, 0.25,-0.25,0.4},
{0.4,-0.4,0.35, 0.45,-0.25,0.4},
},
},
selection_box = {
type = "fixed",
fixed = {-1/2, -1/2, 1/4, 1/2, 1/2, 1/2}, },
groups = {cracky=1}
})
--Torch Wakll
minetest.register_node("3dforniture:torch_wall",
{ description = 'Torch Wall',
drawtype = "nodebox",
tiles = {
"forniture_torch_wall_s.png",
"forniture_torch_wall_i.png",
{ name="forniture_torch_wall_anim.png",
animation={
type="vertical_frames",
aspect_w=40,
aspect_h=40,
length=1.0
}
}
},
inventory_image = "3dforniture_inv_torch_wall.png",
paramtype = 'light',
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
--torch
{-0.05,-0.45,0.45, 0.05,-0.35,0.5},
{-0.05,-0.35,0.4, 0.05,-0.25,0.5},
{-0.05,-0.25,0.35, 0.05,-0.15,0.45},
{-0.05,-0.15,0.3, 0.05,-0.05,0.4},
{-0.05,-0.05,0.25, 0.05,0,0.35},
--fire
{-0.1,0,0.2, 0.1,0.05,0.4},
{-0.15,0.05,0.15, 0.15,0.15,0.45},
{-0.1,0.15,0.2, 0.1,0.25,0.4},
{-0.05,0.25,0.25, 0.05,0.35,0.35},
},
},
sunlight_propagates = true,
walkable = false,
light_source = 18,
selection_box = {
type = "fixed",
fixed = {-0.15, -0.45, 0.15, 0.15,0.35, 0.5},
},
groups = {cracky=2}
})

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 550 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 605 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 643 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

1
mods/bags/depends.txt Normal file
View File

@ -0,0 +1 @@
inventory_plus

140
mods/bags/init.lua Normal file
View File

@ -0,0 +1,140 @@
--[[
Bags for Minetest
Copyright (c) 2012 cornernote, Brett O'Donnell <cornernote@gmail.com>
Source Code: https://github.com/cornernote/minetest-particles
License: GPLv3
]]--
-- get_formspec
local get_formspec = function(player,page)
if page=="bags" then
return "size[8,7.5]"
.."list[current_player;main;0,3.5;8,4;]"
.."button[0,0;2,0.5;main;Back]"
.."button[0,2;2,0.5;bag1;Bag 1]"
.."button[2,2;2,0.5;bag2;Bag 2]"
.."button[4,2;2,0.5;bag3;Bag 3]"
.."button[6,2;2,0.5;bag4;Bag 4]"
.."list[detached:"..player:get_player_name().."_bags;bag1;0.5,1;1,1;]"
.."list[detached:"..player:get_player_name().."_bags;bag2;2.5,1;1,1;]"
.."list[detached:"..player:get_player_name().."_bags;bag3;4.5,1;1,1;]"
.."list[detached:"..player:get_player_name().."_bags;bag4;6.5,1;1,1;]"
end
for i=1,4 do
if page=="bag"..i then
local image = player:get_inventory():get_stack("bag"..i, 1):get_definition().inventory_image
return "size[8,8.5]"
.."list[current_player;main;0,4.5;8,4;]"
.."button[0,0;2,0.5;main;Main]"
.."button[2,0;2,0.5;bags;Bags]"
.."image[7,0;1,1;"..image.."]"
.."list[current_player;bag"..i.."contents;0,1;8,3;]"
end
end
end
-- register_on_player_receive_fields
minetest.register_on_player_receive_fields(function(player, formname, fields)
if fields.bags then
inventory_plus.set_inventory_formspec(player, get_formspec(player,"bags"))
return
end
for i=1,4 do
local page = "bag"..i
if fields[page] then
if player:get_inventory():get_stack(page, 1):get_definition().groups.bagslots==nil then
page = "bags"
end
inventory_plus.set_inventory_formspec(player, get_formspec(player,page))
return
end
end
end)
-- register_on_joinplayer
minetest.register_on_joinplayer(function(player)
inventory_plus.register_button(player,"bags","Bags")
local player_inv = player:get_inventory()
local bags_inv = minetest.create_detached_inventory(player:get_player_name().."_bags",{
on_put = function(inv, listname, index, stack, player)
player:get_inventory():set_stack(listname, index, stack)
player:get_inventory():set_size(listname.."contents", stack:get_definition().groups.bagslots)
end,
on_take = function(inv, listname, index, stack, player)
player:get_inventory():set_stack(listname, index, nil)
end,
allow_put = function(inv, listname, index, stack, player)
if stack:get_definition().groups.bagslots then
return 1
else
return 0
end
end,
allow_take = function(inv, listname, index, stack, player)
if player:get_inventory():is_empty(listname.."contents")==true then
return stack:get_count()
else
return 0
end
end,
allow_move = function(inv, from_list, from_index, to_list, to_index, count, player)
return 0
end,
})
for i=1,4 do
local bag = "bag"..i
player_inv:set_size(bag, 1)
bags_inv:set_size(bag, 1)
bags_inv:set_stack(bag,1,player_inv:get_stack(bag,1))
end
end)
-- register bag tools
minetest.register_tool("bags:small", {
description = "Small Bag",
inventory_image = "bags_small.png",
groups = {bagslots=8},
})
minetest.register_tool("bags:medium", {
description = "Medium Bag",
inventory_image = "bags_medium.png",
groups = {bagslots=16},
})
minetest.register_tool("bags:large", {
description = "Large Bag",
inventory_image = "bags_large.png",
groups = {bagslots=24},
})
-- register bag crafts
minetest.register_craft({
output = "bags:small",
recipe = {
{"", "default:stick", ""},
{"default:wood", "default:wood", "default:wood"},
{"default:wood", "default:wood", "default:wood"},
},
})
minetest.register_craft({
output = "bags:medium",
recipe = {
{"", "default:stick", ""},
{"bags:small", "bags:small", "bags:small"},
{"bags:small", "bags:small", "bags:small"},
},
})
minetest.register_craft({
output = "bags:large",
recipe = {
{"", "default:stick", ""},
{"bags:medium", "bags:medium", "bags:medium"},
{"bags:medium", "bags:medium", "bags:medium"},
},
})
-- log that we started
minetest.log("action", "[MOD]"..minetest.get_current_modname().." -- loaded from "..minetest.get_modpath(minetest.get_current_modname()))

Binary file not shown.

After

Width:  |  Height:  |  Size: 572 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 797 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 572 B

47
mods/beds/README.txt Normal file
View File

@ -0,0 +1,47 @@
===BEDS MOD for MINETEST-C55===
by PilzAdam
Introduction:
This mods brings beds to Minetest. You can use them to sleep at night
to prevent attacks by evil mobs.
How to install:
Unzip the archive an place it in minetest-base-directory/mods/minetest/
if you have a windows client or a linux run-in-place client. If you have
a linux system-wide instalation place it in ~/.minetest/mods/minetest/.
If you want to install this mod only in one world create the folder
worldmods/ in your worlddirectory.
For further information or help see:
http://wiki.minetest.com/wiki/Installing_Mods
How to use the mod:
Craft a bed like this:
white wool white wool white wool
stick stick
After placing it anywhere you can go to sleep with a leftklick with your
hand on the bed. If it is night a chatmessage wishs you "Good night" and
you sleep until the next morning. To go outside the bed it is recommended
to hit the bed again with a leftklick (it also works if you just go away
but its not so safe).
After dying the player will respawn at the last bed he has slept.
License:
Sourcecode: WTFPL (see below)
Graphics: WTFPL (see below)
See also:
http://minetest.net/
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.

2
mods/beds/depends.txt Normal file
View File

@ -0,0 +1,2 @@
default
wool

232
mods/beds/init.lua Normal file
View File

@ -0,0 +1,232 @@
local player_in_bed = 0
minetest.register_node("beds:bed_bottom", {
description = "Bed",
drawtype = "nodebox",
tiles = {"beds_bed_top_bottom.png", "default_wood.png", "beds_bed_side.png", "beds_bed_side.png", "beds_bed_side.png", "beds_bed_side.png"},
paramtype = "light",
paramtype2 = "facedir",
stack_max = 1,
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3},
sounds = default.node_sound_wood_defaults(),
node_box = {
type = "fixed",
fixed = {
-- bed
{-0.5, 0.0, -0.5, 0.5, 0.3, 0.5},
-- stützen
{-0.5, -0.5, -0.5, -0.4, 0.0, -0.4},
{0.4, 0.0, -0.4, 0.5, -0.5, -0.5},
}
},
selection_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, 0.3, 1.5},
}
},
on_construct = function(pos)
local node = minetest.env:get_node(pos)
local param2 = node.param2
if param2 == 0 then
node.name = "beds:bed_top"
pos.z = pos.z+1
minetest.env:set_node(pos, node)
elseif param2 == 1 then
node.name = "beds:bed_top"
pos.x = pos.x+1
minetest.env:set_node(pos, node)
elseif param2 == 2 then
node.name = "beds:bed_top"
pos.z = pos.z-1
minetest.env:set_node(pos, node)
elseif param2 == 3 then
node.name = "beds:bed_top"
pos.x = pos.x-1
minetest.env:set_node(pos, node)
end
end,
on_destruct = function(pos)
local node = minetest.env:get_node(pos)
local param2 = node.param2
if param2 == 0 then
pos.z = pos.z+1
minetest.env:remove_node(pos)
elseif param2 == 1 then
pos.x = pos.x+1
minetest.env:remove_node(pos)
elseif param2 == 2 then
pos.z = pos.z-1
minetest.env:remove_node(pos)
elseif param2 == 3 then
pos.x = pos.x-1
minetest.env:remove_node(pos)
end
end,
on_punch = function(pos, node, puncher)
if not puncher:is_player() then
return
end
if puncher:get_wielded_item():get_name() == "" then
local meta = minetest.env:get_meta(pos)
local param2 = node.param2
if param2 == 0 then
pos.z = pos.z+1
elseif param2 == 1 then
pos.x = pos.x+1
elseif param2 == 2 then
pos.z = pos.z-1
elseif param2 == 3 then
pos.x = pos.x-1
end
if puncher:get_player_name() == meta:get_string("player") then
if param2 == 0 then
pos.x = pos.x-1
elseif param2 == 1 then
pos.z = pos.z+1
elseif param2 == 2 then
pos.x = pos.x+1
elseif param2 == 3 then
pos.z = pos.z-1
end
pos.y = pos.y-0.5
puncher:setpos(pos)
meta:set_string("player", "")
player_in_bed = player_in_bed-1
elseif meta:get_string("player") == "" then
pos.y = pos.y-0.5
puncher:setpos(pos)
meta:set_string("player", puncher:get_player_name())
player_in_bed = player_in_bed+1
end
end
end
})
minetest.register_node("beds:bed_top", {
drawtype = "nodebox",
tiles = {"beds_bed_top_top.png", "default_wood.png", "beds_bed_side_top_r.png", "beds_bed_side_top_l.png", "default_wood.png", "beds_bed_side.png"},
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3},
sounds = default.node_sound_wood_defaults(),
node_box = {
type = "fixed",
fixed = {
-- bed
{-0.5, 0.0, -0.5, 0.5, 0.3, 0.5},
-- stützen
{-0.4, 0.0, 0.4, -0.5, -0.5, 0.5},
{0.5, -0.5, 0.5, 0.4, 0.0, 0.4},
}
},
selection_box = {
type = "fixed",
fixed = {
{0, 0, 0, 0, 0, 0},
}
},
})
minetest.register_alias("beds:bed", "beds:bed_bottom")
minetest.register_craft({
output = "beds:bed",
recipe = {
{"wool:white", "wool:white", "wool:white", },
{"default:stick", "", "default:stick", }
}
})
local player_spawns = {}
local file = io.open(minetest.get_worldpath().."/beds_player_spawns", "r")
if file then
player_spawns = minetest.deserialize(file:read("*all"))
file:close()
end
local timer = 0
local wait = false
minetest.register_globalstep(function(dtime)
if timer<2 then
timer = timer+dtime
return
end
timer = 0
local players = #minetest.get_connected_players()
if players == player_in_bed and players ~= 0 then
if minetest.env:get_timeofday() < 0.2 or minetest.env:get_timeofday() > 0.805 then
if not wait then
minetest.chat_send_all("Good night!!!")
minetest.after(2, function()
minetest.env:set_timeofday(0.23)
wait = false
end)
wait = true
for _,player in ipairs(minetest.get_connected_players()) do
player_spawns[player:get_player_name()] = player:getpos()
end
local file = io.open(minetest.get_worldpath().."/beds_player_spawns", "w")
if file then
file:write(minetest.serialize(player_spawns))
file:close()
end
end
end
end
end)
minetest.register_on_respawnplayer(function(player)
local name = player:get_player_name()
if player_spawns[name] then
player:setpos(player_spawns[name])
return true
end
end)
minetest.register_abm({
nodenames = {"beds:bed_bottom"},
interval = 1,
chance = 1,
action = function(pos, node)
local meta = minetest.env:get_meta(pos)
if meta:get_string("player") ~= "" then
local param2 = node.param2
if param2 == 0 then
pos.z = pos.z+1
elseif param2 == 1 then
pos.x = pos.x+1
elseif param2 == 2 then
pos.z = pos.z-1
elseif param2 == 3 then
pos.x = pos.x-1
end
local player = minetest.env:get_player_by_name(meta:get_string("player"))
if player == nil then
meta:set_string("player", "")
player_in_bed = player_in_bed-1
return
end
local player_pos = player:getpos()
player_pos.x = math.floor(0.5+player_pos.x)
player_pos.y = math.floor(0.5+player_pos.y)
player_pos.z = math.floor(0.5+player_pos.z)
if pos.x ~= player_pos.x or pos.y ~= player_pos.y or pos.z ~= player_pos.z then
meta:set_string("player", "")
player_in_bed = player_in_bed-1
return
end
end
end
})
if minetest.setting_get("log_mods") then
minetest.log("action", "beds loaded")
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 536 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 500 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 502 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 539 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 605 B

16
mods/boats/README.txt Normal file
View File

@ -0,0 +1,16 @@
Minetest 0.4 mod: boats
=======================
by PilzAdam
License of source code:
-----------------------
WTFPL
License of media (textures and sounds):
---------------------------------------
WTFPL
Authors of media files:
-----------------------
textures: Zeg9
model: thetoon and Zeg9

1
mods/boats/depends.txt Normal file
View File

@ -0,0 +1 @@
default

158
mods/boats/init.lua Normal file
View File

@ -0,0 +1,158 @@
--
-- Helper functions
--
local function is_water(pos)
local nn = minetest.env:get_node(pos).name
return minetest.get_item_group(nn, "water") ~= 0
end
local function get_sign(i)
if i == 0 then
return 0
else
return i/math.abs(i)
end
end
local function get_velocity(v, yaw, y)
local x = math.cos(yaw)*v
local z = math.sin(yaw)*v
return {x=x, y=y, z=z}
end
local function get_v(v)
return math.sqrt(v.x^2+v.z^2)
end
--
-- Cart entity
--
local boat = {
physical = true,
collisionbox = {-0.6,-0.4,-0.6, 0.6,0.3,0.6},
visual = "mesh",
mesh = "boat.x",
textures = {"default_wood.png"},
driver = nil,
v = 0,
}
function boat:on_rightclick(clicker)
if not clicker or not clicker:is_player() then
return
end
if self.driver and clicker == self.driver then
self.driver = nil
clicker:set_detach()
elseif not self.driver then
self.driver = clicker
clicker:set_attach(self.object, "", {x=0,y=5,z=0}, {x=0,y=0,z=0})
self.object:setyaw(clicker:get_look_yaw())
end
end
function boat:on_activate(staticdata, dtime_s)
self.object:set_armor_groups({immortal=1})
if staticdata then
self.v = tonumber(staticdata)
end
end
function boat:get_staticdata()
return tostring(v)
end
function boat:on_punch(puncher, time_from_last_punch, tool_capabilities, direction)
self.object:remove()
if puncher and puncher:is_player() then
puncher:get_inventory():add_item("main", "boats:boat")
end
end
function boat:on_step(dtime)
self.v = get_v(self.object:getvelocity())*get_sign(self.v)
if self.driver then
local ctrl = self.driver:get_player_control()
if ctrl.up then
self.v = self.v+0.1
end
if ctrl.down then
self.v = self.v-0.08
end
if ctrl.left then
self.object:setyaw(self.object:getyaw()+math.pi/120+dtime*math.pi/120)
end
if ctrl.right then
self.object:setyaw(self.object:getyaw()-math.pi/120-dtime*math.pi/120)
end
end
local s = get_sign(self.v)
self.v = self.v - 0.02*s
if s ~= get_sign(self.v) then
self.object:setvelocity({x=0, y=0, z=0})
self.v = 0
return
end
if math.abs(self.v) > 4.5 then
self.v = 4.5*get_sign(self.v)
end
local p = self.object:getpos()
p.y = p.y-0.5
if not is_water(p) then
if minetest.registered_nodes[minetest.env:get_node(p).name].walkable then
self.v = 0
end
self.object:setacceleration({x=0, y=-10, z=0})
self.object:setvelocity(get_velocity(self.v, self.object:getyaw(), self.object:getvelocity().y))
else
p.y = p.y+1
if is_water(p) then
self.object:setacceleration({x=0, y=10, z=0})
self.object:setvelocity(get_velocity(self.v, self.object:getyaw(), self.object:getvelocity().y))
else
self.object:setacceleration({x=0, y=0, z=0})
self.object:setvelocity(get_velocity(self.v, self.object:getyaw(), 0))
local pos = self.object:getpos()
pos.y = math.floor(pos.y)+0.5
self.object:setpos(pos)
end
end
end
minetest.register_entity("boats:boat", boat)
minetest.register_craftitem("boats:boat", {
description = "Boat",
inventory_image = "boat_inventory.png",
wield_image = "boat_wield.png",
wield_scale = {x=2, y=2, z=1},
liquids_pointable = true,
on_place = function(itemstack, placer, pointed_thing)
if pointed_thing.type ~= "node" then
return
end
if not is_water(pointed_thing.under) then
return
end
pointed_thing.under.y = pointed_thing.under.y+0.5
minetest.env:add_entity(pointed_thing.under, "boats:boat")
itemstack:take_item()
return itemstack
end,
})
minetest.register_craft({
output = "boats:boat",
recipe = {
{"", "", ""},
{"group:wood", "", "group:wood"},
{"group:wood", "group:wood", "group:wood"},
},
})

11110
mods/boats/models/boat.x Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 985 B

2
mods/bobtraps/depends.txt Executable file
View File

@ -0,0 +1,2 @@
default
mesecons

183
mods/bobtraps/init.lua Executable file
View File

@ -0,0 +1,183 @@
-- State Changes
local update_bobtrap = function (pos, node)
local nodename=""
local param2=""
--Switch Trap State
if
-- Swap Traps
node.name == 'bobtraps:trap_spike' then nodename = 'bobtraps:trap_spike_set'
elseif node.name == 'bobtraps:trap_spike_set' then nodename = 'bobtraps:trap_spike'
elseif node.name == 'bobtraps:trap_spike_major' then nodename = 'bobtraps:trap_spike_major_set'
elseif node.name == 'bobtraps:trap_spike_major_set' then nodename = 'bobtraps:trap_spike_major'
end
minetest.env:add_node(pos, {name = nodename})
end
-- Punch Traps
local on_bobtrap_punched = function (pos, node, puncher)
if
-- Start Traps
node.name == 'bobtraps:trap_spike' or node.name == 'bobtraps:trap_spike_set' or
node.name == 'bobtraps:trap_spike_major' or node.name == 'bobtraps:trap_spike_major_set'
then
update_bobtrap(pos, node)
end
end
minetest.register_on_punchnode(on_bobtrap_punched)
--ABM (Spring The Traps)
minetest.register_abm(
{nodenames = {"bobtraps:trap_spike_set"},
interval = 1.0,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
local objs = minetest.env:get_objects_inside_radius(pos, 1)
for k, obj in pairs(objs) do
update_bobtrap(pos, node)
end
end,
})
minetest.register_abm(
{nodenames = {"bobtraps:trap_spike_major_set"},
interval = 1.0,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
local objs = minetest.env:get_objects_inside_radius(pos, 1)
for k, obj in pairs(objs) do
update_bobtrap(pos, node)
end
end,
})
-- Nodes
minetest.register_node("bobtraps:trap_grass", {
description = "Trap Grass",
tile_images = {"default_grass.png"},
paramtype2 = "facedir",
legacy_facedir_simple = true,
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
is_ground_content = false,
walkable = false,
climbable = false,
})
minetest.register_node("bobtraps:trap_spike", {
description = "Trap Spike Minor",
drawtype = "plantlike",
visual_scale = 1,
tile_images = {"bobtraps_minorspike.png"},
inventory_image = ("bobtraps_minorspike.png"),
paramtype = "light",
walkable = false,
sunlight_propagates = true,
groups = {cracky=3,melty=3},
})
minetest.register_node("bobtraps:trap_spike_set", {
description = "Trap Spike Minor",
drawtype = "raillike",
visual_scale = 1,
tile_images = {"bobtraps_trap_set.png"},
paramtype = "light",
walkable = false,
sunlight_propagates = true,
groups = {cracky=3,melty=3},
drop = 'bobtraps:trap_spike',
})
minetest.register_node("bobtraps:trap_spike_major", {
description = "Trap Spike Minor",
drawtype = "plantlike",
visual_scale = 1,
tile_images = {"bobtraps_majorspike.png"},
inventory_image = ("bobtraps_majorspike.png"),
paramtype = "light",
walkable = false,
sunlight_propagates = true,
groups = {cracky=2,melty=2},
})
minetest.register_node("bobtraps:trap_spike_major_set", {
description = "Trap Spike Major",
drawtype = "raillike",
visual_scale = 1,
tile_images = {"bobtraps_trap_set.png"},
paramtype = "light",
walkable = false,
sunlight_propagates = true,
groups = {cracky=3,melty=3},
drop = 'bobtraps:trap_spike',
})
-- Crafting
minetest.register_craft({
output = 'bobtraps:trap_spike',
recipe = {
{'', '', ''},
{'', 'default:cobble', ''},
{'default:cobble', 'default:apple', 'default:cobble'},
}
})
minetest.register_craft({
output = 'bobtraps:trap_spike_major',
recipe = {
{'', 'default:cobble', ''},
{'', 'default:apple', ''},
{'default:cobble', 'default:apple', 'default:cobble'},
}
})
minetest.register_craft({
output = 'bobtraps:trap_grass',
recipe = {
{'', '', ''},
{'', 'default:dirt', ''},
{'', 'default:stick', ''},
}
})
-- ABM
minetest.register_abm(
{nodenames = {"bobtraps:trap_spike"},
interval = 1.0,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
local objs = minetest.env:get_objects_inside_radius(pos, 1)
for k, obj in pairs(objs) do
obj:set_hp(obj:get_hp()-1)
minetest.sound_play("bobtraps_trap_fall",
{pos = pos, gain = 1.0, max_hear_distance = 3,})
end
end,
})
minetest.register_abm(
{nodenames = {"bobtraps:trap_spike_major"},
interval = 1.0,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
local objs = minetest.env:get_objects_inside_radius(pos, 1)
for k, obj in pairs(objs) do
obj:set_hp(obj:get_hp()-100)
minetest.sound_play("bobtraps_trap_fall",
{pos = pos, gain = 1.0, max_hear_distance = 3,})
end
end,
})

51
mods/bobtraps/readme.txt Executable file
View File

@ -0,0 +1,51 @@
-- BobBlocks v0.0.6
-- (Minetest 0.4 mod Compatible 20120408)
-- http://c55.me/minetest/forum/viewtopic.php?id=1274
------------------------------------------------------------------
------------------------------------------------------------------
-- Requirements: Jeija or Mesecons --
-- c55.me/minetest/forum/viewtopic.php?id=628 --
-- You must edit depends.txt and add either jeija or --
-- mesecons depending on whether or not you're using --
-- jejia v.05 or mesecons pulled from GitHub --
------------------------------------------------------------------
------------------------------------------------------------------
-- Colored Lit Blocks
---- Default state = Solid lit block
---- Secondary state (punch) = transparent unlit block
---- Mesecons activation
-- Colored Lit Poles
---- Default state = Solid lit block
---- Secondary state (punch) = unlit block
---- Mesecons activation
-- Health Kit
---- Default state = health kit inactive
---- Secondary state (punch) = health kit active +10HP when walked through
-- Trap
---- Default Grass (walkable off)
---- Spike Minor (1HP per hit)
------ Spikes can be 'set' and activated when walked over
---- Spike Major (100HP per hit)
------ Spikes can be 'set' and activated when walked over
# Attribution
# Unless otherwise noted, all graphics & sounds
# created by Rabbi Bob
# Licensed under the GPLv2/later
# [GRAPHICS]
# minor & major spikes by Death Dealer
# License: WTFPL
# http://minetest.net/forum/viewtopic.php?id=1582
# [SOUNDS]
# bobblocks_glass
# Author: Ch0cchi
# http://www.freesound.org/people/Ch0cchi/sounds/15285/
# Edited by rabbibob
# bobblocks_trap_fall & bobblocks_trap_fall_major
# Author: Rock Savage
# http://www.freesound.org/people/Rock%20Savage/sounds/65924/#
# Edited by rabbibob
# bobblocks_health
# http://hamsterrepublic.com/ohrrpgce/Free_Sound_Effects.html

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

71
mods/bridges/README.md Normal file
View File

@ -0,0 +1,71 @@
Mod for Minetest that adds bridges (only one node wide!), slim handrails and a self-building-one-node-wide bridge.
Crafting recipes:
<br> S stands for stick
<br> W stands for wooden slab
<br> V stands for either vines or leaves (both can be used)
<br> G stands for groundplate of bridge
<br> H stands for handrail
<br> - stands for "leave empty"
Groundplate: yields 2 "G" parts which are the basis for further bridges:
<br> V V V
<br> V W V
<br> V V V
Handrail: yields 4 "H" parts which are needed in further receipes:
<br> - - -
<br> - G -
<br> - - -
small bridge:
<br> S - S
<br> H G H
<br> S - S
middle part (fits between small bridges):
<br> - - -
<br> H G H
<br> - - -
corner of a bridge:
<br> S H S
<br> - G H
<br> S - S
T junction of a bridge:
<br> S H S
<br> - G -
<br> S - S
end of a bridge.
<br> S H S
<br> H G H
<br> S - S
handrail, one side closed:
<br> - - -
<br> - - -
<br> S H S
handrail, two sides closed:
<br> S - -
<br> H - -
<br> S H S
handrail, three sides closed (if you want to walk around it):
<br> S H S
<br> H - -
<br> S H S
a large, 3 nodes long bridge:
<br> - small_bridge -
<br> - middle_part_of_bridge -
<br> - small_bridge -
the self-building automatic bridge:
<br> large_bridge large_bridge large_bridge
<br> large_bridge large_bridge large_bridge
<br> large_bridge large_bridge large_bridge

1
mods/bridges/depends.txt Normal file
View File

@ -0,0 +1 @@
default

355
mods/bridges/init.lua Normal file
View File

@ -0,0 +1,355 @@
-- to make life a bit easier
bild_pfad = "default_wood.png"; --"forniture_wood.png";
bild_pfad_s1 = "default_wood.png"; --"forniture_wood_s1.png";
bild_pfad_s2 = "default_wood.png"; --"forniture_wood_s2.png";
leg_front_left = {-0.5,-0.5,-0.5, -0.4,0.5,-0.4};
leg_front_right = { 0.4,-0.5,-0.5, 0.5,0.5,-0.4};
leg_back_left = {-0.5,-0.5, 0.4, -0.4,0.5, 0.5};
leg_back_right = { 0.4,-0.5, 0.4, 0.5,0.5, 0.5};
bar_left = {-0.5, 0.35,-0.4,-0.4, 0.4, 0.4};
bar_right = { 0.4, 0.35,-0.4, 0.5, 0.4, 0.4};
bar_back = { 0.4, 0.35, 0.4,-0.5, 0.4, 0.5};
bar_front = { 0.5, 0.35,-0.5,-0.5, 0.4,-0.4};
bar_left_long = {-0.4, 0.35,-0.5,-0.5, 0.4, 0.5};
bar_right_long = { 0.4, 0.35,-0.5, 0.5, 0.4, 0.5};
groundplate_small = {-0.4,-0.45,-0.5, 0.4,-0.4,0.5};
groundplate_corner = {-0.5,-0.45,-0.5, 0.5,-0.4,0.5}; -- slightly larger
local STICK = "default:stick";
local WOOD = "stairs:slab_wood";
local BASIS = "bridges:bridge_basis";
local RAIL = "bridges:handrail_middle";
-- people who do not have vines have to replace "vines:vines" with something they do have and which they think might fit
local VINES = "vines:vines"; -- useful for ropes
local ALT = "default:leaves"; -- alternative for vines
local MAX_BRIDGE_LENGTH = 27; -- this is how far the automatic bridge can extend
local BRIDGE_PARTS = {
-- name, description, node definition, crafting receipe, additional information for yield of receipe
-- the groundplate - essential for bridge building
{ "bridge_basis", "groundplate of a bridge", {
groundplate_small, },
{ { VINES, VINES, VINES },
{ VINES, WOOD, VINES },
{ VINES, VINES, VINES }
}, " 2"}, -- yields 2 groundplates
-- the handrail is a basic part out of which bridges and handrails for staircases can be constructed
{ "handrail_middle", "handrail for bridges and staircases", {
bar_front },
{ { "", "", "" },
{ "", BASIS, "" },
{ "", "", "" }
}, " 4"}, -- one groundplate yiels 4 handrails
-- bridges
{ "bridge_small", "small bridge", { -- TODO: slim legs?
leg_front_left,
leg_front_right,
leg_back_left,
leg_back_right,
bar_right,
bar_left,
groundplate_small, },
{ { STICK, "", STICK },
{ RAIL, BASIS, RAIL },
{ STICK, "", STICK }
}, "" },
{ "bridge_middle", "middle of a bridge", {
bar_right_long,
bar_left_long,
groundplate_small, },
{ { "", "", "" },
{ RAIL, BASIS, RAIL },
{ "", "", "" }
}, "" },
{ "bridge_corner", "corner of a bridge", {
leg_front_left,
leg_front_right,
leg_back_left,
leg_back_right,
bar_right,
bar_back,
groundplate_corner, },
{ { STICK, RAIL, STICK },
{ "", BASIS, RAIL },
{ STICK, "", STICK }
}, "" },
{ "bridge_t", "T junction of a bridge", {
leg_front_left,
leg_front_right,
leg_back_left,
leg_back_right,
bar_back,
groundplate_corner, },
{ { STICK, RAIL, STICK },
{ "", BASIS, "" },
{ STICK, "", STICK }
}, "" },
{ "bridge_end", "end of a bridge", {
leg_front_left,
leg_front_right,
leg_back_left,
leg_back_right,
bar_left,
bar_right,
bar_back,
groundplate_corner, },
{ { STICK, RAIL, STICK },
{ RAIL, BASIS, RAIL },
{ STICK, "", STICK }
}, "" },
-- handrails for the top of starcaises so that people won't fall down
{ "handrail_top", "handrail for staircases, one side closed", {
leg_front_left,
leg_front_right,
bar_front, },
{ { "", "", "" },
{ "", "", "" },
{ STICK, RAIL, STICK }
}, "" },
{ "handrail_corner", "handrail for staircases, two sides closed", {
leg_front_left,
leg_front_right,
bar_front,
bar_left },
{ { STICK, "", "" },
{ RAIL, "", "" },
{ STICK, RAIL, STICK }
}, "" },
{ "handrail_closed", "handrail for staircases, three sides closed", {
leg_front_left,
leg_front_right,
bar_front,
bar_right,
bar_left },
{ { STICK, RAIL, STICK },
{ RAIL, "", "" },
{ STICK, RAIL, STICK }
}, "" },
}
for i in ipairs( BRIDGE_PARTS ) do
minetest.register_node("bridges:"..BRIDGE_PARTS[i][1],
{
description = BRIDGE_PARTS[i][2],
tiles = {
bild_pfad,
bild_pfad,
bild_pfad_s1,
bild_pfad_s1,
bild_pfad_s2,
bild_pfad_s2,
},
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = 'light',
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = BRIDGE_PARTS[i][3],
},
selection_box = {
type = "fixed",
fixed = {-0.5,-0.5,-0.5, 0.5, 0.5, 0.5},
},
-- flammable so that it can be burned if no longer needed
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,flammable=3},
});
minetest.register_craft({
output = "bridges:"..BRIDGE_PARTS[i][1]..BRIDGE_PARTS[i][5],
recipe = BRIDGE_PARTS[i][4],
});
end
-- alternate receipe for the bridge basis
minetest.register_craft({
output = "bridges:bridge_basis 2",
recipe = { { ALT, ALT, ALT },
{ ALT, WOOD, ALT },
{ ALT, ALT, ALT },
},
});
-- a bridge with covers 3 nodes in size
minetest.register_node("bridges:bridge_large",
{ description = 'large bridge',
tiles = {
bild_pfad,
bild_pfad,
bild_pfad_s1,
bild_pfad_s1,
bild_pfad_s2,
bild_pfad_s2,
},
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = 'light',
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
-- the large bridge covers 3 nodes
{-0.5,-0.5,-0.7, -0.4,0.5,-0.6},
{ 0.4,-0.5,-0.7, 0.5,0.5,-0.6},
{-0.5, 0.35,-1.5, -0.4,0.4, 1.5},
{-0.5,-0.5, 0.6, -0.4,0.5, 0.7},
{ 0.4,-0.5, 0.6, 0.5,0.5, 0.7},
{ 0.4, 0.35,-1.5, 0.5,0.4, 1.5},
{-0.4,-0.45,-1.5, 0.4,-0.4,1.5},
}
},
selection_box = {
type = "fixed",
fixed = {-0.5,-0.5,-1.5, 0.5,0.5, 1.5},
},
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,flammable=2}
})
minetest.register_craft({
output = "bridges:bridge_large",
recipe = { { "", "bridges:bridge_middle", "" },
{ "", "bridges:bridge_small", "" },
{ "", "bridges:bridge_middle", "" },
} });
-- special: self-building automatic bridge
minetest.register_node("bridges:bridge_auto", {
description = "self building bruidge",
tiles = { "default_chest_top.png" }, -- looks from all sides like the top of a chest
drawtype = "cube",
is_ground_content = true,
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,flammable=3},
drop = "", -- all leftover parts are in the "chest"
on_construct = function(pos)
local meta = minetest.env:get_meta(pos);
meta:set_string("formspec",
"invsize[8,9;]"..
"list[current_name;main;0,0;8,4;]"..
"list[current_player;main;0,5;8,4;]")
meta:set_string("infotext", "Automatic bridge building set - leftover parts")
local inv = meta:get_inventory();
inv:set_size("main", 8*4);
end,
can_dig = function(pos,player)
local meta = minetest.env:get_meta(pos);
local inv = meta:get_inventory();
return inv:is_empty("main");
end,
after_place_node = function(pos, placer)
local n;
local x_dir;
local z_dir;
local p;
local n;
-- the bridge ought to unfold in the direction the player is looking
local dir = placer:get_look_dir();
local fdir = minetest.dir_to_facedir(dir);
-- the player is looking more in x- than in z-direction
if( math.abs( dir.x ) > math.abs( dir.z )) then
z_dir = 0;
if( dir.x > 0 ) then
x_dir = 1;
else
x_dir = -1;
end
else
x_dir = 0;
if( dir.z > 0 ) then
z_dir = 1;
else
z_dir = -1;
end
end
-- print ("x_dir: "..tostring( x_dir ).." z_dir: "..tostring( z_dir ));
-- we have determined the direction in which the bridge may extend - now lets look how far it can go
local i=1;
-- how many parts of the bridge remain?
local rem_small = math.floor(MAX_BRIDGE_LENGTH/3);
local rem_middle = MAX_BRIDGE_LENGTH-rem_small;
-- extend max. MAX_BRIDGE_LENGTH nodes wide and only if the node needs a bridge (i.e. consists of air)
while( i < MAX_BRIDGE_LENGTH ) do
-- is there space for a bridge?
p = {x=pos.x+(x_dir*i), y=pos.y, z=pos.z+(z_dir*i)};
n = minetest.env:get_node(p);
if( n == nil or n.name ~= "air" ) then
i = MAX_BRIDGE_LENGTH+1; -- end
-- print("At length "..tostring(i)..": node at target position not air; no place for bridge: "..tostring(n.name));
else
-- one small bridge is followed by two middle parts
if( i%3 == 1 ) then
minetest.env:add_node(p, {name="bridges:bridge_small", param1=0, param2=fdir});
rem_small = rem_small - 1; -- one small bridge used
-- print("Placing small bridge at dist "..tostring(i));
else
minetest.env:add_node(p, {name="bridges:bridge_middle", param1=0, param2=fdir});
rem_middle = rem_middle -1; -- one middle part used
-- print("Placing middle bridge at dist "..tostring(i));
end
i = i+1;
end
end
-- do we have to give any leftover parts back?
local meta = minetest.env:get_meta(pos);
local inv = meta:get_inventory();
if( rem_small > 0 ) then
inv:add_item( "main", "bridges:bridge_small "..tostring( rem_small ));
end
if( rem_middle > 0 ) then
inv:add_item( "main", "bridges:bridge_middle "..tostring( rem_middle ));
end
end,
})
minetest.register_craft({
output = "bridges:bridge_auto",
recipe = { { "bridges:bridge_large", "bridges:bridge_large", "bridges:bridge_large" },
{ "bridges:bridge_large", "bridges:bridge_large", "bridges:bridge_large" },
{ "bridges:bridge_large", "bridges:bridge_large", "bridges:bridge_large" },
} });

26
mods/bucket/README.txt Normal file
View File

@ -0,0 +1,26 @@
Minetest 0.4 mod: bucket
=========================
License of source code:
-----------------------
Copyright (C) 2011-2012 Kahrl <kahrl@gmx.net>
Copyright (C) 2011-2012 celeron55, Perttu Ahola <celeron55@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
http://www.gnu.org/licenses/lgpl-2.1.html
License of media (textures and sounds)
--------------------------------------
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
http://creativecommons.org/licenses/by-sa/3.0/
Authors of media files
-----------------------
Everything not listed in here:
Copyright (C) 2010-2012 celeron55, Perttu Ahola <celeron55@gmail.com>

2
mods/bucket/depends.txt Normal file
View File

@ -0,0 +1,2 @@
default

96
mods/bucket/init.lua Normal file
View File

@ -0,0 +1,96 @@
-- Minetest 0.4 mod: bucket
-- See README.txt for licensing and other information.
minetest.register_alias("bucket", "bucket:bucket_empty")
minetest.register_alias("bucket_water", "bucket:bucket_water")
minetest.register_alias("bucket_lava", "bucket:bucket_lava")
minetest.register_craft({
output = 'bucket:bucket_empty 1',
recipe = {
{'default:steel_ingot', '', 'default:steel_ingot'},
{'', 'default:steel_ingot', ''},
}
})
bucket = {}
bucket.liquids = {}
-- Register a new liquid
-- source = name of the source node
-- flowing = name of the flowing node
-- itemname = name of the new bucket item (or nil if liquid is not takeable)
-- inventory_image = texture of the new bucket item (ignored if itemname == nil)
-- This function can be called from any mod (that depends on bucket).
function bucket.register_liquid(source, flowing, itemname, inventory_image)
bucket.liquids[source] = {
source = source,
flowing = flowing,
itemname = itemname,
}
bucket.liquids[flowing] = bucket.liquids[source]
if itemname ~= nil then
minetest.register_craftitem(itemname, {
inventory_image = inventory_image,
stack_max = 1,
liquids_pointable = true,
on_use = function(itemstack, user, pointed_thing)
-- Must be pointing to node
if pointed_thing.type ~= "node" then
return
end
-- Check if pointing to a liquid
n = minetest.env:get_node(pointed_thing.under)
if bucket.liquids[n.name] == nil then
-- Not a liquid
minetest.env:add_node(pointed_thing.above, {name=source})
elseif n.name ~= source then
-- It's a liquid
minetest.env:add_node(pointed_thing.under, {name=source})
end
return {name="bucket:bucket_empty"}
end
})
end
end
minetest.register_craftitem("bucket:bucket_empty", {
description = "Emtpy bucket",
inventory_image = "bucket.png",
stack_max = 1,
liquids_pointable = true,
on_use = function(itemstack, user, pointed_thing)
-- Must be pointing to node
if pointed_thing.type ~= "node" then
return
end
-- Check if pointing to a liquid source
n = minetest.env:get_node(pointed_thing.under)
liquiddef = bucket.liquids[n.name]
if liquiddef ~= nil and liquiddef.source == n.name and liquiddef.itemname ~= nil then
minetest.env:add_node(pointed_thing.under, {name="air"})
return {name=liquiddef.itemname}
end
end,
})
bucket.register_liquid(
"default:water_source",
"default:water_flowing",
"bucket:bucket_water",
"bucket_water.png"
)
bucket.register_liquid(
"default:lava_source",
"default:lava_flowing",
"bucket:bucket_lava",
"bucket_lava.png"
)
minetest.register_craft({
type = "fuel",
recipe = "bucket:bucket_lava",
burntime = 60,
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 329 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 363 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 369 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 942 B

View File

@ -0,0 +1 @@
default

44
mods/camouflage/init.lua Normal file
View File

@ -0,0 +1,44 @@
minetest.register_craft({
output = "camouflage:camoblock",
recipe = {
{"default:leaves", "default:leaves"},
{"default:leaves", "default:leaves"},
}
})
minetest.register_craft({
output = "camouflage:camoladder 4",
recipe = {
{"default:ladder 4", "default:tree"}}
})
minetest.register_node("camouflage:camoblock", {
description = "Nonsolid Camoflage Block",
tiles = {"default_leaves.png"},
drawtype = "glasslike",
walkable = false,
climbable = true,
paramtype = "light",
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, flammable=2},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("camouflage:camoladder", {
description = "Camoflaged Ladder",
drawtype = "signlike",
tiles ={"camo_ladder.png"},
inventory_image = "camo_ladder.png",
wield_image = "camo_ladder.png",
paramtype = "light",
paramtype2 = "wallmounted",
is_ground_content = true,
walkable = false,
climbable = true,
selection_box = {
type = "wallmounted",
--wall_top = = <default>
--wall_bottom = = <default>
--wall_side = = <default>
},
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=3},
legacy_wallmounted = true,
sounds = default.node_sound_wood_defaults(),
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 528 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 905 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 874 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 878 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 679 B

22
mods/carts/README.txt Normal file
View File

@ -0,0 +1,22 @@
Minetest 0.4 mod: carts
=======================
by PilzAdam
License of source code:
-----------------------
WTFPL
License of media (textures, sounds and models):
-----------------------------------------------
CC-0
Authors of media files:
-----------------------
kddekadenz:
cart_bottom.png
cart_side.png
cart_top.png
Zeg9:
cart.x
cart.png

1
mods/carts/depends.txt Normal file
View File

@ -0,0 +1 @@
default

56
mods/carts/functions.lua Normal file
View File

@ -0,0 +1,56 @@
--
-- Helper functions
--
cart_func = {}
function cart_func:get_sign(z)
if z == 0 then
return 0
else
return z/math.abs(z)
end
end
-- Returns the velocity as a unit vector
-- The smaller part of the vector will be turned to 0
function cart_func:velocity_to_dir(v)
if math.abs(v.x) > math.abs(v.z) then
return {x=cart_func:get_sign(v.x), y=cart_func:get_sign(v.y), z=0}
else
return {x=0, y=cart_func:get_sign(v.y), z=cart_func:get_sign(v.z)}
end
end
function cart_func:is_rail(p)
local nn = minetest.env:get_node(p).name
return minetest.get_item_group(nn, "rail") ~= 0
end
function cart_func:is_int(z)
z = math.abs(z)
return math.abs(math.floor(z+0.5)-z) <= 0.1
end
cart_func.v3 = {}
function cart_func.v3:add(v1, v2)
return {x=v1.x+v2.x, y=v1.y+v2.y, z=v1.z+v2.z}
end
function cart_func.v3:copy(v)
return {x=v.x, y=v.y, z=v.z}
end
function cart_func.v3:round(v)
return {
x = math.floor(v.x+0.5),
y = math.floor(v.y+0.5),
z = math.floor(v.z+0.5),
}
end
function cart_func.v3:equal(v1, v2)
return v1.x == v2.x and v1.y == v2.y and v1.z == v2.z
end

475
mods/carts/init.lua Normal file
View File

@ -0,0 +1,475 @@
dofile(minetest.get_modpath("carts").."/functions.lua")
--
-- Cart entity
--
local cart = {
physical = false,
collisionbox = {-0.5,-0.5,-0.5, 0.5,0.5,0.5},
visual = "mesh",
mesh = "cart.x",
visual_size = {x=1, y=1},
textures = {"cart.png"},
driver = nil,
velocity = {x=0, y=0, z=0},
old_pos = nil,
old_velocity = nil,
MAX_V = 15, -- Limit of the velocity
}
function cart:on_rightclick(clicker)
if not clicker or not clicker:is_player() then
return
end
if self.driver and clicker == self.driver then
self.driver = nil
clicker:set_detach()
elseif not self.driver then
self.driver = clicker
clicker:set_attach(self.object, "", {x=0,y=5,z=0}, {x=0,y=0,z=0})
end
end
function cart:on_activate(staticdata, dtime_s)
self.object:set_armor_groups({immortal=1})
if staticdata then
local tmp = minetest.deserialize(staticdata)
if tmp then
self.velocity = tmp.velocity
end
end
self.old_pos = self.object:getpos()
self.old_velocity = self.velocity
end
function cart:get_staticdata()
return minetest.serialize({
velocity = self.velocity,
})
end
-- Remove the cart if holding a tool or accelerate it
function cart:on_punch(puncher, time_from_last_punch, tool_capabilities, direction)
if not puncher or not puncher:is_player() then
return
end
if puncher:get_player_control().sneak then
self.object:remove()
puncher:get_inventory():add_item("main", "carts:cart")
return
end
if puncher == self.driver then
return
end
local d = cart_func:velocity_to_dir(direction)
local s = self.velocity
if time_from_last_punch > tool_capabilities.full_punch_interval then
time_from_last_punch = tool_capabilities.full_punch_interval
end
local f = 4*(time_from_last_punch/tool_capabilities.full_punch_interval)
local v = {x=s.x+d.x*f, y=s.y, z=s.z+d.z*f}
if math.abs(v.x) < 6 and math.abs(v.z) < 6 then
self.velocity = v
else
if math.abs(self.velocity.x) < 6 and math.abs(v.x) >= 6 then
self.velocity.x = 6*cart_func:get_sign(self.velocity.x)
end
if math.abs(self.velocity.z) < 6 and math.abs(v.z) >= 6 then
self.velocity.z = 6*cart_func:get_sign(self.velocity.z)
end
end
end
-- Returns the direction as a unit vector
function cart:get_rail_direction(pos, dir)
local d = cart_func.v3:copy(dir)
-- Check front
d.y = 0
local p = cart_func.v3:add(cart_func.v3:copy(pos), d)
if cart_func:is_rail(p) then
return d
end
-- Check downhill
d.y = -1
p = cart_func.v3:add(cart_func.v3:copy(pos), d)
if cart_func:is_rail(p) then
return d
end
-- Check uphill
d.y = 1
p = cart_func.v3:add(cart_func.v3:copy(pos), d)
if cart_func:is_rail(p) then
return d
end
d.y = 0
-- Check left and right
local view_dir
local other_dir
local a
if d.x == 0 and d.z ~= 0 then
view_dir = "z"
other_dir = "x"
if d.z < 0 then
a = {1, -1}
else
a = {-1, 1}
end
elseif d.z == 0 and d.x ~= 0 then
view_dir = "x"
other_dir = "z"
if d.x > 0 then
a = {1, -1}
else
a = {-1, 1}
end
else
return {x=0, y=0, z=0}
end
d[view_dir] = 0
d[other_dir] = a[1]
p = cart_func.v3:add(cart_func.v3:copy(pos), d)
if cart_func:is_rail(p) then
return d
end
d.y = -1
p = cart_func.v3:add(cart_func.v3:copy(pos), d)
if cart_func:is_rail(p) then
return d
end
d.y = 0
d[other_dir] = a[2]
p = cart_func.v3:add(cart_func.v3:copy(pos), d)
if cart_func:is_rail(p) then
return d
end
d.y = -1
p = cart_func.v3:add(cart_func.v3:copy(pos), d)
if cart_func:is_rail(p) then
return d
end
d.y = 0
return {x=0, y=0, z=0}
end
function cart:calc_rail_direction(pos, vel)
local velocity = cart_func.v3:copy(vel)
local p = cart_func.v3:copy(pos)
if cart_func:is_int(p.x) and cart_func:is_int(p.z) then
local dir = cart_func:velocity_to_dir(velocity)
local dir_old = cart_func.v3:copy(dir)
dir = self:get_rail_direction(cart_func.v3:round(p), dir)
local v = math.max(math.abs(velocity.x), math.abs(velocity.z))
velocity = {
x = v * dir.x,
y = v * dir.y,
z = v * dir.z,
}
if cart_func.v3:equal(velocity, {x=0, y=0, z=0}) then
-- First try this HACK
-- Move the cart on the rail if above or under it
if cart_func:is_rail(cart_func.v3:add(p, {x=0, y=1, z=0})) and vel.y >= 0 then
p = cart_func.v3:add(p, {x=0, y=1, z=0})
return self:calc_rail_direction(p, vel)
end
if cart_func:is_rail(cart_func.v3:add(p, {x=0, y=-1, z=0})) and vel.y <= 0 then
p = cart_func.v3:add(p, {x=0, y=-1, z=0})
return self:calc_rail_direction(p, vel)
end
-- Now the HACK gets really dirty
if cart_func:is_rail(cart_func.v3:add(p, {x=0, y=2, z=0})) and vel.y >= 0 then
p = cart_func.v3:add(p, {x=0, y=1, z=0})
return self:calc_rail_direction(p, vel)
end
if cart_func:is_rail(cart_func.v3:add(p, {x=0, y=-2, z=0})) and vel.y <= 0 then
p = cart_func.v3:add(p, {x=0, y=-1, z=0})
return self:calc_rail_direction(p, vel)
end
return {x=0, y=0, z=0}, p
end
if not cart_func.v3:equal(dir, dir_old) then
return velocity, cart_func.v3:round(p)
end
end
return velocity, p
end
function cart:on_step(dtime)
local pos = self.object:getpos()
local dir = cart_func:velocity_to_dir(self.velocity)
-- Stop the cart if the velocity is nearly 0
-- Only if on a flat railway
if dir.y == 0 then
if math.abs(self.velocity.x) < 0.1 and math.abs(self.velocity.z) < 0.1 then
self.velocity = {x=0, y=0, z=0}
self.object:setvelocity(self.velocity)
self.old_velocity = self.velocity
self.old_pos = self.object:getpos()
return
end
end
--
-- Set the new moving direction
--
-- Recalcualte the rails that are passed since the last server step
local old_dir = cart_func:velocity_to_dir(self.old_velocity)
if old_dir.x ~= 0 then
local sign = cart_func:get_sign(pos.x-self.old_pos.x)
while true do
if sign ~= cart_func:get_sign(pos.x-self.old_pos.x) or pos.x == self.old_pos.x then
break
end
self.old_pos.x = self.old_pos.x + cart_func:get_sign(pos.x-self.old_pos.x)*0.1
self.old_pos.y = self.old_pos.y + cart_func:get_sign(pos.x-self.old_pos.x)*0.1*old_dir.y
self.old_velocity, self.old_pos = self:calc_rail_direction(self.old_pos, self.old_velocity)
old_dir = cart_func:velocity_to_dir(self.old_velocity)
if not cart_func.v3:equal(cart_func:velocity_to_dir(self.old_velocity), dir) then
self.velocity = self.old_velocity
pos = self.old_pos
self.object:setpos(self.old_pos)
break
end
end
elseif old_dir.z ~= 0 then
local sign = cart_func:get_sign(pos.z-self.old_pos.z)
while true do
if sign ~= cart_func:get_sign(pos.z-self.old_pos.z) or pos.z == self.old_pos.z then
break
end
self.old_pos.z = self.old_pos.z + cart_func:get_sign(pos.z-self.old_pos.z)*0.1
self.old_pos.y = self.old_pos.y + cart_func:get_sign(pos.z-self.old_pos.z)*0.1*old_dir.y
self.old_velocity, self.old_pos = self:calc_rail_direction(self.old_pos, self.old_velocity)
old_dir = cart_func:velocity_to_dir(self.old_velocity)
if not cart_func.v3:equal(cart_func:velocity_to_dir(self.old_velocity), dir) then
self.velocity = self.old_velocity
pos = self.old_pos
self.object:setpos(self.old_pos)
break
end
end
end
-- Calculate the new step
self.velocity, pos = self:calc_rail_direction(pos, self.velocity)
self.object:setpos(pos)
dir = cart_func:velocity_to_dir(self.velocity)
-- Accelerate or decelerate the cart according to the pitch and acceleration of the rail node
local a = tonumber(minetest.env:get_meta(pos):get_string("cart_acceleration"))
if not a then
a = 0
end
if self.velocity.y < 0 then
self.velocity = {
x = self.velocity.x + (a+0.13)*cart_func:get_sign(self.velocity.x),
y = self.velocity.y + (a+0.13)*cart_func:get_sign(self.velocity.y),
z = self.velocity.z + (a+0.13)*cart_func:get_sign(self.velocity.z),
}
elseif self.velocity.y > 0 then
self.velocity = {
x = self.velocity.x + (a-0.1)*cart_func:get_sign(self.velocity.x),
y = self.velocity.y + (a-0.1)*cart_func:get_sign(self.velocity.y),
z = self.velocity.z + (a-0.1)*cart_func:get_sign(self.velocity.z),
}
else
self.velocity = {
x = self.velocity.x + (a-0.03)*cart_func:get_sign(self.velocity.x),
y = self.velocity.y + (a-0.03)*cart_func:get_sign(self.velocity.y),
z = self.velocity.z + (a-0.03)*cart_func:get_sign(self.velocity.z),
}
-- Place the cart exactly on top of the rail
if cart_func:is_rail(cart_func.v3:round(pos)) then
self.object:setpos({x=pos.x, y=math.floor(pos.y+0.5), z=pos.z})
pos = self.object:getpos()
end
end
-- Dont switch moving direction
-- Only if on flat railway
if dir.y == 0 then
if cart_func:get_sign(dir.x) ~= cart_func:get_sign(self.velocity.x) then
self.velocity.x = 0
end
if cart_func:get_sign(dir.y) ~= cart_func:get_sign(self.velocity.y) then
self.velocity.y = 0
end
if cart_func:get_sign(dir.z) ~= cart_func:get_sign(self.velocity.z) then
self.velocity.z = 0
end
end
-- Allow only one moving direction (multiply the other one with 0)
dir = cart_func:velocity_to_dir(self.velocity)
self.velocity = {
x = math.abs(self.velocity.x) * dir.x,
y = self.velocity.y,
z = math.abs(self.velocity.z) * dir.z,
}
-- Move cart exactly on the rail
if dir.x ~= 0 and not cart_func:is_int(pos.z) then
pos.z = math.floor(0.5+pos.z)
self.object:setpos(pos)
elseif dir.z ~= 0 and not cart_func:is_int(pos.x) then
pos.x = math.floor(0.5+pos.x)
self.object:setpos(pos)
end
-- Limit the velocity
if math.abs(self.velocity.x) > self.MAX_V then
self.velocity.x = self.MAX_V*cart_func:get_sign(self.velocity.x)
end
if math.abs(self.velocity.y) > self.MAX_V then
self.velocity.y = self.MAX_V*cart_func:get_sign(self.velocity.y)
end
if math.abs(self.velocity.z) > self.MAX_V then
self.velocity.z = self.MAX_V*cart_func:get_sign(self.velocity.z)
end
self.object:setvelocity(self.velocity)
self.old_pos = self.object:getpos()
self.old_velocity = cart_func.v3:copy(self.velocity)
if dir.x < 0 then
self.object:setyaw(math.pi/2)
elseif dir.x > 0 then
self.object:setyaw(3*math.pi/2)
elseif dir.z < 0 then
self.object:setyaw(math.pi)
elseif dir.z > 0 then
self.object:setyaw(0)
end
if dir.y == -1 then
self.object:set_animation({x=1, y=1}, 1, 0)
elseif dir.y == 1 then
self.object:set_animation({x=2, y=2}, 1, 0)
else
self.object:set_animation({x=0, y=0}, 1, 0)
end
end
minetest.register_entity("carts:cart", cart)
minetest.register_craftitem("carts:cart", {
description = "Minecart",
inventory_image = minetest.inventorycube("cart_top.png", "cart_side.png", "cart_side.png"),
wield_image = "cart_side.png",
on_place = function(itemstack, placer, pointed_thing)
if not pointed_thing.type == "node" then
return
end
if cart_func:is_rail(pointed_thing.under) then
minetest.env:add_entity(pointed_thing.under, "carts:cart")
itemstack:take_item()
return itemstack
elseif cart_func:is_rail(pointed_thing.above) then
minetest.env:add_entity(pointed_thing.above, "carts:cart")
itemstack:take_item()
return itemstack
end
end,
})
minetest.register_craft({
output = "carts:cart",
recipe = {
{"", "", ""},
{"default:steel_ingot", "", "default:steel_ingot"},
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
},
})
--
-- Mesecon support
--
minetest.register_node(":default:rail", {
description = "Rail",
drawtype = "raillike",
tiles = {"default_rail.png", "default_rail_curved.png", "default_rail_t_junction.png", "default_rail_crossing.png"},
inventory_image = "default_rail.png",
wield_image = "default_rail.png",
paramtype = "light",
is_ground_content = true,
walkable = false,
selection_box = {
type = "fixed",
-- but how to specify the dimensions for curved and sideways rails?
fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
},
groups = {bendy=2,snappy=1,dig_immediate=2,attached_node=1,rail=1},
mesecons = {
effector = {
action_on = function(pos, node)
minetest.env:get_meta(pos):set_string("cart_acceleration", "0.5")
-- Start the cart
for _,obj in ipairs(minetest.env:get_objects_inside_radius(pos, 1)) do
if obj:get_luaentity() and obj:get_luaentity().name == "carts:cart" then
local self = obj:get_luaentity()
if cart_func.v3:equal(self.velocity, {x=0, y=0, z=0}) then
for _,y in ipairs({0,-1,1}) do
for _,z in ipairs({1,-1}) do
if cart_func.v3:equal(self:get_rail_direction(obj:getpos(), {x=0, y=y, z=z}), {x=0, y=y, z=z}) then
self.velocity = {
x = 0,
y = 0.2*y,
z = 0.2*z,
}
self.old_velocity = self.velocity
return
end
end
for _,x in ipairs({1,-1}) do
if cart_func.v3:equal(self:get_rail_direction(obj:getpos(), {x=x, y=y, z=0}), {x=x, y=y, z=0}) then
self.velocity = {
x = 0.2*x,
y = 0.2*y,
z = 0,
}
self.old_velocity = self.velocity
return
end
end
end
end
end
end
end,
action_off = function(pos, node)
minetest.env:get_meta(pos):set_string("cart_acceleration", "0")
end,
},
},
})

BIN
mods/carts/models/cart.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 422 B

339
mods/carts/models/cart.x Normal file
View File

@ -0,0 +1,339 @@
xof 0303txt 0032
Frame Root {
FrameTransformMatrix {
1.000000, 0.000000, 0.000000, 0.000000,
0.000000, 0.000000, 1.000000, 0.000000,
0.000000, 1.000000,-0.000000, 0.000000,
0.000000, 0.000000, 0.000000, 1.000000;;
}
Frame Cube {
FrameTransformMatrix {
5.000000, 0.000000,-0.000000, 0.000000,
-0.000000, 3.535534, 3.535534, 0.000000,
0.000000,-3.535534, 3.535534, 0.000000,
0.000000,-3.000000, 3.000000, 1.000000;;
}
Mesh { //Cube_001 Mesh
72;
-1.000000; 1.000000;-1.000000;,
-1.000000;-1.000000;-1.000000;,
1.000000;-1.000000;-1.000000;,
1.000000; 1.000000;-1.000000;,
-0.833334;-1.000000; 1.000000;,
-1.000000;-1.000000; 1.000000;,
-1.000000;-0.833333; 1.000000;,
-0.833334;-0.833333; 1.000000;,
-1.000000;-1.000000;-1.000000;,
-1.000000;-1.000000; 1.000000;,
0.999999;-1.000001; 1.000000;,
1.000000;-1.000000;-1.000000;,
0.999999;-1.000001; 1.000000;,
0.833332;-1.000000; 1.000000;,
0.833333;-0.833334; 1.000000;,
1.000000;-0.833334; 1.000000;,
0.833332;-1.000000; 1.000000;,
-0.833334;-1.000000; 1.000000;,
-0.833334;-0.833333; 1.000000;,
0.833333;-0.833334; 1.000000;,
1.000000; 0.833333; 1.000000;,
0.833334; 0.833333; 1.000000;,
0.833334; 1.000000; 1.000000;,
1.000000; 0.999999; 1.000000;,
1.000000;-0.833334; 1.000000;,
0.833333;-0.833334; 1.000000;,
0.833334; 0.833333; 1.000000;,
1.000000; 0.833333; 1.000000;,
0.833334; 0.833333; 1.000000;,
-0.833333; 0.833333; 1.000000;,
-0.833333; 1.000000; 1.000000;,
0.833334; 1.000000; 1.000000;,
0.833334; 0.833333;-0.800000;,
-0.833333; 0.833333;-0.800000;,
-0.833333; 0.833333; 1.000000;,
0.833334; 0.833333; 1.000000;,
-0.833333; 0.833333; 1.000000;,
-1.000000; 0.833333; 1.000000;,
-1.000000; 1.000000; 1.000000;,
-0.833333; 1.000000; 1.000000;,
-0.833334;-0.833333; 1.000000;,
-1.000000;-0.833333; 1.000000;,
-1.000000; 0.833333; 1.000000;,
-0.833333; 0.833333; 1.000000;,
0.833333;-0.833334;-0.800000;,
-0.833334;-0.833333;-0.800000;,
-0.833333; 0.833333;-0.800000;,
0.833334; 0.833333;-0.800000;,
-0.833333; 0.833333;-0.800000;,
-0.833334;-0.833333;-0.800000;,
-0.833334;-0.833333; 1.000000;,
-0.833333; 0.833333; 1.000000;,
-0.833334;-0.833333;-0.800000;,
0.833333;-0.833334;-0.800000;,
0.833333;-0.833334; 1.000000;,
-0.833334;-0.833333; 1.000000;,
0.833333;-0.833334;-0.800000;,
0.833334; 0.833333;-0.800000;,
0.833334; 0.833333; 1.000000;,
0.833333;-0.833334; 1.000000;,
-1.000000; 1.000000;-1.000000;,
-1.000000; 1.000000; 1.000000;,
-1.000000;-1.000000; 1.000000;,
-1.000000;-1.000000;-1.000000;,
-1.000000; 1.000000; 1.000000;,
-1.000000; 1.000000;-1.000000;,
1.000000; 1.000000;-1.000000;,
1.000000; 0.999999; 1.000000;,
1.000000;-1.000000;-1.000000;,
0.999999;-1.000001; 1.000000;,
1.000000; 0.999999; 1.000000;,
1.000000; 1.000000;-1.000000;;
18;
4;0;1;2;3;,
4;4;5;6;7;,
4;8;9;10;11;,
4;12;13;14;15;,
4;16;17;18;19;,
4;20;21;22;23;,
4;24;25;26;27;,
4;28;29;30;31;,
4;32;33;34;35;,
4;36;37;38;39;,
4;40;41;42;43;,
4;44;45;46;47;,
4;48;49;50;51;,
4;52;53;54;55;,
4;56;57;58;59;,
4;60;61;62;63;,
4;64;65;66;67;,
4;68;69;70;71;;
MeshNormals { //Cube_001 Normals
72;
0.000000; 0.000000;-1.000000;,
0.000000; 0.000000;-1.000000;,
0.000000; 0.000000;-1.000000;,
0.000000; 0.000000;-1.000000;,
0.000000;-0.000000; 1.000000;,
0.000000;-0.000000; 1.000000;,
0.000000;-0.000000; 1.000000;,
0.000000;-0.000000; 1.000000;,
-0.000000;-1.000000;-0.000000;,
-0.000000;-1.000000;-0.000000;,
-0.000000;-1.000000;-0.000000;,
-0.000000;-1.000000;-0.000000;,
0.000000;-0.000000; 1.000000;,
0.000000;-0.000000; 1.000000;,
0.000000;-0.000000; 1.000000;,
0.000000;-0.000000; 1.000000;,
0.000000;-0.000000; 1.000000;,
0.000000;-0.000000; 1.000000;,
0.000000;-0.000000; 1.000000;,
0.000000;-0.000000; 1.000000;,
0.000000;-0.000000; 1.000000;,
0.000000;-0.000000; 1.000000;,
0.000000;-0.000000; 1.000000;,
0.000000;-0.000000; 1.000000;,
0.000000;-0.000000; 1.000000;,
0.000000;-0.000000; 1.000000;,
0.000000;-0.000000; 1.000000;,
0.000000;-0.000000; 1.000000;,
0.000000;-0.000000; 1.000000;,
0.000000;-0.000000; 1.000000;,
0.000000;-0.000000; 1.000000;,
0.000000;-0.000000; 1.000000;,
-0.000000;-1.000000; 0.000000;,
-0.000000;-1.000000; 0.000000;,
-0.000000;-1.000000; 0.000000;,
-0.000000;-1.000000; 0.000000;,
0.000000;-0.000000; 1.000000;,
0.000000;-0.000000; 1.000000;,
0.000000;-0.000000; 1.000000;,
0.000000;-0.000000; 1.000000;,
0.000000;-0.000000; 1.000000;,
0.000000;-0.000000; 1.000000;,
0.000000;-0.000000; 1.000000;,
0.000000;-0.000000; 1.000000;,
0.000000;-0.000000; 1.000000;,
0.000000;-0.000000; 1.000000;,
0.000000;-0.000000; 1.000000;,
0.000000;-0.000000; 1.000000;,
1.000000;-0.000000; 0.000000;,
1.000000;-0.000000; 0.000000;,
1.000000;-0.000000; 0.000000;,
1.000000;-0.000000; 0.000000;,
0.000000; 1.000000; 0.000000;,
0.000000; 1.000000; 0.000000;,
0.000000; 1.000000; 0.000000;,
0.000000; 1.000000; 0.000000;,
-1.000000; 0.000000; 0.000000;,
-1.000000; 0.000000; 0.000000;,
-1.000000; 0.000000; 0.000000;,
-1.000000; 0.000000; 0.000000;,
-1.000000; 0.000000;-0.000000;,
-1.000000; 0.000000;-0.000000;,
-1.000000; 0.000000;-0.000000;,
-1.000000; 0.000000;-0.000000;,
0.000000; 1.000000; 0.000000;,
0.000000; 1.000000; 0.000000;,
0.000000; 1.000000; 0.000000;,
0.000000; 1.000000; 0.000000;,
1.000000;-0.000000; 0.000000;,
1.000000;-0.000000; 0.000000;,
1.000000;-0.000000; 0.000000;,
1.000000;-0.000000; 0.000000;;
18;
4;0;1;2;3;,
4;4;5;6;7;,
4;8;9;10;11;,
4;12;13;14;15;,
4;16;17;18;19;,
4;20;21;22;23;,
4;24;25;26;27;,
4;28;29;30;31;,
4;32;33;34;35;,
4;36;37;38;39;,
4;40;41;42;43;,
4;44;45;46;47;,
4;48;49;50;51;,
4;52;53;54;55;,
4;56;57;58;59;,
4;60;61;62;63;,
4;64;65;66;67;,
4;68;69;70;71;;
} //End of Cube_001 Normals
MeshMaterialList { //Cube_001 Material List
1;
18;
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0;;
Material Material {
0.640000; 0.640000; 0.640000; 1.000000;;
96.078431;
0.500000; 0.500000; 0.500000;;
0.000000; 0.000000; 0.000000;;
TextureFilename {"cart.png";}
}
} //End of Cube_001 Material List
MeshTextureCoords { //Cube_001 UV Coordinates
72;
0.000000; 0.500000;,
0.500000; 0.500000;,
0.500000; 1.000000;,
0.000000; 1.000000;,
0.031250; 0.500000;,
-0.000000; 0.500000;,
-0.000000; 0.468750;,
0.031250; 0.468750;,
0.500000; 0.500000;,
0.500000; 0.000000;,
1.000000; 0.000000;,
1.000000; 0.500000;,
0.468750; 0.468750;,
0.500000; 0.468750;,
0.500000; 0.500000;,
0.468750; 0.500000;,
0.031250; 0.468750;,
0.468750; 0.468750;,
0.468750; 0.500000;,
0.031250; 0.500000;,
0.468750; 0.000000;,
0.500000; 0.000000;,
0.500000; 0.031250;,
0.468750; 0.031250;,
0.468750; 0.031250;,
0.500000; 0.031250;,
0.500000; 0.468750;,
0.468750; 0.468750;,
0.468750; 0.031250;,
0.031250; 0.031250;,
0.031250; 0.000000;,
0.468750; 0.000000;,
1.000000; 0.500000;,
0.500000; 0.500000;,
0.500000; 0.000000;,
1.000000; 0.000000;,
0.031250; 0.031250;,
0.000000; 0.031250;,
0.000000; 0.000000;,
0.031250; 0.000000;,
0.031250; 0.468750;,
-0.000000; 0.468750;,
0.000000; 0.031250;,
0.031250; 0.031250;,
0.000000; 0.500000;,
0.500000; 0.500000;,
0.500000; 1.000000;,
0.000000; 1.000000;,
1.000000; 0.500000;,
0.500000; 0.500000;,
0.500000; 0.000000;,
1.000000; 0.000000;,
1.000000; 0.500000;,
0.500000; 0.500000;,
0.500000; 0.000000;,
1.000000; 0.000000;,
1.000000; 0.500000;,
0.500000; 0.500000;,
0.500000; 0.000000;,
1.000000; 0.000000;,
0.500000; 0.500000;,
0.500000; 0.000000;,
1.000000; 0.000000;,
1.000000; 0.500000;,
1.000000; 0.000000;,
1.000000; 0.500000;,
0.500000; 0.500000;,
0.500000; 0.000000;,
0.500000; 0.500000;,
0.500000; 0.000000;,
1.000000; 0.000000;,
1.000000; 0.500000;;
} //End of Cube_001 UV Coordinates
} //End of Cube_001 Mesh
} //End of Cube
} //End of Root Frame
AnimationSet {
Animation {
{Cube}
AnimationKey { //Position
2;
4;
0;3; 0.000000, 0.000000, 0.000000;;,
1;3; 0.000000, 3.000000, 3.000000;;,
2;3; 0.000000,-3.000000, 3.000000;;,
3;3; 0.000000,-3.000000, 3.000000;;;
}
AnimationKey { //Rotation
0;
4;
0;4; -1.000000, 0.000000, 0.000000, 0.000000;;,
1;4; -0.923880,-0.382683,-0.000000, 0.000000;;,
2;4; -0.923880, 0.382683, 0.000000, 0.000000;;,
3;4; -0.923880, 0.382683, 0.000000, 0.000000;;;
}
AnimationKey { //Scale
1;
4;
0;3; 5.000000, 5.000000, 5.000000;;,
1;3; 5.000000, 5.000000, 5.000000;;,
2;3; 5.000000, 5.000000, 5.000000;;,
3;3; 5.000000, 5.000000, 5.000000;;;
}
}
} //End of AnimationSet

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 B

BIN
mods/conifers/c1.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

BIN
mods/conifers/c2.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
mods/conifers/c3.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

View File

@ -0,0 +1 @@
default

524
mods/conifers/init.lua Normal file
View File

@ -0,0 +1,524 @@
--------------------------------------------------------------------------------
--
-- CONIFERS MOD 0.3
-- For Minetest-c55
-- Created by Cisoun (cysoun[at]gmail.com).
--
-- This mod adds some conifers randomly at a certain altitude.
-- There are two types of conifers: regular and narrow.
-- You can define the altitude at which they spawn and their structure and
-- choose if you want to keep normal trees above this altitude.
--
--------------------------------------------------------------------------------
-- Structure definitions.
local TRUNK_MINHEIGHT = 7
local TRUNK_MAXHEIGHT = 25
local LEAVES_MINHEIGHT = 2
local LEAVES_MAXHEIGHT = 6
local LEAVES_MAXRADIUS = 5
local LEAVES_NARROWRADIUS = 3 -- For narrow typed conifers.
local CONIFERS_DISTANCE = 4
local CONIFERS_ALTITUDE = 30
local REMOVE_TREES = false -- Remove trees above CONIFERS_ALTITUDE?
local SAPLING_CHANCE = 100 -- 1/x chances to grow a sapling.
local INTERVAL = 1800
-- End of structure definitions.
conifers = {}
--------------------------------------------------------------------------------
--
-- Definitions
--
--------------------------------------------------------------------------------
--
-- Node definitions
--
minetest.register_node("conifers:trunk", {
description = "Conifer trunk",
tile_images = {
"conifers_trunktop.png",
"conifers_trunktop.png",
"conifers_trunk.png",
"conifers_trunk.png",
"conifers_trunk.png",
"conifers_trunk.png"
},
--inventory_image = minetest.inventorycube(
--"conifers_trunktop.png",
--"conifers_trunk.png",
--"conifers_trunk.png"
--),
paramtype = "facedir_simple",
material = minetest.digprop_woodlike(1.0),
is_ground_content = true,
groups = {
tree = 1,
snappy = 2,
choppy = 2,
oddly_breakable_by_hand = 1,
flammable = 2
},
sounds = default.node_sound_wood_defaults()
})
minetest.register_node("conifers:trunk_reversed", {
description = "Conifer reversed trunk",
tile_images = {
"conifers_trunk_reversed.png",
"conifers_trunk_reversed.png",
"conifers_trunktop.png",
"conifers_trunktop.png",
"conifers_trunk_reversed.png",
"conifers_trunk_reversed.png"
},
--inventory_image = minetest.inventorycube(
--"conifers_trunk.png",
--"conifers_trunktop.png",
--"conifers_trunk.png"
--),
paramtype = "facedir_simple",
material = minetest.digprop_woodlike(1.0),
legacy_facedir_simple = true,
is_ground_content = true,
groups = {
tree = 1,
snappy = 2,
choppy = 2,
oddly_breakable_by_hand = 1,
flammable = 2
},
sounds = default.node_sound_wood_defaults()
})
minetest.register_node("conifers:leaves", {
description = "Conifer leaves",
drawtype = "allfaces_optional",
visual_scale = 1.3,
tile_images = { "conifers_leaves.png" },
--inventory_image = "conifers_leaves.png",
paramtype = "light",
groups = {
snappy = 3,
leafdecay = 3,
flammable = 2
},
drop = {
max_items = 1,
items = {
{
-- player will get sapling with 1/20 chance
items = {'conifers:sapling'},
rarity = 20,
},
{
-- player will get leaves only if he get no saplings,
-- this is because max_items is 1
items = {'conifers:leaves'},
}
}
},
sounds = default.node_sound_leaves_defaults()
})
minetest.register_node("conifers:leaves_special", {
description = "Bright conifer leaves",
drawtype = "allfaces_optional",
visual_scale = 1.3,
tile_images = { "conifers_leaves_special.png" },
--inventory_image = "conifers_leaves_special.png",
paramtype = "light",
groups = {
snappy = 3,
leafdecay = 3,
flammable = 2
},
drop = {
max_items = 1,
items = {
{
-- player will get sapling with 1/20 chance
items = {'conifers:sapling'},
rarity = 20,
},
{
-- player will get leaves only if he get no saplings,
-- this is because max_items is 1
items = {'conifers:leaves'},
}
}
},
sounds = default.node_sound_leaves_defaults()
})
minetest.register_node("conifers:sapling", {
description = "Conifer sapling",
drawtype = "plantlike",
visual_scale = 1.0,
tile_images = {"conifers_sapling.png"},
inventory_image = "conifers_sapling.png",
wield_image = "conifers_sapling.png",
paramtype = "light",
walkable = false,
groups = {
snappy = 2,
dig_immediate = 3,
flammable = 2
},
sounds = default.node_sound_defaults(),
})
--
-- Craft definitions
--
minetest.register_craft({
output = 'node "conifers:trunk_reversed" 2',
recipe = {
{'node "conifers:trunk"', 'node "conifers:trunk"'},
}
})
minetest.register_craft({
output = 'node "conifers:trunk" 2',
recipe = {
{'node "conifers:trunk_reversed"'},
{'node "conifers:trunk_reversed"'}
}
})
minetest.register_craft({
output = 'default:wood 4',
recipe = {
{'conifers:trunk'}
}
})
minetest.register_craft({
output = 'default:wood 4',
recipe = {
{'conifers:trunk_reversed'}
}
})
--
-- ABM definitions
--
-- Spawn random conifers.
minetest.register_abm({
nodenames = "default:dirt_with_grass",
interval = INTERVAL,
chance = 1,
action = function(pos, node, _, _)
if minetest.env:get_node({x = pos.x, y = pos.y + 1, z = pos.z}).name == "air"
and pos.y >= CONIFERS_ALTITUDE
and conifers:is_node_in_cube({"conifers:trunk"}, pos, CONIFERS_DISTANCE) == false
then
if math.random(0,1000) == 5 then
conifers:make_conifer({x = pos.x, y = pos.y + 1, z = pos.z}, math.random(0, 1))
end
end
end
})
-- Saplings.
minetest.register_abm({
nodenames = "conifers:sapling",
interval = INTERVAL,
chance = SAPLING_CHANCE,
action = function(pos, node, _, _)
if minetest.env:get_node({x = pos.x, y = pos.y + 1, z = pos.z}).name == "air" then
conifers:make_conifer({x = pos.x, y = pos.y, z = pos.z}, math.random(0, 1))
end
end
})
-- Should we remove all the trees above the conifers altitude?
if REMOVE_TREES == true then
minetest.register_abm({
nodenames = {
"default:tree",
"default:leaves"
},
interval = INTERVAL/100,
chance = 1,
action = function(pos, node, _, _)
if minetest.env:get_node({x = pos.x, y = pos.y + 1, z = pos.z}).name == "air"
and pos.y >= CONIFERS_ALTITUDE
then
minetest.env:add_node(pos , {name = "air"})
end
end
})
end
--------------------------------------------------------------------------------
--
-- Functions
--
--------------------------------------------------------------------------------
--
-- table_contains(t, v)
--
-- Taken from the Flowers mod by erlehmann.
--
function conifers:table_contains(t, v)
for _, i in ipairs(t) do
if (i == v) then
return true
end
end
return false
end
--
-- is_node_in_cube(nodenames, node_pos, radius)
--
-- Taken from the Flowers mod by erlehmann.
--
function conifers:is_node_in_cube(nodenames, node_pos, radius)
for x = node_pos.x - radius, node_pos.x + radius do
for y = node_pos.y - math.floor(radius / 2), node_pos.y + math.floor(radius / 2) do
for z = node_pos.z - radius, node_pos.z + radius do
n = minetest.env:get_node_or_nil({x = x, y = y, z = z})
if (n == nil)
or (n.name == 'ignore')
or (conifers:table_contains(nodenames, n.name) == true) then
return true
end
end
end
end
return false
end
--
-- are_leaves_surrounded(position)
--
-- Return a boolean value set to 'true' if a leaves block is surrounded
-- by something else than
-- - air
-- - leaves
-- - special leaves
--
-- If a leaves block is surrounded by the blocks above,
-- it can be placed.
-- Otherwise, it will replace blocks we want to keep.
--
function conifers:are_leaves_surrounded(pos)
--
-- Check if a leaves block does not interfer with something else than the air or another leaves block.
--
local node1 = minetest.env:get_node({x = pos.x + 1, y = pos.y, z = pos.z}).name
local node2 = minetest.env:get_node({x = pos.x - 1, y = pos.y, z = pos.z}).name
local node3 = minetest.env:get_node({x = pos.x, y = pos.y, z = pos.z + 1}).name
local node4 = minetest.env:get_node({x = pos.x, y = pos.y, z = pos.z - 1}).name
local replacable_nodes = {
"air",
"conifers:leaves",
"conifers:leaves_special"
}
-- Let's check if the neighboring node is a replacable node.
if (conifers:table_contains(replacable_nodes, node1) == true)
and (conifers:table_contains(replacable_nodes, node2) == true)
and (conifers:table_contains(replacable_nodes, node3) == true)
and (conifers:table_contains(replacable_nodes, node4) == true)
then
return false
else
return true
end
end
--
-- add_leaves_block(position, type of leaves, near trunk?)
--
-- Put a simple leaves block.
-- Leaves must be positioned near a trunk or surrounded by air.
-- Types of leaves are:
-- 0: dark leaves
-- 1: bright leaves (special)
--
function conifers:add_leaves_block(pos, special, near_trunk)
if conifers:are_leaves_surrounded(pos) == false or near_trunk == true then
if special == 0 then
minetest.env:add_node(pos , { name = "conifers:leaves" })
else
minetest.env:add_node(pos , { name = "conifers:leaves_special" })
end
end
end
--
-- make_leaves(middle point, min radius, max radius, type of leaves)
--
-- Make a circle of leaves with a center given by 'middle point'.
-- Types of leaves are:
-- 0: dark leaves
-- 1: bright leaves (special)
--
function conifers:make_leaves(c, radius_min, radius_max, special)
--
-- Using the midpoint circle algorithm from Bresenham we can trace a circle of leaves.
--
for r = radius_min, radius_max do
local m_x = 0
local m_z = r
local m_m = 5 - 4 * r
while m_x <= m_z do
if radius_max > 1 then
if r == 1 then
-- Add a square of leaves (fixing holes near the trunk).
-- [ ] [ ]
-- [#]
-- [ ] [ ]
conifers:add_leaves_block({x = -1 + c.x, y = c.y, z = 1 + c.z}, special)
conifers:add_leaves_block({x = 1 + c.x, y = c.y, z = 1 + c.z}, special)
conifers:add_leaves_block({x = -1 + c.x, y = c.y, z = -1 + c.z}, special)
conifers:add_leaves_block({x = 1 + c.x, y = c.y, z = -1 + c.z}, special)
-- [ ]
-- [ ][#][ ]
-- [ ]
conifers:add_leaves_block({x = c.x, y = c.y, z = -1 + c.z}, special, true)
conifers:add_leaves_block({x = c.x, y = c.y, z = 1 + c.z}, special, true)
conifers:add_leaves_block({x = -1 + c.x, y = c.y, z = c.z}, special, true)
conifers:add_leaves_block({x = 1 + c.x, y = c.y, z = c.z}, special, true)
else
conifers:add_leaves_block({x = m_x + c.x, y = c.y, z = m_z + c.z}, special)
conifers:add_leaves_block({x = m_z + c.x, y = c.y, z = m_x + c.z}, special)
conifers:add_leaves_block({x = -m_x + c.x, y = c.y, z = m_z + c.z}, special)
conifers:add_leaves_block({x = -m_z + c.x, y = c.y, z = m_x + c.z}, special)
conifers:add_leaves_block({x = m_x + c.x, y = c.y, z = -m_z + c.z}, special)
conifers:add_leaves_block({x = m_z + c.x, y = c.y, z = -m_x + c.z}, special)
conifers:add_leaves_block({x = -m_x + c.x, y = c.y, z = -m_z + c.z}, special)
conifers:add_leaves_block({x = -m_z + c.x, y = c.y, z = -m_x + c.z}, special)
end
else
-- Put a small circle of leaves around the trunk.
-- [ ]
-- [ ][#][ ]
-- [ ]
conifers:add_leaves_block({x = c.x, y = c.y, z = -1 + c.z}, special, true)
conifers:add_leaves_block({x = c.x, y = c.y, z = 1 + c.z}, special, true)
conifers:add_leaves_block({x = -1 + c.x, y = c.y, z = c.z}, special, true)
conifers:add_leaves_block({x = 1 + c.x, y = c.y, z = c.z}, special, true)
end
-- Stuff...
if m_m > 0 then
m_z = m_z - 1
m_m = m_m - 8 * m_z
end
m_x = m_x + 1
m_m = m_m + 8 * m_x + 4
end
end
end
--
-- make_conifer(position, type)
--
-- Make a conifer at a given position.
-- Types are:
-- 0: regular pine
-- 1: narrow pine
--
function conifers:make_conifer(pos, conifer_type)
-- Check if we can gros a conifer at this place.
if minetest.env:get_node({x = pos.x, y = pos.y - 1, z = pos.z}).name ~= "default:dirt_with_grass"
and (minetest.env:get_node({x = pos.x, y = pos.y, z = pos.z}).name ~= "air"
or minetest.env:get_node({x = pos.x, y = pos.y, z = pos.z}).name ~= "conifers:sapling"
)
then
return false
--else
--if minetest.env:get_node({x = pos.x, y = pos.y, z = pos.z}).name == "conifers:sapling" then
--minetest.env:add_node(pos , {name = "air"})
--end
end
local height = math.random(TRUNK_MINHEIGHT, TRUNK_MAXHEIGHT) -- Random height of the conifer.
local leaves_height = math.random(LEAVES_MINHEIGHT, LEAVES_MAXHEIGHT) -- Level from where the leaves grow.
local current_block = {} -- Duh...
local leaves_radius = 1
local leaves_max_radius = 2
local special = math.random(0, 1)
-- Let's check if we can grow a tree here.
-- That means, we must have a column of 'height' high which contains
-- only air.
for j = 1, height - 1 do -- Start from 1 so we can grow a sapling.
if minetest.env:get_node({x = pos.x, y = pos.y + j, z = pos.z}).name ~= "air" then
-- Abort
return false
end
end
-- Create the trunk and add the leaves.
for i = 0, height - 1 do
current_block = {
x = pos.x,
y = pos.y + i,
z = pos.z
}
-- Put a trunk block.
minetest.env:add_node(current_block , {name = "conifers:trunk"})
-- Put some leaves.
if i >= leaves_height then
-- Put some leaves.
conifers:make_leaves({x = pos.x, y = pos.y + leaves_height + (height - 1) - i, z = pos.z}, 1, leaves_radius, special)
--
-- TYPE OF CONIFER
--
if conifer_type == 1 then -- Regular type
-- Prepare the next circle of leaves.
leaves_radius = leaves_radius + 1
-- Check if the current radius is the maximum radius at this level.
if leaves_radius > leaves_max_radius then
leaves_radius = 1
leaves_max_radius = leaves_max_radius + 1
-- Does it exceeds the maximum radius?
if leaves_max_radius > LEAVES_MAXRADIUS then
leaves_max_radius = LEAVES_MAXRADIUS
end
end
else -- Narrow type
if i % 2 == 0 then
leaves_radius = LEAVES_NARROWRADIUS - math.random(0, 1)
else
leaves_radius = math.floor(LEAVES_NARROWRADIUS / 2)
end
end
end
end
-- Put a top leaves block.
current_block.y = current_block.y + 1
conifers:add_leaves_block(current_block, special)
-- Blahblahblah
print ('[conifers] A conifer has grown at (' .. pos.x .. ',' .. pos.y .. ',' .. pos.z .. ') with a height of ' .. (height))
return true
end

Some files were not shown because too many files have changed in this diff Show More