1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-11-05 10:00:26 +01:00

[moreblocks] Update

This commit is contained in:
LeMagnesium 2015-11-13 19:11:45 +01:00
parent 1a57595005
commit 90af647d5a
10 changed files with 74 additions and 55 deletions

View File

@ -102,9 +102,11 @@ function circular_saw:get_output_inv(modname, material, amount, max)
local t = circular_saw.names[i] local t = circular_saw.names[i]
local cost = circular_saw.cost_in_microblocks[i] local cost = circular_saw.cost_in_microblocks[i]
local balance = math.min(math.floor(amount/cost), max) local balance = math.min(math.floor(amount/cost), max)
pos = pos + 1 local nodename = modname .. ":" .. t[1] .. "_" .. material .. t[2]
list[pos] = modname .. ":" .. t[1] .. "_" .. material .. t[2] if minetest.registered_nodes[nodename] then
.. " " .. balance pos = pos + 1
list[pos] = nodename .. " " .. balance
end
end end
return list return list
end end

View File

@ -137,8 +137,8 @@ local nodes = {
["iron_glass"] = { ["iron_glass"] = {
description = S("Iron Glass"), description = S("Iron Glass"),
drawtype = "glasslike_framed_optional", drawtype = "glasslike_framed_optional",
tiles = {"moreblocks_iron_glass.png", "moreblocks_iron_glass_detail.png"}, --tiles = {"moreblocks_iron_glass.png", "moreblocks_iron_glass_detail.png"},
--tiles = {"moreblocks_iron_glass.png"}, tiles = {"moreblocks_iron_glass.png"},
paramtype = "light", paramtype = "light",
sunlight_propagates = true, sunlight_propagates = true,
groups = {snappy = 2, cracky = 3, oddly_breakable_by_hand = 3}, groups = {snappy = 2, cracky = 3, oddly_breakable_by_hand = 3},
@ -147,8 +147,8 @@ local nodes = {
["coal_glass"] = { ["coal_glass"] = {
description = S("Coal Glass"), description = S("Coal Glass"),
drawtype = "glasslike_framed_optional", drawtype = "glasslike_framed_optional",
tiles = {"moreblocks_coal_glass.png", "moreblocks_coal_glass_detail.png"}, --tiles = {"moreblocks_coal_glass.png", "moreblocks_coal_glass_detail.png"},
--tiles = {"moreblocks_coal_glass.png"}, tiles = {"moreblocks_coal_glass.png"},
paramtype = "light", paramtype = "light",
sunlight_propagates = true, sunlight_propagates = true,
groups = {snappy = 2, cracky = 3, oddly_breakable_by_hand = 3}, groups = {snappy = 2, cracky = 3, oddly_breakable_by_hand = 3},
@ -157,8 +157,8 @@ local nodes = {
["clean_glass"] = { ["clean_glass"] = {
description = S("Clean Glass"), description = S("Clean Glass"),
drawtype = "glasslike_framed_optional", drawtype = "glasslike_framed_optional",
tiles = {"moreblocks_clean_glass.png", "moreblocks_clean_glass_detail.png"}, --tiles = {"moreblocks_clean_glass.png", "moreblocks_clean_glass_detail.png"},
--tiles = {"moreblocks_clean_glass.png"}, tiles = {"moreblocks_clean_glass.png"},
paramtype = "light", paramtype = "light",
sunlight_propagates = true, sunlight_propagates = true,
groups = {snappy = 2, cracky = 3, oddly_breakable_by_hand = 3}, groups = {snappy = 2, cracky = 3, oddly_breakable_by_hand = 3},
@ -230,8 +230,8 @@ local nodes = {
["trap_glass"] = { ["trap_glass"] = {
description = S("Trap Glass"), description = S("Trap Glass"),
drawtype = "glasslike_framed_optional", drawtype = "glasslike_framed_optional",
tiles = {"moreblocks_trap_glass.png", "default_glass_detail.png"}, --tiles = {"moreblocks_trap_glass.png", "default_glass_detail.png"},
--tiles = {"moreblocks_trap_glass.png"}, tiles = {"moreblocks_trap_glass.png"},
paramtype = "light", paramtype = "light",
sunlight_propagates = true, sunlight_propagates = true,
walkable = false, walkable = false,
@ -284,8 +284,8 @@ local nodes = {
["glow_glass"] = { ["glow_glass"] = {
description = S("Glow Glass"), description = S("Glow Glass"),
drawtype = "glasslike_framed_optional", drawtype = "glasslike_framed_optional",
tiles = {"moreblocks_glow_glass.png", "moreblocks_glow_glass_detail.png"}, --tiles = {"moreblocks_glow_glass.png", "moreblocks_glow_glass_detail.png"},
--tiles = {"moreblocks_glow_glass.png"}, tiles = {"moreblocks_glow_glass.png"},
paramtype = "light", paramtype = "light",
sunlight_propagates = true, sunlight_propagates = true,
light_source = 11, light_source = 11,
@ -295,8 +295,8 @@ local nodes = {
["trap_glow_glass"] = { ["trap_glow_glass"] = {
description = S("Trap Glow Glass"), description = S("Trap Glow Glass"),
drawtype = "glasslike_framed_optional", drawtype = "glasslike_framed_optional",
tiles = {"moreblocks_trap_glass.png", "moreblocks_glow_glass_detail.png"}, --tiles = {"moreblocks_trap_glass.png", "moreblocks_glow_glass_detail.png"},
--tiles = {"moreblocks_trap_glass.png"}, tiles = {"moreblocks_trap_glass.png"},
paramtype = "light", paramtype = "light",
sunlight_propagates = true, sunlight_propagates = true,
light_source = 11, light_source = 11,
@ -308,8 +308,8 @@ local nodes = {
["super_glow_glass"] = { ["super_glow_glass"] = {
description = S("Super Glow Glass"), description = S("Super Glow Glass"),
drawtype = "glasslike_framed_optional", drawtype = "glasslike_framed_optional",
tiles = {"moreblocks_super_glow_glass.png", "moreblocks_super_glow_glass_detail.png"}, --tiles = {"moreblocks_super_glow_glass.png", "moreblocks_super_glow_glass_detail.png"},
--tiles = {"moreblocks_super_glow_glass.png"}, tiles = {"moreblocks_super_glow_glass.png"},
paramtype = "light", paramtype = "light",
sunlight_propagates = true, sunlight_propagates = true,
light_source = 15, light_source = 15,
@ -319,8 +319,8 @@ local nodes = {
["trap_super_glow_glass"] = { ["trap_super_glow_glass"] = {
description = S("Trap Super Glow Glass"), description = S("Trap Super Glow Glass"),
drawtype = "glasslike_framed_optional", drawtype = "glasslike_framed_optional",
tiles = {"moreblocks_trap_super_glow_glass.png", "moreblocks_super_glow_glass_detail.png"}, --tiles = {"moreblocks_trap_super_glow_glass.png", "moreblocks_super_glow_glass_detail.png"},
--tiles = {"moreblocks_trap_super_glow_glass.png"}, tiles = {"moreblocks_trap_super_glow_glass.png"},
paramtype = "light", paramtype = "light",
sunlight_propagates = true, sunlight_propagates = true,
light_source = 15, light_source = 15,

View File

@ -43,7 +43,7 @@ minetest.register_craft({
minetest.register_craft({ minetest.register_craft({
type = "toolrepair", type = "toolrepair",
additional_wear = -0.15, -- Tool repair buff (15% bonus instead of 2%). additional_wear = -0.10, -- Tool repair buff (10% bonus instead of 2%).
}) })
-- Redefinitions of some default nodes -- Redefinitions of some default nodes

View File

@ -17,19 +17,28 @@ and minetest.setting_getbool("creative_mode") then
stairsplus.expect_infinite_stacks = true stairsplus.expect_infinite_stacks = true
end end
function stairsplus:register_all(modname, subname, recipeitem, fields) function stairsplus:prepare_groups(groups)
fields = fields or {} result = {}
fields.groups = fields.groups or {} if groups then
if not moreblocks.config.stairsplus_in_creative_inventory then for k, v in pairs(groups) do
fields.groups.not_in_creative_inventory = 1 if k ~= "wood" and k ~= "stone" then
result[k] = v
end
end
end end
if not moreblocks.config.stairsplus_in_creative_inventory then
result.not_in_creative_inventory = 1
end
return result
end
function stairsplus:register_all(modname, subname, recipeitem, fields)
self:register_stair(modname, subname, recipeitem, fields) self:register_stair(modname, subname, recipeitem, fields)
self:register_slab (modname, subname, recipeitem, fields) self:register_slab (modname, subname, recipeitem, fields)
self:register_slope(modname, subname, recipeitem, fields) self:register_slope(modname, subname, recipeitem, fields)
self:register_panel(modname, subname, recipeitem, fields) self:register_panel(modname, subname, recipeitem, fields)
self:register_micro(modname, subname, recipeitem, fields) self:register_micro(modname, subname, recipeitem, fields)
-- self:register_6dfacedir_conversion(modname, subname) -- Not needed as of Q3 2013, uncomment to fix old maps. -- self:register_6dfacedir_conversion(modname, subname) -- Not needed as of Q3 2013, uncomment to fix old maps.
circular_saw.known_nodes[recipeitem] = {modname, subname}
end end
function register_stair_slab_panel_micro(modname, subname, recipeitem, groups, images, description, drop, light) function register_stair_slab_panel_micro(modname, subname, recipeitem, groups, images, description, drop, light)

View File

@ -10,7 +10,7 @@ local S = moreblocks.intllib
-- Node will be called <modname>:micro_<subname> -- Node will be called <modname>:micro_<subname>
function register_micro(modname, subname, recipeitem, groups, images, description, drop, light) function register_micro(modname, subname, recipeitem, groups, images, description, drop, light)
return stairsplus:register_micro(modname, subname, recipeitem, { stairsplus:register_micro(modname, subname, recipeitem, {
groups = groups, groups = groups,
tiles = images, tiles = images,
description = description, description = description,
@ -68,22 +68,24 @@ function stairsplus:register_micro(modname, subname, recipeitem, fields)
local desc = S("%s Microblock"):format(fields.description) local desc = S("%s Microblock"):format(fields.description)
for alternate, def in pairs(defs) do for alternate, def in pairs(defs) do
for k, v in pairs(fields) do
def[k] = v
end
def.drawtype = "nodebox" def.drawtype = "nodebox"
def.paramtype = "light" def.paramtype = "light"
def.paramtype2 = "facedir" def.paramtype2 = "facedir"
def.on_place = minetest.rotate_node def.on_place = minetest.rotate_node
for k, v in pairs(fields) do def.groups = stairsplus:prepare_groups(fields.groups)
def[k] = v
end
def.description = desc def.description = desc
if fields.drop then if fields.drop then
def.drop = modname.. ":micro_" ..fields.drop..alternate def.drop = modname.. ":micro_" ..fields.drop..alternate
end end
minetest.register_node(":" ..modname.. ":micro_" ..subname..alternate, def) minetest.register_node(":" ..modname.. ":micro_" ..subname..alternate, def)
end end
minetest.register_alias(modname.. ":micro_" ..subname.. "_bottom", modname.. ":micro_" ..subname) minetest.register_alias(modname.. ":micro_" ..subname.. "_bottom", modname.. ":micro_" ..subname)
circular_saw.known_nodes[recipeitem] = {modname, subname}
-- Some saw-less recipes: -- Some saw-less recipes:
minetest.register_craft({ minetest.register_craft({

View File

@ -10,7 +10,7 @@ local S = moreblocks.intllib
-- Node will be called <modname>:panel_<subname> -- Node will be called <modname>:panel_<subname>
function register_panel(modname, subname, recipeitem, groups, images, description, drop, light) function register_panel(modname, subname, recipeitem, groups, images, description, drop, light)
return stairsplus:register_panel(modname, subname, recipeitem, { stairsplus:register_panel(modname, subname, recipeitem, {
groups = groups, groups = groups,
tiles = images, tiles = images,
description = description, description = description,
@ -68,14 +68,15 @@ function stairsplus:register_panel(modname, subname, recipeitem, fields)
local desc = S("%s Panel"):format(fields.description) local desc = S("%s Panel"):format(fields.description)
for alternate, def in pairs(defs) do for alternate, def in pairs(defs) do
for k, v in pairs(fields) do
def[k] = v
end
def.drawtype = "nodebox" def.drawtype = "nodebox"
def.paramtype = "light" def.paramtype = "light"
def.paramtype2 = "facedir" def.paramtype2 = "facedir"
def.on_place = minetest.rotate_node def.on_place = minetest.rotate_node
for k, v in pairs(fields) do
def[k] = v
end
def.description = desc def.description = desc
def.groups = stairsplus:prepare_groups(fields.groups)
if fields.drop then if fields.drop then
def.drop = modname.. ":panel_" ..fields.drop..alternate def.drop = modname.. ":panel_" ..fields.drop..alternate
end end
@ -83,6 +84,8 @@ function stairsplus:register_panel(modname, subname, recipeitem, fields)
end end
minetest.register_alias(modname.. ":panel_" ..subname.. "_bottom", modname.. ":panel_" ..subname) minetest.register_alias(modname.. ":panel_" ..subname.. "_bottom", modname.. ":panel_" ..subname)
circular_saw.known_nodes[recipeitem] = {modname, subname}
-- Some saw-less recipes: -- Some saw-less recipes:
minetest.register_craft({ minetest.register_craft({

View File

@ -42,13 +42,6 @@ for _, name in pairs(default_nodes) do
local nodename = "default:" .. name local nodename = "default:" .. name
local ndef = minetest.registered_nodes[nodename] local ndef = minetest.registered_nodes[nodename]
if ndef then if ndef then
local groups = {}
for k, v in pairs(ndef.groups)
-- Ignore wood and stone groups to not make them usable in crafting:
do if k ~= "wood" and k ~= "stone" then
groups[k] = v
end
end
local drop local drop
if type(ndef.drop) == "string" then if type(ndef.drop) == "string" then
drop = ndef.drop:split(" ")[1]:sub(9) drop = ndef.drop:split(" ")[1]:sub(9)
@ -56,7 +49,7 @@ for _, name in pairs(default_nodes) do
stairsplus:register_all("moreblocks", name, nodename, { stairsplus:register_all("moreblocks", name, nodename, {
description = ndef.description, description = ndef.description,
drop = drop, drop = drop,
groups = groups, groups = ndef.groups,
sounds = ndef.sounds, sounds = ndef.sounds,
tiles = ndef.tiles, tiles = ndef.tiles,
sunlight_propagates = true, sunlight_propagates = true,

View File

@ -10,7 +10,7 @@ local S = moreblocks.intllib
-- Node will be called <modname>:slab_<subname> -- Node will be called <modname>:slab_<subname>
function register_slab(modname, subname, recipeitem, groups, images, description, drop, light) function register_slab(modname, subname, recipeitem, groups, images, description, drop, light)
return stairsplus:register_slab(modname, subname, recipeitem, { stairsplus:register_slab(modname, subname, recipeitem, {
groups = groups, groups = groups,
tiles = images, tiles = images,
description = description, description = description,
@ -30,6 +30,7 @@ function stairsplus:register_slab(modname, subname, recipeitem, fields)
["_14"] = 14, ["_14"] = 14,
["_15"] = 15, ["_15"] = 15,
} }
local desc_base = S("%s Slab"):format(fields.description) local desc_base = S("%s Slab"):format(fields.description)
for alternate, num in pairs(defs) do for alternate, num in pairs(defs) do
local def = { local def = {
@ -38,14 +39,15 @@ function stairsplus:register_slab(modname, subname, recipeitem, fields)
fixed = {-0.5, -0.5, -0.5, 0.5, (num/16)-0.5, 0.5}, fixed = {-0.5, -0.5, -0.5, 0.5, (num/16)-0.5, 0.5},
} }
} }
for k, v in pairs(fields) do
def[k] = v
end
def.drawtype = "nodebox" def.drawtype = "nodebox"
def.paramtype = "light" def.paramtype = "light"
def.paramtype2 = "facedir" def.paramtype2 = "facedir"
def.on_place = minetest.rotate_node def.on_place = minetest.rotate_node
for k, v in pairs(fields) do
def[k] = v
end
def.description = ("%s (%d/16)"):format(desc_base, num) def.description = ("%s (%d/16)"):format(desc_base, num)
def.groups = stairsplus:prepare_groups(fields.groups)
if fields.drop then if fields.drop then
def.drop = modname.. ":slab_" .. fields.drop .. alternate def.drop = modname.. ":slab_" .. fields.drop .. alternate
end end
@ -53,6 +55,8 @@ function stairsplus:register_slab(modname, subname, recipeitem, fields)
end end
minetest.register_alias("stairs:slab_" .. subname, modname .. ":slab_" .. subname) minetest.register_alias("stairs:slab_" .. subname, modname .. ":slab_" .. subname)
circular_saw.known_nodes[recipeitem] = {modname, subname}
-- Some saw-less recipes: -- Some saw-less recipes:
minetest.register_craft({ minetest.register_craft({

View File

@ -113,7 +113,7 @@ local box_slope_outer_half_raised = {
-- Node will be called <modname>:slope_<subname> -- Node will be called <modname>:slope_<subname>
function register_slope(modname, subname, recipeitem, groups, images, description, drop, light) function register_slope(modname, subname, recipeitem, groups, images, description, drop, light)
return stairsplus:register_slope(modname, subname, recipeitem, { stairsplus:register_slope(modname, subname, recipeitem, {
groups = groups, groups = groups,
tiles = images, tiles = images,
description = description, description = description,
@ -222,20 +222,23 @@ function stairsplus:register_slope(modname, subname, recipeitem, fields)
local desc = S("%s Slope"):format(fields.description) local desc = S("%s Slope"):format(fields.description)
for alternate, def in pairs(defs) do for alternate, def in pairs(defs) do
for k, v in pairs(fields) do
def[k] = v
end
def.drawtype = "mesh" def.drawtype = "mesh"
def.paramtype = "light" def.paramtype = "light"
def.paramtype2 = "facedir" def.paramtype2 = "facedir"
def.on_place = minetest.rotate_node def.on_place = minetest.rotate_node
for k, v in pairs(fields) do
def[k] = v
end
def.description = desc def.description = desc
def.groups = stairsplus:prepare_groups(fields.groups)
if fields.drop then if fields.drop then
def.drop = modname.. ":slope_" ..fields.drop..alternate def.drop = modname.. ":slope_" ..fields.drop..alternate
end end
minetest.register_node(":" ..modname.. ":slope_" ..subname..alternate, def) minetest.register_node(":" ..modname.. ":slope_" ..subname..alternate, def)
end end
circular_saw.known_nodes[recipeitem] = {modname, subname}
-- Some saw-less recipes: -- Some saw-less recipes:
minetest.register_craft({ minetest.register_craft({

View File

@ -10,7 +10,7 @@ local S = moreblocks.intllib
-- Node will be called <modname>:stair_<subname> -- Node will be called <modname>:stair_<subname>
function register_stair(modname, subname, recipeitem, groups, images, description, drop, light) function register_stair(modname, subname, recipeitem, groups, images, description, drop, light)
return stairsplus:register_stair(modname, subname, recipeitem, { stairsplus:register_stair(modname, subname, recipeitem, {
groups = groups, groups = groups,
tiles = images, tiles = images,
description = description, description = description,
@ -108,14 +108,15 @@ function stairsplus:register_stair(modname, subname, recipeitem, fields)
local desc = S("%s Stairs"):format(fields.description) local desc = S("%s Stairs"):format(fields.description)
for alternate, def in pairs(defs) do for alternate, def in pairs(defs) do
for k, v in pairs(fields) do
def[k] = v
end
def.drawtype = "nodebox" def.drawtype = "nodebox"
def.paramtype = "light" def.paramtype = "light"
def.paramtype2 = "facedir" def.paramtype2 = "facedir"
def.on_place = minetest.rotate_node def.on_place = minetest.rotate_node
for k, v in pairs(fields) do
def[k] = v
end
def.description = desc def.description = desc
def.groups = stairsplus:prepare_groups(fields.groups)
if fields.drop then if fields.drop then
def.drop = modname .. ":stair_" .. fields.drop .. alternate def.drop = modname .. ":stair_" .. fields.drop .. alternate
end end
@ -123,6 +124,8 @@ function stairsplus:register_stair(modname, subname, recipeitem, fields)
end end
minetest.register_alias("stairs:stair_" .. subname, modname .. ":stair_" .. subname) minetest.register_alias("stairs:stair_" .. subname, modname .. ":stair_" .. subname)
circular_saw.known_nodes[recipeitem] = {modname, subname}
-- Some saw-less recipes: -- Some saw-less recipes:
minetest.register_craft({ minetest.register_craft({