Compare commits

...

2 Commits
main ... dev

24 changed files with 2427 additions and 2505 deletions

View File

@ -1,19 +1,18 @@
local Ombrellone_n_list = { local Ombrellone_n_list = {
{ "Red Ombrellone_n", "red"}, { "Red Ombrellone_n", "red" },
{ "Orange Ombrellone_n", "orange"}, { "Orange Ombrellone_n", "orange" },
{ "Black Ombrellone_n", "black"}, { "Black Ombrellone_n", "black" },
{ "Yellow Ombrellone_n", "yellow"}, { "Yellow Ombrellone_n", "yellow" },
{ "Green Ombrellone_n", "green"}, { "Green Ombrellone_n", "green" },
{ "Blue Ombrellone_n", "blue"}, { "Blue Ombrellone_n", "blue" },
{ "Violet Ombrellone_n", "violet"}, { "Violet Ombrellone_n", "violet" },
{ "White Ombrellone_n", "white"}, { "White Ombrellone_n", "white" },
} }
for i in ipairs(Ombrellone_n_list) do for i in ipairs(Ombrellone_n_list) do
local Ombrellone_ndesc = Ombrellone_n_list[i][1] local Ombrellone_ndesc = Ombrellone_n_list[i][1]
local colour = Ombrellone_n_list[i][2] local colour = Ombrellone_n_list[i][2]
minetest.register_alias_force("summer:Ombrellone_n_"..colour.."", "summer:ombrellone_n_"..colour.."") minetest.register_alias_force("summer:Ombrellone_n_" .. colour .. "", "summer:ombrellone_n_" .. colour .. "")
minetest.register_alias_force("summer:Ombrellone_n_"..colour.."_ch", "summer:ombrellone_n_"..colour.."_ch") minetest.register_alias_force("summer:Ombrellone_n_" .. colour .. "_ch", "summer:ombrellone_n_" .. colour .. "_ch")
end end

View File

@ -1,214 +1,199 @@
local Asciugamano_list = {
{ "Red Asciugamano", "red" },
{ "Orange Asciugamano", "orange" },
local Asciugamano_list = { { "Black Asciugamano", "black" },
{ "Red Asciugamano", "red"}, { "Yellow Asciugamano", "yellow" },
{ "Orange Asciugamano", "orange"}, { "Green Asciugamano", "green" },
{ "Black Asciugamano", "black"}, { "Blue Asciugamano", "blue" },
{ "Yellow Asciugamano", "yellow"}, { "Violet Asciugamano", "violet" },
{ "Green Asciugamano", "green"},
{ "Blue Asciugamano", "blue"},
{ "Violet Asciugamano", "violet"},
} }
for i in ipairs(Asciugamano_list) do for i in ipairs(Asciugamano_list) do
local asciugamanodesc = Asciugamano_list[i][1] local asciugamanodesc = Asciugamano_list[i][1]
local colour = Asciugamano_list[i][2] local colour = Asciugamano_list[i][2]
minetest.register_node("summer:asciugamano_" .. colour .. "", {
description = asciugamanodesc .. "",
drawtype = "mesh",
mesh = "asciugamano.obj",
tiles = { "asciugsmano_" .. colour .. ".png",
},
inventory_image = "asciugsmano_a_" .. colour .. ".png",
wield_image = "asciugsmano_a_" .. colour .. ".png",
minetest.register_node("summer:asciugamano_"..colour.."", { paramtype = "light",
description = asciugamanodesc.."", paramtype2 = "facedir",
drawtype = "mesh", sunlight_propagates = true,
mesh = "asciugamano.obj", walkable = false,
tiles = {"asciugsmano_"..colour..".png", selection_box = {
}, type = "fixed",
inventory_image = "asciugsmano_a_"..colour..".png", fixed = { -1.0, -0.5, -0.5, 1.0, -0.49, 0.5 },
},
wield_image = "asciugsmano_a_"..colour..".png", groups = { snappy = 2, cracky = 3, oddly_breakable_by_hand = 3, not_in_creative_inventory = 0 },
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
walkable = false,
selection_box = {
type = "fixed",
fixed = { -1.0, -0.5,-0.5, 1.0,-0.49, 0.5 },
},
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=0},
--sounds = default.node_sound_wood_defaults(), --sounds = default.node_sound_wood_defaults(),
drop = "summer:asciugamano_"..colour.."", drop = "summer:asciugamano_" .. colour .. "",
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
return minetest.sleep_in_asciugamano( pos, node, clicker, itemstack, pointed_thing ); return minetest.sleep_in_asciugamano(pos, node, clicker, itemstack, pointed_thing);
end end
})
})
minetest.allow_sit = function( player ) minetest.allow_sit = function(player)
-- no check possible -- no check possible
if( not( player.get_player_velocity )) then if (not (player.get_player_velocity)) then
return true; return true;
end end
local velo = player:get_player_velocity(); local velo = player:get_player_velocity();
if( not( velo )) then if (not (velo)) then
return false;
end
local max_velo = 0.0010;
if (math.abs(velo.x) < max_velo
and math.abs(velo.y) < max_velo
and math.abs(velo.z) < max_velo) then
return true;
end
return false; return false;
end end
local max_velo = 0.0010;
if( math.abs(velo.x) < max_velo
and math.abs(velo.y) < max_velo
and math.abs(velo.z) < max_velo ) then
return true;
end
return false;
end
minetest.sleep_in_asciugamano = function(pos, node, clicker, itemstack, pointed_thing)
if (not (clicker) or not (node) or not (node.name) or not (pos) or not (minetest.allow_sit(clicker))) then
minetest.sleep_in_asciugamano = function( pos, node, clicker, itemstack, pointed_thing ) return;
if( not( clicker ) or not( node ) or not( node.name ) or not( pos ) or not( minetest.allow_sit( clicker))) then
return;
end
local animation = default.player_get_animation( clicker );
local pname = clicker:get_player_name();
local place_name = 'place';
-- if only one node is present, the player can only sit;
-- sleeping requires a asciugamano head+foot or two sleeping mats
local allow_sleep = false;
local new_animation = 'lay';
-- let players get back up
if( animation and animation.animation=="lay" ) then
default.player_attached[pname] = false
clicker:setpos({x=pos.x,y=pos.y-0.5,z=pos.z})
clicker:set_eye_offset({x=0,y=0,z=0}, {x=0,y=0,z=0})
clicker:set_physics_override({1, 1, 1})
default.player_set_animation(clicker, "stand", 30)
minetest.chat_send_player( pname, 'That was enough sleep for now. You stand up again.');
return;
end
local second_node_pos = {x=pos.x, y=pos.y, z=pos.z};
-- the node that will contain the head of the player
local p = {x=pos.x, y=pos.y, z=pos.z};
-- the player's head is pointing in this direction
local dir = node.param2;
-- it would be odd to sleep in half a asciugamano
if( node.name=="summer:asciugamano_"..colour.."" ) then
if( node.param2==0 ) then
second_node_pos.z = pos.z-1;
elseif( node.param2==1) then
second_node_pos.x = pos.x-1;
elseif( node.param2==2) then
second_node_pos.z = pos.z+1;
elseif( node.param2==3) then
second_node_pos.x = pos.x+1;
end end
local node2 = minetest.get_node( second_node_pos );
if( not( node2 ) or not( node2.param2 ) or not( node.param2 )
or node2.name ~= "summer:asciugamano_"..colour..""
or node2.param2 ~= node.param2 ) then
allow_sleep = false;
else
allow_sleep = true;
end
place_name = "asciugamano_"..colour.."";
-- if the player clicked on the foot of the asciugamano, locate the head local animation = default.player_get_animation(clicker);
elseif( node.name=='summer:asciugamano' ) then local pname = clicker:get_player_name();
if( node.param2==2 ) then
second_node_pos.z = pos.z-1;
elseif( node.param2==3) then
second_node_pos.x = pos.x-1;
elseif( node.param2==0) then
second_node_pos.z = pos.z+1;
elseif( node.param2==1) then
second_node_pos.x = pos.x+1;
end
local node2 = minetest.get_node( second_node_pos );
if( not( node2 ) or not( node2.param2 ) or not( node.param2 )
or node2.name ~= 'summer:asciugamano'
or node2.param2 ~= node.param2 ) then
allow_sleep = false;
else
allow_sleep = true;
end
if( allow_sleep==true ) then
p = {x=second_node_pos.x, y=second_node_pos.y, z=second_node_pos.z};
end
place_name = 'asciugamano';
elseif( node.name=='summer:sleeping_mat' or node.name=='summer:straw_mat') then local place_name = 'place';
place_name = 'mat'; -- if only one node is present, the player can only sit;
dir = node.param2; -- sleeping requires a asciugamano head+foot or two sleeping mats
allow_sleep = false; local allow_sleep = false;
-- search for a second mat right next to this one local new_animation = 'lay';
local offset = {{x=0,z=-1}, {x=-1,z=0}, {x=0,z=1}, {x=1,z=0}};
for i,off in ipairs( offset ) do -- let players get back up
node2 = minetest.get_node( {x=pos.x+off.x, y=pos.y, z=pos.z+off.z} ); if (animation and animation.animation == "lay") then
if( node2.name == 'summer:sleeping_mat' or node2.name=='summer:straw_mat' ) then default.player_attached[pname] = false
-- if a second mat is found, sleeping is possible clicker:setpos({ x = pos.x, y = pos.y - 0.5, z = pos.z })
clicker:set_eye_offset({ x = 0, y = 0, z = 0 }, { x = 0, y = 0, z = 0 })
clicker:set_physics_override({ 1, 1, 1 })
default.player_set_animation(clicker, "stand", 30)
minetest.chat_send_player(pname, 'That was enough sleep for now. You stand up again.');
return;
end
local second_node_pos = { x = pos.x, y = pos.y, z = pos.z };
-- the node that will contain the head of the player
local p = { x = pos.x, y = pos.y, z = pos.z };
-- the player's head is pointing in this direction
local dir = node.param2;
-- it would be odd to sleep in half a asciugamano
if (node.name == "summer:asciugamano_" .. colour .. "") then
if (node.param2 == 0) then
second_node_pos.z = pos.z - 1;
elseif (node.param2 == 1) then
second_node_pos.x = pos.x - 1;
elseif (node.param2 == 2) then
second_node_pos.z = pos.z + 1;
elseif (node.param2 == 3) then
second_node_pos.x = pos.x + 1;
end
local node2 = minetest.get_node(second_node_pos);
if (not (node2) or not (node2.param2) or not (node.param2)
or node2.name ~= "summer:asciugamano_" .. colour .. ""
or node2.param2 ~= node.param2) then
allow_sleep = false;
else
allow_sleep = true; allow_sleep = true;
dir = i-1; end
place_name = "asciugamano_" .. colour .. "";
-- if the player clicked on the foot of the asciugamano, locate the head
elseif (node.name == 'summer:asciugamano') then
if (node.param2 == 2) then
second_node_pos.z = pos.z - 1;
elseif (node.param2 == 3) then
second_node_pos.x = pos.x - 1;
elseif (node.param2 == 0) then
second_node_pos.z = pos.z + 1;
elseif (node.param2 == 1) then
second_node_pos.x = pos.x + 1;
end
local node2 = minetest.get_node(second_node_pos);
if (not (node2) or not (node2.param2) or not (node.param2)
or node2.name ~= 'summer:asciugamano'
or node2.param2 ~= node.param2) then
allow_sleep = false;
else
allow_sleep = true;
end
if (allow_sleep == true) then
p = { x = second_node_pos.x, y = second_node_pos.y, z = second_node_pos.z };
end
place_name = 'asciugamano';
elseif (node.name == 'summer:sleeping_mat' or node.name == 'summer:straw_mat') then
place_name = 'mat';
dir = node.param2;
allow_sleep = false;
-- search for a second mat right next to this one
local offset = { { x = 0, z = -1 }, { x = -1, z = 0 }, { x = 0, z = 1 }, { x = 1, z = 0 } };
for i, off in ipairs(offset) do
node2 = minetest.get_node({ x = pos.x + off.x, y = pos.y, z = pos.z + off.z });
if (node2.name == 'summer:sleeping_mat' or node2.name == 'summer:straw_mat') then
-- if a second mat is found, sleeping is possible
allow_sleep = true;
dir = i - 1;
end
end end
end end
end
-- set the right height for the asciugamano -- set the right height for the asciugamano
if( place_name=='asciugamano' ) then if (place_name == 'asciugamano') then
p.y = p.y-0.4; p.y = p.y - 0.4;
end
if( allow_sleep==true ) then
-- set the right position (middle of the asciugamano)
if( dir==0 ) then
p.z = p.z-0.5;
elseif( dir==1 ) then
p.x = p.x-0.5;
elseif( dir==2 ) then
p.z = p.z+0.5;
elseif( dir==3 ) then
p.x = p.x+0.5;
end end
end if (allow_sleep == true) then
-- set the right position (middle of the asciugamano)
if( default.player_attached[pname] and animation.animation=="sit") then if (dir == 0) then
-- just changing the animation... p.z = p.z - 0.5;
if( allow_sleep==true ) then elseif (dir == 1) then
default.player_set_animation(clicker, "lay", 30) p.x = p.x - 0.5;
clicker:set_eye_offset({x=0,y=-14,z=2}, {x=0,y=0,z=0}) elseif (dir == 2) then
minetest.chat_send_player( pname, 'You lie down and take a nap. A right-click will wake you up.'); p.z = p.z + 0.5;
return; elseif (dir == 3) then
-- no sleeping on this place p.x = p.x + 0.5;
end
end
if (default.player_attached[pname] and animation.animation == "sit") then
-- just changing the animation...
if (allow_sleep == true) then
default.player_set_animation(clicker, "lay", 30)
clicker:set_eye_offset({ x = 0, y = -14, z = 2 }, { x = 0, y = 0, z = 0 })
minetest.chat_send_player(pname, 'You lie down and take a nap. A right-click will wake you up.');
return;
-- no sleeping on this place
else
default.player_attached[pname] = false
clicker:setpos({ x = pos.x, y = pos.y - 0.5, z = pos.z })
clicker:set_eye_offset({ x = 0, y = 0, z = 0 }, { x = 0, y = 0, z = 0 })
clicker:set_physics_override({ 1, 1, 1 })
default.player_set_animation(clicker, "stand", 30)
minetest.chat_send_player(pname, 'That was enough sitting around for now. You stand up again.');
return;
end
end
clicker:set_eye_offset({ x = 0, y = -7, z = 2 }, { x = 0, y = 0, z = 0 })
clicker:setpos(p);
default.player_set_animation(clicker, new_animation, 30)
clicker:set_physics_override({ 0, 0, 0 })
default.player_attached[pname] = true
if (allow_sleep == true) then
minetest.chat_send_player(pname,
'Aaah! What a comftable ' .. place_name .. '. A second right-click will let you sleep.');
else else
default.player_attached[pname] = false minetest.chat_send_player(pname,
clicker:setpos({x=pos.x,y=pos.y-0.5,z=pos.z}) 'Comftable, but not good enough for a nap. Right-click again if you want to get back up.');
clicker:set_eye_offset({x=0,y=0,z=0}, {x=0,y=0,z=0})
clicker:set_physics_override({1, 1, 1})
default.player_set_animation(clicker, "stand", 30)
minetest.chat_send_player( pname, 'That was enough sitting around for now. You stand up again.');
return;
end end
end end
clicker:set_eye_offset({x=0,y=-7,z=2}, {x=0,y=0,z=0})
clicker:setpos( p );
default.player_set_animation(clicker, new_animation, 30)
clicker:set_physics_override({0, 0, 0})
default.player_attached[pname] = true
if( allow_sleep==true) then
minetest.chat_send_player( pname, 'Aaah! What a comftable '..place_name..'. A second right-click will let you sleep.');
else
minetest.chat_send_player( pname, 'Comftable, but not good enough for a nap. Right-click again if you want to get back up.');
end
end end
--state=true: lay, state=false: stand up
end
--state=true: lay, state=false: stand up

View File

@ -15,8 +15,8 @@ end
local function get_velocity(v, yaw, y) local function get_velocity(v, yaw, y)
local x = -math.sin(yaw) * v local x = -math.sin(yaw) * v
local z = math.cos(yaw) * v local z = math.cos(yaw) * v
return {x = x, y = y, z = z} return { x = x, y = y, z = z }
end end
@ -24,244 +24,236 @@ local function get_v(v)
return math.sqrt(v.x ^ 2 + v.z ^ 2) return math.sqrt(v.x ^ 2 + v.z ^ 2)
end end
local function reg_barca(color) local function reg_barca(color)
local barca_item_name = "summer:barca_" .. color .. "_item"
local barca_ent_name = "summer:barca_" .. color .. "_entity"
local barca_item_name = "summer:barca_"..color.."_item" --
local barca_ent_name = "summer:barca_"..color.."_entity" -- Boat entity
--
-- local barca = {
-- Boat entity physical = true,
-- collisionbox = { -2.5, -0.5, -2.5, 2.5, 0.3, 2.5 },
visual = "mesh",
mesh = "barca.x", --"barcal.obj",
textures = { "barca_" .. color .. ".png" },
local barca = { driver = nil,
physical = true, v = 0,
collisionbox = {-2.5, -0.5, -2.5, 2.5, 0.3, 2.5}, last_v = 0,
visual = "mesh", removed = false
mesh = "barca.x",--"barcal.obj", }
textures = {"barca_"..color..".png" },
driver = nil,
v = 0,
last_v = 0,
removed = false
}
function barca.on_rightclick(self, clicker) function barca.on_rightclick(self, clicker)
if not clicker or not clicker:is_player() then if not clicker or not clicker:is_player() then
return return
end end
local name = clicker:get_player_name() local name = clicker:get_player_name()
if self.driver and clicker == self.driver then if self.driver and clicker == self.driver then
self.driver = nil self.driver = nil
clicker:set_detach()
default.player_attached[name] = false
default.player_set_animation(clicker, "stand" , 30)
local pos = clicker:getpos()
pos = {x = pos.x, y = pos.y + 0.2, z = pos.z}
minetest.after(0.1, function()
clicker:setpos(pos)
end)
elseif not self.driver then
local attach = clicker:get_attach()
if attach and attach:get_luaentity() then
local luaentity = attach:get_luaentity()
if luaentity.driver then
luaentity.driver = nil
end
clicker:set_detach() clicker:set_detach()
default.player_attached[name] = false
default.player_set_animation(clicker, "stand", 30)
local pos = clicker:getpos()
pos = { x = pos.x, y = pos.y + 0.2, z = pos.z }
minetest.after(0.1, function()
clicker:setpos(pos)
end)
elseif not self.driver then
local attach = clicker:get_attach()
if attach and attach:get_luaentity() then
local luaentity = attach:get_luaentity()
if luaentity.driver then
luaentity.driver = nil
end
clicker:set_detach()
end
self.driver = clicker
clicker:set_attach(self.object, "",
{ x = 0, y = 11, z = -3 }, { x = 0, y = 0, z = 0 })
default.player_attached[name] = true
minetest.after(0.2, function()
default.player_set_animation(clicker, "sit", 30)
end)
self.object:setyaw(clicker:get_look_yaw() - math.pi / 2)
end end
self.driver = clicker
clicker:set_attach(self.object, "",
{x = 0, y = 11, z = -3}, {x = 0, y = 0, z = 0})
default.player_attached[name] = true
minetest.after(0.2, function()
default.player_set_animation(clicker, "sit" , 30)
end)
self.object:setyaw(clicker:get_look_yaw() - math.pi / 2)
end end
end
function barca.on_activate(self, staticdata, dtime_s)
function barca.on_activate(self, staticdata, dtime_s) self.object:set_armor_groups({ immortal = 1 })
self.object:set_armor_groups({immortal = 1}) if staticdata then
if staticdata then self.v = tonumber(staticdata)
self.v = tonumber(staticdata) end
self.last_v = self.v
end end
self.last_v = self.v
end
function barca.get_staticdata(self)
function barca.get_staticdata(self) return tostring(self.v)
return tostring(self.v)
end
function barca.on_punch(self, puncher)
if not puncher or not puncher:is_player() or self.removed then
return
end end
if self.driver and puncher == self.driver then
self.driver = nil function barca.on_punch(self, puncher)
puncher:set_detach() if not puncher or not puncher:is_player() or self.removed then
default.player_attached[puncher:get_player_name()] = false return
end end
if not self.driver then if self.driver and puncher == self.driver then
self.removed = true self.driver = nil
-- delay remove to ensure player is detached puncher:set_detach()
minetest.after(0.1, function() default.player_attached[puncher:get_player_name()] = false
self.object:remove() end
end) if not self.driver then
if not minetest.setting_getbool("creative_mode") then self.removed = true
local inv = puncher:get_inventory() -- delay remove to ensure player is detached
if inv:room_for_item("main", "summer:barca_"..color.."_item") then minetest.after(0.1, function()
inv:add_item("main", "summer:barca_"..color.."_item") self.object:remove()
else end)
minetest.add_item(self.object:getpos(), barca_item_name) if not minetest.setting_getbool("creative_mode") then
local inv = puncher:get_inventory()
if inv:room_for_item("main", "summer:barca_" .. color .. "_item") then
inv:add_item("main", "summer:barca_" .. color .. "_item")
else
minetest.add_item(self.object:getpos(), barca_item_name)
end
end end
end end
end end
end
function barca.on_step(self, dtime)
function barca.on_step(self, dtime) self.v = get_v(self.object:getvelocity()) * get_sign(self.v)
self.v = get_v(self.object:getvelocity()) * get_sign(self.v) if self.driver then
if self.driver then local ctrl = self.driver:get_player_control()
local ctrl = self.driver:get_player_control() local yaw = self.object:getyaw()
local yaw = self.object:getyaw() if ctrl.up then
if ctrl.up then self.v = self.v + 0.1
self.v = self.v + 0.1 elseif ctrl.down then
elseif ctrl.down then self.v = self.v - 0.1
self.v = self.v - 0.1
end
if ctrl.left then
if self.v < 0 then
self.object:setyaw(yaw - (1 + dtime) * 0.03)
else
self.object:setyaw(yaw + (1 + dtime) * 0.03)
end end
elseif ctrl.right then if ctrl.left then
if self.v < 0 then if self.v < 0 then
self.object:setyaw(yaw + (1 + dtime) * 0.03) self.object:setyaw(yaw - (1 + dtime) * 0.03)
else else
self.object:setyaw(yaw - (1 + dtime) * 0.03) self.object:setyaw(yaw + (1 + dtime) * 0.03)
end
elseif ctrl.right then
if self.v < 0 then
self.object:setyaw(yaw + (1 + dtime) * 0.03)
else
self.object:setyaw(yaw - (1 + dtime) * 0.03)
end
end end
end end
end local velo = self.object:getvelocity()
local velo = self.object:getvelocity() if self.v == 0 and velo.x == 0 and velo.y == 0 and velo.z == 0 then
if self.v == 0 and velo.x == 0 and velo.y == 0 and velo.z == 0 then self.object:setpos(self.object:getpos())
self.object:setpos(self.object:getpos()) return
return end
end local s = get_sign(self.v)
local s = get_sign(self.v) self.v = self.v - 0.02 * s
self.v = self.v - 0.02 * s if s ~= get_sign(self.v) then
if s ~= get_sign(self.v) then self.object:setvelocity({ x = 0, y = 0, z = 0 })
self.object:setvelocity({x = 0, y = 0, z = 0})
self.v = 0
return
end
if math.abs(self.v) > 5 then
self.v = 5 * get_sign(self.v)
end
local p = self.object:getpos()
p.y = p.y - 0.5
local new_velo = {x = 0, y = 0, z = 0}
local new_acce = {x = 0, y = 0, z = 0}
if not is_water(p) then
local nodedef = minetest.registered_nodes[minetest.get_node(p).name]
if (not nodedef) or nodedef.walkable then
self.v = 0 self.v = 0
new_acce = {x = 0, y = 2, z = 0} return
else
new_acce = {x = 0, y = -1.8, z = 0}
end end
new_velo = get_velocity(self.v, self.object:getyaw(), if math.abs(self.v) > 5 then
self.object:getvelocity().y) self.v = 5 * get_sign(self.v)
self.object:setpos(self.object:getpos()) end
else
p.y = p.y + 1 local p = self.object:getpos()
if is_water(p) then p.y = p.y - 0.5
local y = self.object:getvelocity().y local new_velo = { x = 0, y = 0, z = 0 }
if y >= 7 then local new_acce = { x = 0, y = 0, z = 0 }
y = 7 if not is_water(p) then
elseif y < 0 then local nodedef = minetest.registered_nodes[minetest.get_node(p).name]
new_acce = {x = 0, y = 50, z = 0} if (not nodedef) or nodedef.walkable then
self.v = 0
new_acce = { x = 0, y = 2, z = 0 }
else else
new_acce = {x = 0, y = 7, z = 0} new_acce = { x = 0, y = -1.8, z = 0 }
end end
new_velo = get_velocity(self.v, self.object:getyaw(), y) new_velo = get_velocity(self.v, self.object:getyaw(),
self.object:getvelocity().y)
self.object:setpos(self.object:getpos()) self.object:setpos(self.object:getpos())
else else
new_acce = {x = 0, y = 0, z = 0} p.y = p.y + 1
if math.abs(self.object:getvelocity().y) < 1 then if is_water(p) then
local pos = self.object:getpos() local y = self.object:getvelocity().y
pos.y = math.floor(pos.y) + 1. if y >= 7 then
self.object:setpos(pos) y = 7
new_velo = get_velocity(self.v, self.object:getyaw(), 0) elseif y < 0 then
else new_acce = { x = 0, y = 50, z = 0 }
new_velo = get_velocity(self.v, self.object:getyaw(), else
self.object:getvelocity().y) new_acce = { x = 0, y = 7, z = 0 }
end
new_velo = get_velocity(self.v, self.object:getyaw(), y)
self.object:setpos(self.object:getpos()) self.object:setpos(self.object:getpos())
else
new_acce = { x = 0, y = 0, z = 0 }
if math.abs(self.object:getvelocity().y) < 1 then
local pos = self.object:getpos()
pos.y = math.floor(pos.y) + 1.
self.object:setpos(pos)
new_velo = get_velocity(self.v, self.object:getyaw(), 0)
else
new_velo = get_velocity(self.v, self.object:getyaw(),
self.object:getvelocity().y)
self.object:setpos(self.object:getpos())
end
end end
end end
self.object:setvelocity(new_velo)
self.object:setacceleration(new_acce)
end end
self.object:setvelocity(new_velo)
self.object:setacceleration(new_acce) minetest.register_entity("summer:barca_" .. color .. "", barca)
end
minetest.register_entity("summer:barca_"..color.."", barca) minetest.register_craftitem(barca_item_name, {
description = "Barca (" .. color .. ")",
inventory_image = "barca_" .. color .. "_inv.png",
wield_image = "barca_" .. color .. "_inv.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.add_entity(pointed_thing.under, "summer:barca_" .. color .. "")
if not minetest.setting_getbool("creative_mode") then
itemstack:take_item()
end
return itemstack
end,
})
minetest.register_craftitem(barca_item_name, { if minetest.get_modpath("cannabis") then
description = "Barca ("..color..")", minetest.register_craft({
inventory_image = "barca_"..color.."_inv.png", output = barca_item_name,
wield_image = "barca_"..color.."_inv.png", recipe = {
wield_scale = {x = 2, y = 2, z = 1}, { "", "", "" },
liquids_pointable = true, { "cannabis:canapa_plastic", "wool:" .. color, "cannabis:canapa_plastic" },
{ "cannabis:canapa_plastic", "cannabis:canapa_plastic", "cannabis:canapa_plastic" },
on_place = function(itemstack, placer, pointed_thing) },
if pointed_thing.type ~= "node" then })
return end
end minetest.register_craft({
if not is_water(pointed_thing.under) then output = barca_item_name,
return recipe = {
end { "", "", "" },
pointed_thing.under.y = pointed_thing.under.y + 0.5 { "group:wood", "wool:" .. color, "group:wood" },
minetest.add_entity(pointed_thing.under, "summer:barca_"..color.."") { "group:wood", "group:wood", "group:wood" },
if not minetest.setting_getbool("creative_mode") then },
itemstack:take_item() })
end
return itemstack
end,
})
if minetest.get_modpath("cannabis") then
minetest.register_craft({
output = barca_item_name,
recipe = {
{"" , "" , "" },
{"cannabis:canapa_plastic", "wool:"..color, "cannabis:canapa_plastic"},
{"cannabis:canapa_plastic", "cannabis:canapa_plastic", "cannabis:canapa_plastic"},
},
})
end
minetest.register_craft({
output = barca_item_name,
recipe = {
{"" , "" , "" },
{"group:wood", "wool:"..color, "group:wood"},
{"group:wood","group:wood","group:wood"},
},
})
end end
colors = { colors = {
"black", "red", "green", "blue", "yellow", "violet","orange", "black", "red", "green", "blue", "yellow", "violet", "orange",
} }
for _,color in ipairs(colors) do for _, color in ipairs(colors) do
reg_barca(color) reg_barca(color)
end end

View File

@ -1,46 +1,45 @@
--BRECCIA --BRECCIA
minetest.register_node("summer:breccia", { minetest.register_node("summer:breccia", {
description = "Breccia", description = "Breccia",
tiles = {"breccia.png"}, tiles = { "breccia.png" },
groups = {crumbly = 2, falling_node = 1}, groups = { crumbly = 2, falling_node = 1 },
--groups = {cracky = 3, stone = 1}, --groups = {cracky = 3, stone = 1},
drop = '"summer:pietra" 9', drop = '"summer:pietra" 9',
--legacy_mineral = true, --legacy_mineral = true,
is_ground_content = false, -- is_ground_content = false, --
sounds = default.node_sound_gravel_defaults(), sounds = default.node_sound_gravel_defaults(),
--sounds = default.node_sound_stone_defaults(), --sounds = default.node_sound_stone_defaults(),
}) })
minetest.register_node("summer:breccia_2", { minetest.register_node("summer:breccia_2", {
description = "BrecciaB ", description = "BrecciaB ",
tiles = {"breccia2.png"}, tiles = { "breccia2.png" },
groups = {crumbly = 2, falling_node = 1}, groups = { crumbly = 2, falling_node = 1 },
--groups = {cracky = 3, stone = 1}, --groups = {cracky = 3, stone = 1},
drop = '"summer:pietraA" 9', drop = '"summer:pietraA" 9',
--legacy_mineral = true, --legacy_mineral = true,
sounds = default.node_sound_gravel_defaults(), sounds = default.node_sound_gravel_defaults(),
--sounds = default.node_sound_stone_defaults(), --sounds = default.node_sound_stone_defaults(),
}) })
minetest.register_node("summer:desert_breccia_2", {
minetest.register_node("summer:desert_breccia_2", {
description = "Red Breccia", description = "Red Breccia",
tiles = {"desert_breccia2.png"}, tiles = { "desert_breccia2.png" },
groups = {crumbly = 2, falling_node = 1}, groups = { crumbly = 2, falling_node = 1 },
--groups = {cracky = 3, stone = 1}, --groups = {cracky = 3, stone = 1},
drop = '"summer:desert_pietra" 9', drop = '"summer:desert_pietra" 9',
--legacy_mineral = true, --legacy_mineral = true,
sounds = default.node_sound_gravel_defaults(), sounds = default.node_sound_gravel_defaults(),
--sounds = default.node_sound_stone_defaults(), --sounds = default.node_sound_stone_defaults(),
}) })
minetest.register_node("summer:desert_breccia", { minetest.register_node("summer:desert_breccia", {
description = "Desert Breccia", description = "Desert Breccia",
tiles = {"desert_breccia.png"}, tiles = { "desert_breccia.png" },
groups = {crumbly = 2, falling_node = 1}, groups = { crumbly = 2, falling_node = 1 },
--groups = {cracky = 3, stone = 1}, --groups = {cracky = 3, stone = 1},
drop = '"summer:pietraP" 9', drop = '"summer:pietraP" 9',
--legacy_mineral = true, --legacy_mineral = true,
sounds = default.node_sound_gravel_defaults(), sounds = default.node_sound_gravel_defaults(),
--sounds = default.node_sound_stone_defaults(), --sounds = default.node_sound_stone_defaults(),
}) })

View File

@ -1,123 +1,121 @@
if minetest.get_modpath("wool") and minetest.get_modpath("dye")then if minetest.get_modpath("wool") and minetest.get_modpath("dye") then
local lchest_list = { local lchest_list = {
{ "Red chest", "red"}, { "Red chest", "red" },
{ "Orange chest", "orange"}, { "Orange chest", "orange" },
{ "Black ", "black"}, { "Black ", "black" },
{ "Yellow chest", "yellow"}, { "Yellow chest", "yellow" },
{ "Green chest", "green"}, { "Green chest", "green" },
{ "Blue chest", "blue"}, { "Blue chest", "blue" },
{ "Violet chest", "violet"}, { "Violet chest", "violet" },
{"white chest", "white"} { "white chest", "white" }
} }
for i in ipairs(lchest_list) do for i in ipairs(lchest_list) do
local desc = lchest_list[i][1] local desc = lchest_list[i][1]
local colour = lchest_list[i][2] local colour = lchest_list[i][2]
--sdraia --sdraia
minetest.register_craft({
output = "summer:sdraia_"..colour.."",
recipe = {
{"", "wool:"..colour, "", },
{"cannabis:canapa_fiber", "cannabis:canapa_plastic", "cannabis:canapa_fiber", },
{"", "cannabis:canapa_fiber", "", }
}
})
--portacenere
minetest.register_craft({ minetest.register_craft({
output = "summer:Portacenere_"..colour.."", output = "summer:sdraia_" .. colour .. "",
recipe = { recipe = {
{"cannabis:canapa_fiber", "", "cannabis:canapa_fiber" }, { "", "wool:" .. colour, "", },
{"cannabis:canapa_plastic", "", "cannabis:canapa_plastic" }, { "cannabis:canapa_fiber", "cannabis:canapa_plastic", "cannabis:canapa_fiber", },
{"cannabis:canapa_plastic", "wool:"..colour, "cannabis:canapa_plastic" } { "", "cannabis:canapa_fiber", "", }
} }
}) })
--occhiali
minetest.register_craft({
output = "summer:occhiali_"..colour.."",
recipe = {
{"", "wool:"..colour, "", },
{"", "cannabis:canapa_fiber", "", },
{"cannabis:canapa_plastic", "", "cannabis:canapa_plastic", }
}
})
--porta
minetest.register_craft({
output = "summer:porta_"..colour.."_ch",
recipe = {
{"cannabis:canapa_fiber", "wool:"..colour, "", },
{"wool:"..colour, "cannabis:canapa_fiber", "", },
{"cannabis:canapa_fiber", "cannabis:canapa_fiber", "", }
}
})
--________________________________________________________ --portacenere
--asciugamano minetest.register_craft({
--________________________________________________________ output = "summer:Portacenere_" .. colour .. "",
recipe = {
{ "cannabis:canapa_fiber", "", "cannabis:canapa_fiber" },
{ "cannabis:canapa_plastic", "", "cannabis:canapa_plastic" },
{ "cannabis:canapa_plastic", "wool:" .. colour, "cannabis:canapa_plastic" }
}
})
--occhiali
minetest.register_craft({
output = "summer:occhiali_" .. colour .. "",
recipe = {
{ "", "wool:" .. colour, "", },
{ "", "cannabis:canapa_fiber", "", },
{ "cannabis:canapa_plastic", "", "cannabis:canapa_plastic", }
}
})
--porta
minetest.register_craft({
output = "summer:porta_" .. colour .. "_ch",
recipe = {
{ "cannabis:canapa_fiber", "wool:" .. colour, "", },
{ "wool:" .. colour, "cannabis:canapa_fiber", "", },
{ "cannabis:canapa_fiber", "cannabis:canapa_fiber", "", }
}
})
minetest.register_craft({ --________________________________________________________
output = "summer:asciugamano_"..colour.."",
recipe = {
{"","","", },
{"wool:"..colour, "", "", },
{"cannabis:canapa_fiber", "cannabis:canapa_fiber", "cannabis:canapa_fiber", }
}
})
--________________________________________________________
--ombrellone --asciugamano
--________________________________________________________ --________________________________________________________
minetest.register_craft({
output = "summer:ombrellone_"..colour.."", minetest.register_craft({
recipe = { output = "summer:asciugamano_" .. colour .. "",
{"", "wool:"..colour, "", }, recipe = {
{"", "cannabis:canapa_plastic", "", }, { "", "", "", },
{"", "cannabis:canapa_fiber", "", } { "wool:" .. colour, "", "", },
} { "cannabis:canapa_fiber", "cannabis:canapa_fiber", "cannabis:canapa_fiber", }
}) }
})
--________________________________________________________
--ombrellone
--________________________________________________________
minetest.register_craft({
output = "summer:ombrellone_" .. colour .. "",
recipe = {
{ "", "wool:" .. colour, "", },
{ "", "cannabis:canapa_plastic", "", },
{ "", "cannabis:canapa_fiber", "", }
}
})
minetest.register_craft({
output = "summer:ombrellone_n_"..colour.."", minetest.register_craft({
recipe = { output = "summer:ombrellone_n_" .. colour .. "",
{"cannabis:canapa_fiber", "wool:"..colour, "cannabis:canapa_fiber" }, recipe = {
{"", "cannabis:canapa_plastic", "" }, { "cannabis:canapa_fiber", "wool:" .. colour, "cannabis:canapa_fiber" },
{"", "cannabis:canapa_plastic", "" } { "", "cannabis:canapa_plastic", "" },
} { "", "cannabis:canapa_plastic", "" }
}) }
})
--________________________________________________________
--________________________________________________________
--chest
--________________________________________________________ --chest
minetest.register_craft({ --________________________________________________________
output = "summer:chest"..colour.."", minetest.register_craft({
recipe = { output = "summer:chest" .. colour .. "",
{"cannabis:canapa_plastic","dye:"..colour.."","cannabis:canapa_plastic"}, recipe = {
{"group:wood","","group:wood"}, { "cannabis:canapa_plastic", "dye:" .. colour .. "", "cannabis:canapa_plastic" },
{"group:wood","group:wood","group:wood"} { "group:wood", "", "group:wood" },
{ "group:wood", "group:wood", "group:wood" }
}
}) }
})
minetest.register_craft({
output = "summer:chest_lock"..colour.."", minetest.register_craft({
recipe = { output = "summer:chest_lock" .. colour .. "",
{"summer:chest"..colour.."","cannabis:high_performance_ingot",""} recipe = {
--{"","",""}, { "summer:chest" .. colour .. "", "cannabis:high_performance_ingot", "" }
--{"","",""} --{"","",""},
--{"","",""}
}
}) }
})
end
end end
end

400
canoa.lua
View File

@ -15,8 +15,8 @@ end
local function get_velocity(v, yaw, y) local function get_velocity(v, yaw, y)
local x = -math.sin(yaw) * v local x = -math.sin(yaw) * v
local z = math.cos(yaw) * v local z = math.cos(yaw) * v
return {x = x, y = y, z = z} return { x = x, y = y, z = z }
end end
@ -24,248 +24,240 @@ local function get_v(v)
return math.sqrt(v.x ^ 2 + v.z ^ 2) return math.sqrt(v.x ^ 2 + v.z ^ 2)
end end
local function reg_canoa_(color) local function reg_canoa_(color)
local canoa_item_name = "summer:canoa_" .. color .. "_item"
local canoa_ent_name = "summer:canoa_" .. color .. "_entity"
local canoa_item_name = "summer:canoa_"..color.."_item" --
local canoa_ent_name = "summer:canoa_"..color.."_entity" -- Boat entity
--
-- local canoa_ = {
-- Boat entity physical = true,
-- collisionbox = { -0.5, -0.35, -0.5, 0.5, 0.3, 0.5 },
visual = "mesh",
mesh = "canoa.x",
textures = { "canoa_" .. color .. ".png" },
local canoa_ = { driver = nil,
physical = true, v = 0,
collisionbox = {-0.5, -0.35, -0.5, 0.5, 0.3, 0.5}, last_v = 0,
visual = "mesh", removed = false
mesh = "canoa.x", }
textures = {"canoa_"..color..".png" },
driver = nil,
v = 0,
last_v = 0,
removed = false
}
function canoa_.on_rightclick(self, clicker) function canoa_.on_rightclick(self, clicker)
if not clicker or not clicker:is_player() then if not clicker or not clicker:is_player() then
return return
end end
local name = clicker:get_player_name() local name = clicker:get_player_name()
if self.driver and clicker == self.driver then if self.driver and clicker == self.driver then
self.driver = nil self.driver = nil
clicker:set_detach()
default.player_attached[name] = false
default.player_set_animation(clicker, "stand" , 30)
local pos = clicker:getpos()
pos = {x = pos.x, y = pos.y + 0.2, z = pos.z}
minetest.after(0.1, function()
clicker:setpos(pos)
end)
elseif not self.driver then
local attach = clicker:get_attach()
if attach and attach:get_luaentity() then
local luaentity = attach:get_luaentity()
if luaentity.driver then
luaentity.driver = nil
end
clicker:set_detach() clicker:set_detach()
default.player_attached[name] = false
default.player_set_animation(clicker, "stand", 30)
local pos = clicker:getpos()
pos = { x = pos.x, y = pos.y + 0.2, z = pos.z }
minetest.after(0.1, function()
clicker:setpos(pos)
end)
elseif not self.driver then
local attach = clicker:get_attach()
if attach and attach:get_luaentity() then
local luaentity = attach:get_luaentity()
if luaentity.driver then
luaentity.driver = nil
end
clicker:set_detach()
end
self.driver = clicker
clicker:set_attach(self.object, "",
{ x = 0, y = 11, z = -3 }, { x = 0, y = 0, z = 0 })
default.player_attached[name] = true
minetest.after(0.2, function()
default.player_set_animation(clicker, "sit", 30)
end)
self.object:setyaw(clicker:get_look_yaw() - math.pi / 2)
end end
self.driver = clicker
clicker:set_attach(self.object, "",
{x = 0, y = 11, z = -3}, {x = 0, y = 0, z = 0})
default.player_attached[name] = true
minetest.after(0.2, function()
default.player_set_animation(clicker, "sit" , 30)
end)
self.object:setyaw(clicker:get_look_yaw() - math.pi / 2)
end end
end
function canoa_.on_activate(self, staticdata, dtime_s)
function canoa_.on_activate(self, staticdata, dtime_s) self.object:set_armor_groups({ immortal = 1 })
self.object:set_armor_groups({immortal = 1}) if staticdata then
if staticdata then self.v = tonumber(staticdata)
self.v = tonumber(staticdata) end
self.last_v = self.v
end end
self.last_v = self.v
end
function canoa_.get_staticdata(self)
function canoa_.get_staticdata(self) return tostring(self.v)
return tostring(self.v)
end
function canoa_.on_punch(self, puncher)
if not puncher or not puncher:is_player() or self.removed then
return
end end
if self.driver and puncher == self.driver then
self.driver = nil function canoa_.on_punch(self, puncher)
puncher:set_detach() if not puncher or not puncher:is_player() or self.removed then
default.player_attached[puncher:get_player_name()] = false return
end end
if not self.driver then if self.driver and puncher == self.driver then
self.removed = true self.driver = nil
-- delay remove to ensure player is detached puncher:set_detach()
minetest.after(0.1, function() default.player_attached[puncher:get_player_name()] = false
self.object:remove() end
end) if not self.driver then
if not minetest.setting_getbool("creative_mode") then self.removed = true
local inv = puncher:get_inventory() -- delay remove to ensure player is detached
if inv:room_for_item("main", "summer:canoa_"..color.."_item") then minetest.after(0.1, function()
inv:add_item("main", "summer:canoa_"..color.."_item") self.object:remove()
else end)
minetest.add_item(self.object:getpos(), canoa_item_name) if not minetest.setting_getbool("creative_mode") then
local inv = puncher:get_inventory()
if inv:room_for_item("main", "summer:canoa_" .. color .. "_item") then
inv:add_item("main", "summer:canoa_" .. color .. "_item")
else
minetest.add_item(self.object:getpos(), canoa_item_name)
end
end end
end end
end end
end
function canoa_.on_step(self, dtime)
function canoa_.on_step(self, dtime) self.v = get_v(self.object:getvelocity()) * get_sign(self.v)
self.v = get_v(self.object:getvelocity()) * get_sign(self.v) if self.driver then
if self.driver then local ctrl = self.driver:get_player_control()
local ctrl = self.driver:get_player_control() local yaw = self.object:getyaw()
local yaw = self.object:getyaw() if ctrl.up then
if ctrl.up then self.v = self.v + 0.1
self.v = self.v + 0.1 elseif ctrl.down then
elseif ctrl.down then self.v = self.v - 0.1
self.v = self.v - 0.1
end
if ctrl.left then
if self.v < 0 then
self.object:setyaw(yaw - (1 + dtime) * 0.03)
else
self.object:setyaw(yaw + (1 + dtime) * 0.03)
end end
elseif ctrl.right then if ctrl.left then
if self.v < 0 then if self.v < 0 then
self.object:setyaw(yaw + (1 + dtime) * 0.03) self.object:setyaw(yaw - (1 + dtime) * 0.03)
else else
self.object:setyaw(yaw - (1 + dtime) * 0.03) self.object:setyaw(yaw + (1 + dtime) * 0.03)
end
elseif ctrl.right then
if self.v < 0 then
self.object:setyaw(yaw + (1 + dtime) * 0.03)
else
self.object:setyaw(yaw - (1 + dtime) * 0.03)
end
end end
end end
end local velo = self.object:getvelocity()
local velo = self.object:getvelocity() if self.v == 0 and velo.x == 0 and velo.y == 0 and velo.z == 0 then
if self.v == 0 and velo.x == 0 and velo.y == 0 and velo.z == 0 then self.object:setpos(self.object:getpos())
self.object:setpos(self.object:getpos()) return
return end
end local s = get_sign(self.v)
local s = get_sign(self.v) self.v = self.v - 0.02 * s
self.v = self.v - 0.02 * s if s ~= get_sign(self.v) then
if s ~= get_sign(self.v) then self.object:setvelocity({ x = 0, y = 0, z = 0 })
self.object:setvelocity({x = 0, y = 0, z = 0})
self.v = 0
return
end
if math.abs(self.v) > 5 then
self.v = 5 * get_sign(self.v)
end
local p = self.object:getpos()
p.y = p.y - 0.5
local new_velo = {x = 0, y = 0, z = 0}
local new_acce = {x = 0, y = 0, z = 0}
if not is_water(p) then
local nodedef = minetest.registered_nodes[minetest.get_node(p).name]
if (not nodedef) or nodedef.walkable then
self.v = 0 self.v = 0
new_acce = {x = 0, y = 1, z = 0} return
else
new_acce = {x = 0, y = -9.8, z = 0}
end end
new_velo = get_velocity(self.v, self.object:getyaw(), if math.abs(self.v) > 5 then
self.object:getvelocity().y) self.v = 5 * get_sign(self.v)
self.object:setpos(self.object:getpos()) end
else
p.y = p.y + 1 local p = self.object:getpos()
if is_water(p) then p.y = p.y - 0.5
local y = self.object:getvelocity().y local new_velo = { x = 0, y = 0, z = 0 }
if y >= 5 then local new_acce = { x = 0, y = 0, z = 0 }
y = 5 if not is_water(p) then
elseif y < 0 then local nodedef = minetest.registered_nodes[minetest.get_node(p).name]
new_acce = {x = 0, y = 20, z = 0} if (not nodedef) or nodedef.walkable then
self.v = 0
new_acce = { x = 0, y = 1, z = 0 }
else else
new_acce = {x = 0, y = 5, z = 0} new_acce = { x = 0, y = -9.8, z = 0 }
end end
new_velo = get_velocity(self.v, self.object:getyaw(), y) new_velo = get_velocity(self.v, self.object:getyaw(),
self.object:getvelocity().y)
self.object:setpos(self.object:getpos()) self.object:setpos(self.object:getpos())
else else
new_acce = {x = 0, y = 0, z = 0} p.y = p.y + 1
if math.abs(self.object:getvelocity().y) < 1 then if is_water(p) then
local pos = self.object:getpos() local y = self.object:getvelocity().y
pos.y = math.floor(pos.y) + 0.5 if y >= 5 then
self.object:setpos(pos) y = 5
new_velo = get_velocity(self.v, self.object:getyaw(), 0) elseif y < 0 then
else new_acce = { x = 0, y = 20, z = 0 }
new_velo = get_velocity(self.v, self.object:getyaw(), else
self.object:getvelocity().y) new_acce = { x = 0, y = 5, z = 0 }
end
new_velo = get_velocity(self.v, self.object:getyaw(), y)
self.object:setpos(self.object:getpos()) self.object:setpos(self.object:getpos())
else
new_acce = { x = 0, y = 0, z = 0 }
if math.abs(self.object:getvelocity().y) < 1 then
local pos = self.object:getpos()
pos.y = math.floor(pos.y) + 0.5
self.object:setpos(pos)
new_velo = get_velocity(self.v, self.object:getyaw(), 0)
else
new_velo = get_velocity(self.v, self.object:getyaw(),
self.object:getvelocity().y)
self.object:setpos(self.object:getpos())
end
end end
end end
self.object:setvelocity(new_velo)
self.object:setacceleration(new_acce)
end end
self.object:setvelocity(new_velo)
self.object:setacceleration(new_acce) minetest.register_entity("summer:canoa_" .. color .. "", canoa_)
end
minetest.register_entity("summer:canoa_"..color.."", canoa_) minetest.register_craftitem(canoa_item_name, {
description = "canoa (" .. color .. ")",
inventory_image = "canoa_" .. color .. "_inv.png",
wield_image = "canoa_" .. color .. "_inv.png",
wield_scale = { x = 2, y = 2, z = 1 },
liquids_pointable = true,
on_place = function(itemstack, placer, pointed_thing)
minetest.register_craftitem(canoa_item_name, { if pointed_thing.type ~= "node" then
description = "canoa ("..color..")", return
inventory_image = "canoa_"..color.."_inv.png", end
wield_image = "canoa_"..color.."_inv.png", if not is_water(pointed_thing.under) then
wield_scale = {x = 2, y = 2, z = 1}, return
liquids_pointable = true, end
pointed_thing.under.y = pointed_thing.under.y + 0.5
on_place = function(itemstack, placer, pointed_thing) minetest.add_entity(pointed_thing.under, "summer:canoa_" .. color .. "")
if pointed_thing.type ~= "node" then if not minetest.setting_getbool("creative_mode") then
return itemstack:take_item()
end end
if not is_water(pointed_thing.under) then return itemstack
return end,
end })
pointed_thing.under.y = pointed_thing.under.y + 0.5
minetest.add_entity(pointed_thing.under, "summer:canoa_"..color.."")
if not minetest.setting_getbool("creative_mode") then
itemstack:take_item()
end
return itemstack
end,
})
--canoa --canoa
minetest.register_craft({ minetest.register_craft({
output = canoa_item_name, output = canoa_item_name,
recipe = { recipe = {
{"" , "" , "" }, { "", "", "" },
{"" , "wool:"..color, "" }, { "", "wool:" .. color, "" },
{"group:wood","group:wood","group:wood"}, { "group:wood", "group:wood", "group:wood" },
}, },
}) })
if minetest.get_modpath("cannabis") then if minetest.get_modpath("cannabis") then
minetest.register_craft({ minetest.register_craft({
output = canoa_item_name, output = canoa_item_name,
recipe = { recipe = {
{"" , "" , "" }, { "", "", "" },
{"" , "wool:"..color, "" }, { "", "wool:" .. color, "" },
{"cannabis:canapa_plastic", "cannabis:canapa_plastic", "cannabis:canapa_plastic"}, { "cannabis:canapa_plastic", "cannabis:canapa_plastic", "cannabis:canapa_plastic" },
}, },
}) })
end end
end end
colors = { colors = {
"black", "red", "green", "blue", "yellow", "violet","orange" "black", "red", "green", "blue", "yellow", "violet", "orange"
} }
for _,color in ipairs(colors) do for _, color in ipairs(colors) do
reg_canoa_(color) reg_canoa_(color)
end end

341
chest.lua
View File

@ -8,7 +8,7 @@ local chest_formspec =
"list[current_player;main;0,6.09;8,3;8]" .. "list[current_player;main;0,6.09;8,3;8]" ..
"listring[current_name;main]" .. "listring[current_name;main]" ..
"listring[current_player;main]" .. "listring[current_player;main]" ..
default.get_hotbar_bg(0,4.95) default.get_hotbar_bg(0, 4.95)
local function get_locked_chest_formspec(pos) local function get_locked_chest_formspec(pos)
local spos = pos.x .. "," .. pos.y .. "," .. pos.z local spos = pos.x .. "," .. pos.y .. "," .. pos.z
@ -22,8 +22,8 @@ local function get_locked_chest_formspec(pos)
"list[current_player;main;0,6.09;8,3;8]" .. "list[current_player;main;0,6.09;8,3;8]" ..
"listring[nodemeta:" .. spos .. ";main]" .. "listring[nodemeta:" .. spos .. ";main]" ..
"listring[current_player;main]" .. "listring[current_player;main]" ..
default.get_hotbar_bg(0,4.95) default.get_hotbar_bg(0, 4.95)
return formspec return formspec
end end
local function has_locked_chest_privilege(meta, player) local function has_locked_chest_privilege(meta, player)
@ -40,185 +40,186 @@ local function has_locked_chest_privilege(meta, player)
return true return true
end end
local chest_list = { local chest_list = {
{ "Red chest", "red"}, { "Red chest", "red" },
{ "Orange chest", "orange"}, { "Orange chest", "orange" },
{ "Black chest", "black"}, { "Black chest", "black" },
{ "Yellow chest", "yellow"}, { "Yellow chest", "yellow" },
{ "Green chest", "green"}, { "Green chest", "green" },
{ "Blue chest", "blue"}, { "Blue chest", "blue" },
{ "Violet chest", "violet"}, { "Violet chest", "violet" },
} }
for i in ipairs(chest_list) do for i in ipairs(chest_list) do
local chestdesc = chest_list[i][1] local chestdesc = chest_list[i][1]
local colour = chest_list[i][2] local colour = chest_list[i][2]
minetest.register_node("summer:chest"..colour.."", {
description = chestdesc..colour.."",
tiles = {"chest_top_"..colour..".png", "chest_top_"..colour..".png", "chest_side_"..colour..".png",
"chest_side_"..colour..".png", "chest_side_"..colour..".png", "chest_front_"..colour..".png"},
--inventory_image = "chest_front_"..colour.."_inv.png",
--wield_image = {"chest_front_"..colour..".png",
-- },
paramtype2 = "facedir",
groups = {choppy = 2, oddly_breakable_by_hand = 2,tubedevice = 1, tubedevice_receiver = 1},
tube = {
insert_object = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
return inv:add_item("main", stack)
end,
can_insert = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
return inv:room_for_item("main", stack)
end,
input_inventory = "main",
connect_sides = {left = 1, right = 1, back = 1, front = 1, bottom = 1, top = 1}
},
legacy_facedir_simple = true,
is_ground_content = false,
sounds = default.node_sound_wood_defaults(),
on_construct = function(pos) minetest.register_node("summer:chest" .. colour .. "", {
local meta = minetest.get_meta(pos) description = chestdesc .. colour .. "",
meta:set_string("formspec", chest_formspec) tiles = { "chest_top_" .. colour .. ".png", "chest_top_" .. colour .. ".png", "chest_side_" .. colour .. ".png",
meta:set_string("infotext", "Chest") "chest_side_" .. colour .. ".png", "chest_side_" .. colour .. ".png", "chest_front_" .. colour .. ".png" },
local inv = meta:get_inventory() --inventory_image = "chest_front_"..colour.."_inv.png",
inv:set_size("main", 16*4)
end,
can_dig = function(pos,player)
local meta = minetest.get_meta(pos);
local inv = meta:get_inventory()
return inv:is_empty("main")
end,
on_metadata_inventory_move = function(pos, from_list, from_index,
to_list, to_index, count, player)
minetest.log("action", player:get_player_name() ..
" moves stuff in chest at " .. minetest.pos_to_string(pos))
end,
on_metadata_inventory_put = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name() ..
" moves " .. stack:get_name() ..
" to chest at " .. minetest.pos_to_string(pos))
end,
on_metadata_inventory_take = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name() ..
" takes " .. stack:get_name() ..
" from chest at " .. minetest.pos_to_string(pos))
end,
on_blast = function(pos)
local drops = {}
default.get_inventory_drops(pos, "main", drops)
drops[#drops+1] = "summer:chest"..colour..""
minetest.remove_node(pos)
return drops
end,
})
local lockchest_list = {
{ "Red lockchest", "red"},
{ "Orange lockchest", "orange"},
{ "Black lockchest", "black"},
{ "Yellow lockchest", "yellow"},
{ "Green lockchest", "green"},
{ "Blue lockchest", "blue"},
{ "Violet lockchest", "violet"},
}
for i in ipairs(lockchest_list) do --wield_image = {"chest_front_"..colour..".png",
local lockchestdesc = lockchest_list[i][1] -- },
local colour = lockchest_list[i][2] paramtype2 = "facedir",
groups = { choppy = 2, oddly_breakable_by_hand = 2, tubedevice = 1, tubedevice_receiver = 1 },
tube = {
insert_object = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
return inv:add_item("main", stack)
end,
can_insert = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
return inv:room_for_item("main", stack)
end,
input_inventory = "main",
connect_sides = { left = 1, right = 1, back = 1, front = 1, bottom = 1, top = 1 }
},
legacy_facedir_simple = true,
is_ground_content = false,
sounds = default.node_sound_wood_defaults(),
minetest.register_node("summer:chest_lock"..colour.."", { on_construct = function(pos)
description = lockchestdesc.."",
tiles = {"chest_top_"..colour..".png", "chest_top_"..colour..".png", "chest_side_"..colour..".png",
"chest_side_"..colour..".png", "chest_side_"..colour..".png", "chest_lock_"..colour..".png"},
--inventory_image = "chest_lock_"..colour.."_inv.png",
--wield_image = {"chest_lock_"..colour.."_inv.png",
-- },
paramtype2 = "facedir",
groups = {choppy = 2, oddly_breakable_by_hand = 2,tubedevice = 1, tubedevice_receiver = 1},
tube = {
insert_object = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
meta:set_string("formspec", chest_formspec)
meta:set_string("infotext", "Chest")
local inv = meta:get_inventory() local inv = meta:get_inventory()
return inv:add_item("main", stack) inv:set_size("main", 16 * 4)
end, end,
can_insert = function(pos, node, stack, direction) can_dig = function(pos, player)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos);
local inv = meta:get_inventory() local inv = meta:get_inventory()
return inv:room_for_item("main", stack) return inv:is_empty("main")
end, end,
input_inventory = "main", on_metadata_inventory_move = function(pos, from_list, from_index,
connect_sides = {left = 1, right = 1, back = 1, front = 1, bottom = 1, top = 1} to_list, to_index, count, player)
}, minetest.log("action", player:get_player_name() ..
legacy_facedir_simple = true, " moves stuff in chest at " .. minetest.pos_to_string(pos))
is_ground_content = false, end,
sounds = default.node_sound_wood_defaults(), on_metadata_inventory_put = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name() ..
" moves " .. stack:get_name() ..
" to chest at " .. minetest.pos_to_string(pos))
end,
on_metadata_inventory_take = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name() ..
" takes " .. stack:get_name() ..
" from chest at " .. minetest.pos_to_string(pos))
end,
on_blast = function(pos)
local drops = {}
default.get_inventory_drops(pos, "main", drops)
drops[#drops + 1] = "summer:chest" .. colour .. ""
minetest.remove_node(pos)
return drops
end,
})
local lockchest_list = {
{ "Red lockchest", "red" },
{ "Orange lockchest", "orange" },
{ "Black lockchest", "black" },
{ "Yellow lockchest", "yellow" },
{ "Green lockchest", "green" },
{ "Blue lockchest", "blue" },
{ "Violet lockchest", "violet" },
}
after_place_node = function(pos, placer) for i in ipairs(lockchest_list) do
local meta = minetest.get_meta(pos) local lockchestdesc = lockchest_list[i][1]
meta:set_string("owner", placer:get_player_name() or "") local colour = lockchest_list[i][2]
meta:set_string("infotext", "Locked Chest (owned by " ..
meta:get_string("owner") .. ")") minetest.register_node("summer:chest_lock" .. colour .. "", {
end, description = lockchestdesc .. "",
on_construct = function(pos) tiles = { "chest_top_" .. colour .. ".png", "chest_top_" .. colour .. ".png", "chest_side_" .. colour ..
local meta = minetest.get_meta(pos) ".png",
meta:set_string("infotext", "Locked Chest") "chest_side_" .. colour .. ".png", "chest_side_" .. colour .. ".png", "chest_lock_" .. colour .. ".png" },
meta:set_string("owner", "") --inventory_image = "chest_lock_"..colour.."_inv.png",
local inv = meta:get_inventory()
inv:set_size("main", 16 * 4) --wield_image = {"chest_lock_"..colour.."_inv.png",
end, -- },
can_dig = function(pos,player) paramtype2 = "facedir",
local meta = minetest.get_meta(pos); groups = { choppy = 2, oddly_breakable_by_hand = 2, tubedevice = 1, tubedevice_receiver = 1 },
local inv = meta:get_inventory() tube = {
return inv:is_empty("main") and has_locked_chest_privilege(meta, player) insert_object = function(pos, node, stack, direction)
end, local meta = minetest.get_meta(pos)
allow_metadata_inventory_move = function(pos, from_list, from_index, local inv = meta:get_inventory()
to_list, to_index, count, player) return inv:add_item("main", stack)
local meta = minetest.get_meta(pos) end,
if not has_locked_chest_privilege(meta, player) then can_insert = function(pos, node, stack, direction)
return 0 local meta = minetest.get_meta(pos)
end local inv = meta:get_inventory()
return count return inv:room_for_item("main", stack)
end, end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player) input_inventory = "main",
local meta = minetest.get_meta(pos) connect_sides = { left = 1, right = 1, back = 1, front = 1, bottom = 1, top = 1 }
if not has_locked_chest_privilege(meta, player) then },
return 0 legacy_facedir_simple = true,
end is_ground_content = false,
return stack:get_count() sounds = default.node_sound_wood_defaults(),
end,
allow_metadata_inventory_take = function(pos, listname, index, stack, player) after_place_node = function(pos, placer)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
if not has_locked_chest_privilege(meta, player) then meta:set_string("owner", placer:get_player_name() or "")
return 0 meta:set_string("infotext", "Locked Chest (owned by " ..
end meta:get_string("owner") .. ")")
return stack:get_count() end,
end, on_construct = function(pos)
on_metadata_inventory_put = function(pos, listname, index, stack, player) local meta = minetest.get_meta(pos)
minetest.log("action", player:get_player_name() .. meta:set_string("infotext", "Locked Chest")
" moves " .. stack:get_name() .. meta:set_string("owner", "")
" to locked chest at " .. minetest.pos_to_string(pos)) local inv = meta:get_inventory()
end, inv:set_size("main", 16 * 4)
on_metadata_inventory_take = function(pos, listname, index, stack, player) end,
minetest.log("action", player:get_player_name() .. can_dig = function(pos, player)
" takes " .. stack:get_name() .. local meta = minetest.get_meta(pos);
" from locked chest at " .. minetest.pos_to_string(pos)) local inv = meta:get_inventory()
end, return inv:is_empty("main") and has_locked_chest_privilege(meta, player)
on_rightclick = function(pos, node, clicker) end,
local meta = minetest.get_meta(pos) allow_metadata_inventory_move = function(pos, from_list, from_index,
if has_locked_chest_privilege(meta, clicker) then to_list, to_index, count, player)
minetest.show_formspec( local meta = minetest.get_meta(pos)
clicker:get_player_name(), if not has_locked_chest_privilege(meta, player) then
"summer:chest_lock"..colour.."", return 0
get_locked_chest_formspec(pos) end
) return count
end end,
end, allow_metadata_inventory_put = function(pos, listname, index, stack, player)
on_blast = function() end, local meta = minetest.get_meta(pos)
}) if not has_locked_chest_privilege(meta, player) then
end return 0
end
return stack:get_count()
end,
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
if not has_locked_chest_privilege(meta, player) then
return 0
end
return stack:get_count()
end,
on_metadata_inventory_put = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name() ..
" moves " .. stack:get_name() ..
" to locked chest at " .. minetest.pos_to_string(pos))
end,
on_metadata_inventory_take = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name() ..
" takes " .. stack:get_name() ..
" from locked chest at " .. minetest.pos_to_string(pos))
end,
on_rightclick = function(pos, node, clicker)
local meta = minetest.get_meta(pos)
if has_locked_chest_privilege(meta, clicker) then
minetest.show_formspec(
clicker:get_player_name(),
"summer:chest_lock" .. colour .. "",
get_locked_chest_formspec(pos)
)
end
end,
on_blast = function() end,
})
end
end end

285
craft.lua
View File

@ -1,88 +1,141 @@
if minetest.get_modpath("wool") and minetest.get_modpath("dye")then if minetest.get_modpath("wool") and minetest.get_modpath("dye") then
local lchest_list = { local lchest_list = {
{ "Red chest", "red"}, { "Red chest", "red" },
{ "Orange chest", "orange"}, { "Orange chest", "orange" },
{ "Black ", "black"}, { "Black ", "black" },
{ "Yellow chest", "yellow"}, { "Yellow chest", "yellow" },
{ "Green chest", "green"}, { "Green chest", "green" },
{ "Blue chest", "blue"}, { "Blue chest", "blue" },
{ "Violet chest", "violet"}, { "Violet chest", "violet" },
{"white chest", "white"} { "white chest", "white" }
} }
for i in ipairs(lchest_list) do for i in ipairs(lchest_list) do
local desc = lchest_list[i][1] local desc = lchest_list[i][1]
local colour = lchest_list[i][2] local colour = lchest_list[i][2]
--rake
minetest.register_craft({ --sdraia
minetest.register_craft({
output = "summer:sdraia_" .. colour .. "",
recipe = {
{ "default:stick", "wool:" .. colour, "", },
{ "default:paper", "default:paper", "default:paper", },
{ "default:stick", "", "default:stick", }
}
})
--portacenere
minetest.register_craft({
output = "summer:Portacenere_" .. colour .. "",
recipe = {
{ "group:wood", "", "group:wood" },
{ "default:stick", "default:paper", "default:stick" },
{ "default:paper", "wool:" .. colour, "default:paper" }
}
})
--porta
minetest.register_craft({
output = "summer:porta_" .. colour .. "_ch",
recipe = {
{ "group:wood", "wool:" .. colour, "", },
{ "wool:" .. colour, "group:wood", "", },
{ "group:wood", "group:wood", "", }
}
})
--occhiali
minetest.register_craft({
output = "summer:occhiali_" .. colour .. "",
recipe = {
{ "", "wool:" .. colour, "", },
{ "default:stick", "", "default:stick", },
{ "default:glass", "default:stick", "default:glass", }
}
})
--________________________________________________________
--asciugamano
--________________________________________________________
minetest.register_craft({
output = "summer:asciugamano_" .. colour .. "",
recipe = {
{ "", "", "", },
{ "wool:" .. colour, "", "", },
{ "default:ladder_wood", "default:ladder_wood", "default:ladder_wood", }
}
})
--________________________________________________________
--ombrellone
--________________________________________________________
minetest.register_craft({
output = "summer:ombrellone_" .. colour .. "",
recipe = {
{ "default:paper", "wool:" .. colour, "default:paper", },
{ "", "default:stick", "", },
{ "", "default:stick", "", }
}
})
minetest.register_craft({
output = "summer:ombrellone_n_" .. colour .. "",
recipe = {
{ "", "wool:" .. colour, "" },
{ "default:paper", "default:stick", "default:paper" },
{ "", "default:stick", "" }
}
})
--________________________________________________________
--chest
--________________________________________________________
minetest.register_craft({
output = "summer:chest" .. colour .. "",
recipe = {
{ "default:stone", "dye:" .. colour .. "", "default:stone" },
{ "group:wood", "", "group:wood" },
{ "group:wood", "group:wood", "group:wood" }
}
})
minetest.register_craft({
output = "summer:chest_lock" .. colour .. "",
recipe = {
{ "summer:chest" .. colour .. "", "default:diamond", "" }
--{"","",""},
--{"","",""}
}
})
end
--rake
minetest.register_craft({
output = "summer:rake", output = "summer:rake",
recipe = { recipe = {
{"default:stick", "default:steel_ingot", "default:stick", }, { "default:stick", "default:steel_ingot", "default:stick", },
{"", "default:stick", "", }, { "", "default:stick", "", },
{"", "default:gold_ingot", "", } { "", "default:gold_ingot", "", }
}
})
--sdraia
minetest.register_craft({
output = "summer:sdraia_"..colour.."",
recipe = {
{"default:stick", "wool:"..colour, "", },
{"default:paper", "default:paper", "default:paper", },
{"default:stick", "", "default:stick", }
} }
}) })
--portacenere --________________________________________________________
minetest.register_craft({ --breccia
output = "summer:Portacenere_"..colour.."", --________________________________________________________
recipe = {
{"group:wood", "", "group:wood" },
{"default:stick", "default:paper", "default:stick" },
{"default:paper", "wool:"..colour, "default:paper" }
}
})
--porta --craft BRECCIA BLOCK
minetest.register_craft({
output = "summer:porta_"..colour.."_ch",
recipe = {
{"group:wood", "wool:"..colour, "", },
{"wool:"..colour, "group:wood", "", },
{"group:wood", "group:wood", "", }
}
})
--occhiali
minetest.register_craft({
output = "summer:occhiali_"..colour.."",
recipe = {
{"", "wool:"..colour, "", },
{"default:stick", "", "default:stick", },
{"default:glass", "default:stick", "default:glass", }
}
})
--________________________________________________________
--asciugamano
--________________________________________________________
minetest.register_craft({
output = "summer:asciugamano_"..colour.."",
recipe = {
{"","","", },
{"wool:"..colour, "", "", },
{"default:ladder_wood", "default:ladder_wood", "default:ladder_wood", }
}
})
--________________________________________________________
--breccia
--________________________________________________________
--craft BRECCIA BLOCK
minetest.register_craft({ minetest.register_craft({
output = '"summer:breccia" 4', output = '"summer:breccia" 4',
recipe = { recipe = {
@ -93,7 +146,7 @@ minetest.register_craft({
}) })
minetest.register_craft({ minetest.register_craft({
output ='"summer:desert_breccia_2" 4', output = '"summer:desert_breccia_2" 4',
recipe = { recipe = {
{ "summer:desert_pietra", "summer:desert_pietra", "summer:desert_pietra" }, { "summer:desert_pietra", "summer:desert_pietra", "summer:desert_pietra" },
{ "summer:desert_pietra", "summer:desert_pietra", "summer:desert_pietra" }, { "summer:desert_pietra", "summer:desert_pietra", "summer:desert_pietra" },
@ -117,25 +170,25 @@ minetest.register_craft({
{ "summer:pietraP", "summer:pietraP", "summer:pietraP" }, { "summer:pietraP", "summer:pietraP", "summer:pietraP" },
{ "summer:pietraP", "summer:pietraP", "summer:pietraP" }, { "summer:pietraP", "summer:pietraP", "summer:pietraP" },
}, },
}) })
--____________________________________________________ --____________________________________________________
--granite --granite
--____________________________________________________ --____________________________________________________
--craft GRANITE --craft GRANITE
minetest.register_craft({ minetest.register_craft({
output = '"summer:graniteBC" 5', output = '"summer:graniteBC" 5',
recipe = { recipe = {
{ "", "", "" }, { "", "", "" },
{ "summer:pietraA", "", "" }, { "summer:pietraA", "", "" },
{ "summer:graniteB", "", "" }, { "summer:graniteB", "", "" },
}, },
}) })
minetest.register_craft({ minetest.register_craft({
output = '"summer:graniteB" 5', output = '"summer:graniteB" 5',
recipe = { recipe = {
{ "", "", "" }, { "", "", "" },
{ "summer:graniteP", "summer:graniteA", "" }, { "summer:graniteP", "summer:graniteA", "" },
{ "summer:graniteR", "summer:graniteG", "" }, { "summer:graniteR", "summer:graniteG", "" },
}, },
@ -148,7 +201,7 @@ minetest.register_craft({
{ "summer:mattoneR", "summer:mattoneR", "summer:mattoneR" }, { "summer:mattoneR", "summer:mattoneR", "summer:mattoneR" },
}, },
}) })
minetest.register_craft({ minetest.register_craft({
output = '"summer:graniteA" 5', output = '"summer:graniteA" 5',
recipe = { recipe = {
{ "summer:mattoneA", "summer:mattoneA", "summer:mattoneA" }, { "summer:mattoneA", "summer:mattoneA", "summer:mattoneA" },
@ -164,7 +217,7 @@ minetest.register_craft({
{ "summer:mattoneG", "summer:mattoneG", "summer:mattoneG" }, { "summer:mattoneG", "summer:mattoneG", "summer:mattoneG" },
}, },
}) })
minetest.register_craft({ minetest.register_craft({
output = '"summer:graniteP" 5', output = '"summer:graniteP" 5',
recipe = { recipe = {
{ "summer:mattoneP", "summer:mattoneP", "summer:mattoneP" }, { "summer:mattoneP", "summer:mattoneP", "summer:mattoneP" },
@ -172,61 +225,5 @@ minetest.register_craft({
{ "summer:mattoneP", "summer:mattoneP", "summer:mattoneP" }, { "summer:mattoneP", "summer:mattoneP", "summer:mattoneP" },
}, },
}) })
--________________________________________________________ --________________________________________________________
--________________________________________________________
--ombrellone
--________________________________________________________
minetest.register_craft({
output = "summer:ombrellone_"..colour.."",
recipe = {
{"default:paper", "wool:"..colour, "default:paper", },
{"", "default:stick", "", },
{"", "default:stick", "", }
}
})
minetest.register_craft({
output = "summer:ombrellone_n_"..colour.."",
recipe = {
{"", "wool:"..colour, "" },
{"default:paper", "default:stick", "default:paper" },
{"", "default:stick", "" }
}
})
--________________________________________________________
--chest
--________________________________________________________
minetest.register_craft({
output = "summer:chest"..colour.."",
recipe = {
{"default:stone","dye:"..colour.."","default:stone"},
{"group:wood","","group:wood"},
{"group:wood","group:wood","group:wood"}
}
})
minetest.register_craft({
output = "summer:chest_lock"..colour.."",
recipe = {
{"summer:chest"..colour.."","default:diamond",""}
--{"","",""},
--{"","",""}
}
})
end
end end

View File

@ -1,10 +1,10 @@
local granite = { local granite = {
{"granite", "Granite grey"}, { "granite", "Granite grey" },
{"graniteR", "Granite corten"}, { "graniteR", "Granite corten" },
{"graniteA", "Granite avory"}, { "graniteA", "Granite avory" },
{"graniteP", "Granite pink"}, { "graniteP", "Granite pink" },
{"graniteB", "Granite black"}, { "graniteB", "Granite black" },
{"graniteBC", "Granite black center"}, { "graniteBC", "Granite black center" },
} }
local stairs_mod = minetest.get_modpath("stairs") local stairs_mod = minetest.get_modpath("stairs")
@ -12,100 +12,100 @@ local stairsplus_mod = minetest.get_modpath("moreblocks")
and minetest.global_exists("stairsplus") and minetest.global_exists("stairsplus")
for _, granite in pairs(granite) do for _, granite in pairs(granite) do
if stairsplus_mod then if stairsplus_mod then
stairsplus:register_all("summer", granite[1], "summer:" .. granite[1], { stairsplus:register_all("summer", granite[1], "summer:" .. granite[1], {
description = granite[2] .. " Summer", description = granite[2] .. " Summer",
tiles = {granite[1] .. ".png"}, tiles = { granite[1] .. ".png" },
groups = {cracky = 3}, groups = { cracky = 3 },
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
stairsplus:register_alias_all("summer", granite[1], "summer", granite[1]) stairsplus:register_alias_all("summer", granite[1], "summer", granite[1])
minetest.register_alias("stairs:slab_summer_".. granite[1], "summer:slab_baked_granite_" .. granite[1]) minetest.register_alias("stairs:slab_summer_" .. granite[1], "summer:slab_baked_granite_" .. granite[1])
minetest.register_alias("stairs:stair_summer_".. granite[1], "summer:stair_baked_granite_" .. granite[1]) minetest.register_alias("stairs:stair_summer_" .. granite[1], "summer:stair_baked_granite_" .. granite[1])
-- register all stair types for stairs redo -- register all stair types for stairs redo
elseif stairs_mod and stairs.mod then elseif stairs_mod and stairs.mod then
stairs.register_all("summer_" .. granite[1], "summer:" .. granite[1], stairs.register_all("summer_" .. granite[1], "summer:" .. granite[1],
{cracky = 3}, { cracky = 3 },
{granite[1] .. ".png"}, { granite[1] .. ".png" },
granite[2] .. " Summer", granite[2] .. " Summer",
default.node_sound_stone_defaults()) default.node_sound_stone_defaults())
-- register stair and slab using default stairs -- register stair and slab using default stairs
elseif stairs_mod then elseif stairs_mod then
stairs.register_stair_and_slab("summer_" .. granite[1], "summer:" .. granite[1],
stairs.register_stair_and_slab("summer_".. granite[1], "summer:".. granite[1], { cracky = 3 },
{cracky = 3}, { granite[1] .. ".png" },
{granite[1] .. ".png"},
granite[2] .. " Summer Stair", granite[2] .. " Summer Stair",
granite[2] .. " Summer Slab", granite[2] .. " Summer Slab",
default.node_sound_stone_defaults()) default.node_sound_stone_defaults())
end end
end end
--GRANITE
--GRANITE
minetest.register_node("summer:granite", { minetest.register_node("summer:granite", {
description = "Granite", description = "Granite",
tiles = {"granite.png"}, tiles = { "granite.png" },
--material = minetest.digprop_constanttime(1), --material = minetest.digprop_constanttime(1),
groups = {cracky = 3, stone = 1}, groups = { cracky = 3, stone = 1 },
--drop ='"summer:mattoneG" 9', --drop ='"summer:mattoneG" 9',
stack_max = 9999, stack_max = 9999,
--legacy_mineral = true, --legacy_mineral = true,
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
minetest.register_node("summer:graniteA", { minetest.register_node("summer:graniteA", {
description = "GraniteA", description = "GraniteA",
tiles = {"graniteA.png"}, tiles = { "graniteA.png" },
--material = minetest.digprop_constanttime(1), --material = minetest.digprop_constanttime(1),
groups = {cracky = 3, stone = 1}, groups = { cracky = 3, stone = 1 },
--drop ='"summer:mattoneA" 9', --drop ='"summer:mattoneA" 9',
stack_max = 9999, stack_max = 9999,
--legacy_mineral = true, --legacy_mineral = true,
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
minetest.register_node("summer:graniteP", { minetest.register_node("summer:graniteP", {
description = "GraniteP", description = "GraniteP",
tiles = {"graniteP.png"}, tiles = { "graniteP.png" },
--material = minetest.digprop_constanttime(1), --material = minetest.digprop_constanttime(1),
groups = {cracky = 3, stone = 1}, groups = { cracky = 3, stone = 1 },
--drop ='"summer:mattoneP" 9', --drop ='"summer:mattoneP" 9',
stack_max = 9999, stack_max = 9999,
--legacy_mineral = true, --legacy_mineral = true,
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
minetest.register_node("summer:graniteR", { minetest.register_node("summer:graniteR", {
description = "GraniteR", description = "GraniteR",
tiles = {"graniteR.png"}, tiles = { "graniteR.png" },
--material = minetest.digprop_constanttime(1), --material = minetest.digprop_constanttime(1),
groups = {cracky = 3, stone = 1}, groups = { cracky = 3, stone = 1 },
--drop ='summer:mattoneR 9', --drop ='summer:mattoneR 9',
stack_max = 9999, stack_max = 9999,
--legacy_mineral = true, --legacy_mineral = true,
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
minetest.register_node("summer:graniteBC", { minetest.register_node("summer:graniteBC", {
description = "Granite", description = "Granite",
tiles = {"graniteBC.png"}, tiles = { "graniteBC.png" },
--material = minetest.digprop_constanttime(1), --material = minetest.digprop_constanttime(1),
groups = {cracky = 3, stone = 1}, groups = { cracky = 3, stone = 1 },
--drop ='"summer:mattoneG" 9',
stack_max = 9999,
--legacy_mineral = true,
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("summer:graniteB", {
description = "Granite",
tiles = {"graniteB.png"},
--material = minetest.digprop_constanttime(1),
groups = {cracky = 3, stone = 1},
--drop ='"summer:mattoneG" 9', --drop ='"summer:mattoneG" 9',
stack_max = 9999, stack_max = 9999,
--legacy_mineral = true, --legacy_mineral = true,
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
minetest.register_node("summer:graniteB", {
description = "Granite",
tiles = { "graniteB.png" },
--material = minetest.digprop_constanttime(1),
groups = { cracky = 3, stone = 1 },
--drop ='"summer:mattoneG" 9',
stack_max = 9999,
--legacy_mineral = true,
sounds = default.node_sound_stone_defaults(),
})

View File

@ -1,29 +1,29 @@
local path = minetest.get_modpath("summer") local path = minetest.get_modpath("summer")
dofile(path.."/salvag.lua") dofile(path .. "/salvag.lua")
dofile(path.."/ombrellone.lua") dofile(path .. "/ombrellone.lua")
dofile(path.."/sdraia.lua") dofile(path .. "/sdraia.lua")
dofile(path.."/porta.lua") dofile(path .. "/porta.lua")
dofile(path.."/ombrellone_new.lua") dofile(path .. "/ombrellone_new.lua")
dofile(path.."/materassino.lua") dofile(path .. "/materassino.lua")
dofile(path.."/breccia.lua") dofile(path .. "/breccia.lua")
dofile(path.."/asciugamano.lua") dofile(path .. "/asciugamano.lua")
if minetest.get_modpath("3d_armor") then if minetest.get_modpath("3d_armor") then
dofile(path.."/occhiali.lua") dofile(path .. "/occhiali.lua")
end end
dofile(path.."/chest.lua") dofile(path .. "/chest.lua")
dofile(path.."/portacenere.lua") dofile(path .. "/portacenere.lua")
dofile(path.."/summerstair.lua") dofile(path .. "/summerstair.lua")
dofile(path.."/barche.lua") dofile(path .. "/barche.lua")
dofile(path.."/granite.lua") dofile(path .. "/granite.lua")
dofile(path.."/canoa.lua") dofile(path .. "/canoa.lua")
dofile(path.."/craft.lua") dofile(path .. "/craft.lua")
dofile(path.."/vetro.lua") dofile(path .. "/vetro.lua")
dofile(path.."/aliases.lua") dofile(path .. "/aliases.lua")
dofile(path.."/sabbia.lua") dofile(path .. "/sabbia.lua")
dofile(path.."/mattone.lua") dofile(path .. "/mattone.lua")
--dofile(path.."/pietra.lua") dofile(path .. "/pietra.lua")
dofile(path.."/pallone.lua") dofile(path .. "/pallone.lua")
dofile(path.."/granite.lua") dofile(path .. "/granite.lua")
if minetest.get_modpath("cannabis") then if minetest.get_modpath("cannabis") then
dofile(path.."/canapa.lua") dofile(path .. "/canapa.lua")
end end

View File

@ -15,8 +15,8 @@ end
local function get_velocity(v, yaw, y) local function get_velocity(v, yaw, y)
local x = -math.sin(yaw) * v local x = -math.sin(yaw) * v
local z = math.cos(yaw) * v local z = math.cos(yaw) * v
return {x = x, y = y, z = z} return { x = x, y = y, z = z }
end end
@ -24,245 +24,236 @@ local function get_v(v)
return math.sqrt(v.x ^ 2 + v.z ^ 2) return math.sqrt(v.x ^ 2 + v.z ^ 2)
end end
local function reg_materassino(color) local function reg_materassino(color)
local materassino_item_name = "summer:materassino_" .. color .. "_item"
local materassino_ent_name = "summer:materassino_" .. color .. "_entity"
local materassino_item_name = "summer:materassino_"..color.."_item" --
local materassino_ent_name = "summer:materassino_"..color.."_entity" -- Boat entity
--
-- local materassino = {
-- Boat entity physical = true,
-- collisionbox = { -0.5, -0.35, -0.5, 0.5, 0.3, 0.5 },
visual = "mesh",
mesh = "materassino.obj",
textures = { "materassino_" .. color .. ".png" },
local materassino = { driver = nil,
physical = true, v = 0,
collisionbox = {-0.5, -0.35, -0.5, 0.5, 0.3, 0.5}, last_v = 0,
visual = "mesh", removed = false
mesh = "materassino.obj", }
textures = { "materassino_"..color..".png" },
driver = nil,
v = 0,
last_v = 0,
removed = false
}
function materassino.on_rightclick(self, clicker) function materassino.on_rightclick(self, clicker)
if not clicker or not clicker:is_player() then if not clicker or not clicker:is_player() then
return return
end end
local name = clicker:get_player_name() local name = clicker:get_player_name()
if self.driver and clicker == self.driver then if self.driver and clicker == self.driver then
self.driver = nil self.driver = nil
clicker:set_detach()
default.player_attached[name] = false
default.player_set_animation(clicker, "stand" , 30)
local pos = clicker:getpos()
pos = {x = pos.x, y = pos.y + 0.2, z = pos.z}
minetest.after(0.1, function()
clicker:setpos(pos)
end)
elseif not self.driver then
local attach = clicker:get_attach()
if attach and attach:get_luaentity() then
local luaentity = attach:get_luaentity()
if luaentity.driver then
luaentity.driver = nil
end
clicker:set_detach() clicker:set_detach()
default.player_attached[name] = false
default.player_set_animation(clicker, "stand", 30)
local pos = clicker:getpos()
pos = { x = pos.x, y = pos.y + 0.2, z = pos.z }
minetest.after(0.1, function()
clicker:setpos(pos)
end)
elseif not self.driver then
local attach = clicker:get_attach()
if attach and attach:get_luaentity() then
local luaentity = attach:get_luaentity()
if luaentity.driver then
luaentity.driver = nil
end
clicker:set_detach()
end
self.driver = clicker
clicker:set_attach(self.object, "",
{ x = 0, y = 11, z = -3 }, { x = 0, y = 0, z = 0 })
default.player_attached[name] = true
minetest.after(0.2, function()
default.player_set_animation(clicker, "lay", 30)
end)
self.object:setyaw(clicker:get_look_yaw() - math.pi / 2)
end end
self.driver = clicker
clicker:set_attach(self.object, "",
{x = 0, y = 11, z = -3}, {x = 0, y = 0, z = 0})
default.player_attached[name] = true
minetest.after(0.2, function()
default.player_set_animation(clicker, "lay" , 30)
end)
self.object:setyaw(clicker:get_look_yaw() - math.pi / 2)
end end
end
function materassino.on_activate(self, staticdata, dtime_s)
function materassino.on_activate(self, staticdata, dtime_s) self.object:set_armor_groups({ immortal = 1 })
self.object:set_armor_groups({immortal = 1}) if staticdata then
if staticdata then self.v = tonumber(staticdata)
self.v = tonumber(staticdata) end
self.last_v = self.v
end end
self.last_v = self.v
end
function materassino.get_staticdata(self)
function materassino.get_staticdata(self) return tostring(self.v)
return tostring(self.v)
end
function materassino.on_punch(self, puncher)
if not puncher or not puncher:is_player() or self.removed then
return
end end
if self.driver and puncher == self.driver then
self.driver = nil function materassino.on_punch(self, puncher)
puncher:set_detach() if not puncher or not puncher:is_player() or self.removed then
default.player_attached[puncher:get_player_name()] = false return
end end
if not self.driver then if self.driver and puncher == self.driver then
self.removed = true self.driver = nil
-- delay remove to ensure player is detached puncher:set_detach()
minetest.after(0.1, function() default.player_attached[puncher:get_player_name()] = false
self.object:remove() end
end) if not self.driver then
if not minetest.setting_getbool("creative_mode") then self.removed = true
local inv = puncher:get_inventory() -- delay remove to ensure player is detached
if inv:room_for_item("main", "summer:materassino_"..color.."_item") then minetest.after(0.1, function()
inv:add_item("main", "summer:materassino_"..color.."_item") self.object:remove()
else end)
minetest.add_item(self.object:getpos(), materassino_item_name) if not minetest.setting_getbool("creative_mode") then
local inv = puncher:get_inventory()
if inv:room_for_item("main", "summer:materassino_" .. color .. "_item") then
inv:add_item("main", "summer:materassino_" .. color .. "_item")
else
minetest.add_item(self.object:getpos(), materassino_item_name)
end
end end
end end
end end
end
function materassino.on_step(self, dtime)
function materassino.on_step(self, dtime) self.v = get_v(self.object:getvelocity()) * get_sign(self.v)
self.v = get_v(self.object:getvelocity()) * get_sign(self.v) if self.driver then
if self.driver then local ctrl = self.driver:get_player_control()
local ctrl = self.driver:get_player_control() local yaw = self.object:getyaw()
local yaw = self.object:getyaw() if ctrl.up then
if ctrl.up then self.v = self.v + 0.1
self.v = self.v + 0.1 elseif ctrl.down then
elseif ctrl.down then self.v = self.v - 0.1
self.v = self.v - 0.1
end
if ctrl.left then
if self.v < 0 then
self.object:setyaw(yaw - (1 + dtime) * 0.03)
else
self.object:setyaw(yaw + (1 + dtime) * 0.03)
end end
elseif ctrl.right then if ctrl.left then
if self.v < 0 then if self.v < 0 then
self.object:setyaw(yaw + (1 + dtime) * 0.03) self.object:setyaw(yaw - (1 + dtime) * 0.03)
else else
self.object:setyaw(yaw - (1 + dtime) * 0.03) self.object:setyaw(yaw + (1 + dtime) * 0.03)
end
elseif ctrl.right then
if self.v < 0 then
self.object:setyaw(yaw + (1 + dtime) * 0.03)
else
self.object:setyaw(yaw - (1 + dtime) * 0.03)
end
end end
end end
end local velo = self.object:getvelocity()
local velo = self.object:getvelocity() if self.v == 0 and velo.x == 0 and velo.y == 0 and velo.z == 0 then
if self.v == 0 and velo.x == 0 and velo.y == 0 and velo.z == 0 then self.object:setpos(self.object:getpos())
self.object:setpos(self.object:getpos()) return
return end
end local s = get_sign(self.v)
local s = get_sign(self.v) self.v = self.v - 0.02 * s
self.v = self.v - 0.02 * s if s ~= get_sign(self.v) then
if s ~= get_sign(self.v) then self.object:setvelocity({ x = 0, y = 0, z = 0 })
self.object:setvelocity({x = 0, y = 0, z = 0})
self.v = 0
return
end
if math.abs(self.v) > 5 then
self.v = 5 * get_sign(self.v)
end
local p = self.object:getpos()
p.y = p.y - 0.5
local new_velo = {x = 0, y = 0, z = 0}
local new_acce = {x = 0, y = 0, z = 0}
if not is_water(p) then
local nodedef = minetest.registered_nodes[minetest.get_node(p).name]
if (not nodedef) or nodedef.walkable then
self.v = 0 self.v = 0
new_acce = {x = 0, y = 1, z = 0} return
else
new_acce = {x = 0, y = -9.8, z = 0}
end end
new_velo = get_velocity(self.v, self.object:getyaw(), if math.abs(self.v) > 5 then
self.object:getvelocity().y) self.v = 5 * get_sign(self.v)
self.object:setpos(self.object:getpos()) end
else
p.y = p.y + 1 local p = self.object:getpos()
if is_water(p) then p.y = p.y - 0.5
local y = self.object:getvelocity().y local new_velo = { x = 0, y = 0, z = 0 }
if y >= 5 then local new_acce = { x = 0, y = 0, z = 0 }
y = 5 if not is_water(p) then
elseif y < 0 then local nodedef = minetest.registered_nodes[minetest.get_node(p).name]
new_acce = {x = 0, y = 20, z = 0} if (not nodedef) or nodedef.walkable then
self.v = 0
new_acce = { x = 0, y = 1, z = 0 }
else else
new_acce = {x = 0, y = 5, z = 0} new_acce = { x = 0, y = -9.8, z = 0 }
end end
new_velo = get_velocity(self.v, self.object:getyaw(), y) new_velo = get_velocity(self.v, self.object:getyaw(),
self.object:getvelocity().y)
self.object:setpos(self.object:getpos()) self.object:setpos(self.object:getpos())
else else
new_acce = {x = 0, y = 0, z = 0} p.y = p.y + 1
if math.abs(self.object:getvelocity().y) < 1 then if is_water(p) then
local pos = self.object:getpos() local y = self.object:getvelocity().y
pos.y = math.floor(pos.y) + 0.5 if y >= 5 then
self.object:setpos(pos) y = 5
new_velo = get_velocity(self.v, self.object:getyaw(), 0) elseif y < 0 then
else new_acce = { x = 0, y = 20, z = 0 }
new_velo = get_velocity(self.v, self.object:getyaw(), else
self.object:getvelocity().y) new_acce = { x = 0, y = 5, z = 0 }
end
new_velo = get_velocity(self.v, self.object:getyaw(), y)
self.object:setpos(self.object:getpos()) self.object:setpos(self.object:getpos())
else
new_acce = { x = 0, y = 0, z = 0 }
if math.abs(self.object:getvelocity().y) < 1 then
local pos = self.object:getpos()
pos.y = math.floor(pos.y) + 0.5
self.object:setpos(pos)
new_velo = get_velocity(self.v, self.object:getyaw(), 0)
else
new_velo = get_velocity(self.v, self.object:getyaw(),
self.object:getvelocity().y)
self.object:setpos(self.object:getpos())
end
end end
end end
self.object:setvelocity(new_velo)
self.object:setacceleration(new_acce)
end end
self.object:setvelocity(new_velo)
self.object:setacceleration(new_acce) minetest.register_entity("summer:materassino_" .. color .. "", materassino)
end
minetest.register_entity("summer:materassino_"..color.."", materassino) minetest.register_craftitem(materassino_item_name, {
description = "materassino (" .. color .. ")",
inventory_image = "materassino_" .. color .. "_inv.png",
wield_image = "materassino_" .. color .. "_inv.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.add_entity(pointed_thing.under, "summer:materassino_" .. color .. "")
if not minetest.setting_getbool("creative_mode") then
itemstack:take_item()
end
return itemstack
end,
})
minetest.register_craftitem(materassino_item_name, { if minetest.get_modpath("cannabis") then
description = "materassino ("..color..")", minetest.register_craft({
inventory_image = "materassino_"..color.."_inv.png", output = materassino_item_name,
wield_image = "materassino_"..color.."_inv.png", recipe = {
wield_scale = {x = 2, y = 2, z = 1}, { "", "", "" },
liquids_pointable = true, { "", "wool:" .. color, "" },
{ "cannabis:canapa_plastic", "cannabis:canapa_plastic", "cannabis:canapa_plastic" },
on_place = function(itemstack, placer, pointed_thing) },
if pointed_thing.type ~= "node" then })
return end
end minetest.register_craft({
if not is_water(pointed_thing.under) then output = materassino_item_name,
return recipe = {
end { "", "", "" },
pointed_thing.under.y = pointed_thing.under.y + 0.5 { "", "wool:" .. color, "" },
minetest.add_entity(pointed_thing.under, "summer:materassino_"..color.."") { "wool:" .. color, "wool:" .. color, "wool:" .. color },
if not minetest.setting_getbool("creative_mode") then },
itemstack:take_item() })
end
return itemstack
end,
})
if minetest.get_modpath("cannabis") then
minetest.register_craft({
output = materassino_item_name,
recipe = {
{"", "" ,""},
{"", "wool:"..color, ""},
{"cannabis:canapa_plastic", "cannabis:canapa_plastic", "cannabis:canapa_plastic"},
},
})
end
minetest.register_craft({
output = materassino_item_name,
recipe = {
{"", "" ,""},
{"", "wool:"..color, ""},
{"wool:"..color, "wool:"..color, "wool:"..color},
},
})
end end
colors = { colors = {
"black", "red", "green", "blue", "yellow", "violet","orange", "black", "red", "green", "blue", "yellow", "violet", "orange",
} }
for _,color in ipairs(colors) do for _, color in ipairs(colors) do
reg_materassino(color) reg_materassino(color)
end end

View File

@ -1,43 +1,45 @@
minetest.register_craftitem("summer:mattoneG", { minetest.register_craftitem("summer:mattoneG", {
description = "Mattone", description = "Mattone",
inventory_image = "mattone.png", inventory_image = "mattone.png",
}) })
minetest.register_craftitem("summer:mattoneR", {
minetest.register_craftitem("summer:mattoneR", {
description = "MattoneR", description = "MattoneR",
inventory_image = "mattoneR.png", inventory_image = "mattoneR.png",
}) })
minetest.register_craftitem("summer:mattoneA", { minetest.register_craftitem("summer:mattoneA", {
description = "MattoneA", description = "MattoneA",
inventory_image = "mattoneA.png", inventory_image = "mattoneA.png",
})
})
minetest.register_craftitem("summer:mattoneP", { minetest.register_craftitem("summer:mattoneP", {
description = "MattoneP", description = "MattoneP",
inventory_image = "mattoneP.png", inventory_image = "mattoneP.png",
})
})
--craftMATTONE
--craftMATTONE
minetest.register_craft({ minetest.register_craft({
type = 'cooking', type = 'cooking',
recipe = "summer:pietraA", recipe = "summer:pietraA",
cooktime = 2, cooktime = 2,
output = "summer:mattoneA", output = "summer:mattoneA",
}) })
minetest.register_craft({ minetest.register_craft({
type = 'cooking', type = 'cooking',
recipe = "summer:pietra", recipe = "summer:pietra",
cooktime = 2, cooktime = 2,
output = "summer:mattoneG", output = "summer:mattoneG",
}) })
minetest.register_craft({ minetest.register_craft({
type = 'cooking', type = 'cooking',
recipe = "summer:desert_pietra", recipe = "summer:desert_pietra",
cooktime = 2, cooktime = 2,
output = "summer:mattoneR", output = "summer:mattoneR",
}) })
minetest.register_craft({ minetest.register_craft({
type = 'cooking', type = 'cooking',
recipe = "summer:pietraP", recipe = "summer:pietraP",

View File

@ -1,40 +1,37 @@
local Occhiali_list = { local Occhiali_list = {
{ "Red Occhiali", "red"}, { "Red Occhiali", "red" },
{ "Orange Occhiali", "orange"}, { "Orange Occhiali", "orange" },
{ "Black Occhiali", "black"}, { "Black Occhiali", "black" },
{ "Yellow Occhiali", "yellow"}, { "Yellow Occhiali", "yellow" },
{ "Green Occhiali", "green"}, { "Green Occhiali", "green" },
{ "Blue Occhiali", "blue"}, { "Blue Occhiali", "blue" },
{ "Jam Occhiali", "jam"}, { "Jam Occhiali", "jam" },
{ "Violet Occhiali", "violet"}, { "Violet Occhiali", "violet" },
} }
for i in ipairs(Occhiali_list) do for i in ipairs(Occhiali_list) do
local Occhialidesc = Occhiali_list[i][1] local Occhialidesc = Occhiali_list[i][1]
local colour = Occhiali_list[i][2] local colour = Occhiali_list[i][2]
minetest.register_alias("occhiali"..colour.."","summer:occhiali"..colour.."") minetest.register_alias("occhiali" .. colour .. "", "summer:occhiali" .. colour .. "")
if minetest.get_modpath("summer") then if minetest.get_modpath("summer") then
local stats = { local stats = {
Occhialidesc = { name=Occhialidesc, armor=1.8, heal=0, use=650 }, Occhialidesc = { name = Occhialidesc, armor = 1.8, heal = 0, use = 650 },
} }
--[[local mats = { --[[local mats = {
fibra="cannabis:fibra_ingot", fibra="cannabis:fibra_ingot",
tessuto="cannabis:tessuto_ingot", tessuto="cannabis:tessuto_ingot",
foglie="cannabis:foglie_ingot", foglie="cannabis:foglie_ingot",
high="cannabis:high_performance_ingot", high="cannabis:high_performance_ingot",
}]] }]]
for k, v in pairs(stats) do for k, v in pairs(stats) do
minetest.register_tool("summer:occhiali_"..colour.."", { minetest.register_tool("summer:occhiali_" .. colour .. "", {
description = Occhialidesc, description = Occhialidesc,
tiles= "occhiali_"..colour..".png", tiles = "occhiali_" .. colour .. ".png",
inventory_image = "occhiali_"..colour.."_inv.png", inventory_image = "occhiali_" .. colour .. "_inv.png",
groups = {armor_head=math.floor(5*v.armor), armor_heal=v.heal, armor_use=v.use}, groups = { armor_head = math.floor(5 * v.armor), armor_heal = v.heal, armor_use = v.use },
wear = 0, wear = 0,
}) })
end
end end
end
end end

View File

@ -1,70 +1,68 @@
local Ombrellone_list = { local Ombrellone_list = {
{ "Red Ombrellone", "red"}, { "Red Ombrellone", "red" },
{ "White Ombrellone", "white"}, { "White Ombrellone", "white" },
{ "Orange Ombrellone", "orange"}, { "Orange Ombrellone", "orange" },
{ "Black Ombrellone", "black"}, { "Black Ombrellone", "black" },
{ "Yellow Ombrellone", "yellow"}, { "Yellow Ombrellone", "yellow" },
{ "Green Ombrellone", "green"}, { "Green Ombrellone", "green" },
{ "Blue Ombrellone", "blue"}, { "Blue Ombrellone", "blue" },
{ "Violet Ombrellone", "violet"}, { "Violet Ombrellone", "violet" },
} }
for i in ipairs(Ombrellone_list) do for i in ipairs(Ombrellone_list) do
local ombrellonedesc = Ombrellone_list[i][1] local ombrellonedesc = Ombrellone_list[i][1]
local colour = Ombrellone_list[i][2] local colour = Ombrellone_list[i][2]
minetest.register_node("summer:ombrellone_"..colour.."", { minetest.register_node("summer:ombrellone_" .. colour .. "", {
description = ombrellonedesc.."", description = ombrellonedesc .. "",
drawtype = "mesh", drawtype = "mesh",
mesh = "omb_o.obj", mesh = "omb_o.obj",
tiles = {"ball_"..colour..".png", tiles = { "ball_" .. colour .. ".png",
}, },
inventory_image = "ombo_"..colour.."_q.png", inventory_image = "ombo_" .. colour .. "_q.png",
wield_image = "ombo_"..colour.."_q.png", wield_image = "ombo_" .. colour .. "_q.png",
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
sunlight_propagates = true, sunlight_propagates = true,
walkable = false, walkable = false,
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = { -0.25, -0.5, -0.25, 0.25,0.5, 0.25 }, fixed = { -0.25, -0.5, -0.25, 0.25, 0.5, 0.25 },
}, },
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3, not_in_creative_inventory=0}, groups = { snappy = 2, cracky = 3, oddly_breakable_by_hand = 3, not_in_creative_inventory = 0 },
--sounds = default.node_sound_glass_defaults(), --sounds = default.node_sound_glass_defaults(),
drop = "summer:ombrellone_"..colour.."_ch", drop = "summer:ombrellone_" .. colour .. "_ch",
on_rightclick = function(pos, node, clicker) on_rightclick = function(pos, node, clicker)
node.name = "summer:ombrellone_"..colour.."_ch" node.name = "summer:ombrellone_" .. colour .. "_ch"
minetest.set_node(pos, node) minetest.set_node(pos, node)
end, end,
}) })
minetest.register_node("summer:ombrellone_"..colour.."_ch", { minetest.register_node("summer:ombrellone_" .. colour .. "_ch", {
description = ombrellonedesc.." ch", description = ombrellonedesc .. " ch",
drawtype = "mesh", drawtype = "mesh",
mesh = "omb_c.obj", mesh = "omb_c.obj",
tiles = {"ball_"..colour..".png", tiles = { "ball_" .. colour .. ".png",
}, },
inventory_image = "ombc_"..colour.."_q.png", inventory_image = "ombc_" .. colour .. "_q.png",
wield_image = "ombc_"..colour.."_q.png", wield_image = "ombc_" .. colour .. "_q.png",
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
sunlight_propagates = true, sunlight_propagates = true,
walkable = false, walkable = false,
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = { -0.25, -0.5, -0.25, 0.25,0.5, 0.25 }, fixed = { -0.25, -0.5, -0.25, 0.25, 0.5, 0.25 },
}, },
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3, not_in_creative_inventory=0}, groups = { snappy = 2, cracky = 3, oddly_breakable_by_hand = 3, not_in_creative_inventory = 0 },
--sounds = default.node_sound_glass_defaults(), --sounds = default.node_sound_glass_defaults(),
drop = "summer:ombrellone_"..colour, drop = "summer:ombrellone_" .. colour,
on_rightclick = function(pos, node, clicker) on_rightclick = function(pos, node, clicker)
node.name = "summer:ombrellone_"..colour.."" node.name = "summer:ombrellone_" .. colour .. ""
minetest.set_node(pos, node) minetest.set_node(pos, node)
end, end,
}) })
end end

View File

@ -1,69 +1,68 @@
local Ombrellone_n_list = { local Ombrellone_n_list = {
{ "Red Ombrellone_n", "red"}, { "Red Ombrellone_n", "red" },
{ "Orange Ombrellone_n", "orange"}, { "Orange Ombrellone_n", "orange" },
{ "Black Ombrellone_n", "black"}, { "Black Ombrellone_n", "black" },
{ "Yellow Ombrellone_n", "yellow"}, { "Yellow Ombrellone_n", "yellow" },
{ "Green Ombrellone_n", "green"}, { "Green Ombrellone_n", "green" },
{ "Blue Ombrellone_n", "blue"}, { "Blue Ombrellone_n", "blue" },
{ "Violet Ombrellone_n", "violet"}, { "Violet Ombrellone_n", "violet" },
{ "White Ombrellone_n", "white"}, { "White Ombrellone_n", "white" },
} }
for i in ipairs(Ombrellone_n_list) do for i in ipairs(Ombrellone_n_list) do
local Ombrellone_ndesc = Ombrellone_n_list[i][1] local Ombrellone_ndesc = Ombrellone_n_list[i][1]
local colour = Ombrellone_n_list[i][2] local colour = Ombrellone_n_list[i][2]
minetest.register_node("summer:ombrellone_n_"..colour.."", { minetest.register_node("summer:ombrellone_n_" .. colour .. "", {
description = Ombrellone_ndesc.."", description = Ombrellone_ndesc .. "",
drawtype = "mesh", drawtype = "mesh",
mesh = "omb_n_o.obj", mesh = "omb_n_o.obj",
tiles = {"Ombrellone_n_"..colour..".png", tiles = { "Ombrellone_n_" .. colour .. ".png",
}, },
inventory_image = "ombo_"..colour.."_r.png", inventory_image = "ombo_" .. colour .. "_r.png",
wield_image = "ombo_"..colour.."_r.png" , wield_image = "ombo_" .. colour .. "_r.png",
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
sunlight_propagates = true, sunlight_propagates = true,
walkable = false, walkable = false,
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = { -0.25, -0.5, -0.25, 0.25,0.5, 0.25 }, fixed = { -0.25, -0.5, -0.25, 0.25, 0.5, 0.25 },
}, },
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory = 0}, groups = { snappy = 2, cracky = 3, oddly_breakable_by_hand = 3, not_in_creative_inventory = 0 },
--sounds = default.node_sound_glass_defaults(), --sounds = default.node_sound_glass_defaults(),
drop = "summer:ombrellone_n_"..colour.."_ch", drop = "summer:ombrellone_n_" .. colour .. "_ch",
on_rightclick = function(pos, node, clicker) on_rightclick = function(pos, node, clicker)
node.name = "summer:Ombrellone_n_"..colour.."_ch" node.name = "summer:Ombrellone_n_" .. colour .. "_ch"
minetest.set_node(pos, node) minetest.set_node(pos, node)
end, end,
}) })
minetest.register_node("summer:ombrellone_n_"..colour.."_ch", { minetest.register_node("summer:ombrellone_n_" .. colour .. "_ch", {
description = Ombrellone_ndesc.." ch", description = Ombrellone_ndesc .. " ch",
drawtype = "mesh", drawtype = "mesh",
mesh = "omb_n_c.obj", mesh = "omb_n_c.obj",
tiles = {"Ombrellone_n_"..colour..".png", tiles = { "Ombrellone_n_" .. colour .. ".png",
}, },
inventory_image = "ombc_"..colour.."_r.png", inventory_image = "ombc_" .. colour .. "_r.png",
wield_image = "ombc_"..colour.."_r.png", wield_image = "ombc_" .. colour .. "_r.png",
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
sunlight_propagates = true, sunlight_propagates = true,
walkable = false, walkable = false,
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = { -0.25, -0.5, -0.25, 0.25,0.5, 0.25 }, fixed = { -0.25, -0.5, -0.25, 0.25, 0.5, 0.25 },
}, },
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3, not_in_creative_inventory=0}, groups = { snappy = 2, cracky = 3, oddly_breakable_by_hand = 3, not_in_creative_inventory = 0 },
--sounds = default.node_sound_glass_defaults(), --sounds = default.node_sound_glass_defaults(),
drop = "summer:ombrellone_n_"..colour, drop = "summer:ombrellone_n_" .. colour,
on_rightclick = function(pos, node, clicker) on_rightclick = function(pos, node, clicker)
node.name = "summer:Ombrellone_n_"..colour.."" node.name = "summer:Ombrellone_n_" .. colour .. ""
minetest.set_node(pos, node) minetest.set_node(pos, node)
end, end,
}) })
end end

View File

@ -2,18 +2,17 @@
local CALCIO = 0.1 local CALCIO = 0.1
local function reg_ball(color) local function reg_ball(color)
local ball_item_name = "summer:ball_" .. color .. "_item"
local ball_item_name = "summer:ball_"..color.."_item" local ball_ent_name = "summer:ball_" .. color .. "_entity"
local ball_ent_name = "summer:ball_"..color.."_entity"
minetest.register_entity(ball_ent_name, { minetest.register_entity(ball_ent_name, {
physical = true, physical = true,
visual = "mesh", visual = "mesh",
mesh = "ball.obj", mesh = "ball.obj",
hp_max = 1000, hp_max = 1000,
liquids_pointable = true, liquids_pointable = true,
groups = { immortal = true }, groups = { immortal = true },
textures = { "ball_"..color..".png" }, textures = { "ball_" .. color .. ".png" },
collisionbox = { -0.2, -0.2, -0.2, 0.2, 0.2, 0.2 }, --{ -1, -1, -1, 1, 1, 1 }, collisionbox = { -0.2, -0.2, -0.2, 0.2, 0.2, 0.2 }, --{ -1, -1, -1, 1, 1, 1 },
timer = 0, timer = 0,
@ -21,7 +20,7 @@ local function reg_ball(color)
on_step = function(self, dtime) on_step = function(self, dtime)
self.timer = self.timer + dtime self.timer = self.timer + dtime
if self.timer >= CALCIO then if self.timer >= CALCIO then
self.object:setacceleration({x=0, y=-10, z=0}) self.object:setacceleration({ x = 0, y = -10, z = 0 })
self.timer = 0 self.timer = 0
local vel = self.object:getvelocity() local vel = self.object:getvelocity()
local p = self.object:getpos(); local p = self.object:getpos();
@ -31,8 +30,8 @@ local function reg_ball(color)
if vel.y < 0 then vel.y = vel.y * -0.65 end if vel.y < 0 then vel.y = vel.y * -0.65 end
vel.z = vel.z * 0.90 vel.z = vel.z * 0.90
end end
if (math.abs(vel.x) < 0.1) if (math.abs(vel.x) < 0.1)
and (math.abs(vel.z) < 0.1) then and (math.abs(vel.z) < 0.1) then
vel.x = 0 vel.x = 0
vel.z = 0 vel.z = 0
end end
@ -40,8 +39,8 @@ local function reg_ball(color)
local pos = self.object:getpos() local pos = self.object:getpos()
local objs = minetest.env:get_objects_inside_radius(pos, 1) local objs = minetest.env:get_objects_inside_radius(pos, 1)
local player_count = 0 local player_count = 0
local final_dir = { x=0, y=0, z=0 } local final_dir = { x = 0, y = 0, z = 0 }
for _,obj in ipairs(objs) do for _, obj in ipairs(objs) do
if obj:is_player() then if obj:is_player() then
local objdir = obj:get_look_dir() local objdir = obj:get_look_dir()
local mul = 1 local mul = 1
@ -73,8 +72,8 @@ local function reg_ball(color)
is_moving = function(self) is_moving = function(self)
local v = self.object:getvelocity() local v = self.object:getvelocity()
if (math.abs(v.x) <= 0.1) if (math.abs(v.x) <= 0.1)
and (math.abs(v.z) <= 0.1) then and (math.abs(v.z) <= 0.1) then
v.x = 0 v.x = 0
v.z = 0 v.z = 0
self.object:setvelocity(v) self.object:setvelocity(v)
@ -84,48 +83,47 @@ local function reg_ball(color)
end, end,
}) })
minetest.register_craftitem(ball_item_name,{ minetest.register_craftitem(ball_item_name, {
description = "Summer Ball ("..color..")", description = "Summer Ball (" .. color .. ")",
inventory_image = "summer_ball_"..color.."_inv.png", inventory_image = "summer_ball_" .. color .. "_inv.png",
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
local pos = pointed_thing.above local pos = pointed_thing.above
--pos = { x=pos.x+0.5, y=pos.y, z=pos.z+0.5 } --pos = { x=pos.x+0.5, y=pos.y, z=pos.z+0.5 }
local ent = minetest.env:add_entity(pos, ball_ent_name) local ent = minetest.env:add_entity(pos, ball_ent_name)
ent:setvelocity({x=0, y=-15, z=0}) ent:setvelocity({ x = 0, y = -15, z = 0 })
itemstack:take_item() itemstack:take_item()
return itemstack return itemstack
end, end,
}) })
minetest.register_craft({
output = ball_item_name,
recipe = {
{ "default:paper", "group:leaves", "default:paper" },
{ "group:leaves", "wool:"..color, "group:leaves" },
{ "default:paper", "group:leaves", "default:paper" },
},
})
if minetest.get_modpath("cannabis") then
minetest.register_craft({ minetest.register_craft({
output = ball_item_name, output = ball_item_name,
recipe = { recipe = {
{ "", "cannabis:canapa_plastic", "" }, { "default:paper", "group:leaves", "default:paper" },
{ "cannabis:canapa_plastic", "wool:"..color, "cannabis:canapa_plastic" }, { "group:leaves", "wool:" .. color, "group:leaves" },
{ "", "cannabis:canapa_plastic", "" }, { "default:paper", "group:leaves", "default:paper" },
}, },
}) })
end
if minetest.get_modpath("cannabis") then
minetest.register_craft({
output = ball_item_name,
recipe = {
{ "", "cannabis:canapa_plastic", "" },
{ "cannabis:canapa_plastic", "wool:" .. color, "cannabis:canapa_plastic" },
{ "", "cannabis:canapa_plastic", "" },
},
})
end
end end
colors = { colors = {
"black", "red", "green", "blue", "yellow", "violet","orange" "black", "red", "green", "blue", "yellow", "violet", "orange"
} }
for _,color in ipairs(colors) do for _, color in ipairs(colors) do
reg_ball(color) reg_ball(color)
end end

View File

@ -1,94 +1,94 @@
--ROCCIA --ROCCIA
minetest.register_alias("desert_roccia_1","desert_roccia") minetest.register_alias("desert_roccia_1", "desert_roccia")
minetest.register_alias("roccia_1","roccia") minetest.register_alias("roccia_1", "roccia")
minetest.register_node("summer:roccia_1", { minetest.register_node("summer:roccia_1", {
description = "Roccia", description = "Roccia",
drawtype = "mesh", drawtype = "mesh",
mesh = "roccia.obj", mesh = "roccia.obj",
tiles = {"roccia.png"}, tiles = { "roccia.png" },
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
sunlight_propagates = true, sunlight_propagates = true,
walkable = true, walkable = true,
groups = {cracky = 3, stone = 1}, groups = { cracky = 3, stone = 1 },
drop = '"summer:pietra" 5', drop = '"summer:pietra" 5',
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = { -0.5, -0.5,-0.5, 0.5,0.1, 0.5 }, fixed = { -0.5, -0.5, -0.5, 0.5, 0.1, 0.5 },
}, },
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
-- place a random pebble node -- place a random pebble node
local stack = ItemStack("summer:roccia_"..math.random(1,2)) local stack = ItemStack("summer:roccia_" .. math.random(1, 2))
local ret = minetest.item_place(stack, placer, pointed_thing) local ret = minetest.item_place(stack, placer, pointed_thing)
return ItemStack("summer:roccia_1 "..itemstack:get_count()-(1-ret:get_count())) return ItemStack("summer:roccia_1 " .. itemstack:get_count() - (1 - ret:get_count()))
end,--legacy_mineral = true, end, --legacy_mineral = true,
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
minetest.register_node("summer:desert_roccia_1", { minetest.register_node("summer:desert_roccia_1", {
description = "Desert Roccia", description = "Desert Roccia",
drawtype = "mesh", drawtype = "mesh",
mesh = "desert_roccia.obj", mesh = "desert_roccia.obj",
tiles = {"desert_roccia.png"}, tiles = { "desert_roccia.png" },
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
sunlight_propagates = true, sunlight_propagates = true,
walkable = true, walkable = true,
groups = {cracky = 3, stone = 1}, groups = { cracky = 3, stone = 1 },
drop = '"summer:desert_pietra" 5', drop = '"summer:desert_pietra" 5',
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = { -0.5, -0.5,-0.5, 0.5,0.1, 0.5 }, fixed = { -0.5, -0.5, -0.5, 0.5, 0.1, 0.5 },
}, },
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
-- place a random pebble node -- place a random pebble node
local stack = ItemStack("summer:desert_roccia_"..math.random(1,2)) local stack = ItemStack("summer:desert_roccia_" .. math.random(1, 2))
local ret = minetest.item_place(stack, placer, pointed_thing) local ret = minetest.item_place(stack, placer, pointed_thing)
return ItemStack("summer:desert_roccia_1 "..itemstack:get_count()-(1-ret:get_count())) return ItemStack("summer:desert_roccia_1 " .. itemstack:get_count() - (1 - ret:get_count()))
end, end,
--legacy_mineral = true, --legacy_mineral = true,
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
minetest.register_node("summer:roccia_2", { minetest.register_node("summer:roccia_2", {
description = "Roccia", description = "Roccia",
drawtype = "mesh", drawtype = "mesh",
mesh = "roccia.obj", mesh = "roccia.obj",
tiles = {"roccia.png"}, tiles = { "roccia.png" },
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
sunlight_propagates = true, sunlight_propagates = true,
walkable = true, walkable = true,
groups = {cracky=3, stone=1, not_in_creative_inventory=1}, groups = { cracky = 3, stone = 1, not_in_creative_inventory = 1 },
drop = '"summer:pietra" 5', drop = '"summer:pietra" 5',
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = { -0.5, -0.5,-0.5, 0.5,0.1, 0.5 }, fixed = { -0.5, -0.5, -0.5, 0.5, 0.1, 0.5 },
}, },
--legacy_mineral = true, --legacy_mineral = true,
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
minetest.register_node("summer:desert_roccia_2", { minetest.register_node("summer:desert_roccia_2", {
description = "Desert Roccia", description = "Desert Roccia",
drawtype = "mesh", drawtype = "mesh",
mesh = "desert_roccia.obj", mesh = "desert_roccia.obj",
tiles = {"desert_roccia.png"}, tiles = { "desert_roccia.png" },
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
sunlight_propagates = true, sunlight_propagates = true,
walkable = true, walkable = true,
groups = {cracky=3, stone=1, not_in_creative_inventory=1}, groups = { cracky = 3, stone = 1, not_in_creative_inventory = 1 },
drop = '"summer:desert_pietra" 5', drop = '"summer:desert_pietra" 5',
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = { -0.5, -0.5,-0.5, 0.5,0.1, 0.5 }, fixed = { -0.5, -0.5, -0.5, 0.5, 0.1, 0.5 },
}, },
--legacy_mineral = true, --legacy_mineral = true,
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
--MAPGEN --MAPGEN
minetest.register_on_generated(function(minp, maxp, seed) minetest.register_on_generated(function(minp, maxp, seed)
@ -97,94 +97,98 @@ minetest.register_on_generated(function(minp, maxp, seed)
local perlin1 = minetest.get_perlin(329, 3, 0.6, 100) local perlin1 = minetest.get_perlin(329, 3, 0.6, 100)
-- Assume X and Z lengths are equal -- Assume X and Z lengths are equal
local divlen = 16 local divlen = 16
local divs = (maxp.x-minp.x)/divlen+1; local divs = (maxp.x - minp.x) / divlen + 1;
for divx=0,divs-1 do for divx = 0, divs - 1 do
for divz=0,divs-1 do for divz = 0, divs - 1 do
local x0 = minp.x + math.floor((divx+0)*divlen) local x0 = minp.x + math.floor((divx + 0) * divlen)
local z0 = minp.z + math.floor((divz+0)*divlen) local z0 = minp.z + math.floor((divz + 0) * divlen)
local x1 = minp.x + math.floor((divx+1)*divlen) local x1 = minp.x + math.floor((divx + 1) * divlen)
local z1 = minp.z + math.floor((divz+1)*divlen) local z1 = minp.z + math.floor((divz + 1) * divlen)
-- Determine roccia amount from perlin noise -- Determine roccia amount from perlin noise
local roccia_amount = math.floor(perlin1:get2d({x=x0, y=z0}) ^ 2 * 2) local roccia_amount = math.floor(perlin1:get2d({ x = x0, y = z0 }) ^ 2 * 2)
-- Find random positions for roccias based on this random -- Find random positions for roccias based on this random
local pr = PseudoRandom(seed+1) local pr = PseudoRandom(seed + 1)
for i=0,roccia_amount do for i = 0, roccia_amount do
local x = pr:next(x0, x1) local x = pr:next(x0, x1)
local z = pr:next(z0, z1) local z = pr:next(z0, z1)
-- Find ground level (0...15) -- Find ground level (0...15)
local ground_y = nil local ground_y = nil
for y=30,0,-1 do for y = 30, 0, -1 do
if minetest.get_node({x=x,y=y,z=z}).name ~= "air" then if minetest.get_node({ x = x, y = y, z = z }).name ~= "air" then
ground_y = y ground_y = y
break break
end
end
if ground_y then
local p = { x = x, y = ground_y + 1, z = z }
local nn = minetest.get_node(p).name
-- Check if the node can be replaced
if minetest.registered_nodes[nn] and
minetest.registered_nodes[nn].buildable_to then
nn = minetest.get_node({ x = x, y = ground_y, z = z }).name
-- If desert sand, add dry shrub
if nn == "default:dirt_with_grass" then
minetest.set_node(p, {
name = "summer:roccia_" .. pr:next(1, 2),
param2 = math.random(0,
3)
})
elseif nn == "default:desert_sand" then
minetest.set_node(p,
{ name = "summer:desert_roccia_" .. pr:next(1, 2), param2 = math.random(0, 3) })
end
end
end end
end end
if ground_y then
local p = {x=x,y=ground_y+1,z=z}
local nn = minetest.get_node(p).name
-- Check if the node can be replaced
if minetest.registered_nodes[nn] and
minetest.registered_nodes[nn].buildable_to then
nn = minetest.get_node({x=x,y=ground_y,z=z}).name
-- If desert sand, add dry shrub
if nn == "default:dirt_with_grass" then
minetest.set_node(p,{name="summer:roccia_"..pr:next(1,2), param2=math.random(0,3)})
elseif nn == "default:desert_sand" then
minetest.set_node(p,{name="summer:desert_roccia_"..pr:next(1,2), param2=math.random(0,3)})
end
end
end
end end
end end
end
end end
end) end)
--craft PIETRA
minetest.register_craft({ --craft PIETRA
output = '"summer:pietraA" 2', minetest.register_craft({
recipe = { output = '"summer:pietraA" 2',
{ "", "", "" }, recipe = {
{ "", "", "" }, { "", "", "" },
{ "summer:pietra", "summer:desert_pietra", "" }, { "", "", "" },
}, { "summer:pietra", "summer:desert_pietra", "" },
}) },
minetest.register_craft({ })
output = '"summer:pietraP" 2', minetest.register_craft({
recipe = { output = '"summer:pietraP" 2',
{ "", "", "" }, recipe = {
{ "", "", "" }, { "", "", "" },
{ "summer:pietraA", "summer:desert_pietra", "" }, { "", "", "" },
}, { "summer:pietraA", "summer:desert_pietra", "" },
}) },
})
--craftitem PIETRA
--craftitem PIETRA
minetest.register_craftitem("summer:desert_pietra", { minetest.register_craftitem("summer:desert_pietra", {
description = "Desert Pietra", description = "Desert Pietra",
inventory_image = "desert_pietra.png", inventory_image = "desert_pietra.png",
}) })
minetest.register_craftitem("summer:pietraA", { minetest.register_craftitem("summer:pietraA", {
description = "pietraA", description = "pietraA",
inventory_image = "pietraA.png", inventory_image = "pietraA.png",
}) })
minetest.register_craftitem("summer:pietra", { minetest.register_craftitem("summer:pietra", {
description = "pietra", description = "pietra",
inventory_image = "pietra.png", inventory_image = "pietra.png",
}) })
minetest.register_craftitem("summer:pietraP", { minetest.register_craftitem("summer:pietraP", {
description = "pietraP", description = "pietraP",
inventory_image = "pietraP.png", inventory_image = "pietraP.png",
}) })
-- craftitem MATTONE -- craftitem MATTONE

156
porta.lua
View File

@ -1,12 +1,11 @@
local Porta_list = { local Porta_list = {
{ "Red Door", "red"}, { "Red Door", "red" },
{ "Orange Door", "orange"}, { "Orange Door", "orange" },
{ "Black Door", "black"}, { "Black Door", "black" },
{ "Yellow Door", "yellow"}, { "Yellow Door", "yellow" },
{ "Green Door", "green"}, { "Green Door", "green" },
{ "Blue Door", "blue"}, { "Blue Door", "blue" },
{ "Violet Door", "violet"}, { "Violet Door", "violet" },
} }
--[[ { S("Red Door"), "red"}, --[[ { S("Red Door"), "red"},
{ S("Orange Door"), "orange"}, { S("Orange Door"), "orange"},
@ -19,84 +18,81 @@ local Porta_list = {
for i in ipairs(Porta_list) do for i in ipairs(Porta_list) do
local portadesc = Porta_list[i][1] local portadesc = Porta_list[i][1]
local colour = Porta_list[i][2] local colour = Porta_list[i][2]
minetest.register_node("summer:porta_"..colour.."", { minetest.register_node("summer:porta_" .. colour .. "", {
description = portadesc.."", description = portadesc .. "",
drawtype = "mesh", drawtype = "mesh",
mesh = "porta_2.obj", mesh = "porta_2.obj",
tiles = {"porta_"..colour..".png", tiles = { "porta_" .. colour .. ".png",
}, },
inventory_image = "summer_p_"..colour..".png", inventory_image = "summer_p_" .. colour .. ".png",
wield_image = "summer_p_"..colour..".png", wield_image = "summer_p_" .. colour .. ".png",
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
sunlight_propagates = true, sunlight_propagates = true,
walkable = true, walkable = true,
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = { -0.40, -0.5,-0.5,- 0.5,1.5, 0.5 }, fixed = { -0.40, -0.5, -0.5, -0.5, 1.5, 0.5 },
}, },
collision_box = { collision_box = {
type = "fixed", type = "fixed",
fixed = { -0.40, -0.5,-0.5,- 0.5,1.5, 0.5 }, fixed = { -0.40, -0.5, -0.5, -0.5, 1.5, 0.5 },
}, },
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1}, groups = { snappy = 2, cracky = 3, oddly_breakable_by_hand = 3, not_in_creative_inventory = 1 },
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
--sound_close="summer_porta_ch", --sound_close="summer_porta_ch",
drop = "summer:porta_"..colour.."_ch", drop = "summer:porta_" .. colour .. "_ch",
on_rightclick = function(pos, node, clicker) on_rightclick = function(pos, node, clicker)
node.name = "summer:porta_"..colour.."_ch" node.name = "summer:porta_" .. colour .. "_ch"
minetest.set_node(pos, node) minetest.set_node(pos, node)
minetest.sound_play("summer_porta_ch", { minetest.sound_play("summer_porta_ch", {
to_player = "", to_player = "",
gain = 0.1, gain = 0.1,
pos = pos, pos = pos,
max_hear_distance = 16, max_hear_distance = 16,
})
end,
})
minetest.register_node("summer:porta_"..colour.."_ch", {
description = portadesc.." ch",
drawtype = "mesh",
mesh = "porta.obj",
tiles = {"porta_"..colour..".png",
},
inventory_image = "summer_p_"..colour..".png",
wield_image = "summer_p_"..colour..".png",
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
walkable = true,
selection_box = {
type = "fixed",
fixed = { -0.5, -0.5, 0.40, 0.5,1.5, 0.5},
},
collision_box = {
type = "fixed",
fixed = { -0.5, -0.5, 0.40, 0.5,1.5, 0.5},
},
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3, not_in_creative_inventory=0},
sounds = default.node_sound_wood_defaults(),
drop = "summer:porta_"..colour.."_ch",
on_rightclick = function(pos, node, clicker)
node.name = "summer:porta_"..colour..""
minetest.set_node(pos, node)
minetest.sound_play("summer_porta_op", {
to_player = "",
gain = 0.1,
pos = pos,
max_hear_distance = 16,
}) })
end, end,
}) })
minetest.register_node("summer:porta_" .. colour .. "_ch", {
description = portadesc .. " ch",
drawtype = "mesh",
mesh = "porta.obj",
tiles = { "porta_" .. colour .. ".png",
},
inventory_image = "summer_p_" .. colour .. ".png",
wield_image = "summer_p_" .. colour .. ".png",
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
walkable = true,
selection_box = {
type = "fixed",
fixed = { -0.5, -0.5, 0.40, 0.5, 1.5, 0.5 },
},
collision_box = {
type = "fixed",
fixed = { -0.5, -0.5, 0.40, 0.5, 1.5, 0.5 },
},
groups = { snappy = 2, cracky = 3, oddly_breakable_by_hand = 3, not_in_creative_inventory = 0 },
sounds = default.node_sound_wood_defaults(),
drop = "summer:porta_" .. colour .. "_ch",
on_rightclick = function(pos, node, clicker)
node.name = "summer:porta_" .. colour .. ""
minetest.set_node(pos, node)
minetest.sound_play("summer_porta_op", {
to_player = "",
gain = 0.1,
pos = pos,
max_hear_distance = 16,
})
end,
})
end end

View File

@ -1,72 +1,70 @@
local Portacenere_list = { local Portacenere_list = {
{ "Red Portacenere", "red"}, { "Red Portacenere", "red" },
{ "Orange Portacenere", "orange"}, { "Orange Portacenere", "orange" },
{ "Black Portacenere", "black"}, { "Black Portacenere", "black" },
{ "Yellow Portacenere", "yellow"}, { "Yellow Portacenere", "yellow" },
{ "Green Portacenere", "green"}, { "Green Portacenere", "green" },
{ "Blue Portacenere", "blue"}, { "Blue Portacenere", "blue" },
{ "Violet Portacenere", "violet"}, { "Violet Portacenere", "violet" },
{ "White Portacenere", "white"}, { "White Portacenere", "white" },
} }
for i in ipairs(Portacenere_list) do for i in ipairs(Portacenere_list) do
local Portaceneredesc = Portacenere_list[i][1] local Portaceneredesc = Portacenere_list[i][1]
local colour = Portacenere_list[i][2] local colour = Portacenere_list[i][2]
minetest.register_node("summer:Portacenere_"..colour.."", { minetest.register_node("summer:Portacenere_" .. colour .. "", {
description = Portaceneredesc.."", description = Portaceneredesc .. "",
drawtype = "mesh", drawtype = "mesh",
mesh = "portacenere_o.obj", mesh = "portacenere_o.obj",
tiles = {"portacenere_"..colour..".png", tiles = { "portacenere_" .. colour .. ".png",
}, },
-- inventory_image = "summer_ombo_n_"..colour..".png", -- inventory_image = "summer_ombo_n_"..colour..".png",
-- wield_image = {"summer_ombo_n_"..colour..".png", -- wield_image = {"summer_ombo_n_"..colour..".png",
--}, --},
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
sunlight_propagates = true, sunlight_propagates = true,
walkable = false, walkable = false,
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = { -0.130, -0.5, -0.130, 0.25,-0.25, 0}, fixed = { -0.130, -0.5, -0.130, 0.25, -0.25, 0 },
}, },
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory = 0}, groups = { snappy = 2, cracky = 3, oddly_breakable_by_hand = 3, not_in_creative_inventory = 0 },
--sounds = default.node_sound_glass_defaults(), --sounds = default.node_sound_glass_defaults(),
drop = "summer:Portacenere_"..colour.."_ch", drop = "summer:Portacenere_" .. colour .. "_ch",
on_rightclick = function(pos, node, clicker) on_rightclick = function(pos, node, clicker)
node.name = "summer:Portacenere_"..colour.."_ch" node.name = "summer:Portacenere_" .. colour .. "_ch"
minetest.set_node(pos, node) minetest.set_node(pos, node)
end, end,
}) })
minetest.register_node("summer:Portacenere_"..colour.."_ch", { minetest.register_node("summer:Portacenere_" .. colour .. "_ch", {
description = Portaceneredesc.." ch", description = Portaceneredesc .. " ch",
drawtype = "mesh", drawtype = "mesh",
mesh = "portacenere_c.obj", mesh = "portacenere_c.obj",
tiles = {"portacenere_"..colour..".png", tiles = { "portacenere_" .. colour .. ".png",
}, },
-- inventory_image = "summer_ombc_n_"..colour..".png", -- inventory_image = "summer_ombc_n_"..colour..".png",
--wield_image = {"summer_ombc_n_"..colour..".png",
--},
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
walkable = false,
selection_box = {
type = "fixed",
fixed = { -0.130, -0.5, -0.130, 0.25,-0.25, 0 },
},
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3, not_in_creative_inventory=1},
--sounds = default.node_sound_glass_defaults(),
drop = "summer:Portacenere_"..colour.."ch",
on_rightclick = function(pos, node, clicker)
node.name = "summer:Portacenere_"..colour..""
minetest.set_node(pos, node)
end,
})
--wield_image = {"summer_ombc_n_"..colour..".png",
--},
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
walkable = false,
selection_box = {
type = "fixed",
fixed = { -0.130, -0.5, -0.130, 0.25, -0.25, 0 },
},
groups = { snappy = 2, cracky = 3, oddly_breakable_by_hand = 3, not_in_creative_inventory = 1 },
--sounds = default.node_sound_glass_defaults(),
drop = "summer:Portacenere_" .. colour .. "ch",
on_rightclick = function(pos, node, clicker)
node.name = "summer:Portacenere_" .. colour .. ""
minetest.set_node(pos, node)
end,
})
end end

View File

@ -1,25 +1,19 @@
--_swap tool____________ --_swap tool____________
minetest.register_on_punchnode(function(pos, node, puncher, pointed_thing) minetest.register_on_punchnode(function(pos, node, puncher, pointed_thing)
pos.y = pos.y pos.y = pos.y --Непонятно зачем?
local name = minetest.get_node(pos).name local name = minetest.get_node(pos).name
if name ~= "default:sand" if name ~= "default:sand" and name ~= "default:silver_sand"
and name ~= "default:silver_sand" and name ~= "default:desert_sand" then
and name ~= "default:desert_sand" then return
return end
end pos.y = pos.y
pos.y = pos.y if puncher:get_wielded_item():get_name() == "summer:rake" then
if puncher:get_wielded_item():get_name() == "summer:rake"
then
minetest.remove_node(pos) minetest.remove_node(pos)
node.name = "summer:sabbia_mare" node.name = "summer:sabbia_mare"
minetest.set_node(pos, node) minetest.set_node(pos, node)
minetest.sound_play("summer_n_swap",{pos=pos, max_hear_distance=10})
minetest.sound_play("summer_n_swap", { end
to_player = "", end )
gain = 2.0,})
end
end )
--SABBIA --SABBIA
@ -38,12 +32,4 @@ groups = {crumbly = 3, falling_node = 1, sand = 1},
minetest.register_tool("summer:rake", { minetest.register_tool("summer:rake", {
description = "rake", description = "rake",
inventory_image = "rake.png", inventory_image = "rake.png",
[[on_place = function(itemstack, user, pointed_thing)
minetest.sound_play("summer_n_swap_2", {
to_player = user:get_player_name() ,
gain = 2.0
})]]
}) })

View File

@ -15,8 +15,8 @@ end
local function get_velocity(v, yaw, y) local function get_velocity(v, yaw, y)
local x = -math.sin(yaw) * v local x = -math.sin(yaw) * v
local z = math.cos(yaw) * v local z = math.cos(yaw) * v
return {x = x, y = y, z = z} return { x = x, y = y, z = z }
end end
@ -24,247 +24,238 @@ local function get_v(v)
return math.sqrt(v.x ^ 2 + v.z ^ 2) return math.sqrt(v.x ^ 2 + v.z ^ 2)
end end
local function reg_salvag(color) local function reg_salvag(color)
local salvag_item_name = "summer:salvag_" .. color .. "_item"
local salvag_ent_name = "summer:salvag_" .. color .. "_entity"
local salvag_item_name = "summer:salvag_"..color.."_item" --
local salvag_ent_name = "summer:salvag_"..color.."_entity" -- Boat entity
--
-- local salvag = {
-- Boat entity physical = true,
-- collisionbox = { -0.5, -0.35, -0.5, 0.5, 0.3, 0.5 },
visual = "mesh",
mesh = "salvagl.obj",
textures = { "summer_salvag_" .. color .. ".png" },
local salvag = { driver = nil,
physical = true, v = 0,
collisionbox = {-0.5, -0.35, -0.5, 0.5, 0.3, 0.5}, last_v = 0,
visual = "mesh", removed = false
mesh = "salvagl.obj", }
textures = {"summer_salvag_"..color..".png" },
driver = nil,
v = 0,
last_v = 0,
removed = false
}
function salvag.on_rightclick(self, clicker) function salvag.on_rightclick(self, clicker)
if not clicker or not clicker:is_player() then if not clicker or not clicker:is_player() then
return return
end end
local name = clicker:get_player_name() local name = clicker:get_player_name()
if self.driver and clicker == self.driver then if self.driver and clicker == self.driver then
self.driver = nil self.driver = nil
clicker:set_detach()
default.player_attached[name] = false
default.player_set_animation(clicker, "stand" , 30)
local pos = clicker:getpos()
pos = {x = pos.x, y = pos.y + 0.2, z = pos.z}
minetest.after(0.1, function()
clicker:setpos(pos)
end)
elseif not self.driver then
local attach = clicker:get_attach()
if attach and attach:get_luaentity() then
local luaentity = attach:get_luaentity()
if luaentity.driver then
luaentity.driver = nil
end
clicker:set_detach() clicker:set_detach()
default.player_attached[name] = false
default.player_set_animation(clicker, "stand", 30)
local pos = clicker:getpos()
pos = { x = pos.x, y = pos.y + 0.2, z = pos.z }
minetest.after(0.1, function()
clicker:setpos(pos)
end)
elseif not self.driver then
local attach = clicker:get_attach()
if attach and attach:get_luaentity() then
local luaentity = attach:get_luaentity()
if luaentity.driver then
luaentity.driver = nil
end
clicker:set_detach()
end
self.driver = clicker
clicker:set_attach(self.object, "",
{ x = 0, y = 11, z = -3 }, { x = 0, y = 0, z = 0 })
default.player_attached[name] = true
minetest.after(0.2, function()
default.player_set_animation(clicker, "sit", 30)
end)
self.object:setyaw(clicker:get_look_yaw() - math.pi / 2)
end end
self.driver = clicker
clicker:set_attach(self.object, "",
{x = 0, y = 11, z = -3}, {x = 0, y = 0, z = 0})
default.player_attached[name] = true
minetest.after(0.2, function()
default.player_set_animation(clicker, "sit" , 30)
end)
self.object:setyaw(clicker:get_look_yaw() - math.pi / 2)
end end
end
function salvag.on_activate(self, staticdata, dtime_s)
function salvag.on_activate(self, staticdata, dtime_s) self.object:set_armor_groups({ immortal = 1 })
self.object:set_armor_groups({immortal = 1}) if staticdata then
if staticdata then self.v = tonumber(staticdata)
self.v = tonumber(staticdata) end
self.last_v = self.v
end end
self.last_v = self.v
end
function salvag.get_staticdata(self)
function salvag.get_staticdata(self) return tostring(self.v)
return tostring(self.v)
end
function salvag.on_punch(self, puncher)
if not puncher or not puncher:is_player() or self.removed then
return
end end
if self.driver and puncher == self.driver then
self.driver = nil function salvag.on_punch(self, puncher)
puncher:set_detach() if not puncher or not puncher:is_player() or self.removed then
default.player_attached[puncher:get_player_name()] = false return
end end
if not self.driver then if self.driver and puncher == self.driver then
self.removed = true self.driver = nil
-- delay remove to ensure player is detached puncher:set_detach()
minetest.after(0.1, function() default.player_attached[puncher:get_player_name()] = false
self.object:remove() end
end) if not self.driver then
if not minetest.setting_getbool("creative_mode") then self.removed = true
local inv = puncher:get_inventory() -- delay remove to ensure player is detached
if inv:room_for_item("main", "summer:salvag_"..color.."_item") then minetest.after(0.1, function()
inv:add_item("main", "summer:salvag_"..color.."_item") self.object:remove()
else end)
minetest.add_item(self.object:getpos(), salvag_item_name) if not minetest.setting_getbool("creative_mode") then
local inv = puncher:get_inventory()
if inv:room_for_item("main", "summer:salvag_" .. color .. "_item") then
inv:add_item("main", "summer:salvag_" .. color .. "_item")
else
minetest.add_item(self.object:getpos(), salvag_item_name)
end
end end
end end
end end
end
function salvag.on_step(self, dtime)
function salvag.on_step(self, dtime) self.v = get_v(self.object:getvelocity()) * get_sign(self.v)
self.v = get_v(self.object:getvelocity()) * get_sign(self.v) if self.driver then
if self.driver then local ctrl = self.driver:get_player_control()
local ctrl = self.driver:get_player_control() local yaw = self.object:getyaw()
local yaw = self.object:getyaw() if ctrl.up then
if ctrl.up then self.v = self.v + 0.1
self.v = self.v + 0.1 elseif ctrl.down then
elseif ctrl.down then self.v = self.v - 0.1
self.v = self.v - 0.1
end
if ctrl.left then
if self.v < 0 then
self.object:setyaw(yaw - (1 + dtime) * 0.03)
else
self.object:setyaw(yaw + (1 + dtime) * 0.03)
end end
elseif ctrl.right then if ctrl.left then
if self.v < 0 then if self.v < 0 then
self.object:setyaw(yaw + (1 + dtime) * 0.03) self.object:setyaw(yaw - (1 + dtime) * 0.03)
else else
self.object:setyaw(yaw - (1 + dtime) * 0.03) self.object:setyaw(yaw + (1 + dtime) * 0.03)
end
elseif ctrl.right then
if self.v < 0 then
self.object:setyaw(yaw + (1 + dtime) * 0.03)
else
self.object:setyaw(yaw - (1 + dtime) * 0.03)
end
end end
end end
end local velo = self.object:getvelocity()
local velo = self.object:getvelocity() if self.v == 0 and velo.x == 0 and velo.y == 0 and velo.z == 0 then
if self.v == 0 and velo.x == 0 and velo.y == 0 and velo.z == 0 then self.object:setpos(self.object:getpos())
self.object:setpos(self.object:getpos()) return
return end
end local s = get_sign(self.v)
local s = get_sign(self.v) self.v = self.v - 0.02 * s
self.v = self.v - 0.02 * s if s ~= get_sign(self.v) then
if s ~= get_sign(self.v) then self.object:setvelocity({ x = 0, y = 0, z = 0 })
self.object:setvelocity({x = 0, y = 0, z = 0})
self.v = 0
return
end
if math.abs(self.v) > 5 then
self.v = 5 * get_sign(self.v)
end
local p = self.object:getpos()
p.y = p.y - 0.5
local new_velo = {x = 0, y = 0, z = 0}
local new_acce = {x = 0, y = 0, z = 0}
if not is_water(p) then
local nodedef = minetest.registered_nodes[minetest.get_node(p).name]
if (not nodedef) or nodedef.walkable then
self.v = 0 self.v = 0
new_acce = {x = 0, y = 1, z = 0} return
else
new_acce = {x = 0, y = -9.8, z = 0}
end end
new_velo = get_velocity(self.v, self.object:getyaw(), if math.abs(self.v) > 5 then
self.object:getvelocity().y) self.v = 5 * get_sign(self.v)
self.object:setpos(self.object:getpos()) end
else
p.y = p.y + 1 local p = self.object:getpos()
if is_water(p) then p.y = p.y - 0.5
local y = self.object:getvelocity().y local new_velo = { x = 0, y = 0, z = 0 }
if y >= 5 then local new_acce = { x = 0, y = 0, z = 0 }
y = 5 if not is_water(p) then
elseif y < 0 then local nodedef = minetest.registered_nodes[minetest.get_node(p).name]
new_acce = {x = 0, y = 20, z = 0} if (not nodedef) or nodedef.walkable then
self.v = 0
new_acce = { x = 0, y = 1, z = 0 }
else else
new_acce = {x = 0, y = 5, z = 0} new_acce = { x = 0, y = -9.8, z = 0 }
end end
new_velo = get_velocity(self.v, self.object:getyaw(), y) new_velo = get_velocity(self.v, self.object:getyaw(),
self.object:getvelocity().y)
self.object:setpos(self.object:getpos()) self.object:setpos(self.object:getpos())
else else
new_acce = {x = 0, y = 0, z = 0} p.y = p.y + 1
if math.abs(self.object:getvelocity().y) < 1 then if is_water(p) then
local pos = self.object:getpos() local y = self.object:getvelocity().y
pos.y = math.floor(pos.y) + 0.5 if y >= 5 then
self.object:setpos(pos) y = 5
new_velo = get_velocity(self.v, self.object:getyaw(), 0) elseif y < 0 then
else new_acce = { x = 0, y = 20, z = 0 }
new_velo = get_velocity(self.v, self.object:getyaw(), else
self.object:getvelocity().y) new_acce = { x = 0, y = 5, z = 0 }
end
new_velo = get_velocity(self.v, self.object:getyaw(), y)
self.object:setpos(self.object:getpos()) self.object:setpos(self.object:getpos())
else
new_acce = { x = 0, y = 0, z = 0 }
if math.abs(self.object:getvelocity().y) < 1 then
local pos = self.object:getpos()
pos.y = math.floor(pos.y) + 0.5
self.object:setpos(pos)
new_velo = get_velocity(self.v, self.object:getyaw(), 0)
else
new_velo = get_velocity(self.v, self.object:getyaw(),
self.object:getvelocity().y)
self.object:setpos(self.object:getpos())
end
end end
end end
self.object:setvelocity(new_velo)
self.object:setacceleration(new_acce)
end end
self.object:setvelocity(new_velo)
self.object:setacceleration(new_acce) minetest.register_entity("summer:salvag_" .. color .. "", salvag)
end
minetest.register_entity("summer:salvag_"..color.."", salvag) minetest.register_craftitem(salvag_item_name, {
description = "salvagente (" .. color .. ")",
inventory_image = "summer_salvag_" .. color .. "_inv.png",
wield_image = "summer_salvag_" .. color .. "_inv.png",
wield_scale = { x = 2, y = 2, z = 1 },
liquids_pointable = true,
on_place = function(itemstack, placer, pointed_thing)
minetest.register_craftitem(salvag_item_name, { if pointed_thing.type ~= "node" then
description = "salvagente ("..color..")", return
inventory_image = "summer_salvag_"..color.."_inv.png", end
wield_image = "summer_salvag_"..color.."_inv.png", if not is_water(pointed_thing.under) then
wield_scale = {x = 2, y = 2, z = 1}, return
liquids_pointable = true, end
pointed_thing.under.y = pointed_thing.under.y + 0.5
on_place = function(itemstack, placer, pointed_thing) minetest.add_entity(pointed_thing.under, "summer:salvag_" .. color .. "")
if pointed_thing.type ~= "node" then if not minetest.setting_getbool("creative_mode") then
return itemstack:take_item()
end end
if not is_water(pointed_thing.under) then return itemstack
return end,
end })
pointed_thing.under.y = pointed_thing.under.y + 0.5 minetest.register_craft({
minetest.add_entity(pointed_thing.under, "summer:salvag_"..color.."") output = salvag_item_name,
if not minetest.setting_getbool("creative_mode") then recipe = {
itemstack:take_item() { "", "", "" },
end { "group:leaves", "wool:" .. color, "group:leaves" },
return itemstack { "default:paper", "group:leaves", "default:paper" },
end, },
}) })
minetest.register_craft({
output = salvag_item_name,
recipe = {
{"" , "" , "" },
{"group:leaves", "wool:"..color, "group:leaves"},
{"default:paper", "group:leaves", "default:paper"},
},
})
if minetest.get_modpath("cannabis") then if minetest.get_modpath("cannabis") then
minetest.register_craft({ minetest.register_craft({
output = salvag_item_name, output = salvag_item_name,
recipe = { recipe = {
{"" , "" , "" }, { "", "", "" },
{"cannabis:canapa_plastic", "wool:"..color, "cannabis:canapa_plastic"}, { "cannabis:canapa_plastic", "wool:" .. color, "cannabis:canapa_plastic" },
{"cannabis:canapa_plastic", "cannabis:canapa_plastic", "cannabis:canapa_plastic"}, { "cannabis:canapa_plastic", "cannabis:canapa_plastic", "cannabis:canapa_plastic" },
}, },
}) })
end
end
end end
colors = { colors = {
"black", "red", "green", "blue", "yellow", "violet","orange", "black", "red", "green", "blue", "yellow", "violet", "orange",
} }
for _,color in ipairs(colors) do for _, color in ipairs(colors) do
reg_salvag(color) reg_salvag(color)
end end

View File

@ -1,23 +1,22 @@
local sdraia_list = {
local sdraia_list = { { "Red sdraia", "red" },
{ "Red sdraia", "red"}, { "Orange sdraia", "orange" },
{ "Orange sdraia", "orange"}, { "Black sdraia", "black" },
{ "Black sdraia", "black"}, { "Yellow sdraia", "yellow" },
{ "Yellow sdraia", "yellow"}, { "Green sdraia", "green" },
{ "Green sdraia", "green"}, { "Blue sdraia", "blue" },
{ "Blue sdraia", "blue"}, { "Violet sdraia", "violet" },
{ "Violet sdraia", "violet"},
} }
for i in ipairs(sdraia_list) do for i in ipairs(sdraia_list) do
local sdraiadesc = sdraia_list[i][1] local sdraiadesc = sdraia_list[i][1]
local colour = sdraia_list[i][2] local colour = sdraia_list[i][2]
local sleep_in_sdraia = function( pos, node, clicker, itemstack, pointed_thing ) local sleep_in_sdraia = function(pos, node, clicker, itemstack, pointed_thing)
if( not( clicker ) or not( node ) or not( node.name ) or not( pos ) or not( minetest.allow_sit( clicker))) then if (not (clicker) or not (node) or not (node.name) or not (pos) or not (minetest.allow_sit(clicker))) then
return; return;
end end
local animation = default.player_get_animation( clicker ); local animation = default.player_get_animation(clicker);
local pname = clicker:get_player_name(); local pname = clicker:get_player_name();
local place_name = 'place'; local place_name = 'place';
@ -27,176 +26,174 @@ for i in ipairs(sdraia_list) do
local new_animation = 'lay'; local new_animation = 'lay';
-- let players get back up -- let players get back up
if( animation and animation.animation=="lay" ) then if (animation and animation.animation == "lay") then
default.player_attached[pname] = false default.player_attached[pname] = false
clicker:setpos({x=pos.x,y=pos.y-0.5,z=pos.z}) clicker:setpos({ x = pos.x, y = pos.y - 0.5, z = pos.z })
clicker:set_eye_offset({x=0,y=0,z=0}, {x=0,y=0,z=0}) clicker:set_eye_offset({ x = 0, y = 0, z = 0 }, { x = 0, y = 0, z = 0 })
clicker:set_physics_override({1, 1, 1}) clicker:set_physics_override({ 1, 1, 1 })
default.player_set_animation(clicker, "stand", 30) default.player_set_animation(clicker, "stand", 30)
minetest.chat_send_player( pname, 'You stand up again.'); minetest.chat_send_player(pname, 'You stand up again.');
return; return;
end end
local second_node_pos = {x=pos.x, y=pos.y, z=pos.z}; local second_node_pos = { x = pos.x, y = pos.y, z = pos.z };
-- the node that will contain the head of the player -- the node that will contain the head of the player
local p = {x=pos.x, y=pos.y, z=pos.z}; local p = { x = pos.x, y = pos.y, z = pos.z };
-- the player's head is pointing in this direction -- the player's head is pointing in this direction
local dir = node.param2; local dir = node.param2;
-- it would be odd to sleep in half a sdraia -- it would be odd to sleep in half a sdraia
if( node.name=="summer:sdraia_"..colour.."" ) then if (node.name == "summer:sdraia_" .. colour .. "") then
if( node.param2==0 ) then if (node.param2 == 0) then
second_node_pos.z = pos.z-1; second_node_pos.z = pos.z - 1;
elseif( node.param2==1) then elseif (node.param2 == 1) then
second_node_pos.x = pos.x-1; second_node_pos.x = pos.x - 1;
elseif( node.param2==2) then elseif (node.param2 == 2) then
second_node_pos.z = pos.z+1; second_node_pos.z = pos.z + 1;
elseif( node.param2==3) then elseif (node.param2 == 3) then
second_node_pos.x = pos.x+1; second_node_pos.x = pos.x + 1;
end end
local node2 = minetest.get_node( second_node_pos ); local node2 = minetest.get_node(second_node_pos);
if( not( node2 ) or not( node2.param2 ) or not( node.param2 ) if (not (node2) or not (node2.param2) or not (node.param2)
or node2.name ~= "summer:sdraia_"..colour.."" or node2.name ~= "summer:sdraia_" .. colour .. ""
or node2.param2 ~= node.param2 ) then or node2.param2 ~= node.param2) then
allow_sleep = false; allow_sleep = false;
else else
allow_sleep = true; allow_sleep = true;
end end
place_name = "sdraia_"..colour..""; place_name = "sdraia_" .. colour .. "";
-- if the player clicked on the foot of the sdraia, locate the head -- if the player clicked on the foot of the sdraia, locate the head
elseif( node.name=='summer:sdraia' ) then elseif (node.name == 'summer:sdraia') then
if( node.param2==2 ) then if (node.param2 == 2) then
second_node_pos.z = pos.z-1; second_node_pos.z = pos.z - 1;
elseif( node.param2==3) then elseif (node.param2 == 3) then
second_node_pos.x = pos.x-1; second_node_pos.x = pos.x - 1;
elseif( node.param2==0) then elseif (node.param2 == 0) then
second_node_pos.z = pos.z+1; second_node_pos.z = pos.z + 1;
elseif( node.param2==1) then elseif (node.param2 == 1) then
second_node_pos.x = pos.x+1; second_node_pos.x = pos.x + 1;
end end
local node2 = minetest.get_node( second_node_pos ); local node2 = minetest.get_node(second_node_pos);
if( not( node2 ) or not( node2.param2 ) or not( node.param2 ) if (not (node2) or not (node2.param2) or not (node.param2)
or node2.name ~= 'summer:sdraia' or node2.name ~= 'summer:sdraia'
or node2.param2 ~= node.param2 ) then or node2.param2 ~= node.param2) then
allow_sleep = false; allow_sleep = false;
else else
allow_sleep = true; allow_sleep = true;
end end
if( allow_sleep==true ) then if (allow_sleep == true) then
p = {x=second_node_pos.x, y=second_node_pos.y, z=second_node_pos.z}; p = { x = second_node_pos.x, y = second_node_pos.y, z = second_node_pos.z };
end end
place_name = 'sdraia'; place_name = 'sdraia';
elseif (node.name == 'summer:sleeping_mat' or node.name == 'summer:straw_mat') then
elseif( node.name=='summer:sleeping_mat' or node.name=='summer:straw_mat') then
place_name = 'mat'; place_name = 'mat';
dir = node.param2; dir = node.param2;
allow_sleep = false; allow_sleep = false;
-- search for a second mat right next to this one -- search for a second mat right next to this one
local offset = {{x=0,z=-1}, {x=-1,z=0}, {x=0,z=1}, {x=1,z=0}}; local offset = { { x = 0, z = -1 }, { x = -1, z = 0 }, { x = 0, z = 1 }, { x = 1, z = 0 } };
for i,off in ipairs( offset ) do for i, off in ipairs(offset) do
node2 = minetest.get_node( {x=pos.x+off.x, y=pos.y, z=pos.z+off.z} ); node2 = minetest.get_node({ x = pos.x + off.x, y = pos.y, z = pos.z + off.z });
if( node2.name == 'summer:sleeping_mat' or node2.name=='summer:straw_mat' ) then if (node2.name == 'summer:sleeping_mat' or node2.name == 'summer:straw_mat') then
-- if a second mat is found, sleeping is possible -- if a second mat is found, sleeping is possible
allow_sleep = true; allow_sleep = true;
dir = i-1; dir = i - 1;
end end
end end
end end
-- set the right height for the sdraia -- set the right height for the sdraia
if( place_name=='sdraia' ) then if (place_name == 'sdraia') then
p.y = p.y-0.4; p.y = p.y - 0.4;
end end
if( allow_sleep==true ) then if (allow_sleep == true) then
-- set the right position (middle of the sdraia) -- set the right position (middle of the sdraia)
if( dir==0 ) then if (dir == 0) then
p.z = p.z-0.5; p.z = p.z - 0.5;
elseif( dir==1 ) then elseif (dir == 1) then
p.x = p.x-0.5; p.x = p.x - 0.5;
elseif( dir==2 ) then elseif (dir == 2) then
p.z = p.z+0.5; p.z = p.z + 0.5;
elseif( dir==3 ) then elseif (dir == 3) then
p.x = p.x+0.5; p.x = p.x + 0.5;
end end
end end
if( default.player_attached[pname] and animation.animation=="sit") then if (default.player_attached[pname] and animation.animation == "sit") then
-- just changing the animation... -- just changing the animation...
if( allow_sleep==true ) then if (allow_sleep == true) then
default.player_set_animation(clicker, "lay", 30) default.player_set_animation(clicker, "lay", 30)
clicker:set_eye_offset({x=0,y=-14,z=2}, {x=0,y=0,z=0}) clicker:set_eye_offset({ x = 0, y = -14, z = 2 }, { x = 0, y = 0, z = 0 })
minetest.chat_send_player( pname, 'you lay A right-click will wake you up.'); minetest.chat_send_player(pname, 'you lay A right-click will wake you up.');
return; return;
-- no sleeping on this place -- no sleeping on this place
else else
default.player_attached[pname] = false default.player_attached[pname] = false
clicker:setpos({x=pos.x,y=pos.y-0.5,z=pos.z}) clicker:setpos({ x = pos.x, y = pos.y - 0.5, z = pos.z })
clicker:set_eye_offset({x=0,y=0,z=0}, {x=0,y=0,z=0}) clicker:set_eye_offset({ x = 0, y = 0, z = 0 }, { x = 0, y = 0, z = 0 })
clicker:set_physics_override({1, 1, 1}) clicker:set_physics_override({ 1, 1, 1 })
default.player_set_animation(clicker, "stand", 30) default.player_set_animation(clicker, "stand", 30)
minetest.chat_send_player( pname, 'That was enough sitting around for now. You stand up again.'); minetest.chat_send_player(pname, 'That was enough sitting around for now. You stand up again.');
return; return;
end end
end end
clicker:set_eye_offset({x=0,y=3,z=2}, {x=0,y=3,z=0}) clicker:set_eye_offset({ x = 0, y = 3, z = 2 }, { x = 0, y = 3, z = 0 })
clicker:setpos( p ); clicker:setpos(p);
default.player_set_animation(clicker, new_animation, 30) default.player_set_animation(clicker, new_animation, 30)
clicker:set_physics_override({0,0,0}) clicker:set_physics_override({ 0, 0, 0 })
default.player_attached[pname] = true default.player_attached[pname] = true
return; return;
end end
minetest.register_node("summer:sdraia_"..colour.."", { minetest.register_node("summer:sdraia_" .. colour .. "", {
description = sdraiadesc.."", description = sdraiadesc .. "",
drawtype = "mesh", drawtype = "mesh",
mesh = "sdraia.obj", mesh = "sdraia.obj",
tiles = {"sdraia_"..colour..".png", tiles = { "sdraia_" .. colour .. ".png",
}, },
inventory_image = "sdraia_"..colour.."_inv.png", inventory_image = "sdraia_" .. colour .. "_inv.png",
wield_image = "sdraia_"..colour..".png" , wield_image = "sdraia_" .. colour .. ".png",
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = { 0.4, 0.1,1.0, -0.4,-0.49, -1.0 }, fixed = { 0.4, 0.1, 1.0, -0.4, -0.49, -1.0 },
}, },
collision_box = { collision_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{0.4, 0.1,1.0, -0.4,-0.49, -1.0}, { 0.4, 0.1, 1.0, -0.4, -0.49, -1.0 },
}, },
}, },
is_ground_content = false, is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=0}, groups = { cracky = 3, oddly_breakable_by_hand = 3, not_in_creative_inventory = 0 },
--sounds = default.node_sound_wood_defaults(), --sounds = default.node_sound_wood_defaults(),
drop = "summer:sdraia_"..colour.."", drop = "summer:sdraia_" .. colour .. "",
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
return sleep_in_sdraia( pos, node, clicker, itemstack, pointed_thing ); return sleep_in_sdraia(pos, node, clicker, itemstack, pointed_thing);
end end
})
minetest.allow_sit = function( player )
})
minetest.allow_sit = function(player)
-- no check possible -- no check possible
if( not( player.get_player_velocity )) then if (not (player.get_player_velocity)) then
return true; return true;
end end
local velo = player:get_player_velocity(); local velo = player:get_player_velocity();
if( not( velo )) then if (not (velo)) then
return false; return false;
end end
local max_velo = 0.0010; local max_velo = 0.0010;
if( math.abs(velo.x) < max_velo if (math.abs(velo.x) < max_velo
and math.abs(velo.y) < max_velo and math.abs(velo.y) < max_velo
and math.abs(velo.z) < max_velo ) then and math.abs(velo.z) < max_velo) then
return true; return true;
end end
return false; return false;

View File

@ -7,23 +7,23 @@ minetest.register_node("summer:angstairA", {
"graniteA.png", "graniteA.png",
"graniteA.png", "graniteA.png",
"graniteA.png", "graniteA.png",
"graniteA.png" "graniteA.png"
}, },
--inventory_image = "s_s_A.png", --inventory_image = "s_s_A.png",
--wield_image = "s_s_A.png", --wield_image = "s_s_A.png",
drawtype = "nodebox", drawtype = "nodebox",
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{-0.5, -0.5, -0.5, 0, 0.5, 0.5}, -- NodeBox1 { -0.5, -0.5, -0.5, 0, 0.5, 0.5 }, -- NodeBox1
{-0.5, -0.5, 0, 0.5, 0.5, 0.5}, -- NodeBox2 { -0.5, -0.5, 0, 0.5, 0.5, 0.5 }, -- NodeBox2
{-0.5, -0.5, -0.5, 0.5, 0, 0.5}, -- NodeBox3 { -0.5, -0.5, -0.5, 0.5, 0, 0.5 }, -- NodeBox3
} }
}, },
--material = minetest.digprop_constanttime(1), --material = minetest.digprop_constanttime(1),
groups = {cracky = 3, stone = 1}, groups = { cracky = 3, stone = 1 },
--drop ='"summer:mattoneA" 7', --drop ='"summer:mattoneA" 7',
--legacy_mineral = true, --legacy_mineral = true,
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
@ -33,34 +33,34 @@ minetest.register_node("summer:angstairA", {
minetest.register_craft({ minetest.register_craft({
output = 'summer:angstairA', output = 'summer:angstairA',
recipe = { recipe = {
{'summer:mattoneA','summer:mattoneA',' '}, { 'summer:mattoneA', 'summer:mattoneA', ' ' },
{'summer:mattoneA','summer:mattoneA',' '}, { 'summer:mattoneA', 'summer:mattoneA', ' ' },
{'summer:mattoneA','summer:mattoneA','summer:mattoneA'}, { 'summer:mattoneA', 'summer:mattoneA', 'summer:mattoneA' },
} }
}) })
minetest.register_node("summer:angstairA2", { minetest.register_node("summer:angstairA2", {
description = "Spigolo_scala_granito_bianco", description = "Spigolo_scala_granito_bianco",
tiles = { tiles = {
"graniteA.png", "graniteA.png",
"graniteA.png", "graniteA.png",
"graniteA.png", "graniteA.png",
"graniteA.png", "graniteA.png",
"graniteA.png", "graniteA.png",
"graniteA.png" "graniteA.png"
}, },
drawtype = "nodebox", drawtype = "nodebox",
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{-0.5, -0.5, 0, 0, 0.5, 0.5}, -- NodeBox2 { -0.5, -0.5, 0, 0, 0.5, 0.5 }, -- NodeBox2
{-0.5, -0.5, -0.5, 0.5, 0, 0.5}, -- NodeBox3 { -0.5, -0.5, -0.5, 0.5, 0, 0.5 }, -- NodeBox3
} }
}, },
-- material = minetest.digprop_constanttime(1), -- material = minetest.digprop_constanttime(1),
groups = {cracky = 3, stone = 1}, groups = { cracky = 3, stone = 1 },
--drop ='summer:mattoneA 5', --drop ='summer:mattoneA 5',
--legacy_mineral = true, --legacy_mineral = true,
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
@ -69,9 +69,9 @@ description = "Spigolo_scala_granito_bianco",
minetest.register_craft({ minetest.register_craft({
output = 'summer:angstairA2', output = 'summer:angstairA2',
recipe = { recipe = {
{' ','summer:mattoneA',' '}, { ' ', 'summer:mattoneA', ' ' },
{' ','summer:mattoneA',' '}, { ' ', 'summer:mattoneA', ' ' },
{'summer:mattoneA','summer:mattoneA','summer:mattoneA'}, { 'summer:mattoneA', 'summer:mattoneA', 'summer:mattoneA' },
} }
}) })
minetest.register_node("summer:stairA", { minetest.register_node("summer:stairA", {
@ -86,17 +86,17 @@ minetest.register_node("summer:stairA", {
}, },
drawtype = "nodebox", drawtype = "nodebox",
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{-0.5, -0.5, -0.5, 0.5, 0, 0.5}, -- Node1 { -0.5, -0.5, -0.5, 0.5, 0, 0.5 }, -- Node1
{-0.5, -0.5, 0, 0.5, 0.5, 0.5}, -- Node2 { -0.5, -0.5, 0, 0.5, 0.5, 0.5 }, -- Node2
} }
}, },
-- material = minetest.digprop_constanttime(1), -- material = minetest.digprop_constanttime(1),
groups = {cracky = 3, stone = 1}, groups = { cracky = 3, stone = 1 },
-- drop ='summer:mattoneA 6', -- drop ='summer:mattoneA 6',
--legacy_mineral = true, --legacy_mineral = true,
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
@ -104,13 +104,13 @@ minetest.register_node("summer:stairA", {
minetest.register_craft({ minetest.register_craft({
output = 'summer:stairA', output = 'summer:stairA',
recipe = { recipe = {
{'summer:mattoneA',' ',' '}, { 'summer:mattoneA', ' ', ' ' },
{'summer:mattoneA','summer:mattoneA',' '}, { 'summer:mattoneA', 'summer:mattoneA', ' ' },
{'summer:mattoneA','summer:mattoneA','summer:mattoneA'}, { 'summer:mattoneA', 'summer:mattoneA', 'summer:mattoneA' },
} }
}) })
minetest.register_node("summer:battiscopaA", { minetest.register_node("summer:battiscopaA", {
description = "Battiscopa_granito_bianco", description = "Battiscopa_granito_bianco",
tiles = { tiles = {
"graniteA.png", "graniteA.png",
"graniteA.png", "graniteA.png",
@ -121,18 +121,18 @@ description = "Battiscopa_granito_bianco",
}, },
drawtype = "nodebox", drawtype = "nodebox",
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{-0.5, -0.5, -0.5, 0.5, -0.25, 0.5}, -- NodeBox3 { -0.5, -0.5, -0.5, 0.5, -0.25, 0.5 }, -- NodeBox3
{-0.5, -0.5, -0.375, 0.5, 0.25, 0.5}, -- NodeBox4 { -0.5, -0.5, -0.375, 0.5, 0.25, 0.5 }, -- NodeBox4
{-0.5, 0, -0.5, 0.5, 0.5, 0.5}, -- NodeBox5 { -0.5, 0, -0.5, 0.5, 0.5, 0.5 }, -- NodeBox5
} }
}, },
-- material = minetest.digprop_constanttime(1), -- material = minetest.digprop_constanttime(1),
groups = {cracky = 3, stone = 1}, groups = { cracky = 3, stone = 1 },
-- drop ='summer:mattoneA 8', -- drop ='summer:mattoneA 8',
--legacy_mineral = true, --legacy_mineral = true,
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
@ -140,9 +140,9 @@ description = "Battiscopa_granito_bianco",
minetest.register_craft({ minetest.register_craft({
output = 'summer:battiscopaA', output = 'summer:battiscopaA',
recipe = { recipe = {
{'summer:mattoneA','summer:mattoneA','summer:mattoneA'}, { 'summer:mattoneA', 'summer:mattoneA', 'summer:mattoneA' },
{'summer:mattoneA','summer:mattoneA',' '}, { 'summer:mattoneA', 'summer:mattoneA', ' ' },
{'summer:mattoneA','summer:mattoneA','summer:mattoneA'}, { 'summer:mattoneA', 'summer:mattoneA', 'summer:mattoneA' },
} }
}) })
minetest.register_node("summer:slabA", { minetest.register_node("summer:slabA", {
@ -157,17 +157,17 @@ minetest.register_node("summer:slabA", {
}, },
drawtype = "nodebox", drawtype = "nodebox",
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{-0.5, -0.5, -0.5, 0.5, 0, 0.5}, -- Node1 { -0.5, -0.5, -0.5, 0.5, 0, 0.5 }, -- Node1
-- {-0.5, -0.5, 0, 0.5, 0.5, 0.5}, -- Node2 -- {-0.5, -0.5, 0, 0.5, 0.5, 0.5}, -- Node2
} }
}, },
-- material = minetest.digprop_constanttime(1), -- material = minetest.digprop_constanttime(1),
groups = {cracky = 3, stone = 1}, groups = { cracky = 3, stone = 1 },
-- drop ='summer:mattoneA 6', -- drop ='summer:mattoneA 6',
--legacy_mineral = true, --legacy_mineral = true,
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
@ -175,9 +175,9 @@ minetest.register_node("summer:slabA", {
minetest.register_craft({ minetest.register_craft({
output = 'summer:slabA', output = 'summer:slabA',
recipe = { recipe = {
{' ',' ',' '}, { ' ', ' ', ' ' },
{' ',' ',' '}, { ' ', ' ', ' ' },
{'summer:mattoneA','summer:mattoneA','summer:mattoneA'}, { 'summer:mattoneA', 'summer:mattoneA', 'summer:mattoneA' },
} }
}) })
--P --P
@ -190,23 +190,23 @@ minetest.register_node("summer:angstairP", {
"graniteP.png", "graniteP.png",
"graniteP.png", "graniteP.png",
"graniteP.png", "graniteP.png",
"graniteP.png" "graniteP.png"
}, },
--inventory_image = "s_s_P.png", --inventory_image = "s_s_P.png",
--wield_image = "s_s_P.png", --wield_image = "s_s_P.png",
drawtype = "nodebox", drawtype = "nodebox",
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{-0.5, -0.5, -0.5, 0, 0.5, 0.5}, -- NodeBox1 { -0.5, -0.5, -0.5, 0, 0.5, 0.5 }, -- NodeBox1
{-0.5, -0.5, 0, 0.5, 0.5, 0.5}, -- NodeBox2 { -0.5, -0.5, 0, 0.5, 0.5, 0.5 }, -- NodeBox2
{-0.5, -0.5, -0.5, 0.5, 0, 0.5}, -- NodeBox3 { -0.5, -0.5, -0.5, 0.5, 0, 0.5 }, -- NodeBox3
} }
}, },
-- material = minetest.digprop_constanttime(1), -- material = minetest.digprop_constanttime(1),
groups = {cracky = 3, stone = 1}, groups = { cracky = 3, stone = 1 },
--drop ='"summer:mattoneP" 7', --drop ='"summer:mattoneP" 7',
--legacy_mineral = true, --legacy_mineral = true,
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
@ -216,35 +216,35 @@ minetest.register_node("summer:angstairP", {
minetest.register_craft({ minetest.register_craft({
output = 'summer:angstairP', output = 'summer:angstairP',
recipe = { recipe = {
{'summer:mattoneP','summer:mattoneP',' '}, { 'summer:mattoneP', 'summer:mattoneP', ' ' },
{'summer:mattoneP','summer:mattoneP',' '}, { 'summer:mattoneP', 'summer:mattoneP', ' ' },
{'summer:mattoneP','summer:mattoneP','summer:mattoneP'}, { 'summer:mattoneP', 'summer:mattoneP', 'summer:mattoneP' },
} }
}) })
minetest.register_node("summer:angstairP2", { minetest.register_node("summer:angstairP2", {
description = "Spigolo_scala_granito_rosa", description = "Spigolo_scala_granito_rosa",
tiles = { tiles = {
"graniteP.png", "graniteP.png",
"graniteP.png", "graniteP.png",
"graniteP.png", "graniteP.png",
"graniteP.png", "graniteP.png",
"graniteP.png", "graniteP.png",
"graniteP.png" "graniteP.png"
}, },
drawtype = "nodebox", drawtype = "nodebox",
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{-0.5, -0.5, 0, 0, 0.5, 0.5}, -- NodeBox2 { -0.5, -0.5, 0, 0, 0.5, 0.5 }, -- NodeBox2
{-0.5, -0.5, -0.5, 0.5, 0, 0.5}, -- NodeBox3 { -0.5, -0.5, -0.5, 0.5, 0, 0.5 }, -- NodeBox3
} }
}, },
-- material = minetest.digprop_constanttime(1), -- material = minetest.digprop_constanttime(1),
groups = {cracky = 3, stone = 1}, groups = { cracky = 3, stone = 1 },
drop ='summer:mattoneP 5', drop = 'summer:mattoneP 5',
--legacy_mineral = true, --legacy_mineral = true,
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
@ -252,9 +252,9 @@ description = "Spigolo_scala_granito_rosa",
minetest.register_craft({ minetest.register_craft({
output = 'summer:angstairP2', output = 'summer:angstairP2',
recipe = { recipe = {
{' ','summer:mattoneP',' '}, { ' ', 'summer:mattoneP', ' ' },
{' ','summer:mattoneP',' '}, { ' ', 'summer:mattoneP', ' ' },
{'summer:mattoneP','summer:mattoneP','summer:mattoneP'}, { 'summer:mattoneP', 'summer:mattoneP', 'summer:mattoneP' },
} }
}) })
minetest.register_node("summer:stairP", { minetest.register_node("summer:stairP", {
@ -269,16 +269,16 @@ minetest.register_node("summer:stairP", {
}, },
drawtype = "nodebox", drawtype = "nodebox",
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{-0.5, -0.5, -0.5, 0.5, 0, 0.5}, -- Node1 { -0.5, -0.5, -0.5, 0.5, 0, 0.5 }, -- Node1
{-0.5, -0.5, 0, 0.5, 0.5, 0.5}, -- Node2 { -0.5, -0.5, 0, 0.5, 0.5, 0.5 }, -- Node2
} }
}, },
-- material = minetest.digprop_constanttime(1), -- material = minetest.digprop_constanttime(1),
groups = {cracky = 3, stone = 1}, groups = { cracky = 3, stone = 1 },
--drop ='summer:mattoneP 6', --drop ='summer:mattoneP 6',
--legacy_mineral = true, --legacy_mineral = true,
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
@ -287,13 +287,13 @@ minetest.register_node("summer:stairP", {
minetest.register_craft({ minetest.register_craft({
output = 'summer:stairP', output = 'summer:stairP',
recipe = { recipe = {
{'summer:mattoneP',' ',' '}, { 'summer:mattoneP', ' ', ' ' },
{'summer:mattoneP','summer:mattoneP',' '}, { 'summer:mattoneP', 'summer:mattoneP', ' ' },
{'summer:mattoneP','summer:mattoneP','summer:mattoneP'}, { 'summer:mattoneP', 'summer:mattoneP', 'summer:mattoneP' },
} }
}) })
minetest.register_node("summer:battiscopaP", { minetest.register_node("summer:battiscopaP", {
description = "Battiscopa_granito_rosa", description = "Battiscopa_granito_rosa",
tiles = { tiles = {
"graniteP.png", "graniteP.png",
"graniteP.png", "graniteP.png",
@ -304,17 +304,17 @@ description = "Battiscopa_granito_rosa",
}, },
drawtype = "nodebox", drawtype = "nodebox",
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{-0.5, -0.5, -0.5, 0.5, -0.25, 0.5}, -- NodeBox3 { -0.5, -0.5, -0.5, 0.5, -0.25, 0.5 }, -- NodeBox3
{-0.5, -0.5, -0.375, 0.5, 0.25, 0.5}, -- NodeBox4 { -0.5, -0.5, -0.375, 0.5, 0.25, 0.5 }, -- NodeBox4
{-0.5, 0, -0.5, 0.5, 0.5, 0.5}, -- NodeBox5 { -0.5, 0, -0.5, 0.5, 0.5, 0.5 }, -- NodeBox5
} }
}, },
-- material = minetest.digprop_constanttime(1), -- material = minetest.digprop_constanttime(1),
groups = {cracky = 3, stone = 1}, groups = { cracky = 3, stone = 1 },
--drop ='summer:mattoneP 8', --drop ='summer:mattoneP 8',
--legacy_mineral = true, --legacy_mineral = true,
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
@ -323,9 +323,9 @@ description = "Battiscopa_granito_rosa",
minetest.register_craft({ minetest.register_craft({
output = 'summer:battiscopaP', output = 'summer:battiscopaP',
recipe = { recipe = {
{'summer:mattoneP','summer:mattoneP','summer:mattoneP'}, { 'summer:mattoneP', 'summer:mattoneP', 'summer:mattoneP' },
{'summer:mattoneP','summer:mattoneP',' '}, { 'summer:mattoneP', 'summer:mattoneP', ' ' },
{'summer:mattoneP','summer:mattoneP','summer:mattoneP'}, { 'summer:mattoneP', 'summer:mattoneP', 'summer:mattoneP' },
} }
}) })
minetest.register_node("summer:slabP", { minetest.register_node("summer:slabP", {
@ -340,16 +340,16 @@ minetest.register_node("summer:slabP", {
}, },
drawtype = "nodebox", drawtype = "nodebox",
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{-0.5, -0.5, -0.5, 0.5, 0, 0.5}, -- Node1 { -0.5, -0.5, -0.5, 0.5, 0, 0.5 }, -- Node1
-- {-0.5, -0.5, 0, 0.5, 0.5, 0.5}, -- Node2 -- {-0.5, -0.5, 0, 0.5, 0.5, 0.5}, -- Node2
} }
}, },
-- material = minetest.digprop_constanttime(1), -- material = minetest.digprop_constanttime(1),
groups = {cracky = 3, stone = 1}, groups = { cracky = 3, stone = 1 },
--drop ='summer:mattoneP 6', --drop ='summer:mattoneP 6',
--legacy_mineral = true, --legacy_mineral = true,
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
@ -358,9 +358,9 @@ minetest.register_node("summer:slabP", {
minetest.register_craft({ minetest.register_craft({
output = 'summer:slabP', output = 'summer:slabP',
recipe = { recipe = {
{' ',' ',' '}, { ' ', ' ', ' ' },
{' ',' ',' '}, { ' ', ' ', ' ' },
{'summer:mattoneP','summer:mattoneP','summer:mattoneP'}, { 'summer:mattoneP', 'summer:mattoneP', 'summer:mattoneP' },
} }
}) })
--R --R
@ -373,24 +373,24 @@ minetest.register_node("summer:angstairR", {
"graniteR.png", "graniteR.png",
"graniteR.png", "graniteR.png",
"graniteR.png", "graniteR.png",
"graniteR.png" "graniteR.png"
}, },
--inventory_image = "s_s_R.png", --inventory_image = "s_s_R.png",
--wield_image = "s_s_R.png", --wield_image = "s_s_R.png",
drawtype = "nodebox", drawtype = "nodebox",
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{-0.5, -0.5, -0.5, 0, 0.5, 0.5}, -- NodeBox1 { -0.5, -0.5, -0.5, 0, 0.5, 0.5 }, -- NodeBox1
{-0.5, -0.5, 0, 0.5, 0.5, 0.5}, -- NodeBox2 { -0.5, -0.5, 0, 0.5, 0.5, 0.5 }, -- NodeBox2
{-0.5, -0.5, -0.5, 0.5, 0, 0.5}, -- NodeBox3 { -0.5, -0.5, -0.5, 0.5, 0, 0.5 }, -- NodeBox3
} }
}, },
-- material = minetest.digprop_constanttime(1), -- material = minetest.digprop_constanttime(1),
groups = {cracky = 3, stone = 1}, groups = { cracky = 3, stone = 1 },
drop ='"summer:mattoneR" 7', drop = '"summer:mattoneR" 7',
--legacy_mineral = true, --legacy_mineral = true,
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
@ -399,34 +399,34 @@ minetest.register_node("summer:angstairR", {
minetest.register_craft({ minetest.register_craft({
output = 'summer:angstairR', output = 'summer:angstairR',
recipe = { recipe = {
{'summer:mattoneR','summer:mattoneR',' '}, { 'summer:mattoneR', 'summer:mattoneR', ' ' },
{'summer:mattoneR','summer:mattoneR',' '}, { 'summer:mattoneR', 'summer:mattoneR', ' ' },
{'summer:mattoneR','summer:mattoneR','summer:mattoneR'}, { 'summer:mattoneR', 'summer:mattoneR', 'summer:mattoneR' },
} }
}) })
minetest.register_node("summer:angstairR2", { minetest.register_node("summer:angstairR2", {
description = "Spigolo_scala_granito_rosso", description = "Spigolo_scala_granito_rosso",
tiles = { tiles = {
"graniteR.png", "graniteR.png",
"graniteR.png", "graniteR.png",
"graniteR.png", "graniteR.png",
"graniteR.png", "graniteR.png",
"graniteR.png", "graniteR.png",
"graniteR.png" "graniteR.png"
}, },
drawtype = "nodebox", drawtype = "nodebox",
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{-0.5, -0.5, 0, 0, 0.5, 0.5}, -- NodeBox2 { -0.5, -0.5, 0, 0, 0.5, 0.5 }, -- NodeBox2
{-0.5, -0.5, -0.5, 0.5, 0, 0.5}, -- NodeBox3 { -0.5, -0.5, -0.5, 0.5, 0, 0.5 }, -- NodeBox3
} }
}, },
-- material = minetest.digprop_constanttime(1), -- material = minetest.digprop_constanttime(1),
groups = {cracky = 3, stone = 1}, groups = { cracky = 3, stone = 1 },
--drop ='summer:mattoneR 5', --drop ='summer:mattoneR 5',
--legacy_mineral = true, --legacy_mineral = true,
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
@ -435,9 +435,9 @@ description = "Spigolo_scala_granito_rosso",
minetest.register_craft({ minetest.register_craft({
output = 'summer:angstairR2', output = 'summer:angstairR2',
recipe = { recipe = {
{' ','summer:mattoneR',' '}, { ' ', 'summer:mattoneR', ' ' },
{' ','summer:mattoneR',' '}, { ' ', 'summer:mattoneR', ' ' },
{'summer:mattoneR','summer:mattoneR','summer:mattoneR'}, { 'summer:mattoneR', 'summer:mattoneR', 'summer:mattoneR' },
} }
}) })
minetest.register_node("summer:stairR", { minetest.register_node("summer:stairR", {
@ -452,16 +452,16 @@ minetest.register_node("summer:stairR", {
}, },
drawtype = "nodebox", drawtype = "nodebox",
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{-0.5, -0.5, -0.5, 0.5, 0, 0.5}, -- Node1 { -0.5, -0.5, -0.5, 0.5, 0, 0.5 }, -- Node1
{-0.5, -0.5, 0, 0.5, 0.5, 0.5}, -- Node2 { -0.5, -0.5, 0, 0.5, 0.5, 0.5 }, -- Node2
} }
}, },
-- material = minetest.digprop_constanttime(1), -- material = minetest.digprop_constanttime(1),
groups = {cracky = 3, stone = 1}, groups = { cracky = 3, stone = 1 },
--drop ='summer:mattoneR 6', --drop ='summer:mattoneR 6',
--legacy_mineral = true, --legacy_mineral = true,
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
@ -470,13 +470,13 @@ minetest.register_node("summer:stairR", {
minetest.register_craft({ minetest.register_craft({
output = 'summer:stairR', output = 'summer:stairR',
recipe = { recipe = {
{'summer:mattoneR',' ',' '}, { 'summer:mattoneR', ' ', ' ' },
{'summer:mattoneR','summer:mattoneR',' '}, { 'summer:mattoneR', 'summer:mattoneR', ' ' },
{'summer:mattoneR','summer:mattoneR','summer:mattoneR'}, { 'summer:mattoneR', 'summer:mattoneR', 'summer:mattoneR' },
} }
}) })
minetest.register_node("summer:battiscopaR", { minetest.register_node("summer:battiscopaR", {
description = "Battiscopa_granito_rosso", description = "Battiscopa_granito_rosso",
tiles = { tiles = {
"graniteR.png", "graniteR.png",
"graniteR.png", "graniteR.png",
@ -487,17 +487,17 @@ description = "Battiscopa_granito_rosso",
}, },
drawtype = "nodebox", drawtype = "nodebox",
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{-0.5, -0.5, -0.5, 0.5, -0.25, 0.5}, -- NodeBox3 { -0.5, -0.5, -0.5, 0.5, -0.25, 0.5 }, -- NodeBox3
{-0.5, -0.5, -0.375, 0.5, 0.25, 0.5}, -- NodeBox4 { -0.5, -0.5, -0.375, 0.5, 0.25, 0.5 }, -- NodeBox4
{-0.5, 0, -0.5, 0.5, 0.5, 0.5}, -- NodeBox5 { -0.5, 0, -0.5, 0.5, 0.5, 0.5 }, -- NodeBox5
} }
}, },
-- material = minetest.digprop_constanttime(1), -- material = minetest.digprop_constanttime(1),
groups = {cracky = 3, stone = 1}, groups = { cracky = 3, stone = 1 },
--drop ='summer:mattoneR 8', --drop ='summer:mattoneR 8',
--legacy_mineral = true, --legacy_mineral = true,
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
@ -506,9 +506,9 @@ description = "Battiscopa_granito_rosso",
minetest.register_craft({ minetest.register_craft({
output = 'summer:battiscopaR', output = 'summer:battiscopaR',
recipe = { recipe = {
{'summer:mattoneR','summer:mattoneR','summer:mattoneR'}, { 'summer:mattoneR', 'summer:mattoneR', 'summer:mattoneR' },
{'summer:mattoneR','summer:mattoneR',' '}, { 'summer:mattoneR', 'summer:mattoneR', ' ' },
{'summer:mattoneR','summer:mattoneR','summer:mattoneR'}, { 'summer:mattoneR', 'summer:mattoneR', 'summer:mattoneR' },
} }
}) })
minetest.register_node("summer:slabR", { minetest.register_node("summer:slabR", {
@ -523,16 +523,16 @@ minetest.register_node("summer:slabR", {
}, },
drawtype = "nodebox", drawtype = "nodebox",
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{-0.5, -0.5, -0.5, 0.5, 0, 0.5}, -- Node1 { -0.5, -0.5, -0.5, 0.5, 0, 0.5 }, -- Node1
-- {-0.5, -0.5, 0, 0.5, 0.5, 0.5}, -- Node2 -- {-0.5, -0.5, 0, 0.5, 0.5, 0.5}, -- Node2
} }
}, },
-- material = minetest.digprop_constanttime(1), -- material = minetest.digprop_constanttime(1),
groups = {cracky = 3, stone = 1}, groups = { cracky = 3, stone = 1 },
--drop ='summer:mattoneR 6', --drop ='summer:mattoneR 6',
--legacy_mineral = true, --legacy_mineral = true,
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
@ -541,9 +541,9 @@ minetest.register_node("summer:slabR", {
minetest.register_craft({ minetest.register_craft({
output = 'summer:slabR', output = 'summer:slabR',
recipe = { recipe = {
{' ',' ',' '}, { ' ', ' ', ' ' },
{' ',' ',' '}, { ' ', ' ', ' ' },
{'summer:mattoneR','summer:mattoneR','summer:mattoneR'}, { 'summer:mattoneR', 'summer:mattoneR', 'summer:mattoneR' },
} }
}) })
--G --G
@ -556,23 +556,23 @@ minetest.register_node("summer:angstair", {
"granite.png", "granite.png",
"granite.png", "granite.png",
"granite.png", "granite.png",
"granite.png" "granite.png"
}, },
--inventory_image = "s_s_.png", --inventory_image = "s_s_.png",
--wield_image = "s_s_.png", --wield_image = "s_s_.png",
drawtype = "nodebox", drawtype = "nodebox",
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{-0.5, -0.5, -0.5, 0, 0.5, 0.5}, -- NodeBox1 { -0.5, -0.5, -0.5, 0, 0.5, 0.5 }, -- NodeBox1
{-0.5, -0.5, 0, 0.5, 0.5, 0.5}, -- NodeBox2 { -0.5, -0.5, 0, 0.5, 0.5, 0.5 }, -- NodeBox2
{-0.5, -0.5, -0.5, 0.5, 0, 0.5}, -- NodeBox3 { -0.5, -0.5, -0.5, 0.5, 0, 0.5 }, -- NodeBox3
} }
}, },
-- material = minetest.digprop_constanttime(1), -- material = minetest.digprop_constanttime(1),
groups = {cracky = 3, stone = 1}, groups = { cracky = 3, stone = 1 },
--drop ='"summer:mattone" 7', --drop ='"summer:mattone" 7',
--legacy_mineral = true, --legacy_mineral = true,
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
@ -582,34 +582,34 @@ minetest.register_node("summer:angstair", {
minetest.register_craft({ minetest.register_craft({
output = 'summer:angstair', output = 'summer:angstair',
recipe = { recipe = {
{'summer:mattone','summer:mattone',' '}, { 'summer:mattone', 'summer:mattone', ' ' },
{'summer:mattone','summer:mattone',' '}, { 'summer:mattone', 'summer:mattone', ' ' },
{'summer:mattone','summer:mattone','summer:mattone'}, { 'summer:mattone', 'summer:mattone', 'summer:mattone' },
} }
}) })
minetest.register_node("summer:angstair2", { minetest.register_node("summer:angstair2", {
description = "Spigolo_scala_granito_grigio", description = "Spigolo_scala_granito_grigio",
tiles = { tiles = {
"granite.png", "granite.png",
"granite.png", "granite.png",
"granite.png", "granite.png",
"granite.png", "granite.png",
"granite.png", "granite.png",
"granite.png" "granite.png"
}, },
drawtype = "nodebox", drawtype = "nodebox",
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{-0.5, -0.5, 0, 0, 0.5, 0.5}, -- NodeBox2 { -0.5, -0.5, 0, 0, 0.5, 0.5 }, -- NodeBox2
{-0.5, -0.5, -0.5, 0.5, 0, 0.5}, -- NodeBox3 { -0.5, -0.5, -0.5, 0.5, 0, 0.5 }, -- NodeBox3
} }
}, },
-- material = minetest.digprop_constanttime(1), -- material = minetest.digprop_constanttime(1),
groups = {cracky = 3, stone = 1}, groups = { cracky = 3, stone = 1 },
--drop ='summer:mattone 5', --drop ='summer:mattone 5',
--legacy_mineral = true, --legacy_mineral = true,
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
@ -618,9 +618,9 @@ description = "Spigolo_scala_granito_grigio",
minetest.register_craft({ minetest.register_craft({
output = 'summer:angstair2', output = 'summer:angstair2',
recipe = { recipe = {
{' ','summer:mattone',' '}, { ' ', 'summer:mattone', ' ' },
{' ','summer:mattone',' '}, { ' ', 'summer:mattone', ' ' },
{'summer:mattone','summer:mattone','summer:mattone'}, { 'summer:mattone', 'summer:mattone', 'summer:mattone' },
} }
}) })
minetest.register_node("summer:stair", { minetest.register_node("summer:stair", {
@ -635,16 +635,16 @@ minetest.register_node("summer:stair", {
}, },
drawtype = "nodebox", drawtype = "nodebox",
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{-0.5, -0.5, -0.5, 0.5, 0, 0.5}, -- Node1 { -0.5, -0.5, -0.5, 0.5, 0, 0.5 }, -- Node1
{-0.5, -0.5, 0, 0.5, 0.5, 0.5}, -- Node2 { -0.5, -0.5, 0, 0.5, 0.5, 0.5 }, -- Node2
} }
}, },
-- material = minetest.digprop_constanttime(1), -- material = minetest.digprop_constanttime(1),
groups = {cracky = 3, stone = 1}, groups = { cracky = 3, stone = 1 },
--drop ='summer:mattone 6', --drop ='summer:mattone 6',
--legacy_mineral = true, --legacy_mineral = true,
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
@ -653,13 +653,13 @@ minetest.register_node("summer:stair", {
minetest.register_craft({ minetest.register_craft({
output = 'summer:stair', output = 'summer:stair',
recipe = { recipe = {
{'summer:mattone',' ',' '}, { 'summer:mattone', ' ', ' ' },
{'summer:mattone','summer:mattone',' '}, { 'summer:mattone', 'summer:mattone', ' ' },
{'summer:mattone','summer:mattone','summer:mattone'}, { 'summer:mattone', 'summer:mattone', 'summer:mattone' },
} }
}) })
minetest.register_node("summer:battiscopa", { minetest.register_node("summer:battiscopa", {
description = "Battiscopa_granito_grigio", description = "Battiscopa_granito_grigio",
tiles = { tiles = {
"granite.png", "granite.png",
"granite.png", "granite.png",
@ -670,17 +670,17 @@ description = "Battiscopa_granito_grigio",
}, },
drawtype = "nodebox", drawtype = "nodebox",
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{-0.5, -0.5, -0.5, 0.5, -0.25, 0.5}, -- NodeBox3 { -0.5, -0.5, -0.5, 0.5, -0.25, 0.5 }, -- NodeBox3
{-0.5, -0.5, -0.375, 0.5, 0.25, 0.5}, -- NodeBox4 { -0.5, -0.5, -0.375, 0.5, 0.25, 0.5 }, -- NodeBox4
{-0.5, 0, -0.5, 0.5, 0.5, 0.5}, -- NodeBox5 { -0.5, 0, -0.5, 0.5, 0.5, 0.5 }, -- NodeBox5
} }
}, },
-- material = minetest.digprop_constanttime(1), -- material = minetest.digprop_constanttime(1),
groups = {cracky = 3, stone = 1}, groups = { cracky = 3, stone = 1 },
--drop ='summer:mattone 8', --drop ='summer:mattone 8',
--legacy_mineral = true, --legacy_mineral = true,
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
@ -689,9 +689,9 @@ description = "Battiscopa_granito_grigio",
minetest.register_craft({ minetest.register_craft({
output = 'summer:battiscopa', output = 'summer:battiscopa',
recipe = { recipe = {
{'summer:mattone','summer:mattone','summer:mattone'}, { 'summer:mattone', 'summer:mattone', 'summer:mattone' },
{'summer:mattone','summer:mattone',' '}, { 'summer:mattone', 'summer:mattone', ' ' },
{'summer:mattone','summer:mattone','summer:mattone'}, { 'summer:mattone', 'summer:mattone', 'summer:mattone' },
} }
}) })
minetest.register_node("summer:slab", { minetest.register_node("summer:slab", {
@ -706,16 +706,16 @@ minetest.register_node("summer:slab", {
}, },
drawtype = "nodebox", drawtype = "nodebox",
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{-0.5, -0.5, -0.5, 0.5, 0, 0.5}, -- Node1 { -0.5, -0.5, -0.5, 0.5, 0, 0.5 }, -- Node1
--{-0.5, -0.5, 0, 0.5, 0.5, 0.5}, -- Node2 --{-0.5, -0.5, 0, 0.5, 0.5, 0.5}, -- Node2
} }
}, },
-- material = minetest.digprop_constanttime(1), -- material = minetest.digprop_constanttime(1),
groups = {cracky = 3, stone = 1}, groups = { cracky = 3, stone = 1 },
--drop ='summer:mattone 6', --drop ='summer:mattone 6',
--legacy_mineral = true, --legacy_mineral = true,
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
@ -724,8 +724,8 @@ minetest.register_node("summer:slab", {
minetest.register_craft({ minetest.register_craft({
output = 'summer:slab', output = 'summer:slab',
recipe = { recipe = {
{' ',' ',' '}, { ' ', ' ', ' ' },
{' ',' ',' '}, { ' ', ' ', ' ' },
{'summer:mattone','summer:mattone','summer:mattone'}, { 'summer:mattone', 'summer:mattone', 'summer:mattone' },
} }
}) })

356
vetro.lua
View File

@ -1,113 +1,160 @@
local vetro_list = { local vetro_list = {
{ "Red vetro", "red"}, { "Red vetro", "red" },
{ "Orange vetro", "orange"}, { "Orange vetro", "orange" },
{ "Black vetro", "black"}, { "Black vetro", "black" },
{ "Yellow vetro", "yellow"}, { "Yellow vetro", "yellow" },
{ "Green vetro", "green"}, { "Green vetro", "green" },
{ "Dark vetro", "dark_green"}, { "Dark vetro", "dark_green" },
{ "Cyan vetro", "cyan"}, { "Cyan vetro", "cyan" },
{ "Grey vetro", "grey"}, { "Grey vetro", "grey" },
{ "Withe vetro", "white"}, { "Withe vetro", "white" },
{ "Fuxia vetro", "magenta"}, { "Fuxia vetro", "magenta" },
{ "Trasparent vetro", "trasp"}, { "Trasparent vetro", "trasp" },
{ "Blue vetro", "blue"}, { "Blue vetro", "blue" },
{ "Violet vetro", "violet"}, { "Violet vetro", "violet" },
} }
for i in ipairs(vetro_list) do for i in ipairs(vetro_list) do
local vetrodesc = vetro_list[i][1] local vetrodesc = vetro_list[i][1]
local colour = vetro_list[i][2] local colour = vetro_list[i][2]
--trasparente con cornice colorata
--trasparente con cornice colorata
minetest.register_node("summer:vetro_"..colour.."", {
description = vetrodesc.."trasparente incorniciata", minetest.register_node("summer:vetro_" .. colour .. "", {
tiles = {"vetro_"..colour..".png"}, description = vetrodesc .. "trasparente incorniciata",
sunlight_propagates = true, tiles = { "vetro_" .. colour .. ".png" },
drawtype = "glasslike", sunlight_propagates = true,
-- use_texture_alpha = true, drawtype = "glasslike",
paramtype = "light", -- use_texture_alpha = true,
paramtype2 = "glasslikeliquidlevel", paramtype = "light",
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=0}, paramtype2 = "glasslikeliquidlevel",
drop = "summer:vetro_"..colour.."", groups = { snappy = 2, cracky = 3, oddly_breakable_by_hand = 3, not_in_creative_inventory = 0 },
drop = "summer:vetro_" .. colour .. "",
sounds = default.node_sound_glass_defaults(), sounds = default.node_sound_glass_defaults(),
}) })
--trasparente cornice colorata vetro unito --trasparente cornice colorata vetro unito
minetest.register_node("summer:vetro_unito_"..colour.."", { minetest.register_node("summer:vetro_unito_" .. colour .. "", {
description = vetrodesc.."trasparente incorniciata unito", description = vetrodesc .. "trasparente incorniciata unito",
tiles = {"vetro_"..colour..".png","vetro_trasp.png"}, tiles = { "vetro_" .. colour .. ".png", "vetro_trasp.png" },
sunlight_propagates = true, sunlight_propagates = true,
drawtype = "glasslike_framed", drawtype = "glasslike_framed",
use_texture_alpha = true, use_texture_alpha = true,
paramtype = "light", paramtype = "light",
paramtype2 = "glasslikeliquidlevel", paramtype2 = "glasslikeliquidlevel",
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=0}, groups = { snappy = 2, cracky = 3, oddly_breakable_by_hand = 3, not_in_creative_inventory = 0 },
drop = "summer:vetro_unito_"..colour.."", drop = "summer:vetro_unito_" .. colour .. "",
sounds = default.node_sound_glass_defaults(), sounds = default.node_sound_glass_defaults(),
}) })
--colorato con cornice colorato --colorato con cornice colorato
minetest.register_node("summer:vetro_colorato_"..colour.."", { minetest.register_node("summer:vetro_colorato_" .. colour .. "", {
description = vetrodesc.."cornice colorato", description = vetrodesc .. "cornice colorato",
tiles = {"vetro_traspc_"..colour..".png"}, tiles = { "vetro_traspc_" .. colour .. ".png" },
sunlight_propagates = true, sunlight_propagates = true,
drawtype = "glasslike", drawtype = "glasslike",
use_texture_alpha = true, use_texture_alpha = true,
paramtype = "light", paramtype = "light",
paramtype2 = "glasslikeliquidlevel", paramtype2 = "glasslikeliquidlevel",
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=0}, groups = { snappy = 2, cracky = 3, oddly_breakable_by_hand = 3, not_in_creative_inventory = 0 },
drop = "summer:vetro_colorato_"..colour.."", drop = "summer:vetro_colorato_" .. colour .. "",
sounds = default.node_sound_glass_defaults(), sounds = default.node_sound_glass_defaults(),
--colorato con cornice colorato unito --colorato con cornice colorato unito
}) })
minetest.register_node("summer:vetro_colorato_unito_"..colour.."", { minetest.register_node("summer:vetro_colorato_unito_" .. colour .. "", {
description = vetrodesc.."unito colorato", description = vetrodesc .. "unito colorato",
tiles = {"vetro_traspc_"..colour..".png","vetro_trasp_"..colour..".png"}, tiles = { "vetro_traspc_" .. colour .. ".png", "vetro_trasp_" .. colour .. ".png" },
sunlight_propagates = true, sunlight_propagates = true,
drawtype = "glasslike_framed", drawtype = "glasslike_framed",
use_texture_alpha = true, use_texture_alpha = true,
paramtype = "light", paramtype = "light",
paramtype2 = "glasslikeliquidlevel", paramtype2 = "glasslikeliquidlevel",
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=0}, groups = { snappy = 2, cracky = 3, oddly_breakable_by_hand = 3, not_in_creative_inventory = 0 },
drop = "summer:vetro_colorato_unito_"..colour.."", drop = "summer:vetro_colorato_unito_" .. colour .. "",
sounds = default.node_sound_glass_defaults(), sounds = default.node_sound_glass_defaults(),
}) })
--senza cornice --senza cornice
minetest.register_node("summer:vetro_colorato_uni_"..colour.."", { minetest.register_node("summer:vetro_colorato_uni_" .. colour .. "", {
description = vetrodesc.." uniforme colorato", description = vetrodesc .. " uniforme colorato",
tiles = {"vetro_trasp_"..colour..".png",}, tiles = { "vetro_trasp_" .. colour .. ".png", },
sunlight_propagates = true, sunlight_propagates = true,
drawtype = "glasslike", drawtype = "glasslike",
use_texture_alpha = true, use_texture_alpha = true,
paramtype = "light", paramtype = "light",
paramtype2 = "glasslikeliquidlevel", paramtype2 = "glasslikeliquidlevel",
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=0}, groups = { snappy = 2, cracky = 3, oddly_breakable_by_hand = 3, not_in_creative_inventory = 0 },
drop = "summer:vetro_colorato_uni_"..colour.."", drop = "summer:vetro_colorato_uni_" .. colour .. "",
sounds = default.node_sound_glass_defaults(), sounds = default.node_sound_glass_defaults(),
}) })
minetest.register_craftitem("summer:vetro_traspp", { --vetro senza cornce
minetest.register_craft({
output = "summer:vetro_colorato_uni_" .. colour .. "",
recipe = {
{ "", "dye:" .. colour, "", },
{ "", "summer:vetro_traspp", "", },
{ "", "", "", }
}
})
--vetro cornice trasp
minetest.register_craft({
output = "summer:vetro_" .. colour .. "",
recipe = {
{ "default:stick", "dye:" .. colour, "default:stick", },
{ "default:stick", "summer:vetro_traspp", "default:stick", },
{ "default:stick", "default:stick", "default:stick", }
}
})
--vetro cornice trasp unito
minetest.register_craft({
output = "summer:vetro_unito_" .. colour .. "",
recipe = {
{ "", "dye:" .. colour, "", },
{ "", "summer:vetro_traspp", "", },
{ "default:stick", "default:stick", "default:stick", }
}
})
--vetro cornice colorato
minetest.register_craft({
output = "summer:vetro_colorato_" .. colour .. "",
recipe = {
{ "default:stick", "dye:" .. colour, "default:stick" },
{ "default:stick", "summer:vetro_" .. colour, "default:stick" },
{ "default:stick", "default:stick", "default:stick" }
}
})
--vetro cornice colorato unito
minetest.register_craft({
output = "summer:vetro_colorato_unito_" .. colour .. "",
recipe = {
{ "", "dye:" .. colour, "" },
{ "", "summer:vetro_" .. colour, "" },
{ "default:stick", "default:stick", "default:stick" }
}
})
end
minetest.register_craftitem("summer:vetro_traspp", {
description = "vetrino", description = "vetrino",
inventory_image = "vetro_traspp.png", inventory_image = "vetro_traspp.png",
--groups = {stick = 1, flammable = 2}, --groups = {stick = 1, flammable = 2},
}) })
minetest.register_craft({ minetest.register_craft({
type = "cooking", type = "cooking",
cooktime = 10, cooktime = 10,
output = "summer:vetro_traspp", output = "summer:vetro_traspp",
recipe = "summer:mattoneG" recipe = "summer:mattoneG"
}) })
minetest.register_craft({ minetest.register_craft({
type = "cooking", type = "cooking",
cooktime = 10, cooktime = 10,
output = "summer:vetro_traspp", output = "summer:vetro_traspp",
@ -125,90 +172,45 @@ minetest.register_craft({
output = "summer:vetro_traspp", output = "summer:vetro_traspp",
recipe = "summer:mattoneP" recipe = "summer:mattoneP"
}) })
--vetro senza cornce
minetest.register_craft({ --trasp
output = "summer:vetro_colorato_uni_"..colour.."", minetest.register_craft({
recipe = { output = "summer:vetro_colorato_trasp",
{"", "dye:"..colour, "", }, recipe = {
{"", "summer:vetro_traspp","", }, { "default:stick", "default:stick", "default:stick" },
{"", "", "", } { "default:stick", "summer:vetro_traspp", "default:stick" },
} { "default:stick", "default:stick", "default:stick" }
}) }
--vetro cornice trasp })
minetest.register_craft({ minetest.register_craft({
output = "summer:vetro_"..colour.."", output = "summer:vetro_colorato_unito_trasp",
recipe = { recipe = {
{"default:stick", "dye:"..colour, "default:stick", }, { "", "", "" },
{"default:stick", "summer:vetro_traspp","default:stick", }, { "", "summer:vetro_traspp", "" },
{"default:stick", "default:stick", "default:stick", } { "default:stick", "default:stick", "default:stick" }
} }
}) })
--vetro cornice trasp unito minetest.register_craft({
minetest.register_craft({ output = "summer:vetro_unito_trasp",
output = "summer:vetro_unito_"..colour.."", recipe = {
recipe = { { "default:stick", "", "", },
{"", "dye:"..colour, "", }, { "default:stick", "summer:vetro_traspp", "", },
{"", "summer:vetro_traspp","", }, { "default:stick", "", "", }
{"default:stick", "default:stick", "default:stick", } }
} })
}) minetest.register_craft({
--vetro cornice colorato output = "summer:vetro_colorato_uni_trasp",
minetest.register_craft({ recipe = {
output = "summer:vetro_colorato_"..colour.."", { "", "", "", },
recipe = { { "summer:vetro_traspp", "summer:vetro_traspp", "", },
{"default:stick", "dye:"..colour, "default:stick" }, { "summer:vetro_traspp", "summer:vetro_traspp", "", }
{"default:stick", "summer:vetro_"..colour,"default:stick" }, }
{"default:stick", "default:stick", "default:stick" } })
} minetest.register_craft({
}) output = "summer:vetro_trasp",
--vetro cornice colorato unito recipe = {
minetest.register_craft({ { "default:stick", "default:stick", "default:stick", },
output = "summer:vetro_colorato_unito_"..colour.."", { "default:stick", "summer:vetro_traspp", "default:stick", },
recipe = { { "default:stick", "", "default:stick", }
{"", "dye:"..colour, "" }, }
{"", "summer:vetro_"..colour,"" }, })
{"default:stick", "default:stick", "default:stick" }
}
})
--trasp
minetest.register_craft({
output = "summer:vetro_colorato_trasp",
recipe = {
{"default:stick", "default:stick", "default:stick" },
{"default:stick", "summer:vetro_traspp","default:stick" },
{"default:stick", "default:stick", "default:stick" }
}
})
minetest.register_craft({
output = "summer:vetro_colorato_unito_trasp",
recipe = {
{"", "", "" },
{"", "summer:vetro_traspp","" },
{"default:stick", "default:stick", "default:stick" }
}
})
minetest.register_craft({
output = "summer:vetro_unito_trasp",
recipe = {
{"default:stick", "", "", },
{"default:stick", "summer:vetro_traspp","", },
{"default:stick", "", "", }
}
})
minetest.register_craft({
output = "summer:vetro_colorato_uni_trasp",
recipe = {
{"", "", "", },
{"summer:vetro_traspp", "summer:vetro_traspp","", },
{"summer:vetro_traspp", "summer:vetro_traspp", "", }
}
})
minetest.register_craft({
output = "summer:vetro_trasp",
recipe = {
{"default:stick", "default:stick", "default:stick", },
{"default:stick", "summer:vetro_traspp","default:stick", },
{"default:stick", "", "default:stick", }
}
})
end