Compare commits

..

1 Commits
dev ... main

Author SHA1 Message Date
Vitaliy Olkhin
f0ba412b5c исправлен звук 2024-11-30 14:55:53 +05:00
23 changed files with 2534 additions and 2470 deletions

View File

@ -1,18 +1,19 @@
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,199 +1,214 @@
local Asciugamano_list = {
{ "Red Asciugamano", "red" },
{ "Orange Asciugamano", "orange" },
{ "Black Asciugamano", "black" }, local Asciugamano_list = {
{ "Yellow Asciugamano", "yellow" }, { "Red Asciugamano", "red"},
{ "Green Asciugamano", "green" }, { "Orange Asciugamano", "orange"},
{ "Blue Asciugamano", "blue" }, { "Black Asciugamano", "black"},
{ "Violet Asciugamano", "violet" }, { "Yellow Asciugamano", "yellow"},
{ "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",
paramtype = "light", minetest.register_node("summer:asciugamano_"..colour.."", {
paramtype2 = "facedir", description = asciugamanodesc.."",
sunlight_propagates = true, drawtype = "mesh",
walkable = false, mesh = "asciugamano.obj",
selection_box = { tiles = {"asciugsmano_"..colour..".png",
type = "fixed", },
fixed = { -1.0, -0.5, -0.5, 1.0, -0.49, 0.5 }, inventory_image = "asciugsmano_a_"..colour..".png",
},
groups = { snappy = 2, cracky = 3, oddly_breakable_by_hand = 3, not_in_creative_inventory = 0 }, wield_image = "asciugsmano_a_"..colour..".png",
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
return; 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
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 );
local animation = default.player_get_animation(clicker); if( not( node2 ) or not( node2.param2 ) or not( node.param2 )
local pname = clicker:get_player_name(); or node2.name ~= "summer:asciugamano_"..colour..""
or node2.param2 ~= node.param2 ) then
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
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
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; 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
-- set the right height for the asciugamano
if (place_name == 'asciugamano') then
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
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
minetest.chat_send_player(pname, allow_sleep = true;
'Comftable, but not good enough for a nap. Right-click again if you want to get back up.'); 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
-- set the right height for the asciugamano
if( place_name=='asciugamano' ) then
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
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
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,236 +24,244 @@ 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"
-- Boat entity local barca_ent_name = "summer:barca_"..color.."_entity"
--
local barca = { --
physical = true, -- Boat entity
collisionbox = { -2.5, -0.5, -2.5, 2.5, 0.3, 2.5 }, --
visual = "mesh",
mesh = "barca.x", --"barcal.obj",
textures = { "barca_" .. color .. ".png" },
driver = nil, local barca = {
v = 0, physical = true,
last_v = 0, collisionbox = {-2.5, -0.5, -2.5, 2.5, 0.3, 2.5},
removed = false visual = "mesh",
} mesh = "barca.x",--"barcal.obj",
textures = {"barca_"..color..".png" },
driver = nil,
function barca.on_rightclick(self, clicker) v = 0,
if not clicker or not clicker:is_player() then last_v = 0,
return removed = false
end
local name = clicker:get_player_name()
if self.driver and clicker == self.driver then
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()
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
function barca.on_activate(self, staticdata, dtime_s)
self.object:set_armor_groups({ immortal = 1 })
if staticdata then
self.v = tonumber(staticdata)
end
self.last_v = self.v
end
function barca.get_staticdata(self)
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
if self.driver and puncher == self.driver then
self.driver = nil
puncher:set_detach()
default.player_attached[puncher:get_player_name()] = false
end
if not self.driver then
self.removed = true
-- delay remove to ensure player is detached
minetest.after(0.1, function()
self.object:remove()
end)
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
function barca.on_step(self, dtime)
self.v = get_v(self.object:getvelocity()) * get_sign(self.v)
if self.driver then
local ctrl = self.driver:get_player_control()
local yaw = self.object:getyaw()
if ctrl.up then
self.v = self.v + 0.1
elseif ctrl.down then
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
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
local velo = self.object:getvelocity()
if self.v == 0 and velo.x == 0 and velo.y == 0 and velo.z == 0 then
self.object:setpos(self.object:getpos())
return
end
local s = get_sign(self.v)
self.v = self.v - 0.02 * s
if s ~= get_sign(self.v) then
self.object:setvelocity({ x = 0, y = 0, z = 0 })
self.v = 0
return
end
if math.abs(self.v) > 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
new_acce = { x = 0, y = 2, z = 0 }
else
new_acce = { x = 0, y = -1.8, z = 0 }
end
new_velo = get_velocity(self.v, self.object:getyaw(),
self.object:getvelocity().y)
self.object:setpos(self.object:getpos())
else
p.y = p.y + 1
if is_water(p) then
local y = self.object:getvelocity().y
if y >= 7 then
y = 7
elseif y < 0 then
new_acce = { x = 0, y = 50, z = 0 }
else
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())
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
self.object:setvelocity(new_velo)
self.object:setacceleration(new_acce)
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,
})
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
colors = {
"black", "red", "green", "blue", "yellow", "violet", "orange",
} }
for _, color in ipairs(colors) do
function barca.on_rightclick(self, clicker)
if not clicker or not clicker:is_player() then
return
end
local name = clicker:get_player_name()
if self.driver and clicker == self.driver then
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()
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
function barca.on_activate(self, staticdata, dtime_s)
self.object:set_armor_groups({immortal = 1})
if staticdata then
self.v = tonumber(staticdata)
end
self.last_v = self.v
end
function barca.get_staticdata(self)
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
if self.driver and puncher == self.driver then
self.driver = nil
puncher:set_detach()
default.player_attached[puncher:get_player_name()] = false
end
if not self.driver then
self.removed = true
-- delay remove to ensure player is detached
minetest.after(0.1, function()
self.object:remove()
end)
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
function barca.on_step(self, dtime)
self.v = get_v(self.object:getvelocity()) * get_sign(self.v)
if self.driver then
local ctrl = self.driver:get_player_control()
local yaw = self.object:getyaw()
if ctrl.up then
self.v = self.v + 0.1
elseif ctrl.down then
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
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
local velo = self.object:getvelocity()
if self.v == 0 and velo.x == 0 and velo.y == 0 and velo.z == 0 then
self.object:setpos(self.object:getpos())
return
end
local s = get_sign(self.v)
self.v = self.v - 0.02 * s
if s ~= get_sign(self.v) then
self.object:setvelocity({x = 0, y = 0, z = 0})
self.v = 0
return
end
if math.abs(self.v) > 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
new_acce = {x = 0, y = 2, z = 0}
else
new_acce = {x = 0, y = -1.8, z = 0}
end
new_velo = get_velocity(self.v, self.object:getyaw(),
self.object:getvelocity().y)
self.object:setpos(self.object:getpos())
else
p.y = p.y + 1
if is_water(p) then
local y = self.object:getvelocity().y
if y >= 7 then
y = 7
elseif y < 0 then
new_acce = {x = 0, y = 50, z = 0}
else
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())
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
self.object:setvelocity(new_velo)
self.object:setacceleration(new_acce)
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,
})
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
colors = {
"black", "red", "green", "blue", "yellow", "violet","orange",
}
for _,color in ipairs(colors) do
reg_barca(color) reg_barca(color)
end end

View File

@ -1,45 +1,46 @@
--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,121 +1,123 @@
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:sdraia_" .. colour .. "", output = "summer:Portacenere_"..colour.."",
recipe = { recipe = {
{ "", "wool:" .. colour, "", }, {"cannabis:canapa_fiber", "", "cannabis:canapa_fiber" },
{ "cannabis:canapa_fiber", "cannabis:canapa_plastic", "cannabis:canapa_fiber", }, {"cannabis:canapa_plastic", "", "cannabis:canapa_plastic" },
{ "", "cannabis:canapa_fiber", "", } {"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", "", }
}
})
--portacenere --________________________________________________________
minetest.register_craft({ --asciugamano
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", }
}
})
--________________________________________________________
--asciugamano --ombrellone
--________________________________________________________ --________________________________________________________
minetest.register_craft({
minetest.register_craft({ output = "summer:ombrellone_"..colour.."",
output = "summer:asciugamano_" .. colour .. "", recipe = {
recipe = { {"", "wool:"..colour, "", },
{ "", "", "", }, {"", "cannabis:canapa_plastic", "", },
{ "wool:" .. colour, "", "", }, {"", "cannabis:canapa_fiber", "", }
{ "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({
minetest.register_craft({ output = "summer:ombrellone_n_"..colour.."",
output = "summer:ombrellone_n_" .. colour .. "", recipe = {
recipe = { {"cannabis:canapa_fiber", "wool:"..colour, "cannabis:canapa_fiber" },
{ "cannabis:canapa_fiber", "wool:" .. colour, "cannabis:canapa_fiber" }, {"", "cannabis:canapa_plastic", "" },
{ "", "cannabis:canapa_plastic", "" }, {"", "cannabis:canapa_plastic", "" }
{ "", "cannabis:canapa_plastic", "" } }
} })
})
--________________________________________________________
--________________________________________________________
--chest
--chest --________________________________________________________
--________________________________________________________ minetest.register_craft({
minetest.register_craft({ output = "summer:chest"..colour.."",
output = "summer:chest" .. colour .. "", recipe = {
recipe = { {"cannabis:canapa_plastic","dye:"..colour.."","cannabis:canapa_plastic"},
{ "cannabis:canapa_plastic", "dye:" .. colour .. "", "cannabis:canapa_plastic" }, {"group:wood","","group:wood"},
{ "group:wood", "", "group:wood" }, {"group:wood","group:wood","group:wood"}
{ "group:wood", "group:wood", "group:wood" }
}
} })
})
minetest.register_craft({
minetest.register_craft({ output = "summer:chest_lock"..colour.."",
output = "summer:chest_lock" .. colour .. "", recipe = {
recipe = { {"summer:chest"..colour.."","cannabis:high_performance_ingot",""}
{ "summer:chest" .. colour .. "", "cannabis:high_performance_ingot", "" } --{"","",""},
--{"","",""}, --{"","",""}
--{"","",""}
}
} })
})
end
end end
end

416
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,240 +24,248 @@ 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"
-- Boat entity local canoa_ent_name = "summer:canoa_"..color.."_entity"
--
local canoa_ = { --
physical = true, -- Boat entity
collisionbox = { -0.5, -0.35, -0.5, 0.5, 0.3, 0.5 }, --
visual = "mesh",
mesh = "canoa.x",
textures = { "canoa_" .. color .. ".png" },
driver = nil, local canoa_ = {
v = 0, physical = true,
last_v = 0, collisionbox = {-0.5, -0.35, -0.5, 0.5, 0.3, 0.5},
removed = false visual = "mesh",
} 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)
self.object:set_armor_groups({ immortal = 1 }) function canoa_.on_activate(self, staticdata, dtime_s)
if staticdata then self.object:set_armor_groups({immortal = 1})
self.v = tonumber(staticdata) if staticdata then
end self.v = tonumber(staticdata)
self.last_v = self.v
end end
self.last_v = self.v
end
function canoa_.get_staticdata(self)
return tostring(self.v) function canoa_.get_staticdata(self)
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
function canoa_.on_punch(self, puncher) self.driver = nil
if not puncher or not puncher:is_player() or self.removed then puncher:set_detach()
return default.player_attached[puncher:get_player_name()] = false
end
if self.driver and puncher == self.driver then
self.driver = nil
puncher:set_detach()
default.player_attached[puncher:get_player_name()] = false
end
if not self.driver then
self.removed = true
-- delay remove to ensure player is detached
minetest.after(0.1, function()
self.object:remove()
end)
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
if not self.driver then
function canoa_.on_step(self, dtime) self.removed = true
self.v = get_v(self.object:getvelocity()) * get_sign(self.v) -- delay remove to ensure player is detached
if self.driver then minetest.after(0.1, function()
local ctrl = self.driver:get_player_control() self.object:remove()
local yaw = self.object:getyaw() end)
if ctrl.up then if not minetest.setting_getbool("creative_mode") then
self.v = self.v + 0.1 local inv = puncher:get_inventory()
elseif ctrl.down then if inv:room_for_item("main", "summer:canoa_"..color.."_item") then
self.v = self.v - 0.1 inv:add_item("main", "summer:canoa_"..color.."_item")
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
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
local velo = self.object:getvelocity()
if self.v == 0 and velo.x == 0 and velo.y == 0 and velo.z == 0 then
self.object:setpos(self.object:getpos())
return
end
local s = get_sign(self.v)
self.v = self.v - 0.02 * s
if s ~= get_sign(self.v) then
self.object:setvelocity({ x = 0, y = 0, z = 0 })
self.v = 0
return
end
if math.abs(self.v) > 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
new_acce = { x = 0, y = 1, z = 0 }
else else
new_acce = { x = 0, y = -9.8, z = 0 } minetest.add_item(self.object:getpos(), canoa_item_name)
end end
new_velo = get_velocity(self.v, self.object:getyaw(), end
self.object:getvelocity().y) end
end
function canoa_.on_step(self, dtime)
self.v = get_v(self.object:getvelocity()) * get_sign(self.v)
if self.driver then
local ctrl = self.driver:get_player_control()
local yaw = self.object:getyaw()
if ctrl.up then
self.v = self.v + 0.1
elseif ctrl.down then
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
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
local velo = self.object:getvelocity()
if self.v == 0 and velo.x == 0 and velo.y == 0 and velo.z == 0 then
self.object:setpos(self.object:getpos())
return
end
local s = get_sign(self.v)
self.v = self.v - 0.02 * s
if s ~= get_sign(self.v) then
self.object:setvelocity({x = 0, y = 0, z = 0})
self.v = 0
return
end
if math.abs(self.v) > 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
new_acce = {x = 0, y = 1, z = 0}
else
new_acce = {x = 0, y = -9.8, z = 0}
end
new_velo = get_velocity(self.v, self.object:getyaw(),
self.object:getvelocity().y)
self.object:setpos(self.object:getpos())
else
p.y = p.y + 1
if is_water(p) then
local y = self.object:getvelocity().y
if y >= 5 then
y = 5
elseif y < 0 then
new_acce = {x = 0, y = 20, z = 0}
else
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 else
p.y = p.y + 1 new_acce = {x = 0, y = 0, z = 0}
if is_water(p) then if math.abs(self.object:getvelocity().y) < 1 then
local y = self.object:getvelocity().y local pos = self.object:getpos()
if y >= 5 then pos.y = math.floor(pos.y) + 0.5
y = 5 self.object:setpos(pos)
elseif y < 0 then new_velo = get_velocity(self.v, self.object:getyaw(), 0)
new_acce = { x = 0, y = 20, z = 0 }
else
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())
else else
new_acce = { x = 0, y = 0, z = 0 } new_velo = get_velocity(self.v, self.object:getyaw(),
if math.abs(self.object:getvelocity().y) < 1 then self.object:getvelocity().y)
local pos = self.object:getpos() self.object:setpos(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)
minetest.register_entity("summer:canoa_" .. color .. "", canoa_) self.object:setacceleration(new_acce)
end
minetest.register_craftitem(canoa_item_name, { minetest.register_entity("summer:canoa_"..color.."", canoa_)
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)
if pointed_thing.type ~= "node" then minetest.register_craftitem(canoa_item_name, {
return description = "canoa ("..color..")",
end inventory_image = "canoa_"..color.."_inv.png",
if not is_water(pointed_thing.under) then wield_image = "canoa_"..color.."_inv.png",
return wield_scale = {x = 2, y = 2, z = 1},
end liquids_pointable = true,
pointed_thing.under.y = pointed_thing.under.y + 0.5
minetest.add_entity(pointed_thing.under, "summer:canoa_" .. color .. "") on_place = function(itemstack, placer, pointed_thing)
if not minetest.setting_getbool("creative_mode") then if pointed_thing.type ~= "node" then
itemstack:take_item() return
end end
return itemstack if not is_water(pointed_thing.under) then
end, return
}) 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,186 +40,185 @@ 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 .. "", { minetest.register_node("summer:chest"..colour.."", {
description = chestdesc .. colour .. "", description = chestdesc..colour.."",
tiles = { "chest_top_" .. colour .. ".png", "chest_top_" .. colour .. ".png", "chest_side_" .. colour .. ".png", 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" }, "chest_side_"..colour..".png", "chest_side_"..colour..".png", "chest_front_"..colour..".png"},
--inventory_image = "chest_front_"..colour.."_inv.png", --inventory_image = "chest_front_"..colour.."_inv.png",
--wield_image = {"chest_front_"..colour..".png", --wield_image = {"chest_front_"..colour..".png",
-- }, -- },
paramtype2 = "facedir", paramtype2 = "facedir",
groups = { choppy = 2, oddly_breakable_by_hand = 2, tubedevice = 1, tubedevice_receiver = 1 }, groups = {choppy = 2, oddly_breakable_by_hand = 2,tubedevice = 1, tubedevice_receiver = 1},
tube = { tube = {
insert_object = function(pos, node, stack, direction) 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)
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()
inv:set_size("main", 16 * 4) return inv:add_item("main", stack)
end, end,
can_dig = function(pos, player) can_insert = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos); local meta = minetest.get_meta(pos)
local inv = meta:get_inventory() local inv = meta:get_inventory()
return inv:is_empty("main") return inv:room_for_item("main", stack)
end, end,
on_metadata_inventory_move = function(pos, from_list, from_index, input_inventory = "main",
to_list, to_index, count, player) connect_sides = {left = 1, right = 1, back = 1, front = 1, bottom = 1, top = 1}
minetest.log("action", player:get_player_name() .. },
" moves stuff in chest at " .. minetest.pos_to_string(pos)) legacy_facedir_simple = true,
end, is_ground_content = false,
on_metadata_inventory_put = function(pos, listname, index, stack, player) sounds = default.node_sound_wood_defaults(),
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 on_construct = function(pos)
local lockchestdesc = lockchest_list[i][1] local meta = minetest.get_meta(pos)
local colour = lockchest_list[i][2] meta:set_string("formspec", chest_formspec)
meta:set_string("infotext", "Chest")
local inv = meta:get_inventory()
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"},
}
minetest.register_node("summer:chest_lock" .. colour .. "", { for i in ipairs(lockchest_list) do
description = lockchestdesc .. "", local lockchestdesc = lockchest_list[i][1]
tiles = { "chest_top_" .. colour .. ".png", "chest_top_" .. colour .. ".png", "chest_side_" .. colour .. local colour = lockchest_list[i][2]
".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", minetest.register_node("summer:chest_lock"..colour.."", {
-- }, description = lockchestdesc.."",
paramtype2 = "facedir", tiles = {"chest_top_"..colour..".png", "chest_top_"..colour..".png", "chest_side_"..colour..".png",
groups = { choppy = 2, oddly_breakable_by_hand = 2, tubedevice = 1, tubedevice_receiver = 1 }, "chest_side_"..colour..".png", "chest_side_"..colour..".png", "chest_lock_"..colour..".png"},
tube = { --inventory_image = "chest_lock_"..colour.."_inv.png",
insert_object = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos) --wield_image = {"chest_lock_"..colour.."_inv.png",
local inv = meta:get_inventory() -- },
return inv:add_item("main", stack) paramtype2 = "facedir",
end, groups = {choppy = 2, oddly_breakable_by_hand = 2,tubedevice = 1, tubedevice_receiver = 1},
can_insert = function(pos, node, stack, direction) tube = {
local meta = minetest.get_meta(pos) insert_object = function(pos, node, stack, direction)
local inv = meta:get_inventory() local meta = minetest.get_meta(pos)
return inv:room_for_item("main", stack) local inv = meta:get_inventory()
end, return inv:add_item("main", stack)
input_inventory = "main", end,
connect_sides = { left = 1, right = 1, back = 1, front = 1, bottom = 1, top = 1 } can_insert = function(pos, node, stack, direction)
}, local meta = minetest.get_meta(pos)
legacy_facedir_simple = true, local inv = meta:get_inventory()
is_ground_content = false, return inv:room_for_item("main", stack)
sounds = default.node_sound_wood_defaults(), 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(),
after_place_node = function(pos, placer) after_place_node = function(pos, placer)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
meta:set_string("owner", placer:get_player_name() or "") meta:set_string("owner", placer:get_player_name() or "")
meta:set_string("infotext", "Locked Chest (owned by " .. meta:set_string("infotext", "Locked Chest (owned by " ..
meta:get_string("owner") .. ")") meta:get_string("owner") .. ")")
end, end,
on_construct = function(pos) on_construct = function(pos)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
meta:set_string("infotext", "Locked Chest") meta:set_string("infotext", "Locked Chest")
meta:set_string("owner", "") meta:set_string("owner", "")
local inv = meta:get_inventory() local inv = meta:get_inventory()
inv:set_size("main", 16 * 4) inv:set_size("main", 16 * 4)
end, end,
can_dig = function(pos, player) 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:is_empty("main") and has_locked_chest_privilege(meta, player) return inv:is_empty("main") and has_locked_chest_privilege(meta, player)
end, end,
allow_metadata_inventory_move = function(pos, from_list, from_index, allow_metadata_inventory_move = function(pos, from_list, from_index,
to_list, to_index, count, player) to_list, to_index, count, player)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
if not has_locked_chest_privilege(meta, player) then if not has_locked_chest_privilege(meta, player) then
return 0 return 0
end end
return count return count
end, end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player) allow_metadata_inventory_put = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
if not has_locked_chest_privilege(meta, player) then if not has_locked_chest_privilege(meta, player) then
return 0 return 0
end end
return stack:get_count() return stack:get_count()
end, end,
allow_metadata_inventory_take = function(pos, listname, index, stack, player) allow_metadata_inventory_take = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
if not has_locked_chest_privilege(meta, player) then if not has_locked_chest_privilege(meta, player) then
return 0 return 0
end end
return stack:get_count() return stack:get_count()
end, end,
on_metadata_inventory_put = function(pos, listname, index, stack, player) on_metadata_inventory_put = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name() .. minetest.log("action", player:get_player_name() ..
" moves " .. stack:get_name() .. " moves " .. stack:get_name() ..
" to locked chest at " .. minetest.pos_to_string(pos)) " to locked chest at " .. minetest.pos_to_string(pos))
end, end,
on_metadata_inventory_take = function(pos, listname, index, stack, player) on_metadata_inventory_take = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name() .. minetest.log("action", player:get_player_name() ..
" takes " .. stack:get_name() .. " takes " .. stack:get_name() ..
" from locked chest at " .. minetest.pos_to_string(pos)) " from locked chest at " .. minetest.pos_to_string(pos))
end, end,
on_rightclick = function(pos, node, clicker) on_rightclick = function(pos, node, clicker)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
if has_locked_chest_privilege(meta, clicker) then if has_locked_chest_privilege(meta, clicker) then
minetest.show_formspec( minetest.show_formspec(
clicker:get_player_name(), clicker:get_player_name(),
"summer:chest_lock" .. colour .. "", "summer:chest_lock"..colour.."",
get_locked_chest_formspec(pos) get_locked_chest_formspec(pos)
) )
end end
end, end,
on_blast = function() end, on_blast = function() end,
}) })
end end
end end

285
craft.lua
View File

@ -1,141 +1,88 @@
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
--sdraia minetest.register_craft({
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
--breccia minetest.register_craft({
--________________________________________________________ output = "summer:Portacenere_"..colour.."",
recipe = {
{"group:wood", "", "group:wood" },
{"default:stick", "default:paper", "default:stick" },
{"default:paper", "wool:"..colour, "default:paper" }
}
})
--craft BRECCIA BLOCK --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", }
}
})
--________________________________________________________
--breccia
--________________________________________________________
--craft BRECCIA BLOCK
minetest.register_craft({ minetest.register_craft({
output = '"summer:breccia" 4', output = '"summer:breccia" 4',
recipe = { recipe = {
@ -146,7 +93,7 @@ if minetest.get_modpath("wool") and minetest.get_modpath("dye") then
}) })
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" },
@ -170,25 +117,25 @@ if minetest.get_modpath("wool") and minetest.get_modpath("dye") then
{ "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", "" },
}, },
@ -201,7 +148,7 @@ if minetest.get_modpath("wool") and minetest.get_modpath("dye") then
{ "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" },
@ -217,7 +164,7 @@ if minetest.get_modpath("wool") and minetest.get_modpath("dye") then
{ "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" },
@ -225,5 +172,61 @@ if minetest.get_modpath("wool") and minetest.get_modpath("dye") then
{ "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],
{ cracky = 3 }, stairs.register_stair_and_slab("summer_".. granite[1], "summer:".. granite[1],
{ granite[1] .. ".png" }, {cracky = 3},
{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,236 +24,245 @@ 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"
-- Boat entity local materassino_ent_name = "summer:materassino_"..color.."_entity"
--
local materassino = { --
physical = true, -- Boat entity
collisionbox = { -0.5, -0.35, -0.5, 0.5, 0.3, 0.5 }, --
visual = "mesh",
mesh = "materassino.obj",
textures = { "materassino_" .. color .. ".png" },
driver = nil, local materassino = {
v = 0, physical = true,
last_v = 0, collisionbox = {-0.5, -0.35, -0.5, 0.5, 0.3, 0.5},
removed = false visual = "mesh",
} 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)
self.object:set_armor_groups({ immortal = 1 }) function materassino.on_activate(self, staticdata, dtime_s)
if staticdata then self.object:set_armor_groups({immortal = 1})
self.v = tonumber(staticdata) if staticdata then
end self.v = tonumber(staticdata)
self.last_v = self.v
end end
self.last_v = self.v
end
function materassino.get_staticdata(self)
return tostring(self.v) function materassino.get_staticdata(self)
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
function materassino.on_punch(self, puncher) self.driver = nil
if not puncher or not puncher:is_player() or self.removed then puncher:set_detach()
return default.player_attached[puncher:get_player_name()] = false
end
if self.driver and puncher == self.driver then
self.driver = nil
puncher:set_detach()
default.player_attached[puncher:get_player_name()] = false
end
if not self.driver then
self.removed = true
-- delay remove to ensure player is detached
minetest.after(0.1, function()
self.object:remove()
end)
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
if not self.driver then
function materassino.on_step(self, dtime) self.removed = true
self.v = get_v(self.object:getvelocity()) * get_sign(self.v) -- delay remove to ensure player is detached
if self.driver then minetest.after(0.1, function()
local ctrl = self.driver:get_player_control() self.object:remove()
local yaw = self.object:getyaw() end)
if ctrl.up then if not minetest.setting_getbool("creative_mode") then
self.v = self.v + 0.1 local inv = puncher:get_inventory()
elseif ctrl.down then if inv:room_for_item("main", "summer:materassino_"..color.."_item") then
self.v = self.v - 0.1 inv:add_item("main", "summer:materassino_"..color.."_item")
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
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
local velo = self.object:getvelocity()
if self.v == 0 and velo.x == 0 and velo.y == 0 and velo.z == 0 then
self.object:setpos(self.object:getpos())
return
end
local s = get_sign(self.v)
self.v = self.v - 0.02 * s
if s ~= get_sign(self.v) then
self.object:setvelocity({ x = 0, y = 0, z = 0 })
self.v = 0
return
end
if math.abs(self.v) > 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
new_acce = { x = 0, y = 1, z = 0 }
else else
new_acce = { x = 0, y = -9.8, z = 0 } minetest.add_item(self.object:getpos(), materassino_item_name)
end end
new_velo = get_velocity(self.v, self.object:getyaw(), end
self.object:getvelocity().y) end
end
function materassino.on_step(self, dtime)
self.v = get_v(self.object:getvelocity()) * get_sign(self.v)
if self.driver then
local ctrl = self.driver:get_player_control()
local yaw = self.object:getyaw()
if ctrl.up then
self.v = self.v + 0.1
elseif ctrl.down then
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
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
local velo = self.object:getvelocity()
if self.v == 0 and velo.x == 0 and velo.y == 0 and velo.z == 0 then
self.object:setpos(self.object:getpos())
return
end
local s = get_sign(self.v)
self.v = self.v - 0.02 * s
if s ~= get_sign(self.v) then
self.object:setvelocity({x = 0, y = 0, z = 0})
self.v = 0
return
end
if math.abs(self.v) > 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
new_acce = {x = 0, y = 1, z = 0}
else
new_acce = {x = 0, y = -9.8, z = 0}
end
new_velo = get_velocity(self.v, self.object:getyaw(),
self.object:getvelocity().y)
self.object:setpos(self.object:getpos())
else
p.y = p.y + 1
if is_water(p) then
local y = self.object:getvelocity().y
if y >= 5 then
y = 5
elseif y < 0 then
new_acce = {x = 0, y = 20, z = 0}
else
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 else
p.y = p.y + 1 new_acce = {x = 0, y = 0, z = 0}
if is_water(p) then if math.abs(self.object:getvelocity().y) < 1 then
local y = self.object:getvelocity().y local pos = self.object:getpos()
if y >= 5 then pos.y = math.floor(pos.y) + 0.5
y = 5 self.object:setpos(pos)
elseif y < 0 then new_velo = get_velocity(self.v, self.object:getyaw(), 0)
new_acce = { x = 0, y = 20, z = 0 }
else
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())
else else
new_acce = { x = 0, y = 0, z = 0 } new_velo = get_velocity(self.v, self.object:getyaw(),
if math.abs(self.object:getvelocity().y) < 1 then self.object:getvelocity().y)
local pos = self.object:getpos() self.object:setpos(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)
minetest.register_entity("summer:materassino_" .. color .. "", materassino) self.object:setacceleration(new_acce)
end
minetest.register_craftitem(materassino_item_name, { minetest.register_entity("summer:materassino_"..color.."", materassino)
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,
})
if minetest.get_modpath("cannabis") then minetest.register_craftitem(materassino_item_name, {
minetest.register_craft({ description = "materassino ("..color..")",
output = materassino_item_name, inventory_image = "materassino_"..color.."_inv.png",
recipe = { wield_image = "materassino_"..color.."_inv.png",
{ "", "", "" }, wield_scale = {x = 2, y = 2, z = 1},
{ "", "wool:" .. color, "" }, liquids_pointable = true,
{ "cannabis:canapa_plastic", "cannabis:canapa_plastic", "cannabis:canapa_plastic" },
}, on_place = function(itemstack, placer, pointed_thing)
}) if pointed_thing.type ~= "node" then
end return
minetest.register_craft({ end
output = materassino_item_name, if not is_water(pointed_thing.under) then
recipe = { return
{ "", "", "" }, end
{ "", "wool:" .. color, "" }, pointed_thing.under.y = pointed_thing.under.y + 0.5
{ "wool:" .. color, "wool:" .. color, "wool:" .. color }, minetest.add_entity(pointed_thing.under, "summer:materassino_"..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,45 +1,43 @@
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,37 +1,40 @@
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,68 +1,70 @@
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,68 +1,69 @@
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,17 +2,18 @@
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_ent_name = "summer:ball_" .. color .. "_entity" local ball_item_name = "summer:ball_"..color.."_item"
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,
@ -20,7 +21,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();
@ -30,8 +31,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
@ -39,8 +40,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
@ -72,8 +73,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)
@ -83,47 +84,48 @@ 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({ minetest.register_craft({
output = ball_item_name, output = ball_item_name,
recipe = { recipe = {
{ "default:paper", "group:leaves", "default:paper" }, { "default:paper", "group:leaves", "default:paper" },
{ "group:leaves", "wool:" .. color, "group:leaves" }, { "group:leaves", "wool:"..color, "group:leaves" },
{ "default:paper", "group:leaves", "default:paper" }, { "default:paper", "group:leaves", "default:paper" },
}, },
}) })
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", "" },
},
})
if minetest.get_modpath("cannabis") then end
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,98 +97,94 @@ 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
--craft PIETRA minetest.register_craft({
minetest.register_craft({ output = '"summer:pietraA" 2',
output = '"summer:pietraA" 2', recipe = {
recipe = { { "", "", "" },
{ "", "", "" }, { "", "", "" },
{ "", "", "" }, { "summer:pietra", "summer:desert_pietra", "" },
{ "summer:pietra", "summer:desert_pietra", "" }, },
}, })
}) minetest.register_craft({
minetest.register_craft({ output = '"summer:pietraP" 2',
output = '"summer:pietraP" 2', recipe = {
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

154
porta.lua
View File

@ -1,11 +1,12 @@
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"},
@ -18,81 +19,84 @@ 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, end,
}) })
minetest.register_node("summer:porta_" .. colour .. "_ch", { minetest.register_node("summer:porta_"..colour.."_ch", {
description = portadesc .. " ch", description = portadesc.." ch",
drawtype = "mesh", drawtype = "mesh",
mesh = "porta.obj", mesh = "porta.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.5, -0.5, 0.40, 0.5, 1.5, 0.5 }, fixed = { -0.5, -0.5, 0.40, 0.5,1.5, 0.5},
}, },
collision_box = { collision_box = {
type = "fixed", type = "fixed",
fixed = { -0.5, -0.5, 0.40, 0.5, 1.5, 0.5 }, 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 }, 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: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 .. "" node.name = "summer:porta_"..colour..""
minetest.set_node(pos, node) minetest.set_node(pos, node)
minetest.sound_play("summer_porta_op", { minetest.sound_play("summer_porta_op", {
to_player = "", to_player = "",
gain = 0.1, gain = 0.1,
pos = pos, pos = pos,
max_hear_distance = 16, max_hear_distance = 16,
}) })
end, end,
}) })
end end

View File

@ -1,70 +1,72 @@
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", --wield_image = {"summer_ombc_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 = 1 }, groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3, not_in_creative_inventory=1},
--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 .. "" node.name = "summer:Portacenere_"..colour..""
minetest.set_node(pos, node) minetest.set_node(pos, node)
end, end,
}) })
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,238 +24,247 @@ 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"
-- Boat entity local salvag_ent_name = "summer:salvag_"..color.."_entity"
--
local salvag = { --
physical = true, -- Boat entity
collisionbox = { -0.5, -0.35, -0.5, 0.5, 0.3, 0.5 }, --
visual = "mesh",
mesh = "salvagl.obj",
textures = { "summer_salvag_" .. color .. ".png" },
driver = nil, local salvag = {
v = 0, physical = true,
last_v = 0, collisionbox = {-0.5, -0.35, -0.5, 0.5, 0.3, 0.5},
removed = false visual = "mesh",
} 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)
self.object:set_armor_groups({ immortal = 1 }) function salvag.on_activate(self, staticdata, dtime_s)
if staticdata then self.object:set_armor_groups({immortal = 1})
self.v = tonumber(staticdata) if staticdata then
end self.v = tonumber(staticdata)
self.last_v = self.v
end end
self.last_v = self.v
end
function salvag.get_staticdata(self)
return tostring(self.v) function salvag.get_staticdata(self)
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
function salvag.on_punch(self, puncher) self.driver = nil
if not puncher or not puncher:is_player() or self.removed then puncher:set_detach()
return default.player_attached[puncher:get_player_name()] = false
end
if self.driver and puncher == self.driver then
self.driver = nil
puncher:set_detach()
default.player_attached[puncher:get_player_name()] = false
end
if not self.driver then
self.removed = true
-- delay remove to ensure player is detached
minetest.after(0.1, function()
self.object:remove()
end)
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
if not self.driver then
function salvag.on_step(self, dtime) self.removed = true
self.v = get_v(self.object:getvelocity()) * get_sign(self.v) -- delay remove to ensure player is detached
if self.driver then minetest.after(0.1, function()
local ctrl = self.driver:get_player_control() self.object:remove()
local yaw = self.object:getyaw() end)
if ctrl.up then if not minetest.setting_getbool("creative_mode") then
self.v = self.v + 0.1 local inv = puncher:get_inventory()
elseif ctrl.down then if inv:room_for_item("main", "summer:salvag_"..color.."_item") then
self.v = self.v - 0.1 inv:add_item("main", "summer:salvag_"..color.."_item")
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
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
local velo = self.object:getvelocity()
if self.v == 0 and velo.x == 0 and velo.y == 0 and velo.z == 0 then
self.object:setpos(self.object:getpos())
return
end
local s = get_sign(self.v)
self.v = self.v - 0.02 * s
if s ~= get_sign(self.v) then
self.object:setvelocity({ x = 0, y = 0, z = 0 })
self.v = 0
return
end
if math.abs(self.v) > 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
new_acce = { x = 0, y = 1, z = 0 }
else else
new_acce = { x = 0, y = -9.8, z = 0 } minetest.add_item(self.object:getpos(), salvag_item_name)
end end
new_velo = get_velocity(self.v, self.object:getyaw(), end
self.object:getvelocity().y) end
end
function salvag.on_step(self, dtime)
self.v = get_v(self.object:getvelocity()) * get_sign(self.v)
if self.driver then
local ctrl = self.driver:get_player_control()
local yaw = self.object:getyaw()
if ctrl.up then
self.v = self.v + 0.1
elseif ctrl.down then
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
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
local velo = self.object:getvelocity()
if self.v == 0 and velo.x == 0 and velo.y == 0 and velo.z == 0 then
self.object:setpos(self.object:getpos())
return
end
local s = get_sign(self.v)
self.v = self.v - 0.02 * s
if s ~= get_sign(self.v) then
self.object:setvelocity({x = 0, y = 0, z = 0})
self.v = 0
return
end
if math.abs(self.v) > 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
new_acce = {x = 0, y = 1, z = 0}
else
new_acce = {x = 0, y = -9.8, z = 0}
end
new_velo = get_velocity(self.v, self.object:getyaw(),
self.object:getvelocity().y)
self.object:setpos(self.object:getpos())
else
p.y = p.y + 1
if is_water(p) then
local y = self.object:getvelocity().y
if y >= 5 then
y = 5
elseif y < 0 then
new_acce = {x = 0, y = 20, z = 0}
else
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 else
p.y = p.y + 1 new_acce = {x = 0, y = 0, z = 0}
if is_water(p) then if math.abs(self.object:getvelocity().y) < 1 then
local y = self.object:getvelocity().y local pos = self.object:getpos()
if y >= 5 then pos.y = math.floor(pos.y) + 0.5
y = 5 self.object:setpos(pos)
elseif y < 0 then new_velo = get_velocity(self.v, self.object:getyaw(), 0)
new_acce = { x = 0, y = 20, z = 0 }
else
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())
else else
new_acce = { x = 0, y = 0, z = 0 } new_velo = get_velocity(self.v, self.object:getyaw(),
if math.abs(self.object:getvelocity().y) < 1 then self.object:getvelocity().y)
local pos = self.object:getpos() self.object:setpos(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)
minetest.register_entity("summer:salvag_" .. color .. "", salvag) self.object:setacceleration(new_acce)
end
minetest.register_craftitem(salvag_item_name, { minetest.register_entity("summer:salvag_"..color.."", salvag)
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)
if pointed_thing.type ~= "node" then minetest.register_craftitem(salvag_item_name, {
return description = "salvagente ("..color..")",
end inventory_image = "summer_salvag_"..color.."_inv.png",
if not is_water(pointed_thing.under) then wield_image = "summer_salvag_"..color.."_inv.png",
return wield_scale = {x = 2, y = 2, z = 1},
end liquids_pointable = true,
pointed_thing.under.y = pointed_thing.under.y + 0.5
minetest.add_entity(pointed_thing.under, "summer:salvag_" .. color .. "") on_place = function(itemstack, placer, pointed_thing)
if not minetest.setting_getbool("creative_mode") then if pointed_thing.type ~= "node" then
itemstack:take_item() return
end end
return itemstack if not is_water(pointed_thing.under) then
end, return
}) end
minetest.register_craft({ pointed_thing.under.y = pointed_thing.under.y + 0.5
output = salvag_item_name, minetest.add_entity(pointed_thing.under, "summer:salvag_"..color.."")
recipe = { if not minetest.setting_getbool("creative_mode") then
{ "", "", "" }, itemstack:take_item()
{ "group:leaves", "wool:" .. color, "group:leaves" }, end
{ "default:paper", "group:leaves", "default:paper" }, return itemstack
}, 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,22 +1,23 @@
local sdraia_list = {
{ "Red sdraia", "red" }, local sdraia_list = {
{ "Orange sdraia", "orange" }, { "Red sdraia", "red"},
{ "Black sdraia", "black" }, { "Orange sdraia", "orange"},
{ "Yellow sdraia", "yellow" }, { "Black sdraia", "black"},
{ "Green sdraia", "green" }, { "Yellow sdraia", "yellow"},
{ "Blue sdraia", "blue" }, { "Green sdraia", "green"},
{ "Violet sdraia", "violet" }, { "Blue sdraia", "blue"},
{ "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';
@ -26,174 +27,176 @@ 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 @@ minetest.register_node("summer:angstairA2", {
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 @@ minetest.register_node("summer:battiscopaA", {
}, },
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 @@ minetest.register_node("summer:battiscopaA", {
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 @@ minetest.register_node("summer:angstairP2", {
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 @@ minetest.register_node("summer:battiscopaP", {
}, },
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 @@ minetest.register_node("summer:battiscopaP", {
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 @@ minetest.register_node("summer:angstairR2", {
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 @@ minetest.register_node("summer:battiscopaR", {
}, },
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 @@ minetest.register_node("summer:battiscopaR", {
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 @@ minetest.register_node("summer:angstair2", {
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 @@ minetest.register_node("summer:battiscopa", {
}, },
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 @@ minetest.register_node("summer:battiscopa", {
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,160 +1,113 @@
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.."", {
minetest.register_node("summer:vetro_" .. colour .. "", { description = vetrodesc.."trasparente incorniciata",
description = vetrodesc .. "trasparente incorniciata", tiles = {"vetro_"..colour..".png"},
tiles = { "vetro_" .. 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_"..colour.."",
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(),
}) })
--vetro senza cornce minetest.register_craftitem("summer:vetro_traspp", {
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",
@ -172,45 +125,90 @@ minetest.register_craft({
output = "summer:vetro_traspp", output = "summer:vetro_traspp",
recipe = "summer:mattoneP" recipe = "summer:mattoneP"
}) })
--vetro senza cornce
--trasp minetest.register_craft({
minetest.register_craft({ output = "summer:vetro_colorato_uni_"..colour.."",
output = "summer:vetro_colorato_trasp", recipe = {
recipe = { {"", "dye:"..colour, "", },
{ "default:stick", "default:stick", "default:stick" }, {"", "summer:vetro_traspp","", },
{ "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_colorato_unito_trasp", output = "summer:vetro_"..colour.."",
recipe = { recipe = {
{ "", "", "" }, {"default:stick", "dye:"..colour, "default:stick", },
{ "", "summer:vetro_traspp", "" }, {"default:stick", "summer:vetro_traspp","default:stick", },
{ "default:stick", "default:stick", "default:stick" } {"default:stick", "default:stick", "default:stick", }
} }
}) })
minetest.register_craft({ --vetro cornice trasp unito
output = "summer:vetro_unito_trasp", minetest.register_craft({
recipe = { output = "summer:vetro_unito_"..colour.."",
{ "default:stick", "", "", }, recipe = {
{ "default:stick", "summer:vetro_traspp", "", }, {"", "dye:"..colour, "", },
{ "default:stick", "", "", } {"", "summer:vetro_traspp","", },
} {"default:stick", "default:stick", "default:stick", }
}) }
minetest.register_craft({ })
output = "summer:vetro_colorato_uni_trasp", --vetro cornice colorato
recipe = { minetest.register_craft({
{ "", "", "", }, output = "summer:vetro_colorato_"..colour.."",
{ "summer:vetro_traspp", "summer:vetro_traspp", "", }, recipe = {
{ "summer:vetro_traspp", "summer:vetro_traspp", "", } {"default:stick", "dye:"..colour, "default:stick" },
} {"default:stick", "summer:vetro_"..colour,"default:stick" },
}) {"default:stick", "default:stick", "default:stick" }
minetest.register_craft({ }
output = "summer:vetro_trasp", })
recipe = { --vetro cornice colorato unito
{ "default:stick", "default:stick", "default:stick", }, minetest.register_craft({
{ "default:stick", "summer:vetro_traspp", "default:stick", }, output = "summer:vetro_colorato_unito_"..colour.."",
{ "default:stick", "", "default:stick", } recipe = {
} {"", "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