Оформатировать код и убрать дублирующие рецепты (granite и vetro)

This commit is contained in:
Aleksandr Avdeev 2024-11-27 10:11:00 +03:00
parent d3aab548e5
commit 3553dcaec8
24 changed files with 2442 additions and 2506 deletions

View File

@ -1,4 +1,3 @@
local Ombrellone_n_list = { local Ombrellone_n_list = {
{ "Red Ombrellone_n", "red" }, { "Red Ombrellone_n", "red" },
{ "Orange Ombrellone_n", "orange" }, { "Orange Ombrellone_n", "orange" },

View File

@ -1,6 +1,3 @@
local Asciugamano_list = { local Asciugamano_list = {
{ "Red Asciugamano", "red" }, { "Red Asciugamano", "red" },
{ "Orange Asciugamano", "orange" }, { "Orange Asciugamano", "orange" },
@ -15,9 +12,6 @@ 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 .. "", { minetest.register_node("summer:asciugamano_" .. colour .. "", {
description = asciugamanodesc .. "", description = asciugamanodesc .. "",
drawtype = "mesh", drawtype = "mesh",
@ -41,11 +35,8 @@ for i in ipairs(Asciugamano_list) do
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
@ -64,8 +55,6 @@ minetest.allow_sit = function( player )
return false; return false;
end end
minetest.sleep_in_asciugamano = function(pos, node, clicker, itemstack, pointed_thing) 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 if (not (clicker) or not (node) or not (node.name) or not (pos) or not (minetest.allow_sit(clicker))) then
return; return;
@ -140,7 +129,6 @@ minetest.sleep_in_asciugamano = function( pos, node, clicker, itemstack, pointed
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 = 'asciugamano'; place_name = 'asciugamano';
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;
@ -193,7 +181,6 @@ minetest.sleep_in_asciugamano = function( pos, node, clicker, itemstack, pointed
end end
end end
clicker:set_eye_offset({ x = 0, y = -7, z = 2 }, { x = 0, y = 0, z = 0 }) clicker:set_eye_offset({ x = 0, y = -7, z = 2 }, { x = 0, y = 0, z = 0 })
clicker:setpos(p); clicker:setpos(p);
default.player_set_animation(clicker, new_animation, 30) default.player_set_animation(clicker, new_animation, 30)
@ -201,14 +188,12 @@ minetest.sleep_in_asciugamano = function( pos, node, clicker, itemstack, pointed
default.player_attached[pname] = true default.player_attached[pname] = true
if (allow_sleep == true) then if (allow_sleep == true) then
minetest.chat_send_player( pname, 'Aaah! What a comftable '..place_name..'. A second right-click will let you sleep.'); 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, 'Comftable, but not good enough for a nap. Right-click again if you want to get back up.'); 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 end
end end
--state=true: lay, state=false: stand up --state=true: lay, state=false: stand up

View File

@ -24,7 +24,6 @@ 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_item_name = "summer:barca_" .. color .. "_item"
local barca_ent_name = "summer:barca_" .. color .. "_entity" local barca_ent_name = "summer:barca_" .. color .. "_entity"
@ -81,7 +80,6 @@ function barca.on_rightclick(self, clicker)
end end
end end
function barca.on_activate(self, staticdata, dtime_s) function barca.on_activate(self, staticdata, dtime_s)
self.object:set_armor_groups({ immortal = 1 }) self.object:set_armor_groups({ immortal = 1 })
if staticdata then if staticdata then
@ -90,12 +88,10 @@ function barca.on_activate(self, staticdata, dtime_s)
self.last_v = self.v self.last_v = self.v
end end
function barca.get_staticdata(self) function barca.get_staticdata(self)
return tostring(self.v) return tostring(self.v)
end end
function barca.on_punch(self, puncher) function barca.on_punch(self, puncher)
if not puncher or not puncher:is_player() or self.removed then if not puncher or not puncher:is_player() or self.removed then
return return
@ -122,7 +118,6 @@ function barca.on_punch(self, puncher)
end end
end end
function barca.on_step(self, dtime) function barca.on_step(self, dtime)
self.v = get_v(self.object:getvelocity()) * get_sign(self.v) self.v = get_v(self.object:getvelocity()) * get_sign(self.v)
if self.driver then if self.driver then
@ -209,7 +204,6 @@ function barca.on_step(self, dtime)
self.object:setacceleration(new_acce) self.object:setacceleration(new_acce)
end end
minetest.register_entity("summer:barca_" .. color .. "", barca) minetest.register_entity("summer:barca_" .. color .. "", barca)
@ -263,5 +257,3 @@ colors = {
for _, color in ipairs(colors) do for _, color in ipairs(colors) do
reg_barca(color) reg_barca(color)
end end

View File

@ -21,6 +21,7 @@ minetest.register_node("summer:breccia_2", {
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" },
@ -31,6 +32,7 @@ minetest.register_node("summer:breccia_2", {
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" },
@ -41,6 +43,3 @@ minetest.register_node("summer:desert_breccia", {
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

@ -117,7 +117,5 @@ minetest.register_craft({
} }
}) })
end end
end end

View File

@ -24,7 +24,6 @@ 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_item_name = "summer:canoa_" .. color .. "_item"
local canoa_ent_name = "summer:canoa_" .. color .. "_entity" local canoa_ent_name = "summer:canoa_" .. color .. "_entity"
@ -81,7 +80,6 @@ function canoa_.on_rightclick(self, clicker)
end end
end end
function canoa_.on_activate(self, staticdata, dtime_s) function canoa_.on_activate(self, staticdata, dtime_s)
self.object:set_armor_groups({ immortal = 1 }) self.object:set_armor_groups({ immortal = 1 })
if staticdata then if staticdata then
@ -90,12 +88,10 @@ function canoa_.on_activate(self, staticdata, dtime_s)
self.last_v = self.v self.last_v = self.v
end end
function canoa_.get_staticdata(self) function canoa_.get_staticdata(self)
return tostring(self.v) return tostring(self.v)
end end
function canoa_.on_punch(self, puncher) function canoa_.on_punch(self, puncher)
if not puncher or not puncher:is_player() or self.removed then if not puncher or not puncher:is_player() or self.removed then
return return
@ -122,7 +118,6 @@ function canoa_.on_punch(self, puncher)
end end
end end
function canoa_.on_step(self, dtime) function canoa_.on_step(self, dtime)
self.v = get_v(self.object:getvelocity()) * get_sign(self.v) self.v = get_v(self.object:getvelocity()) * get_sign(self.v)
if self.driver then if self.driver then
@ -209,7 +204,6 @@ function canoa_.on_step(self, dtime)
self.object:setacceleration(new_acce) self.object:setacceleration(new_acce)
end end
minetest.register_entity("summer:canoa_" .. color .. "", canoa_) minetest.register_entity("summer:canoa_" .. color .. "", canoa_)
@ -267,5 +261,3 @@ colors = {
for _, color in ipairs(colors) do for _, color in ipairs(colors) do
reg_canoa_(color) reg_canoa_(color)
end end

View File

@ -132,7 +132,8 @@ for i in ipairs(lockchest_list) do
minetest.register_node("summer:chest_lock" .. colour .. "", { minetest.register_node("summer:chest_lock" .. colour .. "", {
description = lockchestdesc .. "", description = lockchestdesc .. "",
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_lock_" .. colour .. ".png" }, "chest_side_" .. colour .. ".png", "chest_side_" .. colour .. ".png", "chest_lock_" .. colour .. ".png" },
--inventory_image = "chest_lock_"..colour.."_inv.png", --inventory_image = "chest_lock_"..colour.."_inv.png",

127
craft.lua
View File

@ -14,15 +14,7 @@ for i in ipairs(lchest_list) do
local desc = lchest_list[i][1] local desc = lchest_list[i][1]
local colour = lchest_list[i][2] local colour = lchest_list[i][2]
--rake
minetest.register_craft({
output = "summer:rake",
recipe = {
{"default:stick", "default:steel_ingot", "default:stick", },
{"", "default:stick", "", },
{"", "default:gold_ingot", "", }
}
})
--sdraia --sdraia
minetest.register_craft({ minetest.register_craft({
output = "summer:sdraia_" .. colour .. "", output = "summer:sdraia_" .. colour .. "",
@ -78,6 +70,67 @@ minetest.register_craft({
} }
}) })
--________________________________________________________
--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",
recipe = {
{ "default:stick", "default:steel_ingot", "default:stick", },
{ "", "default:stick", "", },
{ "", "default:gold_ingot", "", }
}
})
--________________________________________________________ --________________________________________________________
--breccia --breccia
--________________________________________________________ --________________________________________________________
@ -173,60 +226,4 @@ minetest.register_craft({
}, },
}) })
--________________________________________________________ --________________________________________________________
--________________________________________________________
--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

@ -13,7 +13,6 @@ local stairsplus_mod = minetest.get_modpath("moreblocks")
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" },
@ -27,7 +26,6 @@ if stairsplus_mod then
-- 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" },
@ -36,7 +34,6 @@ if stairsplus_mod then
-- register stair and slab using default stairs -- register stair and slab using default stairs
elseif stairs_mod then elseif stairs_mod then
stairs.register_stair_and_slab("summer_" .. granite[1], "summer:" .. granite[1], stairs.register_stair_and_slab("summer_" .. granite[1], "summer:" .. granite[1],
{ cracky = 3 }, { cracky = 3 },
{ granite[1] .. ".png" }, { granite[1] .. ".png" },
@ -45,6 +42,7 @@ if stairsplus_mod then
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",
@ -56,6 +54,7 @@ minetest.register_node("summer:granite", {
--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" },
@ -66,6 +65,7 @@ minetest.register_node("summer:graniteA", {
--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" },
@ -76,6 +76,7 @@ minetest.register_node("summer:graniteP", {
--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" },
@ -97,6 +98,7 @@ minetest.register_node("summer:graniteR", {
--legacy_mineral = true, --legacy_mineral = true,
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
minetest.register_node("summer:graniteB", { minetest.register_node("summer:graniteB", {
description = "Granite", description = "Granite",
tiles = { "graniteB.png" }, tiles = { "graniteB.png" },
@ -107,5 +109,3 @@ minetest.register_node("summer:graniteR", {
--legacy_mineral = true, --legacy_mineral = true,
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })

View File

@ -21,7 +21,7 @@ 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

View File

@ -24,7 +24,6 @@ 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_item_name = "summer:materassino_" .. color .. "_item"
local materassino_ent_name = "summer:materassino_" .. color .. "_entity" local materassino_ent_name = "summer:materassino_" .. color .. "_entity"
@ -81,7 +80,6 @@ function materassino.on_rightclick(self, clicker)
end end
end end
function materassino.on_activate(self, staticdata, dtime_s) function materassino.on_activate(self, staticdata, dtime_s)
self.object:set_armor_groups({ immortal = 1 }) self.object:set_armor_groups({ immortal = 1 })
if staticdata then if staticdata then
@ -90,12 +88,10 @@ function materassino.on_activate(self, staticdata, dtime_s)
self.last_v = self.v self.last_v = self.v
end end
function materassino.get_staticdata(self) function materassino.get_staticdata(self)
return tostring(self.v) return tostring(self.v)
end end
function materassino.on_punch(self, puncher) function materassino.on_punch(self, puncher)
if not puncher or not puncher:is_player() or self.removed then if not puncher or not puncher:is_player() or self.removed then
return return
@ -122,7 +118,6 @@ function materassino.on_punch(self, puncher)
end end
end end
function materassino.on_step(self, dtime) function materassino.on_step(self, dtime)
self.v = get_v(self.object:getvelocity()) * get_sign(self.v) self.v = get_v(self.object:getvelocity()) * get_sign(self.v)
if self.driver then if self.driver then
@ -209,7 +204,6 @@ function materassino.on_step(self, dtime)
self.object:setacceleration(new_acce) self.object:setacceleration(new_acce)
end end
minetest.register_entity("summer:materassino_" .. color .. "", materassino) minetest.register_entity("summer:materassino_" .. color .. "", materassino)
@ -237,8 +231,6 @@ minetest.register_craftitem(materassino_item_name, {
}) })
if minetest.get_modpath("cannabis") then if minetest.get_modpath("cannabis") then
minetest.register_craft({ minetest.register_craft({
output = materassino_item_name, output = materassino_item_name,
recipe = { recipe = {
@ -265,4 +257,3 @@ colors = {
for _, color in ipairs(colors) do for _, color in ipairs(colors) do
reg_materassino(color) reg_materassino(color)
end end

View File

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

View File

@ -32,9 +32,6 @@ if minetest.get_modpath("summer") then
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

@ -65,6 +65,4 @@ minetest.register_node("summer:ombrellone_"..colour.."_ch", {
minetest.set_node(pos, node) minetest.set_node(pos, node)
end, end,
}) })
end end

View File

@ -66,4 +66,3 @@ minetest.register_node("summer:ombrellone_n_"..colour.."_ch", {
end, end,
}) })
end end

View File

@ -2,7 +2,6 @@
local CALCIO = 0.1 local CALCIO = 0.1
local function reg_ball(color) local function reg_ball(color)
local ball_item_name = "summer:ball_" .. color .. "_item" local ball_item_name = "summer:ball_" .. color .. "_item"
local ball_ent_name = "summer:ball_" .. color .. "_entity" local ball_ent_name = "summer:ball_" .. color .. "_entity"
@ -118,7 +117,6 @@ if minetest.get_modpath("cannabis") then
{ "", "cannabis:canapa_plastic", "" }, { "", "cannabis:canapa_plastic", "" },
}, },
}) })
end end
end end

View File

@ -129,13 +129,17 @@ minetest.register_on_generated(function(minp, maxp, seed)
nn = minetest.get_node({ x = x, y = ground_y, z = z }).name nn = minetest.get_node({ x = x, y = ground_y, z = z }).name
-- If desert sand, add dry shrub -- If desert sand, add dry shrub
if nn == "default:dirt_with_grass" then if nn == "default:dirt_with_grass" then
minetest.set_node(p,{name="summer:roccia_"..pr:next(1,2), param2=math.random(0,3)}) minetest.set_node(p, {
name = "summer:roccia_" .. pr:next(1, 2),
param2 = math.random(0,
3)
})
elseif nn == "default:desert_sand" then elseif nn == "default:desert_sand" then
minetest.set_node(p,{name="summer:desert_roccia_"..pr:next(1,2), param2=math.random(0,3)}) 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

View File

@ -1,4 +1,3 @@
local Porta_list = { local Porta_list = {
{ "Red Door", "red" }, { "Red Door", "red" },
{ "Orange Door", "orange" }, { "Orange Door", "orange" },
@ -96,7 +95,4 @@ minetest.register_node("summer:porta_"..colour.."_ch", {
}) })
end, end,
}) })
end end

View File

@ -67,6 +67,4 @@ minetest.register_node("summer:Portacenere_"..colour.."_ch", {
minetest.set_node(pos, node) minetest.set_node(pos, node)
end, end,
}) })
end end

View File

@ -16,8 +16,8 @@ minetest.register_on_punchnode(function(pos, node, puncher, pointed_thing)
minetest.sound_play("summer_n_swap", { minetest.sound_play("summer_n_swap", {
to_player = "", to_player = "",
gain = 2.0,}) gain = 2.0,
})
end end
end) end)

View File

@ -24,7 +24,6 @@ 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_item_name = "summer:salvag_" .. color .. "_item"
local salvag_ent_name = "summer:salvag_" .. color .. "_entity" local salvag_ent_name = "summer:salvag_" .. color .. "_entity"
@ -81,7 +80,6 @@ function salvag.on_rightclick(self, clicker)
end end
end end
function salvag.on_activate(self, staticdata, dtime_s) function salvag.on_activate(self, staticdata, dtime_s)
self.object:set_armor_groups({ immortal = 1 }) self.object:set_armor_groups({ immortal = 1 })
if staticdata then if staticdata then
@ -90,12 +88,10 @@ function salvag.on_activate(self, staticdata, dtime_s)
self.last_v = self.v self.last_v = self.v
end end
function salvag.get_staticdata(self) function salvag.get_staticdata(self)
return tostring(self.v) return tostring(self.v)
end end
function salvag.on_punch(self, puncher) function salvag.on_punch(self, puncher)
if not puncher or not puncher:is_player() or self.removed then if not puncher or not puncher:is_player() or self.removed then
return return
@ -122,7 +118,6 @@ function salvag.on_punch(self, puncher)
end end
end end
function salvag.on_step(self, dtime) function salvag.on_step(self, dtime)
self.v = get_v(self.object:getvelocity()) * get_sign(self.v) self.v = get_v(self.object:getvelocity()) * get_sign(self.v)
if self.driver then if self.driver then
@ -209,7 +204,6 @@ function salvag.on_step(self, dtime)
self.object:setacceleration(new_acce) self.object:setacceleration(new_acce)
end end
minetest.register_entity("summer:salvag_" .. color .. "", salvag) minetest.register_entity("summer:salvag_" .. color .. "", salvag)
@ -255,7 +249,6 @@ minetest.register_craft({
{ "cannabis:canapa_plastic", "cannabis:canapa_plastic", "cannabis:canapa_plastic" }, { "cannabis:canapa_plastic", "cannabis:canapa_plastic", "cannabis:canapa_plastic" },
}, },
}) })
end end
end end
@ -266,5 +259,3 @@ colors = {
for _, color in ipairs(colors) do for _, color in ipairs(colors) do
reg_salvag(color) reg_salvag(color)
end end

View File

@ -1,4 +1,3 @@
local sdraia_list = { local sdraia_list = {
{ "Red sdraia", "red" }, { "Red sdraia", "red" },
{ "Orange sdraia", "orange" }, { "Orange sdraia", "orange" },
@ -86,7 +85,6 @@ for i in ipairs(sdraia_list) do
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;
@ -146,7 +144,6 @@ for i in ipairs(sdraia_list) do
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

View File

@ -95,35 +95,6 @@ for i in ipairs(vetro_list) do
sounds = default.node_sound_glass_defaults(), sounds = default.node_sound_glass_defaults(),
})
minetest.register_craftitem("summer:vetro_traspp", {
description = "vetrino",
inventory_image = "vetro_traspp.png",
--groups = {stick = 1, flammable = 2},
})
minetest.register_craft({
type = "cooking",
cooktime = 10,
output = "summer:vetro_traspp",
recipe = "summer:mattoneG"
})
minetest.register_craft({
type = "cooking",
cooktime = 10,
output = "summer:vetro_traspp",
recipe = "summer:mattoneA"
})
minetest.register_craft({
type = "cooking",
cooktime = 10,
output = "summer:vetro_traspp",
recipe = "summer:mattoneR"
})
minetest.register_craft({
type = "cooking",
cooktime = 10,
output = "summer:vetro_traspp",
recipe = "summer:mattoneP"
}) })
--vetro senza cornce --vetro senza cornce
minetest.register_craft({ minetest.register_craft({
@ -170,6 +141,38 @@ minetest.register_craft({
{ "default:stick", "default:stick", "default:stick" } { "default:stick", "default:stick", "default:stick" }
} }
}) })
end
minetest.register_craftitem("summer:vetro_traspp", {
description = "vetrino",
inventory_image = "vetro_traspp.png",
--groups = {stick = 1, flammable = 2},
})
minetest.register_craft({
type = "cooking",
cooktime = 10,
output = "summer:vetro_traspp",
recipe = "summer:mattoneG"
})
minetest.register_craft({
type = "cooking",
cooktime = 10,
output = "summer:vetro_traspp",
recipe = "summer:mattoneA"
})
minetest.register_craft({
type = "cooking",
cooktime = 10,
output = "summer:vetro_traspp",
recipe = "summer:mattoneR"
})
minetest.register_craft({
type = "cooking",
cooktime = 10,
output = "summer:vetro_traspp",
recipe = "summer:mattoneP"
})
--trasp --trasp
minetest.register_craft({ minetest.register_craft({
output = "summer:vetro_colorato_trasp", output = "summer:vetro_colorato_trasp",
@ -211,4 +214,3 @@ minetest.register_craft({
{ "default:stick", "", "default:stick", } { "default:stick", "", "default:stick", }
} }
}) })
end