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:
parent
1a57595005
commit
90af647d5a
|
@ -102,9 +102,11 @@ function circular_saw:get_output_inv(modname, material, amount, max)
|
|||
local t = circular_saw.names[i]
|
||||
local cost = circular_saw.cost_in_microblocks[i]
|
||||
local balance = math.min(math.floor(amount/cost), max)
|
||||
pos = pos + 1
|
||||
list[pos] = modname .. ":" .. t[1] .. "_" .. material .. t[2]
|
||||
.. " " .. balance
|
||||
local nodename = modname .. ":" .. t[1] .. "_" .. material .. t[2]
|
||||
if minetest.registered_nodes[nodename] then
|
||||
pos = pos + 1
|
||||
list[pos] = nodename .. " " .. balance
|
||||
end
|
||||
end
|
||||
return list
|
||||
end
|
||||
|
|
|
@ -137,8 +137,8 @@ local nodes = {
|
|||
["iron_glass"] = {
|
||||
description = S("Iron Glass"),
|
||||
drawtype = "glasslike_framed_optional",
|
||||
tiles = {"moreblocks_iron_glass.png", "moreblocks_iron_glass_detail.png"},
|
||||
--tiles = {"moreblocks_iron_glass.png"},
|
||||
--tiles = {"moreblocks_iron_glass.png", "moreblocks_iron_glass_detail.png"},
|
||||
tiles = {"moreblocks_iron_glass.png"},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
groups = {snappy = 2, cracky = 3, oddly_breakable_by_hand = 3},
|
||||
|
@ -147,8 +147,8 @@ local nodes = {
|
|||
["coal_glass"] = {
|
||||
description = S("Coal Glass"),
|
||||
drawtype = "glasslike_framed_optional",
|
||||
tiles = {"moreblocks_coal_glass.png", "moreblocks_coal_glass_detail.png"},
|
||||
--tiles = {"moreblocks_coal_glass.png"},
|
||||
--tiles = {"moreblocks_coal_glass.png", "moreblocks_coal_glass_detail.png"},
|
||||
tiles = {"moreblocks_coal_glass.png"},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
groups = {snappy = 2, cracky = 3, oddly_breakable_by_hand = 3},
|
||||
|
@ -157,8 +157,8 @@ local nodes = {
|
|||
["clean_glass"] = {
|
||||
description = S("Clean Glass"),
|
||||
drawtype = "glasslike_framed_optional",
|
||||
tiles = {"moreblocks_clean_glass.png", "moreblocks_clean_glass_detail.png"},
|
||||
--tiles = {"moreblocks_clean_glass.png"},
|
||||
--tiles = {"moreblocks_clean_glass.png", "moreblocks_clean_glass_detail.png"},
|
||||
tiles = {"moreblocks_clean_glass.png"},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
groups = {snappy = 2, cracky = 3, oddly_breakable_by_hand = 3},
|
||||
|
@ -230,8 +230,8 @@ local nodes = {
|
|||
["trap_glass"] = {
|
||||
description = S("Trap Glass"),
|
||||
drawtype = "glasslike_framed_optional",
|
||||
tiles = {"moreblocks_trap_glass.png", "default_glass_detail.png"},
|
||||
--tiles = {"moreblocks_trap_glass.png"},
|
||||
--tiles = {"moreblocks_trap_glass.png", "default_glass_detail.png"},
|
||||
tiles = {"moreblocks_trap_glass.png"},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
|
@ -284,8 +284,8 @@ local nodes = {
|
|||
["glow_glass"] = {
|
||||
description = S("Glow Glass"),
|
||||
drawtype = "glasslike_framed_optional",
|
||||
tiles = {"moreblocks_glow_glass.png", "moreblocks_glow_glass_detail.png"},
|
||||
--tiles = {"moreblocks_glow_glass.png"},
|
||||
--tiles = {"moreblocks_glow_glass.png", "moreblocks_glow_glass_detail.png"},
|
||||
tiles = {"moreblocks_glow_glass.png"},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
light_source = 11,
|
||||
|
@ -295,8 +295,8 @@ local nodes = {
|
|||
["trap_glow_glass"] = {
|
||||
description = S("Trap Glow Glass"),
|
||||
drawtype = "glasslike_framed_optional",
|
||||
tiles = {"moreblocks_trap_glass.png", "moreblocks_glow_glass_detail.png"},
|
||||
--tiles = {"moreblocks_trap_glass.png"},
|
||||
--tiles = {"moreblocks_trap_glass.png", "moreblocks_glow_glass_detail.png"},
|
||||
tiles = {"moreblocks_trap_glass.png"},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
light_source = 11,
|
||||
|
@ -308,8 +308,8 @@ local nodes = {
|
|||
["super_glow_glass"] = {
|
||||
description = S("Super Glow Glass"),
|
||||
drawtype = "glasslike_framed_optional",
|
||||
tiles = {"moreblocks_super_glow_glass.png", "moreblocks_super_glow_glass_detail.png"},
|
||||
--tiles = {"moreblocks_super_glow_glass.png"},
|
||||
--tiles = {"moreblocks_super_glow_glass.png", "moreblocks_super_glow_glass_detail.png"},
|
||||
tiles = {"moreblocks_super_glow_glass.png"},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
light_source = 15,
|
||||
|
@ -319,8 +319,8 @@ local nodes = {
|
|||
["trap_super_glow_glass"] = {
|
||||
description = S("Trap Super Glow Glass"),
|
||||
drawtype = "glasslike_framed_optional",
|
||||
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", "moreblocks_super_glow_glass_detail.png"},
|
||||
tiles = {"moreblocks_trap_super_glow_glass.png"},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
light_source = 15,
|
||||
|
|
|
@ -43,7 +43,7 @@ minetest.register_craft({
|
|||
|
||||
minetest.register_craft({
|
||||
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
|
||||
|
|
|
@ -17,19 +17,28 @@ and minetest.setting_getbool("creative_mode") then
|
|||
stairsplus.expect_infinite_stacks = true
|
||||
end
|
||||
|
||||
function stairsplus:register_all(modname, subname, recipeitem, fields)
|
||||
fields = fields or {}
|
||||
fields.groups = fields.groups or {}
|
||||
if not moreblocks.config.stairsplus_in_creative_inventory then
|
||||
fields.groups.not_in_creative_inventory = 1
|
||||
function stairsplus:prepare_groups(groups)
|
||||
result = {}
|
||||
if groups then
|
||||
for k, v in pairs(groups) do
|
||||
if k ~= "wood" and k ~= "stone" then
|
||||
result[k] = v
|
||||
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_slab (modname, subname, recipeitem, fields)
|
||||
self:register_slope(modname, subname, recipeitem, fields)
|
||||
self:register_panel(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.
|
||||
circular_saw.known_nodes[recipeitem] = {modname, subname}
|
||||
end
|
||||
|
||||
function register_stair_slab_panel_micro(modname, subname, recipeitem, groups, images, description, drop, light)
|
||||
|
|
|
@ -10,7 +10,7 @@ local S = moreblocks.intllib
|
|||
-- Node will be called <modname>:micro_<subname>
|
||||
|
||||
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,
|
||||
tiles = images,
|
||||
description = description,
|
||||
|
@ -68,22 +68,24 @@ function stairsplus:register_micro(modname, subname, recipeitem, fields)
|
|||
|
||||
local desc = S("%s Microblock"):format(fields.description)
|
||||
for alternate, def in pairs(defs) do
|
||||
for k, v in pairs(fields) do
|
||||
def[k] = v
|
||||
end
|
||||
def.drawtype = "nodebox"
|
||||
def.paramtype = "light"
|
||||
def.paramtype2 = "facedir"
|
||||
def.on_place = minetest.rotate_node
|
||||
for k, v in pairs(fields) do
|
||||
def[k] = v
|
||||
end
|
||||
def.groups = stairsplus:prepare_groups(fields.groups)
|
||||
def.description = desc
|
||||
if fields.drop then
|
||||
def.drop = modname.. ":micro_" ..fields.drop..alternate
|
||||
end
|
||||
minetest.register_node(":" ..modname.. ":micro_" ..subname..alternate, def)
|
||||
end
|
||||
|
||||
minetest.register_alias(modname.. ":micro_" ..subname.. "_bottom", modname.. ":micro_" ..subname)
|
||||
|
||||
circular_saw.known_nodes[recipeitem] = {modname, subname}
|
||||
|
||||
-- Some saw-less recipes:
|
||||
|
||||
minetest.register_craft({
|
||||
|
|
|
@ -10,7 +10,7 @@ local S = moreblocks.intllib
|
|||
-- Node will be called <modname>:panel_<subname>
|
||||
|
||||
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,
|
||||
tiles = images,
|
||||
description = description,
|
||||
|
@ -68,14 +68,15 @@ function stairsplus:register_panel(modname, subname, recipeitem, fields)
|
|||
|
||||
local desc = S("%s Panel"):format(fields.description)
|
||||
for alternate, def in pairs(defs) do
|
||||
for k, v in pairs(fields) do
|
||||
def[k] = v
|
||||
end
|
||||
def.drawtype = "nodebox"
|
||||
def.paramtype = "light"
|
||||
def.paramtype2 = "facedir"
|
||||
def.on_place = minetest.rotate_node
|
||||
for k, v in pairs(fields) do
|
||||
def[k] = v
|
||||
end
|
||||
def.description = desc
|
||||
def.groups = stairsplus:prepare_groups(fields.groups)
|
||||
if fields.drop then
|
||||
def.drop = modname.. ":panel_" ..fields.drop..alternate
|
||||
end
|
||||
|
@ -83,6 +84,8 @@ function stairsplus:register_panel(modname, subname, recipeitem, fields)
|
|||
end
|
||||
minetest.register_alias(modname.. ":panel_" ..subname.. "_bottom", modname.. ":panel_" ..subname)
|
||||
|
||||
circular_saw.known_nodes[recipeitem] = {modname, subname}
|
||||
|
||||
-- Some saw-less recipes:
|
||||
|
||||
minetest.register_craft({
|
||||
|
|
|
@ -42,13 +42,6 @@ for _, name in pairs(default_nodes) do
|
|||
local nodename = "default:" .. name
|
||||
local ndef = minetest.registered_nodes[nodename]
|
||||
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
|
||||
if type(ndef.drop) == "string" then
|
||||
drop = ndef.drop:split(" ")[1]:sub(9)
|
||||
|
@ -56,7 +49,7 @@ for _, name in pairs(default_nodes) do
|
|||
stairsplus:register_all("moreblocks", name, nodename, {
|
||||
description = ndef.description,
|
||||
drop = drop,
|
||||
groups = groups,
|
||||
groups = ndef.groups,
|
||||
sounds = ndef.sounds,
|
||||
tiles = ndef.tiles,
|
||||
sunlight_propagates = true,
|
||||
|
|
|
@ -10,7 +10,7 @@ local S = moreblocks.intllib
|
|||
-- Node will be called <modname>:slab_<subname>
|
||||
|
||||
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,
|
||||
tiles = images,
|
||||
description = description,
|
||||
|
@ -30,6 +30,7 @@ function stairsplus:register_slab(modname, subname, recipeitem, fields)
|
|||
["_14"] = 14,
|
||||
["_15"] = 15,
|
||||
}
|
||||
|
||||
local desc_base = S("%s Slab"):format(fields.description)
|
||||
for alternate, num in pairs(defs) do
|
||||
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},
|
||||
}
|
||||
}
|
||||
for k, v in pairs(fields) do
|
||||
def[k] = v
|
||||
end
|
||||
def.drawtype = "nodebox"
|
||||
def.paramtype = "light"
|
||||
def.paramtype2 = "facedir"
|
||||
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.groups = stairsplus:prepare_groups(fields.groups)
|
||||
if fields.drop then
|
||||
def.drop = modname.. ":slab_" .. fields.drop .. alternate
|
||||
end
|
||||
|
@ -53,6 +55,8 @@ function stairsplus:register_slab(modname, subname, recipeitem, fields)
|
|||
end
|
||||
minetest.register_alias("stairs:slab_" .. subname, modname .. ":slab_" .. subname)
|
||||
|
||||
circular_saw.known_nodes[recipeitem] = {modname, subname}
|
||||
|
||||
-- Some saw-less recipes:
|
||||
|
||||
minetest.register_craft({
|
||||
|
|
|
@ -113,7 +113,7 @@ local box_slope_outer_half_raised = {
|
|||
-- Node will be called <modname>:slope_<subname>
|
||||
|
||||
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,
|
||||
tiles = images,
|
||||
description = description,
|
||||
|
@ -222,20 +222,23 @@ function stairsplus:register_slope(modname, subname, recipeitem, fields)
|
|||
|
||||
local desc = S("%s Slope"):format(fields.description)
|
||||
for alternate, def in pairs(defs) do
|
||||
for k, v in pairs(fields) do
|
||||
def[k] = v
|
||||
end
|
||||
def.drawtype = "mesh"
|
||||
def.paramtype = "light"
|
||||
def.paramtype2 = "facedir"
|
||||
def.on_place = minetest.rotate_node
|
||||
for k, v in pairs(fields) do
|
||||
def[k] = v
|
||||
end
|
||||
def.description = desc
|
||||
def.groups = stairsplus:prepare_groups(fields.groups)
|
||||
if fields.drop then
|
||||
def.drop = modname.. ":slope_" ..fields.drop..alternate
|
||||
end
|
||||
minetest.register_node(":" ..modname.. ":slope_" ..subname..alternate, def)
|
||||
end
|
||||
|
||||
circular_saw.known_nodes[recipeitem] = {modname, subname}
|
||||
|
||||
-- Some saw-less recipes:
|
||||
|
||||
minetest.register_craft({
|
||||
|
|
|
@ -10,7 +10,7 @@ local S = moreblocks.intllib
|
|||
-- Node will be called <modname>:stair_<subname>
|
||||
|
||||
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,
|
||||
tiles = images,
|
||||
description = description,
|
||||
|
@ -108,14 +108,15 @@ function stairsplus:register_stair(modname, subname, recipeitem, fields)
|
|||
|
||||
local desc = S("%s Stairs"):format(fields.description)
|
||||
for alternate, def in pairs(defs) do
|
||||
for k, v in pairs(fields) do
|
||||
def[k] = v
|
||||
end
|
||||
def.drawtype = "nodebox"
|
||||
def.paramtype = "light"
|
||||
def.paramtype2 = "facedir"
|
||||
def.on_place = minetest.rotate_node
|
||||
for k, v in pairs(fields) do
|
||||
def[k] = v
|
||||
end
|
||||
def.description = desc
|
||||
def.groups = stairsplus:prepare_groups(fields.groups)
|
||||
if fields.drop then
|
||||
def.drop = modname .. ":stair_" .. fields.drop .. alternate
|
||||
end
|
||||
|
@ -123,6 +124,8 @@ function stairsplus:register_stair(modname, subname, recipeitem, fields)
|
|||
end
|
||||
minetest.register_alias("stairs:stair_" .. subname, modname .. ":stair_" .. subname)
|
||||
|
||||
circular_saw.known_nodes[recipeitem] = {modname, subname}
|
||||
|
||||
-- Some saw-less recipes:
|
||||
|
||||
minetest.register_craft({
|
||||
|
|
Loading…
Reference in New Issue
Block a user