mirror of
https://github.com/minetest-mods/technic.git
synced 2025-03-21 03:40:31 +01:00
Merge 4b66e9f447c72bb03074170cfebbe9d411feb9cb into 9755127ffd92b2fc49676fbc6b446403965e005d
This commit is contained in:
commit
cc2735739b
@ -26,43 +26,43 @@ end
|
||||
minetest.register_craft({
|
||||
output = 'technic:rebar 6',
|
||||
recipe = {
|
||||
{'','', steel_ingot},
|
||||
{'',steel_ingot,''},
|
||||
{steel_ingot, '', ''},
|
||||
{ "", "", steel_ingot },
|
||||
{ "", steel_ingot, "" },
|
||||
{ steel_ingot, "", "" },
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:concrete 5',
|
||||
recipe = {
|
||||
{'default:stone','technic:rebar','default:stone'},
|
||||
{'technic:rebar','default:stone','technic:rebar'},
|
||||
{'default:stone','technic:rebar','default:stone'},
|
||||
{ "default:stone", "technic:rebar", "default:stone" },
|
||||
{ "technic:rebar", "default:stone", "technic:rebar" },
|
||||
{ "default:stone", "technic:rebar", "default:stone" },
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:concrete_post_platform 6',
|
||||
recipe = {
|
||||
{'technic:concrete','technic:concrete_post','technic:concrete'},
|
||||
{ "technic:concrete", "technic:concrete_post", "technic:concrete" },
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:concrete_post 12',
|
||||
recipe = {
|
||||
{'default:stone','technic:rebar','default:stone'},
|
||||
{'default:stone','technic:rebar','default:stone'},
|
||||
{'default:stone','technic:rebar','default:stone'},
|
||||
{ "default:stone", "technic:rebar", "default:stone" },
|
||||
{ "default:stone", "technic:rebar", "default:stone" },
|
||||
{ "default:stone", "technic:rebar", "default:stone" },
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:blast_resistant_concrete 5',
|
||||
recipe = {
|
||||
{'technic:concrete','technic:composite_plate','technic:concrete'},
|
||||
{'technic:composite_plate','technic:concrete','technic:composite_plate'},
|
||||
{'technic:concrete','technic:composite_plate','technic:concrete'},
|
||||
{ "technic:concrete", "technic:composite_plate", "technic:concrete" },
|
||||
{ "technic:composite_plate", "technic:concrete", "technic:composite_plate" },
|
||||
{ "technic:concrete", "technic:composite_plate", "technic:concrete" },
|
||||
}
|
||||
})
|
||||
|
||||
@ -73,49 +73,49 @@ minetest.register_craftitem(":technic:rebar", {
|
||||
|
||||
minetest.register_node(":technic:concrete", {
|
||||
description = S("Concrete Block"),
|
||||
tiles = {"technic_concrete_block.png",},
|
||||
groups = {cracky=1, level=2, concrete=1},
|
||||
tiles = { "technic_concrete_block.png", },
|
||||
groups = { cracky = 1, level = 2, concrete = 1 },
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node(":technic:blast_resistant_concrete", {
|
||||
description = S("Blast-resistant Concrete Block"),
|
||||
tiles = {"technic_blast_resistant_concrete_block.png",},
|
||||
groups = {cracky=1, level=3, concrete=1},
|
||||
tiles = { "technic_blast_resistant_concrete_block.png", },
|
||||
groups = { cracky = 1, level = 3, concrete = 1 },
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
on_blast = function(pos, intensity)
|
||||
if intensity > 9 then
|
||||
minetest.remove_node(pos)
|
||||
return {"technic:blast_resistant_concrete"}
|
||||
return { "technic:blast_resistant_concrete" }
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
local box_platform = {-0.5, 0.3, -0.5, 0.5, 0.5, 0.5}
|
||||
local box_post = {-0.15, -0.5, -0.15, 0.15, 0.5, 0.15}
|
||||
local box_front = {-0.1, -0.3, 0, 0.1, 0.3, -0.5}
|
||||
local box_back = {-0.1, -0.3, 0, 0.1, 0.3, 0.5}
|
||||
local box_left = {0, -0.3, -0.1, -0.5, 0.3, 0.1}
|
||||
local box_right = {0, -0.3, -0.1, 0.5, 0.3, 0.1}
|
||||
local box_platform = { -0.5, 0.3, -0.5, 0.5, 0.5, 0.5 }
|
||||
local box_post = { -0.15, -0.5, -0.15, 0.15, 0.5, 0.15 }
|
||||
local box_front = { -0.1, -0.3, 0, 0.1, 0.3, -0.5 }
|
||||
local box_back = { -0.1, -0.3, 0, 0.1, 0.3, 0.5 }
|
||||
local box_left = { 0, -0.3, -0.1, -0.5, 0.3, 0.1 }
|
||||
local box_right = { 0, -0.3, -0.1, 0.5, 0.3, 0.1 }
|
||||
|
||||
minetest.register_node(":technic:concrete_post_platform", {
|
||||
description = S("Concrete Post Platform"),
|
||||
tiles = {"technic_concrete_block.png",},
|
||||
groups={cracky=1, level=2},
|
||||
tiles = { "technic_concrete_block.png", },
|
||||
groups = { cracky = 1, level = 2 },
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
paramtype = "light",
|
||||
drawtype = "nodebox",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {box_platform}
|
||||
fixed = { box_platform }
|
||||
},
|
||||
on_place = function (itemstack, placer, pointed_thing)
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
local node = minetest.get_node(pointed_thing.under)
|
||||
if node.name ~= "technic:concrete_post" then
|
||||
return minetest.item_place_node(itemstack, placer, pointed_thing)
|
||||
end
|
||||
minetest.set_node(pointed_thing.under, {name="technic:concrete_post_with_platform"})
|
||||
minetest.set_node(pointed_thing.under, { name = "technic:concrete_post_with_platform" })
|
||||
itemstack:take_item()
|
||||
placer:set_wielded_item(itemstack)
|
||||
return itemstack
|
||||
@ -133,18 +133,18 @@ for platform = 0, 1 do
|
||||
|
||||
minetest.register_node(":technic:concrete_post"..(platform == 1 and "_with_platform" or ""), {
|
||||
description = S("Concrete Post"),
|
||||
tiles = {"technic_concrete_block.png"},
|
||||
groups = {cracky=1, level=2, concrete_post=1, not_in_creative_inventory=platform},
|
||||
tiles = { "technic_concrete_block.png" },
|
||||
groups = { cracky = 1, level = 2, concrete_post = 1, not_in_creative_inventory = platform },
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
drop = (platform == 1 and "technic:concrete_post_platform" or
|
||||
"technic:concrete_post"),
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
drawtype = "nodebox",
|
||||
connects_to = {"group:concrete", "group:concrete_post"},
|
||||
connects_to = { "group:concrete", "group:concrete_post" },
|
||||
node_box = {
|
||||
type = "connected",
|
||||
fixed = {box_post, (platform == 1 and box_platform or nil)},
|
||||
fixed = { box_post, (platform == 1 and box_platform or nil) },
|
||||
connect_front = box_front,
|
||||
connect_back = box_back,
|
||||
connect_left = box_left,
|
||||
|
@ -10,111 +10,110 @@ if minetest.get_modpath("moreblocks") then
|
||||
-- chrome seems to be too hard of a metal to be actually sawable
|
||||
|
||||
stairsplus:register_all("technic", "marble", "technic:marble", {
|
||||
description=S("Marble"),
|
||||
groups={cracky=3, not_in_creative_inventory=1},
|
||||
tiles={"technic_marble.png"},
|
||||
description = S("Marble"),
|
||||
groups = { cracky = 3, not_in_creative_inventory = 1 },
|
||||
tiles = { "technic_marble.png" },
|
||||
})
|
||||
|
||||
stairsplus:register_all("technic", "marble_bricks", "technic:marble_bricks", {
|
||||
description=S("Marble Bricks"),
|
||||
groups={cracky=3, not_in_creative_inventory=1},
|
||||
tiles={"technic_marble_bricks.png"},
|
||||
description = S("Marble Bricks"),
|
||||
groups = { cracky = 3, not_in_creative_inventory = 1 },
|
||||
tiles = { "technic_marble_bricks.png" },
|
||||
})
|
||||
|
||||
stairsplus:register_all("technic", "granite", "technic:granite", {
|
||||
description=S("Granite"),
|
||||
groups={cracky=1, not_in_creative_inventory=1},
|
||||
tiles={"technic_granite.png"},
|
||||
description = S("Granite"),
|
||||
groups = { cracky = 1, not_in_creative_inventory = 1 },
|
||||
tiles = { "technic_granite.png" },
|
||||
})
|
||||
|
||||
stairsplus:register_all("technic", "concrete", "technic:concrete", {
|
||||
description=S("Concrete"),
|
||||
groups={cracky=3, not_in_creative_inventory=1},
|
||||
tiles={"technic_concrete_block.png"},
|
||||
description = S("Concrete"),
|
||||
groups = { cracky = 3, not_in_creative_inventory = 1 },
|
||||
tiles = { "technic_concrete_block.png" },
|
||||
})
|
||||
|
||||
stairsplus:register_all("technic", "zinc_block", "technic:zinc_block", {
|
||||
description=S("Zinc Block"),
|
||||
groups={cracky=1, not_in_creative_inventory=1},
|
||||
tiles={"technic_zinc_block.png"},
|
||||
description = S("Zinc Block"),
|
||||
groups = { cracky = 1, not_in_creative_inventory = 1 },
|
||||
tiles = { "technic_zinc_block.png" },
|
||||
})
|
||||
|
||||
stairsplus:register_all("technic", "cast_iron_block", "technic:cast_iron_block", {
|
||||
description=S("Cast Iron Block"),
|
||||
groups={cracky=1, not_in_creative_inventory=1},
|
||||
tiles={"technic_cast_iron_block.png"},
|
||||
description = S("Cast Iron Block"),
|
||||
groups = { cracky = 1, not_in_creative_inventory = 1 },
|
||||
tiles = { "technic_cast_iron_block.png" },
|
||||
})
|
||||
|
||||
stairsplus:register_all("technic", "carbon_steel_block", "technic:carbon_steel_block", {
|
||||
description=S("Carbon Steel Block"),
|
||||
groups={cracky=1, not_in_creative_inventory=1},
|
||||
tiles={"technic_carbon_steel_block.png"},
|
||||
description = S("Carbon Steel Block"),
|
||||
groups = { cracky = 1, not_in_creative_inventory = 1 },
|
||||
tiles = { "technic_carbon_steel_block.png" },
|
||||
})
|
||||
|
||||
stairsplus:register_all("technic", "stainless_steel_block", "technic:stainless_steel_block", {
|
||||
description=S("Stainless Steel Block"),
|
||||
groups={cracky=1, not_in_creative_inventory=1},
|
||||
tiles={"technic_stainless_steel_block.png"},
|
||||
description = S("Stainless Steel Block"),
|
||||
groups = { cracky = 1, not_in_creative_inventory = 1 },
|
||||
tiles = { "technic_stainless_steel_block.png" },
|
||||
})
|
||||
|
||||
stairsplus:register_all("technic", "brass_block", "technic:brass_block", {
|
||||
description=S("Brass Block"),
|
||||
groups={cracky=1, not_in_creative_inventory=1},
|
||||
tiles={"technic_brass_block.png"},
|
||||
description = S("Brass Block"),
|
||||
groups = { cracky = 1, not_in_creative_inventory = 1 },
|
||||
tiles = { "technic_brass_block.png" },
|
||||
})
|
||||
|
||||
function register_technic_stairs_alias(modname, origname, newmod, newname)
|
||||
minetest.register_alias(modname .. ":slab_" .. origname, newmod..":slab_" .. newname)
|
||||
minetest.register_alias(modname .. ":slab_" .. origname .. "_inverted", newmod..":slab_" .. newname .. "_inverted")
|
||||
minetest.register_alias(modname .. ":slab_" .. origname .. "_wall", newmod..":slab_" .. newname .. "_wall")
|
||||
minetest.register_alias(modname .. ":slab_" .. origname .. "_quarter", newmod..":slab_" .. newname .. "_quarter")
|
||||
minetest.register_alias(modname .. ":slab_" .. origname .. "_quarter_inverted", newmod..":slab_" .. newname .. "_quarter_inverted")
|
||||
minetest.register_alias(modname .. ":slab_" .. origname .. "_quarter_wall", newmod..":slab_" .. newname .. "_quarter_wall")
|
||||
minetest.register_alias(modname .. ":slab_" .. origname .. "_three_quarter", newmod..":slab_" .. newname .. "_three_quarter")
|
||||
minetest.register_alias(modname .. ":slab_" .. origname .. "_three_quarter_inverted", newmod..":slab_" .. newname .. "_three_quarter_inverted")
|
||||
minetest.register_alias(modname .. ":slab_" .. origname .. "_three_quarter_wall", newmod..":slab_" .. newname .. "_three_quarter_wall")
|
||||
minetest.register_alias(modname .. ":stair_" .. origname, newmod..":stair_" .. newname)
|
||||
minetest.register_alias(modname .. ":stair_" .. origname .. "_inverted", newmod..":stair_" .. newname .. "_inverted")
|
||||
minetest.register_alias(modname .. ":stair_" .. origname .. "_wall", newmod..":stair_" .. newname .. "_wall")
|
||||
minetest.register_alias(modname .. ":stair_" .. origname .. "_wall_half", newmod..":stair_" .. newname .. "_wall_half")
|
||||
minetest.register_alias(modname .. ":stair_" .. origname .. "_wall_half_inverted", newmod..":stair_" .. newname .. "_wall_half_inverted")
|
||||
minetest.register_alias(modname .. ":stair_" .. origname .. "_half", newmod..":stair_" .. newname .. "_half")
|
||||
minetest.register_alias(modname .. ":stair_" .. origname .. "_half_inverted", newmod..":stair_" .. newname .. "_half_inverted")
|
||||
minetest.register_alias(modname .. ":stair_" .. origname .. "_right_half", newmod..":stair_" .. newname .. "_right_half")
|
||||
minetest.register_alias(modname .. ":stair_" .. origname .. "_right_half_inverted", newmod..":stair_" .. newname .. "_right_half_inverted")
|
||||
minetest.register_alias(modname .. ":stair_" .. origname .. "_wall_half", newmod..":stair_" .. newname .. "_wall_half")
|
||||
minetest.register_alias(modname .. ":stair_" .. origname .. "_wall_half_inverted", newmod..":stair_" .. newname .. "_wall_half_inverted")
|
||||
minetest.register_alias(modname .. ":stair_" .. origname .. "_inner", newmod..":stair_" .. newname .. "_inner")
|
||||
minetest.register_alias(modname .. ":stair_" .. origname .. "_inner_inverted", newmod..":stair_" .. newname .. "_inner_inverted")
|
||||
minetest.register_alias(modname .. ":stair_" .. origname .. "_outer", newmod..":stair_" .. newname .. "_outer")
|
||||
minetest.register_alias(modname .. ":stair_" .. origname .. "_outer_inverted", newmod..":stair_" .. newname .. "_outer_inverted")
|
||||
minetest.register_alias(modname .. ":panel_" .. origname .. "_bottom", newmod..":panel_" .. newname .. "_bottom")
|
||||
minetest.register_alias(modname .. ":panel_" .. origname .. "_top", newmod..":panel_" .. newname .. "_top")
|
||||
minetest.register_alias(modname .. ":panel_" .. origname .. "_vertical", newmod..":panel_" .. newname .. "_vertical")
|
||||
minetest.register_alias(modname .. ":micro_" .. origname .. "_bottom", newmod..":micro_" .. newname .. "_bottom")
|
||||
minetest.register_alias(modname .. ":micro_" .. origname .. "_top", newmod..":micro_" .. newname .. "_top")
|
||||
minetest.register_alias(modname..":slab_"..origname, newmod..":slab_"..newname)
|
||||
minetest.register_alias(modname..":slab_"..origname.."_inverted", newmod..":slab_"..newname.."_inverted")
|
||||
minetest.register_alias(modname..":slab_"..origname.."_wall", newmod..":slab_"..newname.."_wall")
|
||||
minetest.register_alias(modname..":slab_"..origname.."_quarter", newmod..":slab_"..newname.."_quarter")
|
||||
minetest.register_alias(modname..":slab_"..origname.."_quarter_inverted", newmod..":slab_"..newname.."_quarter_inverted")
|
||||
minetest.register_alias(modname..":slab_"..origname.."_quarter_wall", newmod..":slab_"..newname.."_quarter_wall")
|
||||
minetest.register_alias(modname..":slab_"..origname.."_three_quarter", newmod..":slab_"..newname.."_three_quarter")
|
||||
minetest.register_alias(modname..":slab_"..origname.."_three_quarter_inverted", newmod..":slab_"..newname.."_three_quarter_inverted")
|
||||
minetest.register_alias(modname..":slab_"..origname.."_three_quarter_wall", newmod..":slab_"..newname.."_three_quarter_wall")
|
||||
minetest.register_alias(modname..":stair_"..origname, newmod..":stair_"..newname)
|
||||
minetest.register_alias(modname..":stair_"..origname.."_inverted", newmod..":stair_"..newname.."_inverted")
|
||||
minetest.register_alias(modname..":stair_"..origname.."_wall", newmod..":stair_"..newname.."_wall")
|
||||
minetest.register_alias(modname..":stair_"..origname.."_wall_half", newmod..":stair_"..newname.."_wall_half")
|
||||
minetest.register_alias(modname..":stair_"..origname.."_wall_half_inverted", newmod..":stair_"..newname.."_wall_half_inverted")
|
||||
minetest.register_alias(modname..":stair_"..origname.."_half", newmod..":stair_"..newname.."_half")
|
||||
minetest.register_alias(modname..":stair_"..origname.."_half_inverted", newmod..":stair_"..newname.."_half_inverted")
|
||||
minetest.register_alias(modname..":stair_"..origname.."_right_half", newmod..":stair_"..newname.."_right_half")
|
||||
minetest.register_alias(modname..":stair_"..origname.."_right_half_inverted", newmod..":stair_"..newname.."_right_half_inverted")
|
||||
minetest.register_alias(modname..":stair_"..origname.."_wall_half", newmod..":stair_"..newname.."_wall_half")
|
||||
minetest.register_alias(modname..":stair_"..origname.."_wall_half_inverted", newmod..":stair_"..newname.."_wall_half_inverted")
|
||||
minetest.register_alias(modname..":stair_"..origname.."_inner", newmod..":stair_"..newname.."_inner")
|
||||
minetest.register_alias(modname..":stair_"..origname.."_inner_inverted", newmod..":stair_"..newname.."_inner_inverted")
|
||||
minetest.register_alias(modname..":stair_"..origname.."_outer", newmod..":stair_"..newname.."_outer")
|
||||
minetest.register_alias(modname..":stair_"..origname.."_outer_inverted", newmod..":stair_"..newname.."_outer_inverted")
|
||||
minetest.register_alias(modname..":panel_"..origname.."_bottom", newmod..":panel_"..newname.."_bottom")
|
||||
minetest.register_alias(modname..":panel_"..origname.."_top", newmod..":panel_"..newname.."_top")
|
||||
minetest.register_alias(modname..":panel_"..origname.."_vertical", newmod..":panel_"..newname.."_vertical")
|
||||
minetest.register_alias(modname..":micro_"..origname.."_bottom", newmod..":micro_"..newname.."_bottom")
|
||||
minetest.register_alias(modname..":micro_"..origname.."_top", newmod..":micro_"..newname.."_top")
|
||||
end
|
||||
|
||||
register_technic_stairs_alias("stairsplus", "concrete", "technic", "concrete")
|
||||
register_technic_stairs_alias("stairsplus", "marble", "technic", "marble")
|
||||
register_technic_stairs_alias("stairsplus", "granite", "technic", "granite")
|
||||
register_technic_stairs_alias("stairsplus", "marble_bricks", "technic", "marble_bricks")
|
||||
|
||||
end
|
||||
|
||||
local iclip_def = {
|
||||
description = "Insulator/cable clip",
|
||||
drawtype = "mesh",
|
||||
mesh = "technic_insulator_clip.obj",
|
||||
tiles = {"technic_insulator_clip.png"},
|
||||
tiles = { "technic_insulator_clip.png" },
|
||||
is_ground_content = false,
|
||||
groups = {choppy=1, snappy=1, oddly_breakable_by_hand=1 },
|
||||
groups = { choppy = 1, snappy = 1, oddly_breakable_by_hand = 1 },
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
}
|
||||
|
||||
local iclipfence_def = {
|
||||
description = "Insulator/cable clip",
|
||||
tiles = {"technic_insulator_clip.png"},
|
||||
tiles = { "technic_insulator_clip.png" },
|
||||
is_ground_content = false,
|
||||
paramtype = "light",
|
||||
drawtype = "nodebox",
|
||||
@ -132,17 +131,25 @@ local iclipfence_def = {
|
||||
},
|
||||
-- connect_top =
|
||||
-- connect_bottom =
|
||||
connect_front = {{-1/16,3/16,-1/2,1/16,5/16,-1/8},
|
||||
{-1/16,-5/16,-1/2,1/16,-3/16,-1/8}},
|
||||
connect_left = {{-1/2,3/16,-1/16,-1/8,5/16,1/16},
|
||||
{-1/2,-5/16,-1/16,-1/8,-3/16,1/16}},
|
||||
connect_back = {{-1/16,3/16,1/8,1/16,5/16,1/2},
|
||||
{-1/16,-5/16,1/8,1/16,-3/16,1/2}},
|
||||
connect_right = {{1/8,3/16,-1/16,1/2,5/16,1/16},
|
||||
{1/8,-5/16,-1/16,1/2,-3/16,1/16}},
|
||||
connect_front = {
|
||||
{ -1/16, 3/16, -1/2, 1/16, 5/16, -1/8 },
|
||||
{ -1/16, -5/16, -1/2, 1/16, -3/16, -1/8 }
|
||||
},
|
||||
connects_to = {"group:fence", "group:wood", "group:tree"},
|
||||
groups = {fence=1, choppy=1, snappy=1, oddly_breakable_by_hand=1 },
|
||||
connect_left = {
|
||||
{ -1/2, 3/16, -1/16, -1/8, 5/16, 1/16 },
|
||||
{ -1/2, -5/16, -1/16, -1/8, -3/16, 1/16 }
|
||||
},
|
||||
connect_back = {
|
||||
{ -1/16, 3/16, 1/8, 1/16, 5/16, 1/2 },
|
||||
{ -1/16, -5/16, 1/8, 1/16, -3/16, 1/2 }
|
||||
},
|
||||
connect_right = {
|
||||
{ 1/8, 3/16, -1/16, 1/2, 5/16, 1/16 },
|
||||
{ 1/8, -5/16, -1/16, 1/2, -3/16, 1/16 }
|
||||
},
|
||||
},
|
||||
connects_to = { "group:fence", "group:wood", "group:tree" },
|
||||
groups = { fence = 1, choppy = 1, snappy = 1, oddly_breakable_by_hand = 1 },
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
}
|
||||
|
||||
@ -154,14 +161,14 @@ if minetest.get_modpath("unifieddyes") then
|
||||
unifieddyes.recolor_on_place(pos, placer, itemstack, pointed_thing)
|
||||
end
|
||||
iclip_def.after_dig_node = unifieddyes.after_dig_node
|
||||
iclip_def.groups = {choppy=1, snappy=1, oddly_breakable_by_hand=1, ud_param2_colorable = 1}
|
||||
iclip_def.groups = { choppy = 1, snappy = 1, oddly_breakable_by_hand = 1, ud_param2_colorable = 1 }
|
||||
|
||||
iclipfence_def.paramtype2 = "color"
|
||||
iclipfence_def.palette = "unifieddyes_palette_extended.png"
|
||||
iclipfence_def.on_construct = unifieddyes.on_construct
|
||||
iclipfence_def.after_place_node = unifieddyes.recolor_on_place
|
||||
iclipfence_def.after_dig_node = unifieddyes.after_dig_node
|
||||
iclipfence_def.groups = {fence=1, choppy=1, snappy=1, oddly_breakable_by_hand=1, ud_param2_colorable = 1}
|
||||
iclipfence_def.groups = { fence = 1, choppy = 1, snappy = 1, oddly_breakable_by_hand = 1, ud_param2_colorable = 1 }
|
||||
iclipfence_def.place_param2 = 171 -- medium amber, low saturation, closest color to default:wood
|
||||
end
|
||||
|
||||
@ -171,17 +178,17 @@ minetest.register_node(":technic:insulator_clip_fencepost", iclipfence_def)
|
||||
minetest.register_craft({
|
||||
output = "technic:insulator_clip",
|
||||
recipe = {
|
||||
{ "", "dye:white", ""},
|
||||
{ "", "technic:raw_latex", ""},
|
||||
{ "technic:raw_latex", "default:stone", "technic:raw_latex"},
|
||||
{ "", "dye:white", "" },
|
||||
{ "", "technic:raw_latex", "" },
|
||||
{ "technic:raw_latex", "default:stone", "technic:raw_latex" },
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "technic:insulator_clip_fencepost 2",
|
||||
recipe = {
|
||||
{ "", "dye:white", ""},
|
||||
{ "", "technic:raw_latex", ""},
|
||||
{ "technic:raw_latex", "default:fence_wood", "technic:raw_latex"},
|
||||
{ "", "dye:white", "" },
|
||||
{ "", "technic:raw_latex", "" },
|
||||
{ "technic:raw_latex", "default:fence_wood", "technic:raw_latex" },
|
||||
}
|
||||
})
|
||||
|
@ -4,153 +4,153 @@ local mesecons_materials = minetest.get_modpath("mesecons_materials")
|
||||
-- tubes crafting recipes
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'pipeworks:accelerator_tube_1',
|
||||
output = "pipeworks:accelerator_tube_1",
|
||||
recipe = {
|
||||
{'technic:copper_coil', 'pipeworks:tube_1', 'technic:copper_coil'},
|
||||
{ "technic:copper_coil", "pipeworks:tube_1", "technic:copper_coil" },
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'pipeworks:teleport_tube_1',
|
||||
output = "pipeworks:teleport_tube_1",
|
||||
recipe = {
|
||||
{'default:mese_crystal', 'technic:copper_coil', 'default:mese_crystal'},
|
||||
{'pipeworks:tube_1', 'technic:control_logic_unit', 'pipeworks:tube_1'},
|
||||
{'default:mese_crystal', 'technic:copper_coil', 'default:mese_crystal'},
|
||||
{ "default:mese_crystal", "technic:copper_coil", "default:mese_crystal" },
|
||||
{ "pipeworks:tube_1", "technic:control_logic_unit", "pipeworks:tube_1" },
|
||||
{ "default:mese_crystal", "technic:copper_coil", "default:mese_crystal" },
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:diamond_drill_head',
|
||||
output = "technic:diamond_drill_head",
|
||||
recipe = {
|
||||
{'technic:stainless_steel_ingot', 'default:diamond', 'technic:stainless_steel_ingot'},
|
||||
{'default:diamond', '', 'default:diamond'},
|
||||
{'technic:stainless_steel_ingot', 'default:diamond', 'technic:stainless_steel_ingot'},
|
||||
{ "technic:stainless_steel_ingot", "default:diamond", "technic:stainless_steel_ingot" },
|
||||
{ "default:diamond", "", "default:diamond" },
|
||||
{ "technic:stainless_steel_ingot", "default:diamond", "technic:stainless_steel_ingot" },
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:green_energy_crystal',
|
||||
output = "technic:green_energy_crystal",
|
||||
recipe = {
|
||||
{'default:gold_ingot', 'technic:battery', 'dye:green'},
|
||||
{'technic:battery', 'technic:red_energy_crystal', 'technic:battery'},
|
||||
{'dye:green', 'technic:battery', 'default:gold_ingot'},
|
||||
{ "default:gold_ingot", "technic:battery", "dye:green" },
|
||||
{ "technic:battery", "technic:red_energy_crystal", "technic:battery" },
|
||||
{ "dye:green", "technic:battery", "default:gold_ingot" },
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:blue_energy_crystal',
|
||||
output = "technic:blue_energy_crystal",
|
||||
recipe = {
|
||||
{'moreores:mithril_ingot', 'technic:battery', 'dye:blue'},
|
||||
{'technic:battery', 'technic:green_energy_crystal', 'technic:battery'},
|
||||
{'dye:blue', 'technic:battery', 'moreores:mithril_ingot'},
|
||||
{ "moreores:mithril_ingot", "technic:battery", "dye:blue" },
|
||||
{ "technic:battery", "technic:green_energy_crystal", "technic:battery" },
|
||||
{ "dye:blue", "technic:battery", "moreores:mithril_ingot" },
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:red_energy_crystal',
|
||||
output = "technic:red_energy_crystal",
|
||||
recipe = {
|
||||
{'moreores:silver_ingot', 'technic:battery', 'dye:red'},
|
||||
{'technic:battery', 'default:diamondblock', 'technic:battery'},
|
||||
{'dye:red', 'technic:battery', 'moreores:silver_ingot'},
|
||||
{ "moreores:silver_ingot", "technic:battery", "dye:red" },
|
||||
{ "technic:battery", "default:diamondblock", "technic:battery" },
|
||||
{ "dye:red", "technic:battery", "moreores:silver_ingot" },
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:fine_copper_wire 2',
|
||||
recipe = {
|
||||
{'', 'default:copper_ingot', ''},
|
||||
{'', 'default:copper_ingot', ''},
|
||||
{'', 'default:copper_ingot', ''},
|
||||
{ "", "default:copper_ingot", "" },
|
||||
{ "", "default:copper_ingot", "" },
|
||||
{ "", "default:copper_ingot", "" },
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:fine_gold_wire 2',
|
||||
recipe = {
|
||||
{'', 'default:gold_ingot', ''},
|
||||
{'', 'default:gold_ingot', ''},
|
||||
{'', 'default:gold_ingot', ''},
|
||||
{ "", "default:gold_ingot", "" },
|
||||
{ "", "default:gold_ingot", "" },
|
||||
{ "", "default:gold_ingot", "" },
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:fine_silver_wire 2',
|
||||
recipe = {
|
||||
{'', 'moreores:silver_ingot', ''},
|
||||
{'', 'moreores:silver_ingot', ''},
|
||||
{'', 'moreores:silver_ingot', ''},
|
||||
{ "", "moreores:silver_ingot", "" },
|
||||
{ "", "moreores:silver_ingot", "" },
|
||||
{ "", "moreores:silver_ingot", "" },
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:copper_coil 1',
|
||||
recipe = {
|
||||
{'technic:fine_copper_wire', 'technic:wrought_iron_ingot', 'technic:fine_copper_wire'},
|
||||
{'technic:wrought_iron_ingot', '', 'technic:wrought_iron_ingot'},
|
||||
{'technic:fine_copper_wire', 'technic:wrought_iron_ingot', 'technic:fine_copper_wire'},
|
||||
{ "technic:fine_copper_wire", "technic:wrought_iron_ingot", "technic:fine_copper_wire" },
|
||||
{ "technic:wrought_iron_ingot", "", "technic:wrought_iron_ingot" },
|
||||
{ "technic:fine_copper_wire", "technic:wrought_iron_ingot", "technic:fine_copper_wire" },
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:motor',
|
||||
output = "technic:motor",
|
||||
recipe = {
|
||||
{'technic:carbon_steel_ingot', 'technic:copper_coil', 'technic:carbon_steel_ingot'},
|
||||
{'technic:carbon_steel_ingot', 'technic:copper_coil', 'technic:carbon_steel_ingot'},
|
||||
{'technic:carbon_steel_ingot', 'default:copper_ingot', 'technic:carbon_steel_ingot'},
|
||||
{ "technic:carbon_steel_ingot", "technic:copper_coil", "technic:carbon_steel_ingot" },
|
||||
{ "technic:carbon_steel_ingot", "technic:copper_coil", "technic:carbon_steel_ingot" },
|
||||
{ "technic:carbon_steel_ingot", "default:copper_ingot", "technic:carbon_steel_ingot" },
|
||||
}
|
||||
})
|
||||
|
||||
local isolation = mesecons_materials and "mesecons_materials:fiber" or "technic:rubber"
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:lv_transformer',
|
||||
output = "technic:lv_transformer",
|
||||
recipe = {
|
||||
{isolation, 'technic:wrought_iron_ingot', isolation},
|
||||
{'technic:copper_coil', 'technic:wrought_iron_ingot', 'technic:copper_coil'},
|
||||
{'technic:wrought_iron_ingot', 'technic:wrought_iron_ingot', 'technic:wrought_iron_ingot'},
|
||||
{ isolation, "technic:wrought_iron_ingot", isolation },
|
||||
{ "technic:copper_coil", "technic:wrought_iron_ingot", "technic:copper_coil" },
|
||||
{ "technic:wrought_iron_ingot", "technic:wrought_iron_ingot", "technic:wrought_iron_ingot" },
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:mv_transformer',
|
||||
output = "technic:mv_transformer",
|
||||
recipe = {
|
||||
{isolation, 'technic:carbon_steel_ingot', isolation},
|
||||
{'technic:copper_coil', 'technic:carbon_steel_ingot', 'technic:copper_coil'},
|
||||
{'technic:carbon_steel_ingot', 'technic:carbon_steel_ingot', 'technic:carbon_steel_ingot'},
|
||||
{ isolation, "technic:carbon_steel_ingot", isolation },
|
||||
{ "technic:copper_coil", "technic:carbon_steel_ingot", "technic:copper_coil" },
|
||||
{ "technic:carbon_steel_ingot", "technic:carbon_steel_ingot", "technic:carbon_steel_ingot" },
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:hv_transformer',
|
||||
output = "technic:hv_transformer",
|
||||
recipe = {
|
||||
{isolation, 'technic:stainless_steel_ingot', isolation},
|
||||
{'technic:copper_coil', 'technic:stainless_steel_ingot', 'technic:copper_coil'},
|
||||
{'technic:stainless_steel_ingot', 'technic:stainless_steel_ingot', 'technic:stainless_steel_ingot'},
|
||||
{ isolation, "technic:stainless_steel_ingot", isolation },
|
||||
{ "technic:copper_coil", "technic:stainless_steel_ingot", "technic:copper_coil" },
|
||||
{ "technic:stainless_steel_ingot", "technic:stainless_steel_ingot", "technic:stainless_steel_ingot" },
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:control_logic_unit',
|
||||
output = "technic:control_logic_unit",
|
||||
recipe = {
|
||||
{'', 'technic:fine_gold_wire', ''},
|
||||
{'default:copper_ingot', 'technic:silicon_wafer', 'default:copper_ingot'},
|
||||
{'', 'technic:chromium_ingot', ''},
|
||||
{ "", "technic:fine_gold_wire", "" },
|
||||
{ "default:copper_ingot", "technic:silicon_wafer", "default:copper_ingot" },
|
||||
{ "", "technic:chromium_ingot", "" },
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:mixed_metal_ingot 9',
|
||||
recipe = {
|
||||
{'technic:stainless_steel_ingot', 'technic:stainless_steel_ingot', 'technic:stainless_steel_ingot'},
|
||||
{'default:bronze_ingot', 'default:bronze_ingot', 'default:bronze_ingot'},
|
||||
{'moreores:tin_ingot', 'moreores:tin_ingot', 'moreores:tin_ingot'},
|
||||
{ "technic:stainless_steel_ingot", "technic:stainless_steel_ingot", "technic:stainless_steel_ingot" },
|
||||
{ "default:bronze_ingot", "default:bronze_ingot", "default:bronze_ingot" },
|
||||
{ "moreores:tin_ingot", "moreores:tin_ingot", "moreores:tin_ingot" },
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:carbon_cloth',
|
||||
output = "technic:carbon_cloth",
|
||||
recipe = {
|
||||
{'technic:graphite', 'technic:graphite', 'technic:graphite'}
|
||||
{ "technic:graphite", "technic:graphite", "technic:graphite" }
|
||||
}
|
||||
})
|
||||
|
||||
@ -168,7 +168,7 @@ minetest.register_craft({
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "default:bronze_ingot 0",
|
||||
recipe = {"default:copper_ingot", "default:steel_ingot"}
|
||||
recipe = { "default:copper_ingot", "default:steel_ingot" }
|
||||
})
|
||||
|
||||
-- Accelerator tube
|
||||
@ -194,7 +194,7 @@ minetest.register_craft({
|
||||
minetest.register_craft({
|
||||
output = "default:dirt 2",
|
||||
type = "shapeless",
|
||||
replacements = {{"bucket:bucket_water","bucket:bucket_empty"}},
|
||||
replacements = { { "bucket:bucket_water", "bucket:bucket_empty" } },
|
||||
recipe = {
|
||||
"technic:stone_dust",
|
||||
"group:leaves",
|
||||
|
@ -172,7 +172,7 @@ function technic.trace_node_ray_fat(pos, dir, range)
|
||||
-- We can just use fixed integer keys here because the
|
||||
-- table will be completely cleared before we reach this
|
||||
-- code block again.
|
||||
local dlen = math.sqrt(dx*dx + dy*dy + dz*dz)
|
||||
local dlen = math.sqrt(dx * dx + dy * dy + dz * dz)
|
||||
-- Normalized axis deltas
|
||||
local dxn, dyn, dzn = dx / dlen, dy / dlen, dz / dlen
|
||||
if not sx and dxn > 0.5 then
|
||||
|
@ -16,7 +16,7 @@ technic.modpath = modpath
|
||||
if rawget(_G, "intllib") then
|
||||
technic.getter = intllib.Getter()
|
||||
else
|
||||
technic.getter = function(s,a,...)if a==nil then return s end a={a,...}return s:gsub("(@?)@(%(?)(%d+)(%)?)",function(e,o,n,c)if e==""then return a[tonumber(n)]..(o==""and c or"")else return"@"..o..n..c end end) end
|
||||
technic.getter = function(s, a, ...) if a == nil then return s end a = { a, ... } return s:gsub("(@?)@(%(?)(%d+)(%)?)", function(e, o, n, c) if e == "" then return a[tonumber(n)]..(o == "" and c or "") else return "@"..o..n..c end end) end
|
||||
end
|
||||
local S = technic.getter
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
local S = technic.getter
|
||||
|
||||
minetest.register_craftitem("technic:silicon_wafer", {
|
||||
@ -6,7 +5,7 @@ minetest.register_craftitem("technic:silicon_wafer", {
|
||||
inventory_image = "technic_silicon_wafer.png",
|
||||
})
|
||||
|
||||
minetest.register_craftitem( "technic:doped_silicon_wafer", {
|
||||
minetest.register_craftitem("technic:doped_silicon_wafer", {
|
||||
description = S("Doped Silicon Wafer"),
|
||||
inventory_image = "technic_doped_silicon_wafer.png",
|
||||
})
|
||||
@ -16,15 +15,14 @@ minetest.register_craftitem("technic:uranium_fuel", {
|
||||
inventory_image = "technic_uranium_fuel.png",
|
||||
})
|
||||
|
||||
minetest.register_craftitem( "technic:diamond_drill_head", {
|
||||
minetest.register_craftitem("technic:diamond_drill_head", {
|
||||
description = S("Diamond Drill Head"),
|
||||
inventory_image = "technic_diamond_drill_head.png",
|
||||
})
|
||||
|
||||
minetest.register_tool("technic:blue_energy_crystal", {
|
||||
description = S("Blue Energy Crystal"),
|
||||
inventory_image = minetest.inventorycube(
|
||||
"technic_diamond_block_blue.png",
|
||||
inventory_image = minetest.inventorycube("technic_diamond_block_blue.png",
|
||||
"technic_diamond_block_blue.png",
|
||||
"technic_diamond_block_blue.png"),
|
||||
wear_represents = "technic_RE_charge",
|
||||
@ -32,15 +30,14 @@ minetest.register_tool("technic:blue_energy_crystal", {
|
||||
tool_capabilities = {
|
||||
max_drop_level = 0,
|
||||
groupcaps = {
|
||||
fleshy = {times={}, uses=10000, maxlevel=0}
|
||||
fleshy = { times = {}, uses = 10000, maxlevel = 0 }
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_tool("technic:green_energy_crystal", {
|
||||
description = S("Green Energy Crystal"),
|
||||
inventory_image = minetest.inventorycube(
|
||||
"technic_diamond_block_green.png",
|
||||
inventory_image = minetest.inventorycube("technic_diamond_block_green.png",
|
||||
"technic_diamond_block_green.png",
|
||||
"technic_diamond_block_green.png"),
|
||||
wear_represents = "technic_RE_charge",
|
||||
@ -48,15 +45,14 @@ minetest.register_tool("technic:green_energy_crystal", {
|
||||
tool_capabilities = {
|
||||
max_drop_level = 0,
|
||||
groupcaps = {
|
||||
fleshy = {times={}, uses=10000, maxlevel=0}
|
||||
fleshy = { times = {}, uses = 10000, maxlevel = 0 }
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_tool("technic:red_energy_crystal", {
|
||||
description = S("Red Energy Crystal"),
|
||||
inventory_image = minetest.inventorycube(
|
||||
"technic_diamond_block_red.png",
|
||||
inventory_image = minetest.inventorycube("technic_diamond_block_red.png",
|
||||
"technic_diamond_block_red.png",
|
||||
"technic_diamond_block_red.png"),
|
||||
wear_represents = "technic_RE_charge",
|
||||
@ -64,7 +60,7 @@ minetest.register_tool("technic:red_energy_crystal", {
|
||||
tool_capabilities = {
|
||||
max_drop_level = 0,
|
||||
groupcaps = {
|
||||
fleshy = {times={}, uses=10000, maxlevel=0}
|
||||
fleshy = { times = {}, uses = 10000, maxlevel = 0 }
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -105,12 +101,12 @@ minetest.register_craftitem("technic:mv_transformer", {
|
||||
inventory_image = "technic_mv_transformer.png",
|
||||
})
|
||||
|
||||
minetest.register_craftitem( "technic:hv_transformer", {
|
||||
minetest.register_craftitem("technic:hv_transformer", {
|
||||
description = S("High Voltage Transformer"),
|
||||
inventory_image = "technic_hv_transformer.png",
|
||||
})
|
||||
|
||||
minetest.register_craftitem( "technic:control_logic_unit", {
|
||||
minetest.register_craftitem("technic:control_logic_unit", {
|
||||
description = S("Control Logic Unit"),
|
||||
inventory_image = "technic_control_logic_unit.png",
|
||||
})
|
||||
@ -147,11 +143,11 @@ minetest.register_craftitem("technic:carbon_cloth", {
|
||||
|
||||
minetest.register_node("technic:machine_casing", {
|
||||
description = S("Machine Casing"),
|
||||
groups = {cracky=2},
|
||||
groups = { cracky = 2 },
|
||||
sunlight_propagates = true,
|
||||
paramtype = "light",
|
||||
drawtype = "allfaces",
|
||||
tiles = {"technic_machine_casing.png"},
|
||||
tiles = { "technic_machine_casing.png" },
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
@ -162,9 +158,9 @@ for p = 0, 35 do
|
||||
local block = "technic:uranium"..psuffix.."_block"
|
||||
local ov = p == 7 and minetest.override_item or nil;
|
||||
(ov or minetest.register_craftitem)(ingot, {
|
||||
description = string.format(S("%.1f%%-Fissile Uranium Ingot"), p/10),
|
||||
description = string.format(S("%.1f%%-Fissile Uranium Ingot"), p / 10),
|
||||
inventory_image = "technic_uranium_ingot.png",
|
||||
groups = {uranium_ingot=1, not_in_creative_inventory=nici},
|
||||
groups = { uranium_ingot = 1, not_in_creative_inventory = nici },
|
||||
});
|
||||
-- Note on radioactivity of blocks:
|
||||
-- Source: <http://www.wise-uranium.org/rup.html>
|
||||
@ -197,27 +193,32 @@ for p = 0, 35 do
|
||||
-- uranium ore has radioactive=1. This yields radioactive=1.0
|
||||
-- for a fully-depleted uranium block and radioactive=2.6 for
|
||||
-- a 3.5%-fissile uranium block.
|
||||
local radioactivity = math.floor(math.sqrt((1+5.55*p/35) * 18 / (1+5.55*7/35)) + 0.5);
|
||||
local radioactivity = math.floor(math.sqrt((1 + 5.55 * p / 35) * 18 / (1 + 5.55 * 7 / 35)) + 0.5);
|
||||
(ov or minetest.register_node)(block, {
|
||||
description = string.format(S("%.1f%%-Fissile Uranium Block"), p/10),
|
||||
tiles = {"technic_uranium_block.png"},
|
||||
description = string.format(S("%.1f%%-Fissile Uranium Block"), p / 10),
|
||||
tiles = { "technic_uranium_block.png" },
|
||||
is_ground_content = true,
|
||||
groups = {uranium_block=1, not_in_creative_inventory=nici,
|
||||
cracky=1, level=2, radioactive=radioactivity},
|
||||
groups = {
|
||||
uranium_block = 1,
|
||||
not_in_creative_inventory = nici,
|
||||
cracky = 1,
|
||||
level = 2,
|
||||
radioactive = radioactivity
|
||||
},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
});
|
||||
if not ov then
|
||||
minetest.register_craft({
|
||||
output = block,
|
||||
recipe = {
|
||||
{ingot, ingot, ingot},
|
||||
{ingot, ingot, ingot},
|
||||
{ingot, ingot, ingot},
|
||||
{ ingot, ingot, ingot },
|
||||
{ ingot, ingot, ingot },
|
||||
{ ingot, ingot, ingot },
|
||||
},
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = ingot.." 9",
|
||||
recipe = {{block}},
|
||||
recipe = { { block } },
|
||||
})
|
||||
end
|
||||
end
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
-- Aliases to convert from legacy node/item names
|
||||
|
||||
technic.legacy_nodenames = {
|
||||
|
@ -2,9 +2,9 @@
|
||||
minetest.register_craft({
|
||||
output = 'technic:hv_battery_box0',
|
||||
recipe = {
|
||||
{'technic:mv_battery_box0', 'technic:mv_battery_box0', 'technic:mv_battery_box0'},
|
||||
{'technic:mv_battery_box0', 'technic:hv_transformer', 'technic:mv_battery_box0'},
|
||||
{'', 'technic:hv_cable', ''},
|
||||
{ 'technic:mv_battery_box0', 'technic:mv_battery_box0', 'technic:mv_battery_box0' },
|
||||
{ 'technic:mv_battery_box0', "technic:hv_transformer", 'technic:mv_battery_box0' },
|
||||
{ "", "technic:hv_cable", "" },
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -1,10 +1,9 @@
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:hv_cable 3',
|
||||
recipe = {
|
||||
{'homedecor:plastic_sheeting', 'homedecor:plastic_sheeting', 'homedecor:plastic_sheeting'},
|
||||
{'technic:mv_cable', 'technic:mv_cable', 'technic:mv_cable'},
|
||||
{'homedecor:plastic_sheeting', 'homedecor:plastic_sheeting', 'homedecor:plastic_sheeting'},
|
||||
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" },
|
||||
{ "technic:mv_cable", "technic:mv_cable", "technic:mv_cable" },
|
||||
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" },
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -13,9 +13,9 @@ local S = technic.getter
|
||||
minetest.register_craft({
|
||||
output = "technic:forcefield_emitter_off",
|
||||
recipe = {
|
||||
{"default:mese", "technic:motor", "default:mese" },
|
||||
{"technic:deployer_off", "technic:machine_casing", "technic:deployer_off"},
|
||||
{"default:mese", "technic:hv_cable", "default:mese" },
|
||||
{ "default:mese", "technic:motor", "default:mese" },
|
||||
{ "technic:deployer_off", "technic:machine_casing", "technic:deployer_off" },
|
||||
{ "default:mese", "technic:hv_cable", "default:mese" },
|
||||
}
|
||||
})
|
||||
|
||||
@ -42,9 +42,8 @@ local function update_forcefield(pos, meta, active, first)
|
||||
local shape = meta:get_int("shape")
|
||||
local range = meta:get_int("range")
|
||||
local vm = VoxelManip()
|
||||
local MinEdge, MaxEdge = vm:read_from_map(vector.subtract(pos, range),
|
||||
vector.add(pos, range))
|
||||
local area = VoxelArea:new({MinEdge = MinEdge, MaxEdge = MaxEdge})
|
||||
local MinEdge, MaxEdge = vm:read_from_map(vector.subtract(pos, range), vector.add(pos, range))
|
||||
local area = VoxelArea:new({ MinEdge = MinEdge, MaxEdge = MaxEdge })
|
||||
local data = vm:get_data()
|
||||
|
||||
local c_air = minetest.get_content_id("air")
|
||||
@ -194,8 +193,8 @@ end
|
||||
|
||||
minetest.register_node("technic:forcefield_emitter_off", {
|
||||
description = S("%s Forcefield Emitter"):format("HV"),
|
||||
tiles = {"technic_forcefield_emitter_off.png"},
|
||||
groups = {cracky = 1, technic_machine = 1, technic_hv = 1},
|
||||
tiles = { "technic_forcefield_emitter_off.png" },
|
||||
groups = { cracky = 1, technic_machine = 1, technic_hv = 1 },
|
||||
on_receive_fields = forcefield_receive_fields,
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
@ -214,9 +213,13 @@ minetest.register_node("technic:forcefield_emitter_off", {
|
||||
|
||||
minetest.register_node("technic:forcefield_emitter_on", {
|
||||
description = S("%s Forcefield Emitter"):format("HV"),
|
||||
tiles = {"technic_forcefield_emitter_on.png"},
|
||||
groups = {cracky = 1, technic_machine = 1, technic_hv = 1,
|
||||
not_in_creative_inventory=1},
|
||||
tiles = { "technic_forcefield_emitter_on.png" },
|
||||
groups = {
|
||||
cracky = 1,
|
||||
technic_machine = 1,
|
||||
technic_hv = 1,
|
||||
not_in_creative_inventory = 1
|
||||
},
|
||||
drop = "technic:forcefield_emitter_off",
|
||||
on_receive_fields = forcefield_receive_fields,
|
||||
on_destruct = function(pos)
|
||||
@ -225,7 +228,7 @@ minetest.register_node("technic:forcefield_emitter_on", {
|
||||
end,
|
||||
mesecons = mesecons,
|
||||
technic_run = run,
|
||||
technic_on_disable = function (pos, node)
|
||||
technic_on_disable = function(pos, node)
|
||||
local meta = minetest.get_meta(pos)
|
||||
update_forcefield(pos, meta, false)
|
||||
technic.swap_node(pos, "technic:forcefield_emitter_off")
|
||||
@ -236,12 +239,13 @@ minetest.register_node("technic:forcefield", {
|
||||
description = S("%s Forcefield"):format("HV"),
|
||||
sunlight_propagates = true,
|
||||
drawtype = "glasslike",
|
||||
groups = {not_in_creative_inventory=1},
|
||||
groups = { not_in_creative_inventory = 1 },
|
||||
paramtype = "light",
|
||||
light_source = 15,
|
||||
light_source = LIGHT_MAX,
|
||||
diggable = false,
|
||||
drop = '',
|
||||
tiles = {{
|
||||
drop = "",
|
||||
tiles = {
|
||||
{
|
||||
name = "technic_forcefield_animated.png",
|
||||
animation = {
|
||||
type = "vertical_frames",
|
||||
@ -249,7 +253,8 @@ minetest.register_node("technic:forcefield", {
|
||||
aspect_h = 16,
|
||||
length = 1.0,
|
||||
},
|
||||
}},
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
|
@ -1,13 +1,13 @@
|
||||
minetest.register_alias("hv_generator", "technic:hv_generator")
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:hv_generator',
|
||||
output = "technic:hv_generator",
|
||||
recipe = {
|
||||
{'technic:carbon_plate', 'technic:mv_generator', 'technic:composite_plate'},
|
||||
{'pipeworks:tube_1', 'technic:hv_transformer', 'pipeworks:tube_1'},
|
||||
{'technic:stainless_steel_ingot', 'technic:hv_cable', 'technic:stainless_steel_ingot'},
|
||||
{ "technic:carbon_plate", "technic:mv_generator", "technic:composite_plate" },
|
||||
{ "pipeworks:tube_1", "technic:hv_transformer", "pipeworks:tube_1" },
|
||||
{ "technic:stainless_steel_ingot", "technic:hv_cable", "technic:stainless_steel_ingot" },
|
||||
}
|
||||
})
|
||||
|
||||
technic.register_generator({tier="HV", tube=1, supply=1200})
|
||||
technic.register_generator({ tier = "HV", tube = 1, supply = 1200 })
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
technic.register_tier("HV", "High Voltage")
|
||||
|
||||
local path = technic.modpath.."/machines/HV"
|
||||
|
@ -20,16 +20,15 @@ local reactor_desc = S("@1 Nuclear Reactor Core", S("HV")),
|
||||
|
||||
-- FIXME: Recipe should make more sense like a rod recepticle, steam chamber, HV generator?
|
||||
minetest.register_craft({
|
||||
output = 'technic:hv_nuclear_reactor_core',
|
||||
output = "technic:hv_nuclear_reactor_core",
|
||||
recipe = {
|
||||
{'technic:carbon_plate', 'default:obsidian_glass', 'technic:carbon_plate'},
|
||||
{'technic:composite_plate', 'technic:machine_casing', 'technic:composite_plate'},
|
||||
{'technic:stainless_steel_ingot', 'technic:hv_cable', 'technic:stainless_steel_ingot'},
|
||||
{ "technic:carbon_plate", "default:obsidian_glass", "technic:carbon_plate" },
|
||||
{ "technic:composite_plate", "technic:machine_casing", "technic:composite_plate" },
|
||||
{ "technic:stainless_steel_ingot", "technic:hv_cable", "technic:stainless_steel_ingot" },
|
||||
}
|
||||
})
|
||||
|
||||
local reactor_formspec =
|
||||
"invsize[8,9;]"..
|
||||
local reactor_formspec = "invsize[8,9;]"..
|
||||
"label[0,0;"..S("Nuclear Reactor Rod Compartment").."]"..
|
||||
"list[current_name;src;2,1;3,2;]"..
|
||||
"list[current_player;main;0,5;8,4;]"..
|
||||
@ -37,22 +36,22 @@ local reactor_formspec =
|
||||
|
||||
-- "Boxy sphere"
|
||||
local node_box = {
|
||||
{-0.353, -0.353, -0.353, 0.353, 0.353, 0.353}, -- Box
|
||||
{-0.495, -0.064, -0.064, 0.495, 0.064, 0.064}, -- Circle +-x
|
||||
{-0.483, -0.128, -0.128, 0.483, 0.128, 0.128},
|
||||
{-0.462, -0.191, -0.191, 0.462, 0.191, 0.191},
|
||||
{-0.433, -0.249, -0.249, 0.433, 0.249, 0.249},
|
||||
{-0.397, -0.303, -0.303, 0.397, 0.303, 0.303},
|
||||
{-0.305, -0.396, -0.305, 0.305, 0.396, 0.305}, -- Circle +-y
|
||||
{-0.250, -0.432, -0.250, 0.250, 0.432, 0.250},
|
||||
{-0.191, -0.461, -0.191, 0.191, 0.461, 0.191},
|
||||
{-0.130, -0.482, -0.130, 0.130, 0.482, 0.130},
|
||||
{-0.066, -0.495, -0.066, 0.066, 0.495, 0.066},
|
||||
{-0.064, -0.064, -0.495, 0.064, 0.064, 0.495}, -- Circle +-z
|
||||
{-0.128, -0.128, -0.483, 0.128, 0.128, 0.483},
|
||||
{-0.191, -0.191, -0.462, 0.191, 0.191, 0.462},
|
||||
{-0.249, -0.249, -0.433, 0.249, 0.249, 0.433},
|
||||
{-0.303, -0.303, -0.397, 0.303, 0.303, 0.397},
|
||||
{ -0.353, -0.353, -0.353, 0.353, 0.353, 0.353 }, -- Box
|
||||
{ -0.495, -0.064, -0.064, 0.495, 0.064, 0.064 }, -- Circle +-x
|
||||
{ -0.483, -0.128, -0.128, 0.483, 0.128, 0.128 },
|
||||
{ -0.462, -0.191, -0.191, 0.462, 0.191, 0.191 },
|
||||
{ -0.433, -0.249, -0.249, 0.433, 0.249, 0.249 },
|
||||
{ -0.397, -0.303, -0.303, 0.397, 0.303, 0.303 },
|
||||
{ -0.305, -0.396, -0.305, 0.305, 0.396, 0.305 }, -- Circle +-y
|
||||
{ -0.250, -0.432, -0.250, 0.250, 0.432, 0.250 },
|
||||
{ -0.191, -0.461, -0.191, 0.191, 0.461, 0.191 },
|
||||
{ -0.130, -0.482, -0.130, 0.130, 0.482, 0.130 },
|
||||
{ -0.066, -0.495, -0.066, 0.066, 0.495, 0.066 },
|
||||
{ -0.064, -0.064, -0.495, 0.064, 0.064, 0.495 }, -- Circle +-z
|
||||
{ -0.128, -0.128, -0.483, 0.128, 0.128, 0.483 },
|
||||
{ -0.191, -0.191, -0.462, 0.191, 0.191, 0.462 },
|
||||
{ -0.249, -0.249, -0.433, 0.249, 0.249, 0.433 },
|
||||
{ -0.303, -0.303, -0.397, 0.303, 0.303, 0.397 },
|
||||
}
|
||||
|
||||
local SS_OFF = 0
|
||||
@ -65,18 +64,18 @@ local function siren_set_state(pos, state)
|
||||
local siren = reactor_siren[hpos]
|
||||
if not siren then
|
||||
if state == SS_OFF then return end
|
||||
siren = {state=SS_OFF}
|
||||
siren = { state = SS_OFF }
|
||||
reactor_siren[hpos] = siren
|
||||
end
|
||||
if state == SS_DANGER and siren.state ~= SS_DANGER then
|
||||
if siren.handle then minetest.sound_stop(siren.handle) end
|
||||
siren.handle = minetest.sound_play("technic_hv_nuclear_reactor_siren_danger_loop",
|
||||
{pos=pos, gain=1.5, loop=true, max_hear_distance=48})
|
||||
{ pos = pos, gain = 1.5, loop = true, max_hear_distance = 48 })
|
||||
siren.state = SS_DANGER
|
||||
elseif state == SS_CLEAR then
|
||||
if siren.handle then minetest.sound_stop(siren.handle) end
|
||||
local clear_handle = minetest.sound_play("technic_hv_nuclear_reactor_siren_clear",
|
||||
{pos=pos, gain=1.5, loop=false, max_hear_distance=48})
|
||||
{ pos = pos, gain = 1.5, loop = false, max_hear_distance = 48 })
|
||||
siren.handle = clear_handle
|
||||
siren.state = SS_CLEAR
|
||||
minetest.after(10, function()
|
||||
@ -148,7 +147,7 @@ local function reactor_structure_badness(pos)
|
||||
local pos2 = vector.add(pos, 3)
|
||||
local MinEdge, MaxEdge = vm:read_from_map(pos1, pos2)
|
||||
local data = vm:get_data()
|
||||
local area = VoxelArea:new({MinEdge=MinEdge, MaxEdge=MaxEdge})
|
||||
local area = VoxelArea:new({ MinEdge = MinEdge, MaxEdge = MaxEdge })
|
||||
|
||||
local c_blast_concrete = minetest.get_content_id("technic:blast_resistant_concrete")
|
||||
local c_lead = minetest.get_content_id("technic:lead_block")
|
||||
@ -168,17 +167,17 @@ local function reactor_structure_badness(pos)
|
||||
if cid == c_blast_concrete then
|
||||
blast_layer = blast_layer + 1
|
||||
end
|
||||
elseif x == pos1.x+1 or x == pos2.x-1 or
|
||||
y == pos1.y+1 or y == pos2.y-1 or
|
||||
z == pos1.z+1 or z == pos2.z-1 then
|
||||
elseif x == pos1.x + 1 or x == pos2.x - 1 or
|
||||
y == pos1.y + 1 or y == pos2.y - 1 or
|
||||
z == pos1.z + 1 or z == pos2.z - 1 then
|
||||
if cid == c_lead then
|
||||
lead_layer = lead_layer + 1
|
||||
elseif cid == c_steel then
|
||||
steel_layer = steel_layer + 1
|
||||
end
|
||||
elseif x == pos1.x+2 or x == pos2.x-2 or
|
||||
y == pos1.y+2 or y == pos2.y-2 or
|
||||
z == pos1.z+2 or z == pos2.z-2 then
|
||||
elseif x == pos1.x + 2 or x == pos2.x - 2 or
|
||||
y == pos1.y + 2 or y == pos2.y - 2 or
|
||||
z == pos1.z + 2 or z == pos2.z - 2 then
|
||||
if cid == c_water_source or cid == c_water_flowing then
|
||||
water_layer = water_layer + 1
|
||||
end
|
||||
@ -188,13 +187,13 @@ local function reactor_structure_badness(pos)
|
||||
end
|
||||
|
||||
if steel_layer >= 96 then
|
||||
for z = pos1.z+1, pos2.z-1 do
|
||||
for y = pos1.y+1, pos2.y-1 do
|
||||
for x = pos1.x+1, pos2.x-1 do
|
||||
for z = pos1.z + 1, pos2.z - 1 do
|
||||
for y = pos1.y + 1, pos2.y - 1 do
|
||||
for x = pos1.x + 1, pos2.x - 1 do
|
||||
local vi = area:index(x, y, z)
|
||||
if x == pos1.x+1 or x == pos2.x-1 or
|
||||
y == pos1.y+1 or y == pos2.y-1 or
|
||||
z == pos1.z+1 or z == pos2.z-1 then
|
||||
if x == pos1.x + 1 or x == pos2.x - 1 or
|
||||
y == pos1.y + 1 or y == pos2.y - 1 or
|
||||
z == pos1.z + 1 or z == pos2.z - 1 then
|
||||
if data[vi] == c_steel then
|
||||
data[vi] = c_lead
|
||||
end
|
||||
@ -216,15 +215,15 @@ end
|
||||
|
||||
local function melt_down_reactor(pos)
|
||||
minetest.log("action", "A reactor melted down at "..minetest.pos_to_string(pos))
|
||||
minetest.set_node(pos, {name="technic:corium_source"})
|
||||
minetest.set_node(pos, { name = "technic:corium_source" })
|
||||
end
|
||||
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"technic:hv_nuclear_reactor_core_active"},
|
||||
nodenames = { "technic:hv_nuclear_reactor_core_active" },
|
||||
interval = 4,
|
||||
chance = 1,
|
||||
action = function (pos, node)
|
||||
action = function(pos, node)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local badness = reactor_structure_badness(pos)
|
||||
local accum_badness = meta:get_int("structure_accumulated_badness")
|
||||
@ -289,8 +288,8 @@ end
|
||||
|
||||
minetest.register_node("technic:hv_nuclear_reactor_core", {
|
||||
description = reactor_desc,
|
||||
tiles = {"technic_hv_nuclear_reactor_core.png"},
|
||||
groups = {cracky=1, technic_machine=1, technic_hv=1},
|
||||
tiles = { "technic_hv_nuclear_reactor_core.png" },
|
||||
groups = { cracky = 1, technic_machine = 1, technic_hv = 1 },
|
||||
legacy_facedir_simple = true,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
drawtype = "nodebox",
|
||||
@ -316,14 +315,19 @@ minetest.register_node("technic:hv_nuclear_reactor_core", {
|
||||
})
|
||||
|
||||
minetest.register_node("technic:hv_nuclear_reactor_core_active", {
|
||||
tiles = {"technic_hv_nuclear_reactor_core.png"},
|
||||
groups = {cracky=1, technic_machine=1, technic_hv=1,
|
||||
radioactive=4, not_in_creative_inventory=1},
|
||||
tiles = { "technic_hv_nuclear_reactor_core.png" },
|
||||
groups = {
|
||||
cracky = 1,
|
||||
technic_machine = 1,
|
||||
technic_hv = 1,
|
||||
radioactive = 4,
|
||||
not_in_creative_inventory = 1
|
||||
},
|
||||
legacy_facedir_simple = true,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
drop = "technic:hv_nuclear_reactor_core",
|
||||
drawtype = "nodebox",
|
||||
light_source = 14,
|
||||
light_source = LIGHT_MAX,
|
||||
paramtype = "light",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
|
@ -1,11 +1,11 @@
|
||||
|
||||
local S = technic.getter
|
||||
|
||||
minetest.register_craft({
|
||||
recipe = {
|
||||
{"technic:carbon_plate", "pipeworks:filter", "technic:composite_plate"},
|
||||
{"technic:motor", "technic:machine_casing", "technic:diamond_drill_head"},
|
||||
{"technic:carbon_steel_block", "technic:hv_cable", "technic:carbon_steel_block"}},
|
||||
{ "technic:carbon_plate", "pipeworks:filter", "technic:composite_plate" },
|
||||
{ "technic:motor", "technic:machine_casing", "technic:diamond_drill_head" },
|
||||
{ "technic:carbon_steel_block", "technic:hv_cable", "technic:carbon_steel_block" }
|
||||
},
|
||||
output = "technic:quarry",
|
||||
})
|
||||
|
||||
@ -26,28 +26,25 @@ local function set_quarry_formspec(meta)
|
||||
else
|
||||
formspec = formspec.."button[4,1;2,1;disable;"..S("Enabled").."]"
|
||||
end
|
||||
local diameter = radius*2 + 1
|
||||
local diameter = radius * 2 + 1
|
||||
local nd = meta:get_int("dug")
|
||||
local rel_y = quarry_dig_above_nodes - math.floor(nd / (diameter*diameter))
|
||||
formspec = formspec.."label[0,4;"..minetest.formspec_escape(
|
||||
nd == 0 and S("Digging not started") or
|
||||
local rel_y = quarry_dig_above_nodes - math.floor(nd / (diameter * diameter))
|
||||
formspec = formspec.."label[0,4;"..minetest.formspec_escape(nd == 0 and S("Digging not started") or
|
||||
(rel_y < -quarry_max_depth and S("Digging finished") or
|
||||
(meta:get_int("purge_on") == 1 and S("Purging cache") or
|
||||
S("Digging %d m "..(rel_y > 0 and "above" or "below").." machine")
|
||||
:format(math.abs(rel_y))))
|
||||
).."]"
|
||||
S("Digging %d m "..(rel_y > 0 and "above" or "below").." machine"):format(math.abs(rel_y))))).."]"
|
||||
formspec = formspec.."button[4,2;2,1;restart;"..S("Restart").."]"
|
||||
meta:set_string("formspec", formspec)
|
||||
end
|
||||
|
||||
local function set_quarry_demand(meta)
|
||||
local radius = meta:get_int("size")
|
||||
local diameter = radius*2 + 1
|
||||
local diameter = radius * 2 + 1
|
||||
local machine_name = S("%s Quarry"):format("HV")
|
||||
if meta:get_int("enabled") == 0 or meta:get_int("purge_on") == 1 then
|
||||
meta:set_string("infotext", S(meta:get_int("purge_on") == 1 and "%s purging cache" or "%s Disabled"):format(machine_name))
|
||||
meta:set_int("HV_EU_demand", 0)
|
||||
elseif meta:get_int("dug") == diameter*diameter * (quarry_dig_above_nodes+1+quarry_max_depth) then
|
||||
elseif meta:get_int("dug") == diameter * diameter * (quarry_dig_above_nodes + 1 + quarry_max_depth) then
|
||||
meta:set_string("infotext", S("%s Finished"):format(machine_name))
|
||||
meta:set_int("HV_EU_demand", 0)
|
||||
else
|
||||
@ -79,7 +76,7 @@ local function quarry_handle_purge(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local inv = meta:get_inventory()
|
||||
local i = 0
|
||||
for _,stack in ipairs(inv:get_list("cache")) do
|
||||
for _, stack in ipairs(inv:get_list("cache")) do
|
||||
i = i + 1
|
||||
if stack then
|
||||
local item = stack:to_table()
|
||||
@ -109,32 +106,32 @@ local function quarry_run(pos, node)
|
||||
|
||||
if meta:get_int("enabled") and meta:get_int("HV_EU_input") >= quarry_demand and meta:get_int("purge_on") == 0 then
|
||||
local pdir = minetest.facedir_to_dir(node.param2)
|
||||
local qdir = pdir.x == 1 and vector.new(0,0,-1) or
|
||||
(pdir.z == -1 and vector.new(-1,0,0) or
|
||||
(pdir.x == -1 and vector.new(0,0,1) or
|
||||
vector.new(1,0,0)))
|
||||
local qdir = pdir.x == 1 and vector.new(0, 0, -1) or
|
||||
(pdir.z == -1 and vector.new(-1, 0, 0) or
|
||||
(pdir.x == -1 and vector.new(0, 0, 1) or
|
||||
vector.new(1, 0, 0)))
|
||||
local radius = meta:get_int("size")
|
||||
local diameter = radius*2 + 1
|
||||
local diameter = radius * 2 + 1
|
||||
local startpos = vector.add(vector.add(vector.add(pos,
|
||||
vector.new(0, quarry_dig_above_nodes, 0)),
|
||||
pdir),
|
||||
vector.multiply(qdir, -radius))
|
||||
local endpos = vector.add(vector.add(vector.add(startpos,
|
||||
vector.new(0, -quarry_dig_above_nodes-quarry_max_depth, 0)),
|
||||
vector.multiply(pdir, diameter-1)),
|
||||
vector.multiply(qdir, diameter-1))
|
||||
vector.new(0, -quarry_dig_above_nodes - quarry_max_depth, 0)),
|
||||
vector.multiply(pdir, diameter - 1)),
|
||||
vector.multiply(qdir, diameter - 1))
|
||||
local vm = VoxelManip()
|
||||
local minpos, maxpos = vm:read_from_map(startpos, endpos)
|
||||
local area = VoxelArea:new({MinEdge=minpos, MaxEdge=maxpos})
|
||||
local area = VoxelArea:new({ MinEdge = minpos, MaxEdge = maxpos })
|
||||
local data = vm:get_data()
|
||||
local c_air = minetest.get_content_id("air")
|
||||
local owner = meta:get_string("owner")
|
||||
local nd = meta:get_int("dug")
|
||||
while nd ~= diameter*diameter * (quarry_dig_above_nodes+1+quarry_max_depth) do
|
||||
local ry = math.floor(nd / (diameter*diameter))
|
||||
local ndl = nd % (diameter*diameter)
|
||||
while nd ~= diameter * diameter * (quarry_dig_above_nodes + 1 + quarry_max_depth) do
|
||||
local ry = math.floor(nd / (diameter * diameter))
|
||||
local ndl = nd % (diameter * diameter)
|
||||
if ry % 2 == 1 then
|
||||
ndl = diameter*diameter - 1 - ndl
|
||||
ndl = diameter * diameter - 1 - ndl
|
||||
end
|
||||
local rq = math.floor(ndl / diameter)
|
||||
local rp = ndl % diameter
|
||||
@ -150,15 +147,15 @@ local function quarry_run(pos, node)
|
||||
local dignode
|
||||
if can_dig then
|
||||
dignode = technic.get_or_load_node(digpos) or minetest.get_node(digpos)
|
||||
local dignodedef = minetest.registered_nodes[dignode.name] or {diggable=false}
|
||||
local dignodedef = minetest.registered_nodes[dignode.name] or { diggable = false }
|
||||
if not dignodedef.diggable or (dignodedef.can_dig and not dignodedef.can_dig(digpos, nil)) then
|
||||
can_dig = false
|
||||
end
|
||||
end
|
||||
|
||||
if can_dig then
|
||||
for ay = startpos.y, digpos.y+1, -1 do
|
||||
local checkpos = {x=digpos.x, y=ay, z=digpos.z}
|
||||
for ay = startpos.y, digpos.y + 1, -1 do
|
||||
local checkpos = { x = digpos.x, y = ay, z = digpos.z }
|
||||
local checknode = technic.get_or_load_node(checkpos) or minetest.get_node(checkpos)
|
||||
if checknode.name ~= "air" then
|
||||
can_dig = false
|
||||
@ -181,7 +178,7 @@ local function quarry_run(pos, node)
|
||||
break
|
||||
end
|
||||
end
|
||||
if nd == diameter*diameter * (quarry_dig_above_nodes+1+quarry_max_depth) then
|
||||
if nd == diameter * diameter * (quarry_dig_above_nodes + 1 + quarry_max_depth) then
|
||||
-- if a quarry is finished, we enable purge mode
|
||||
meta:set_int("purge_on", 1)
|
||||
end
|
||||
@ -207,17 +204,19 @@ end
|
||||
|
||||
minetest.register_node("technic:quarry", {
|
||||
description = S("%s Quarry"):format("HV"),
|
||||
tiles = {"technic_carbon_steel_block.png", "technic_carbon_steel_block.png",
|
||||
tiles = {
|
||||
"technic_carbon_steel_block.png", "technic_carbon_steel_block.png",
|
||||
"technic_carbon_steel_block.png^default_tool_mesepick.png", "technic_carbon_steel_block.png"},
|
||||
"technic_carbon_steel_block.png", "technic_carbon_steel_block.png",
|
||||
"technic_carbon_steel_block.png^default_tool_mesepick.png", "technic_carbon_steel_block.png"
|
||||
},
|
||||
inventory_image = minetest.inventorycube("technic_carbon_steel_block.png",
|
||||
"technic_carbon_steel_block.png^default_tool_mesepick.png",
|
||||
"technic_carbon_steel_block.png"),
|
||||
paramtype2 = "facedir",
|
||||
groups = {cracky=2, tubedevice=1, technic_machine=1, technic_hv=1},
|
||||
connect_sides = {"bottom", "front", "left", "right"},
|
||||
groups = { cracky = 2, tubedevice = 1, technic_machine = 1, technic_hv = 1 },
|
||||
connect_sides = { "bottom", "front", "left", "right" },
|
||||
tube = {
|
||||
connect_sides = {top = 1},
|
||||
connect_sides = { top = 1 },
|
||||
-- lower priority than other tubes, so that quarries will prefer any
|
||||
-- other tube to another quarry, which could lead to server freezes
|
||||
-- in certain quarry placements (2x2 for example would never eject)
|
||||
@ -241,7 +240,7 @@ minetest.register_node("technic:quarry", {
|
||||
meta:set_string("owner", placer:get_player_name())
|
||||
pipeworks.scan_for_tube_objects(pos)
|
||||
end,
|
||||
can_dig = function(pos,player)
|
||||
can_dig = function(pos, player)
|
||||
local meta = minetest.get_meta(pos);
|
||||
local inv = meta:get_inventory()
|
||||
return inv:is_empty("cache")
|
||||
|
@ -4,11 +4,11 @@
|
||||
minetest.register_craft({
|
||||
output = 'technic:solar_array_hv 1',
|
||||
recipe = {
|
||||
{'technic:solar_array_mv', 'technic:solar_array_mv', 'technic:solar_array_mv'},
|
||||
{'technic:carbon_plate', 'technic:hv_transformer', 'technic:composite_plate'},
|
||||
{'', 'technic:hv_cable', ''},
|
||||
{ "technic:solar_array_mv", "technic:solar_array_mv", "technic:solar_array_mv" },
|
||||
{ "technic:carbon_plate", "technic:hv_transformer", "technic:composite_plate" },
|
||||
{ "", "technic:hv_cable", "" },
|
||||
}
|
||||
})
|
||||
|
||||
technic.register_solar_array({tier="HV", power=100})
|
||||
technic.register_solar_array({ tier = "HV", power = 100 })
|
||||
|
||||
|
@ -2,13 +2,13 @@
|
||||
|
||||
-- FIXME: kpoppel: I'd like to introduce an induction heating element here...
|
||||
minetest.register_craft({
|
||||
output = 'technic:lv_alloy_furnace',
|
||||
output = "technic:lv_alloy_furnace",
|
||||
recipe = {
|
||||
{'default:brick', 'default:brick', 'default:brick'},
|
||||
{'default:brick', 'technic:machine_casing', 'default:brick'},
|
||||
{'default:brick', 'technic:lv_cable', 'default:brick'},
|
||||
{ "default:brick", "default:brick", "default:brick" },
|
||||
{ "default:brick", "technic:machine_casing", "default:brick" },
|
||||
{ "default:brick", "technic:lv_cable", "default:brick" },
|
||||
}
|
||||
})
|
||||
|
||||
technic.register_alloy_furnace({tier = "LV", speed = 1, demand = {300}})
|
||||
technic.register_alloy_furnace({ tier = "LV", speed = 1, demand = { 300 } })
|
||||
|
||||
|
@ -1,10 +1,9 @@
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:lv_battery_box0',
|
||||
recipe = {
|
||||
{'group:wood', 'group:wood', 'group:wood'},
|
||||
{'technic:battery', 'technic:machine_casing', 'technic:battery'},
|
||||
{'technic:battery', 'technic:lv_cable', 'technic:battery'},
|
||||
{ "group:wood", "group:wood", "group:wood" },
|
||||
{ "technic:battery", "technic:machine_casing", "technic:battery" },
|
||||
{ "technic:battery", "technic:lv_cable", "technic:battery" },
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -1,12 +1,11 @@
|
||||
|
||||
minetest.register_alias("lv_cable", "technic:lv_cable")
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:lv_cable 6',
|
||||
recipe = {
|
||||
{'default:paper', 'default:paper', 'default:paper'},
|
||||
{'default:copper_ingot', 'default:copper_ingot', 'default:copper_ingot'},
|
||||
{'default:paper', 'default:paper', 'default:paper'},
|
||||
{ "default:paper", "default:paper", "default:paper" },
|
||||
{ "default:copper_ingot", "default:copper_ingot", "default:copper_ingot" },
|
||||
{ "default:paper", "default:paper", "default:paper" },
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -11,11 +11,11 @@ local S = technic.getter
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:cnc',
|
||||
output = "technic:cnc",
|
||||
recipe = {
|
||||
{'default:glass', 'technic:diamond_drill_head', 'default:glass'},
|
||||
{'technic:control_logic_unit', 'technic:machine_casing', 'technic:motor'},
|
||||
{'technic:carbon_steel_ingot', 'technic:lv_cable', 'technic:carbon_steel_ingot'},
|
||||
{ "default:glass", "technic:diamond_drill_head", "default:glass" },
|
||||
{ "technic:control_logic_unit", "technic:machine_casing", "technic:motor" },
|
||||
{ "technic:carbon_steel_ingot", "technic:lv_cable", "technic:carbon_steel_ingot" },
|
||||
},
|
||||
})
|
||||
|
||||
@ -48,7 +48,7 @@ local twosize_products = {
|
||||
}
|
||||
|
||||
local cnc_formspec =
|
||||
"invsize[9,11;]"..
|
||||
"invsize[9,11;]"..
|
||||
"label[1,0;"..S("Choose Milling Program:").."]"..
|
||||
"image_button[1,0.5;1,1;technic_cnc_slope.png;slope; ]"..
|
||||
"image_button[2,0.5;1,1;technic_cnc_slope_edge.png;slope_edge; ]"..
|
||||
@ -123,19 +123,19 @@ local function form_handler(pos, formname, fields, sender)
|
||||
end
|
||||
|
||||
if onesize_products[k] ~= nil or twosize_products[k] ~= nil then
|
||||
meta:set_float( "cnc_multiplier", multiplier)
|
||||
meta:set_float("cnc_multiplier", multiplier)
|
||||
meta:set_string("cnc_user", sender:get_player_name())
|
||||
end
|
||||
|
||||
if onesize_products[k] ~= nil or (twosize_products[k] ~= nil and size==2) then
|
||||
meta:set_string("cnc_product", inputname .. "_technic_cnc_" .. k)
|
||||
--print(inputname .. "_technic_cnc_" .. k)
|
||||
if onesize_products[k] ~= nil or (twosize_products[k] ~= nil and size == 2) then
|
||||
meta:set_string("cnc_product", inputname.."_technic_cnc_"..k)
|
||||
--print(inputname.."_technic_cnc_"..k)
|
||||
break
|
||||
end
|
||||
|
||||
if twosize_products[k] ~= nil and size==1 then
|
||||
meta:set_string("cnc_product", inputname .. "_technic_cnc_" .. k .. "_double")
|
||||
--print(inputname .. "_technic_cnc_" .. k .. "_double")
|
||||
if twosize_products[k] ~= nil and size == 1 then
|
||||
meta:set_string("cnc_product", inputname.."_technic_cnc_"..k.."_double")
|
||||
--print(inputname.."_technic_cnc_"..k.."_double")
|
||||
break
|
||||
end
|
||||
end
|
||||
@ -183,10 +183,12 @@ end
|
||||
-- The actual block inactive state
|
||||
minetest.register_node("technic:cnc", {
|
||||
description = S("%s CNC Machine"):format("LV"),
|
||||
tiles = {"technic_cnc_top.png", "technic_cnc_bottom.png", "technic_cnc_side.png",
|
||||
"technic_cnc_side.png", "technic_cnc_side.png", "technic_cnc_front.png"},
|
||||
groups = {cracky=2, technic_machine=1, technic_lv=1},
|
||||
connect_sides = {"bottom", "back", "left", "right"},
|
||||
tiles = {
|
||||
"technic_cnc_top.png", "technic_cnc_bottom.png", "technic_cnc_side.png",
|
||||
"technic_cnc_side.png", "technic_cnc_side.png", "technic_cnc_front.png"
|
||||
},
|
||||
groups = { cracky = 2, technic_machine = 1, technic_lv = 1 },
|
||||
connect_sides = { "bottom", "back", "left", "right" },
|
||||
paramtype2 = "facedir",
|
||||
legacy_facedir_simple = true,
|
||||
on_construct = function(pos)
|
||||
@ -209,10 +211,12 @@ minetest.register_node("technic:cnc", {
|
||||
-- Active state block
|
||||
minetest.register_node("technic:cnc_active", {
|
||||
description = S("%s CNC Machine"):format("LV"),
|
||||
tiles = {"technic_cnc_top_active.png", "technic_cnc_bottom.png", "technic_cnc_side.png",
|
||||
"technic_cnc_side.png", "technic_cnc_side.png", "technic_cnc_front_active.png"},
|
||||
groups = {cracky=2, technic_machine=1, technic_lv=1, not_in_creative_inventory=1},
|
||||
connect_sides = {"bottom", "back", "left", "right"},
|
||||
tiles = {
|
||||
"technic_cnc_top_active.png", "technic_cnc_bottom.png", "technic_cnc_side.png",
|
||||
"technic_cnc_side.png", "technic_cnc_side.png", "technic_cnc_front_active.png"
|
||||
},
|
||||
groups = { cracky = 2, technic_machine = 1, technic_lv = 1, not_in_creative_inventory = 1 },
|
||||
connect_sides = { "bottom", "back", "left", "right" },
|
||||
paramtype2 = "facedir",
|
||||
drop = "technic:cnc",
|
||||
legacy_facedir_simple = true,
|
||||
|
@ -11,78 +11,96 @@ technic.cnc = {}
|
||||
-- Define slope boxes for the various nodes
|
||||
-------------------------------------------
|
||||
technic.cnc.programs = {
|
||||
{ suffix = "technic_cnc_stick",
|
||||
model = {-0.15, -0.5, -0.15, 0.15, 0.5, 0.15},
|
||||
{
|
||||
suffix = "technic_cnc_stick",
|
||||
model = { -0.15, -0.5, -0.15, 0.15, 0.5, 0.15 },
|
||||
desc = S("Stick")
|
||||
},
|
||||
|
||||
{ suffix = "technic_cnc_element_end_double",
|
||||
model = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.5},
|
||||
{
|
||||
suffix = "technic_cnc_element_end_double",
|
||||
model = { -0.3, -0.5, -0.3, 0.3, 0.5, 0.5 },
|
||||
desc = S("Element End Double")
|
||||
},
|
||||
|
||||
{ suffix = "technic_cnc_element_cross_double",
|
||||
{
|
||||
suffix = "technic_cnc_element_cross_double",
|
||||
model = {
|
||||
{0.3, -0.5, -0.3, 0.5, 0.5, 0.3},
|
||||
{-0.3, -0.5, -0.5, 0.3, 0.5, 0.5},
|
||||
{-0.5, -0.5, -0.3, -0.3, 0.5, 0.3}},
|
||||
{ 0.3, -0.5, -0.3, 0.5, 0.5, 0.3 },
|
||||
{ -0.3, -0.5, -0.5, 0.3, 0.5, 0.5 },
|
||||
{ -0.5, -0.5, -0.3, -0.3, 0.5, 0.3 }
|
||||
},
|
||||
desc = S("Element Cross Double")
|
||||
},
|
||||
|
||||
{ suffix = "technic_cnc_element_t_double",
|
||||
{
|
||||
suffix = "technic_cnc_element_t_double",
|
||||
model = {
|
||||
{-0.3, -0.5, -0.5, 0.3, 0.5, 0.3},
|
||||
{-0.5, -0.5, -0.3, -0.3, 0.5, 0.3},
|
||||
{0.3, -0.5, -0.3, 0.5, 0.5, 0.3}},
|
||||
{ -0.3, -0.5, -0.5, 0.3, 0.5, 0.3 },
|
||||
{ -0.5, -0.5, -0.3, -0.3, 0.5, 0.3 },
|
||||
{ 0.3, -0.5, -0.3, 0.5, 0.5, 0.3 }
|
||||
},
|
||||
desc = S("Element T Double")
|
||||
},
|
||||
|
||||
{ suffix = "technic_cnc_element_edge_double",
|
||||
{
|
||||
suffix = "technic_cnc_element_edge_double",
|
||||
model = {
|
||||
{-0.3, -0.5, -0.5, 0.3, 0.5, 0.3},
|
||||
{-0.5, -0.5, -0.3, -0.3, 0.5, 0.3}},
|
||||
{ -0.3, -0.5, -0.5, 0.3, 0.5, 0.3 },
|
||||
{ -0.5, -0.5, -0.3, -0.3, 0.5, 0.3 }
|
||||
},
|
||||
desc = S("Element Edge Double")
|
||||
},
|
||||
|
||||
{ suffix = "technic_cnc_element_straight_double",
|
||||
model = {-0.3, -0.5, -0.5, 0.3, 0.5, 0.5},
|
||||
{
|
||||
suffix = "technic_cnc_element_straight_double",
|
||||
model = { -0.3, -0.5, -0.5, 0.3, 0.5, 0.5 },
|
||||
desc = S("Element Straight Double")
|
||||
},
|
||||
|
||||
{ suffix = "technic_cnc_element_end",
|
||||
model = {-0.3, -0.5, -0.3, 0.3, 0, 0.5},
|
||||
{
|
||||
suffix = "technic_cnc_element_end",
|
||||
model = { -0.3, -0.5, -0.3, 0.3, 0, 0.5 },
|
||||
desc = S("Element End")
|
||||
},
|
||||
|
||||
{ suffix = "technic_cnc_element_cross",
|
||||
{
|
||||
suffix = "technic_cnc_element_cross",
|
||||
model = {
|
||||
{0.3, -0.5, -0.3, 0.5, 0, 0.3},
|
||||
{-0.3, -0.5, -0.5, 0.3, 0, 0.5},
|
||||
{-0.5, -0.5, -0.3, -0.3, 0, 0.3}},
|
||||
{ 0.3, -0.5, -0.3, 0.5, 0, 0.3 },
|
||||
{ -0.3, -0.5, -0.5, 0.3, 0, 0.5 },
|
||||
{ -0.5, -0.5, -0.3, -0.3, 0, 0.3 }
|
||||
},
|
||||
desc = S("Element Cross")
|
||||
},
|
||||
|
||||
{ suffix = "technic_cnc_element_t",
|
||||
{
|
||||
suffix = "technic_cnc_element_t",
|
||||
model = {
|
||||
{-0.3, -0.5, -0.5, 0.3, 0, 0.3},
|
||||
{-0.5, -0.5, -0.3, -0.3, 0, 0.3},
|
||||
{0.3, -0.5, -0.3, 0.5, 0, 0.3}},
|
||||
{ -0.3, -0.5, -0.5, 0.3, 0, 0.3 },
|
||||
{ -0.5, -0.5, -0.3, -0.3, 0, 0.3 },
|
||||
{ 0.3, -0.5, -0.3, 0.5, 0, 0.3 }
|
||||
},
|
||||
desc = S("Element T")
|
||||
},
|
||||
|
||||
{ suffix = "technic_cnc_element_edge",
|
||||
{
|
||||
suffix = "technic_cnc_element_edge",
|
||||
model = {
|
||||
{-0.3, -0.5, -0.5, 0.3, 0, 0.3},
|
||||
{-0.5, -0.5, -0.3, -0.3, 0, 0.3}},
|
||||
{ -0.3, -0.5, -0.5, 0.3, 0, 0.3 },
|
||||
{ -0.5, -0.5, -0.3, -0.3, 0, 0.3 }
|
||||
},
|
||||
desc = S("Element Edge")
|
||||
},
|
||||
|
||||
{ suffix = "technic_cnc_element_straight",
|
||||
model = {-0.3, -0.5, -0.5, 0.3, 0, 0.5},
|
||||
{
|
||||
suffix = "technic_cnc_element_straight",
|
||||
model = { -0.3, -0.5, -0.5, 0.3, 0, 0.5 },
|
||||
desc = S("Element Straight")
|
||||
},
|
||||
|
||||
{ suffix = "technic_cnc_oblate_spheroid",
|
||||
{
|
||||
suffix = "technic_cnc_oblate_spheroid",
|
||||
model = "technic_oblate_spheroid.obj",
|
||||
desc = S("Oblate spheroid"),
|
||||
cbox = {
|
||||
@ -95,32 +113,38 @@ technic.cnc.programs = {
|
||||
}
|
||||
},
|
||||
|
||||
{ suffix = "technic_cnc_sphere",
|
||||
{
|
||||
suffix = "technic_cnc_sphere",
|
||||
model = "technic_sphere.obj",
|
||||
desc = S("Sphere")
|
||||
},
|
||||
|
||||
{ suffix = "technic_cnc_cylinder_horizontal",
|
||||
{
|
||||
suffix = "technic_cnc_cylinder_horizontal",
|
||||
model = "technic_cylinder_horizontal.obj",
|
||||
desc = S("Horizontal Cylinder")
|
||||
},
|
||||
|
||||
{ suffix = "technic_cnc_cylinder",
|
||||
{
|
||||
suffix = "technic_cnc_cylinder",
|
||||
model = "technic_cylinder.obj",
|
||||
desc = S("Cylinder")
|
||||
},
|
||||
|
||||
{ suffix = "technic_cnc_twocurvededge",
|
||||
{
|
||||
suffix = "technic_cnc_twocurvededge",
|
||||
model = "technic_two_curved_edge.obj",
|
||||
desc = S("Two Curved Edge/Corner Block")
|
||||
},
|
||||
|
||||
{ suffix = "technic_cnc_onecurvededge",
|
||||
{
|
||||
suffix = "technic_cnc_onecurvededge",
|
||||
model = "technic_one_curved_edge.obj",
|
||||
desc = S("One Curved Edge Block")
|
||||
},
|
||||
|
||||
{ suffix = "technic_cnc_spike",
|
||||
{
|
||||
suffix = "technic_cnc_spike",
|
||||
model = "technic_pyramid_spike.obj",
|
||||
desc = S("Spike"),
|
||||
cbox = {
|
||||
@ -134,7 +158,8 @@ technic.cnc.programs = {
|
||||
}
|
||||
},
|
||||
|
||||
{ suffix = "technic_cnc_pyramid",
|
||||
{
|
||||
suffix = "technic_cnc_pyramid",
|
||||
model = "technic_pyramid.obj",
|
||||
desc = S("Pyramid"),
|
||||
cbox = {
|
||||
@ -148,7 +173,8 @@ technic.cnc.programs = {
|
||||
}
|
||||
},
|
||||
|
||||
{ suffix = "technic_cnc_slope_inner_edge_upsdown",
|
||||
{
|
||||
suffix = "technic_cnc_slope_inner_edge_upsdown",
|
||||
model = "technic_innercorner_upsdown.obj",
|
||||
desc = S("Slope Upside Down Inner Edge/Corner"),
|
||||
sbox = {
|
||||
@ -169,7 +195,8 @@ technic.cnc.programs = {
|
||||
}
|
||||
},
|
||||
|
||||
{ suffix = "technic_cnc_slope_edge_upsdown",
|
||||
{
|
||||
suffix = "technic_cnc_slope_edge_upsdown",
|
||||
model = "technic_outercorner_upsdown.obj",
|
||||
desc = S("Slope Upside Down Outer Edge/Corner"),
|
||||
cbox = {
|
||||
@ -183,7 +210,8 @@ technic.cnc.programs = {
|
||||
}
|
||||
},
|
||||
|
||||
{ suffix = "technic_cnc_slope_inner_edge",
|
||||
{
|
||||
suffix = "technic_cnc_slope_inner_edge",
|
||||
model = "technic_innercorner.obj",
|
||||
desc = S("Slope Inner Edge/Corner"),
|
||||
sbox = {
|
||||
@ -204,7 +232,8 @@ technic.cnc.programs = {
|
||||
}
|
||||
},
|
||||
|
||||
{ suffix = "technic_cnc_slope_edge",
|
||||
{
|
||||
suffix = "technic_cnc_slope_edge",
|
||||
model = "technic_outercorner.obj",
|
||||
desc = S("Slope Outer Edge/Corner"),
|
||||
cbox = {
|
||||
@ -218,7 +247,8 @@ technic.cnc.programs = {
|
||||
}
|
||||
},
|
||||
|
||||
{ suffix = "technic_cnc_slope_upsdown",
|
||||
{
|
||||
suffix = "technic_cnc_slope_upsdown",
|
||||
model = "technic_slope_upsdown.obj",
|
||||
desc = S("Slope Upside Down"),
|
||||
cbox = {
|
||||
@ -232,7 +262,8 @@ technic.cnc.programs = {
|
||||
}
|
||||
},
|
||||
|
||||
{ suffix = "technic_cnc_slope_lying",
|
||||
{
|
||||
suffix = "technic_cnc_slope_lying",
|
||||
model = "technic_slope_horizontal.obj",
|
||||
desc = S("Slope Lying"),
|
||||
cbox = {
|
||||
@ -246,7 +277,8 @@ technic.cnc.programs = {
|
||||
}
|
||||
},
|
||||
|
||||
{ suffix = "technic_cnc_slope",
|
||||
{
|
||||
suffix = "technic_cnc_slope",
|
||||
model = "technic_slope.obj",
|
||||
desc = S("Slope"),
|
||||
cbox = {
|
||||
@ -259,17 +291,18 @@ technic.cnc.programs = {
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
-- Allow disabling certain programs for some node. Default is allowing all types for all nodes
|
||||
technic.cnc.programs_disable = {
|
||||
-- ["default:brick"] = {"technic_cnc_stick"}, -- Example: Disallow the stick for brick
|
||||
-- ...
|
||||
["default:dirt"] = {"technic_cnc_oblate_spheroid", "technic_cnc_slope_upsdown", "technic_cnc_edge",
|
||||
["default:dirt"] = {
|
||||
"technic_cnc_oblate_spheroid", "technic_cnc_slope_upsdown", "technic_cnc_edge",
|
||||
"technic_cnc_inner_edge", "technic_cnc_slope_edge_upsdown",
|
||||
"technic_cnc_slope_inner_edge_upsdown", "technic_cnc_stick",
|
||||
"technic_cnc_cylinder_horizontal"}
|
||||
"technic_cnc_cylinder_horizontal"
|
||||
}
|
||||
}
|
||||
|
||||
-- Generic function for registering all the different node types
|
||||
|
@ -6,86 +6,86 @@ local S = technic.getter
|
||||
-- DIRT
|
||||
-------
|
||||
technic.cnc.register_all("default:dirt",
|
||||
{snappy=2,choppy=2,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
|
||||
{"default_grass.png", "default_dirt.png", "default_grass.png"},
|
||||
{ snappy = 2, choppy = 2, oddly_breakable_by_hand = 3, not_in_creative_inventory = 1 },
|
||||
{ "default_grass.png", "default_dirt.png", "default_grass.png" },
|
||||
S("Dirt"))
|
||||
-- WOOD
|
||||
-------
|
||||
technic.cnc.register_all("default:wood",
|
||||
{snappy=2, choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1},
|
||||
{"default_wood.png"},
|
||||
{ snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, not_in_creative_inventory = 1 },
|
||||
{ "default_wood.png" },
|
||||
S("Wooden"))
|
||||
-- STONE
|
||||
--------
|
||||
technic.cnc.register_all("default:stone",
|
||||
{cracky=3, not_in_creative_inventory=1},
|
||||
{"default_stone.png"},
|
||||
{ cracky = 3, not_in_creative_inventory = 1 },
|
||||
{ "default_stone.png" },
|
||||
S("Stone"))
|
||||
-- COBBLE
|
||||
---------
|
||||
technic.cnc.register_all("default:cobble",
|
||||
{cracky=3, not_in_creative_inventory=1},
|
||||
{"default_cobble.png"},
|
||||
{ cracky = 3, not_in_creative_inventory = 1 },
|
||||
{ "default_cobble.png" },
|
||||
S("Cobble"))
|
||||
-- BRICK
|
||||
--------
|
||||
technic.cnc.register_all("default:brick",
|
||||
{cracky=3, not_in_creative_inventory=1},
|
||||
{"default_brick.png"},
|
||||
{ cracky = 3, not_in_creative_inventory = 1 },
|
||||
{ "default_brick.png" },
|
||||
S("Brick"))
|
||||
|
||||
-- SANDSTONE
|
||||
------------
|
||||
technic.cnc.register_all("default:sandstone",
|
||||
{crumbly=2, cracky=3, not_in_creative_inventory=1},
|
||||
{"default_sandstone.png"},
|
||||
{ crumbly = 2, cracky = 3, not_in_creative_inventory = 1 },
|
||||
{ "default_sandstone.png" },
|
||||
S("Sandstone"))
|
||||
|
||||
-- LEAVES
|
||||
---------
|
||||
technic.cnc.register_all("default:leaves",
|
||||
{snappy=2, choppy=2, oddly_breakable_by_hand=3, not_in_creative_inventory=1},
|
||||
{"default_leaves.png"},
|
||||
{ snappy = 2, choppy = 2, oddly_breakable_by_hand = 3, not_in_creative_inventory = 1 },
|
||||
{ "default_leaves.png" },
|
||||
S("Leaves"))
|
||||
-- TREE
|
||||
-------
|
||||
technic.cnc.register_all("default:tree",
|
||||
{snappy=1, choppy=2, oddly_breakable_by_hand=2, flammable=3, wood=1, not_in_creative_inventory=1},
|
||||
{"default_tree.png"},
|
||||
{ snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, wood = 1, not_in_creative_inventory = 1 },
|
||||
{ "default_tree.png" },
|
||||
S("Tree"))
|
||||
|
||||
-- WROUGHT IRON
|
||||
---------------
|
||||
technic.cnc.register_all("default:steelblock",
|
||||
{cracky=1, level=2, not_in_creative_inventory=1},
|
||||
{"technic_wrought_iron_block.png"},
|
||||
{ cracky = 1, level = 2, not_in_creative_inventory = 1 },
|
||||
{ "technic_wrought_iron_block.png" },
|
||||
S("Wrought Iron"))
|
||||
|
||||
-- Bronze
|
||||
--------
|
||||
technic.cnc.register_all("default:bronzeblock",
|
||||
{cracky=1, level=2, not_in_creative_inventory=1},
|
||||
{"default_bronze_block.png"},
|
||||
{ cracky = 1, level = 2, not_in_creative_inventory = 1 },
|
||||
{ "default_bronze_block.png" },
|
||||
S("Bronze"))
|
||||
|
||||
-- Stainless Steel
|
||||
--------
|
||||
technic.cnc.register_all("technic:stainless_steel_block",
|
||||
{cracky=1, level=2, not_in_creative_inventory=1},
|
||||
{"technic_stainless_steel_block.png"},
|
||||
{ cracky = 1, level = 2, not_in_creative_inventory = 1 },
|
||||
{ "technic_stainless_steel_block.png" },
|
||||
S("Stainless Steel"))
|
||||
|
||||
-- Marble
|
||||
------------
|
||||
technic.cnc.register_all("technic:marble",
|
||||
{cracky=3, not_in_creative_inventory=1},
|
||||
{"technic_marble.png"},
|
||||
{ cracky = 3, not_in_creative_inventory = 1 },
|
||||
{ "technic_marble.png" },
|
||||
S("Marble"))
|
||||
|
||||
-- Granite
|
||||
------------
|
||||
technic.cnc.register_all("technic:granite",
|
||||
{cracky=1, not_in_creative_inventory=1},
|
||||
{"technic_granite.png"},
|
||||
{ cracky = 1, not_in_creative_inventory = 1 },
|
||||
{ "technic_granite.png" },
|
||||
S("Granite"))
|
||||
|
||||
|
@ -1,13 +1,12 @@
|
||||
|
||||
minetest.register_alias("compressor", "technic:lv_compressor")
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:lv_compressor',
|
||||
output = "technic:lv_compressor",
|
||||
recipe = {
|
||||
{'default:stone', 'technic:motor', 'default:stone'},
|
||||
{'mesecons:piston', 'technic:machine_casing', 'mesecons:piston'},
|
||||
{'technic:fine_silver_wire', 'technic:lv_cable', 'technic:fine_silver_wire'},
|
||||
{ "default:stone", "technic:motor", "default:stone" },
|
||||
{ "mesecons:piston", "technic:machine_casing", "mesecons:piston" },
|
||||
{ "technic:fine_silver_wire", "technic:lv_cable", "technic:fine_silver_wire" },
|
||||
}
|
||||
})
|
||||
|
||||
technic.register_compressor({tier = "LV", demand = {300}, speed = 1})
|
||||
technic.register_compressor({ tier = "LV", demand = { 300 }, speed = 1 })
|
||||
|
@ -3,14 +3,14 @@
|
||||
|
||||
-- FIXME: kpoppel I'd like to introduce an induction heating element here also
|
||||
minetest.register_craft({
|
||||
output = 'technic:electric_furnace',
|
||||
output = "technic:electric_furnace",
|
||||
recipe = {
|
||||
{'default:cobble', 'default:cobble', 'default:cobble'},
|
||||
{'default:cobble', 'technic:machine_casing', 'default:cobble'},
|
||||
{'default:cobble', 'technic:lv_cable', 'default:cobble'},
|
||||
{ "default:cobble", "default:cobble", "default:cobble" },
|
||||
{ "default:cobble", "technic:machine_casing", "default:cobble" },
|
||||
{ "default:cobble", "technic:lv_cable", "default:cobble" },
|
||||
}
|
||||
})
|
||||
|
||||
technic.register_electric_furnace({tier="LV", demand={300}, speed = 2})
|
||||
technic.register_electric_furnace({ tier = "LV", demand = { 300 }, speed = 2 })
|
||||
|
||||
|
||||
|
@ -1,13 +1,12 @@
|
||||
|
||||
minetest.register_alias("extractor", "technic:lv_extractor")
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:lv_extractor',
|
||||
output = "technic:lv_extractor",
|
||||
recipe = {
|
||||
{'technic:treetap', 'technic:motor', 'technic:treetap'},
|
||||
{'technic:treetap', 'technic:machine_casing', 'technic:treetap'},
|
||||
{'', 'technic:lv_cable', ''},
|
||||
{ "technic:treetap", "technic:motor", "technic:treetap" },
|
||||
{ "technic:treetap", "technic:machine_casing", "technic:treetap" },
|
||||
{ "", "technic:lv_cable", "" },
|
||||
}
|
||||
})
|
||||
|
||||
technic.register_extractor({tier = "LV", demand = {300}, speed = 1})
|
||||
technic.register_extractor({ tier = "LV", demand = { 300 }, speed = 1 })
|
||||
|
@ -6,13 +6,13 @@
|
||||
minetest.register_alias("lv_generator", "technic:lv_generator")
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:lv_generator',
|
||||
output = "technic:lv_generator",
|
||||
recipe = {
|
||||
{'default:stone', 'default:furnace', 'default:stone'},
|
||||
{'default:stone', 'technic:machine_casing', 'default:stone'},
|
||||
{'default:stone', 'technic:lv_cable', 'default:stone'},
|
||||
{ "default:stone", "default:furnace", "default:stone" },
|
||||
{ "default:stone", "technic:machine_casing", "default:stone" },
|
||||
{ "default:stone", "technic:lv_cable", "default:stone" },
|
||||
}
|
||||
})
|
||||
|
||||
technic.register_generator({tier="LV", supply=200})
|
||||
technic.register_generator({ tier = "LV", supply = 200 })
|
||||
|
||||
|
@ -8,11 +8,11 @@ minetest.register_alias("geothermal", "technic:geothermal")
|
||||
local S = technic.getter
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:geothermal',
|
||||
output = "technic:geothermal",
|
||||
recipe = {
|
||||
{'technic:granite', 'default:diamond', 'technic:granite'},
|
||||
{'technic:fine_copper_wire', 'technic:machine_casing', 'technic:fine_copper_wire'},
|
||||
{'technic:granite', 'technic:lv_cable', 'technic:granite'},
|
||||
{ "technic:granite", "default:diamond", "technic:granite" },
|
||||
{ "technic:fine_copper_wire", "technic:machine_casing", "technic:fine_copper_wire" },
|
||||
{ "technic:granite", "technic:lv_cable", "technic:granite" },
|
||||
}
|
||||
})
|
||||
|
||||
@ -41,14 +41,14 @@ local run = function(pos, node)
|
||||
-- W|L
|
||||
|
||||
local positions = {
|
||||
{x=pos.x+1, y=pos.y, z=pos.z},
|
||||
{x=pos.x+1, y=pos.y-1, z=pos.z},
|
||||
{x=pos.x-1, y=pos.y, z=pos.z},
|
||||
{x=pos.x-1, y=pos.y-1, z=pos.z},
|
||||
{x=pos.x, y=pos.y, z=pos.z+1},
|
||||
{x=pos.x, y=pos.y-1, z=pos.z+1},
|
||||
{x=pos.x, y=pos.y, z=pos.z-1},
|
||||
{x=pos.x, y=pos.y-1, z=pos.z-1},
|
||||
{ x = pos.x + 1, y = pos.y, z = pos.z },
|
||||
{ x = pos.x + 1, y = pos.y - 1, z = pos.z },
|
||||
{ x = pos.x - 1, y = pos.y, z = pos.z },
|
||||
{ x = pos.x - 1, y = pos.y - 1, z = pos.z },
|
||||
{ x = pos.x, y = pos.y, z = pos.z + 1 },
|
||||
{ x = pos.x, y = pos.y - 1, z = pos.z + 1 },
|
||||
{ x = pos.x, y = pos.y, z = pos.z - 1 },
|
||||
{ x = pos.x, y = pos.y - 1, z = pos.z - 1 },
|
||||
}
|
||||
for _, p in pairs(positions) do
|
||||
local check = check_node_around(p)
|
||||
@ -69,7 +69,7 @@ local run = function(pos, node)
|
||||
S("Geothermal %s Generator"):format("LV").." ("..production_level.."%)")
|
||||
|
||||
if production_level > 0 and minetest.get_node(pos).name == "technic:geothermal" then
|
||||
technic.swap_node (pos, "technic:geothermal_active")
|
||||
technic.swap_node(pos, "technic:geothermal_active")
|
||||
return
|
||||
end
|
||||
if production_level == 0 then
|
||||
@ -80,10 +80,17 @@ end
|
||||
|
||||
minetest.register_node("technic:geothermal", {
|
||||
description = S("Geothermal %s Generator"):format("LV"),
|
||||
tiles = {"technic_geothermal_top.png", "technic_machine_bottom.png", "technic_geothermal_side.png",
|
||||
"technic_geothermal_side.png", "technic_geothermal_side.png", "technic_geothermal_side.png"},
|
||||
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
|
||||
technic_machine=1, technic_lv=1},
|
||||
tiles = {
|
||||
"technic_geothermal_top.png", "technic_machine_bottom.png", "technic_geothermal_side.png",
|
||||
"technic_geothermal_side.png", "technic_geothermal_side.png", "technic_geothermal_side.png"
|
||||
},
|
||||
groups = {
|
||||
snappy = 2,
|
||||
choppy = 2,
|
||||
oddly_breakable_by_hand = 2,
|
||||
technic_machine = 1,
|
||||
technic_lv = 1
|
||||
},
|
||||
paramtype2 = "facedir",
|
||||
legacy_facedir_simple = true,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
@ -97,11 +104,19 @@ minetest.register_node("technic:geothermal", {
|
||||
|
||||
minetest.register_node("technic:geothermal_active", {
|
||||
description = S("Geothermal %s Generator"):format("LV"),
|
||||
tiles = {"technic_geothermal_top_active.png", "technic_machine_bottom.png", "technic_geothermal_side.png",
|
||||
"technic_geothermal_side.png", "technic_geothermal_side.png", "technic_geothermal_side.png"},
|
||||
tiles = {
|
||||
"technic_geothermal_top_active.png", "technic_machine_bottom.png", "technic_geothermal_side.png",
|
||||
"technic_geothermal_side.png", "technic_geothermal_side.png", "technic_geothermal_side.png"
|
||||
},
|
||||
paramtype2 = "facedir",
|
||||
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
|
||||
technic_machine=1, technic_lv=1, not_in_creative_inventory=1},
|
||||
groups = {
|
||||
snappy = 2,
|
||||
choppy = 2,
|
||||
oddly_breakable_by_hand = 2,
|
||||
technic_machine = 1,
|
||||
technic_lv = 1,
|
||||
not_in_creative_inventory = 1
|
||||
},
|
||||
legacy_facedir_simple = true,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
drop = "technic:geothermal",
|
||||
|
@ -1,13 +1,12 @@
|
||||
|
||||
minetest.register_alias("grinder", "technic:lv_grinder")
|
||||
minetest.register_craft({
|
||||
output = 'technic:lv_grinder',
|
||||
output = "technic:lv_grinder",
|
||||
recipe = {
|
||||
{'default:desert_stone', 'default:diamond', 'default:desert_stone'},
|
||||
{'default:desert_stone', 'technic:machine_casing', 'default:desert_stone'},
|
||||
{'technic:granite', 'technic:lv_cable', 'technic:granite'},
|
||||
{ "default:desert_stone", "default:diamond", "default:desert_stone" },
|
||||
{ "default:desert_stone", "technic:machine_casing", "default:desert_stone" },
|
||||
{ "technic:granite", "technic:lv_cable", "technic:granite" },
|
||||
}
|
||||
})
|
||||
|
||||
technic.register_grinder({tier="LV", demand={200}, speed=1})
|
||||
technic.register_grinder({ tier = "LV", demand = { 200 }, speed = 1 })
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
technic.register_tier("LV", "Low Voltage")
|
||||
|
||||
local path = technic.modpath.."/machines/LV"
|
||||
|
@ -5,11 +5,11 @@ local S = technic.getter
|
||||
|
||||
minetest.register_alias("music_player", "technic:music_player")
|
||||
minetest.register_craft({
|
||||
output = 'technic:music_player',
|
||||
output = "technic:music_player",
|
||||
recipe = {
|
||||
{'technic:chromium_ingot', 'default:diamond', 'technic:chromium_ingot'},
|
||||
{'default:diamond', 'technic:machine_casing', 'default:diamond'},
|
||||
{'default:mossycobble', 'technic:lv_cable', 'default:mossycobble'},
|
||||
{ "technic:chromium_ingot", "default:diamond", "technic:chromium_ingot" },
|
||||
{ "default:diamond", "technic:machine_casing", "default:diamond" },
|
||||
{ "default:mossycobble", "technic:lv_cable", "default:mossycobble" },
|
||||
}
|
||||
})
|
||||
|
||||
@ -17,7 +17,7 @@ local music_handles = {}
|
||||
|
||||
local function play_track(pos, track)
|
||||
return minetest.sound_play("technic_track"..tostring(track),
|
||||
{pos = pos, gain = 1.0, loop = true, max_hear_distance = 72,})
|
||||
{ pos = pos, gain = 1.0, loop = true, max_hear_distance = 72, })
|
||||
end
|
||||
|
||||
local run = function(pos, node)
|
||||
@ -84,19 +84,25 @@ local function set_display(meta)
|
||||
"button[1,3;1,1;track8;8]"..
|
||||
"button[2,3;1,1;track9;9]"..
|
||||
"button[3,1;1,1;stop;Stop]"..
|
||||
"label[0,4;"..minetest.formspec_escape(
|
||||
meta:get_int("active") == 0 and
|
||||
"label[0,4;"..minetest.formspec_escape(meta:get_int("active") == 0 and
|
||||
S("Stopped") or
|
||||
S("Current track %s"):format(meta:get_int("current_track"))).."]")
|
||||
end
|
||||
|
||||
minetest.register_node("technic:music_player", {
|
||||
description = S("%s Music Player"):format("LV"),
|
||||
tiles = {"technic_music_player_top.png", "technic_machine_bottom.png", "technic_music_player_side.png",
|
||||
"technic_music_player_side.png", "technic_music_player_side.png", "technic_music_player_side.png"},
|
||||
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
|
||||
technic_machine=1, technic_lv=1},
|
||||
connect_sides = {"bottom"},
|
||||
tiles = {
|
||||
"technic_music_player_top.png", "technic_machine_bottom.png", "technic_music_player_side.png",
|
||||
"technic_music_player_side.png", "technic_music_player_side.png", "technic_music_player_side.png"
|
||||
},
|
||||
groups = {
|
||||
snappy = 2,
|
||||
choppy = 2,
|
||||
oddly_breakable_by_hand = 2,
|
||||
technic_machine = 1,
|
||||
technic_lv = 1
|
||||
},
|
||||
connect_sides = { "bottom" },
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
|
@ -8,11 +8,11 @@
|
||||
minetest.register_craft({
|
||||
output = 'technic:solar_array_lv 1',
|
||||
recipe = {
|
||||
{'technic:solar_panel', 'technic:solar_panel', 'technic:solar_panel'},
|
||||
{'technic:carbon_steel_ingot', 'technic:lv_transformer', 'technic:carbon_steel_ingot'},
|
||||
{'', 'technic:lv_cable', ''},
|
||||
{ "technic:solar_panel", "technic:solar_panel", "technic:solar_panel" },
|
||||
{ "technic:carbon_steel_ingot", "technic:lv_transformer", "technic:carbon_steel_ingot" },
|
||||
{ "", "technic:lv_cable", "" },
|
||||
}
|
||||
})
|
||||
|
||||
technic.register_solar_array({tier="LV", power=10})
|
||||
technic.register_solar_array({ tier = "LV", power = 10 })
|
||||
|
||||
|
@ -6,11 +6,10 @@ local S = technic.getter
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:solar_panel',
|
||||
output = "technic:solar_panel",
|
||||
recipe = {
|
||||
{'technic:doped_silicon_wafer', 'technic:doped_silicon_wafer', 'technic:doped_silicon_wafer'},
|
||||
{'technic:fine_silver_wire', 'technic:lv_cable', 'mesecons_materials:glue'},
|
||||
|
||||
{ "technic:doped_silicon_wafer", "technic:doped_silicon_wafer", "technic:doped_silicon_wafer" },
|
||||
{ "technic:fine_silver_wire", "technic:lv_cable", "mesecons_materials:glue" },
|
||||
}
|
||||
})
|
||||
|
||||
@ -22,7 +21,7 @@ local run = function(pos, node)
|
||||
-- As there is no way to determine if light is sunlight that is just a shame.
|
||||
-- To take care of some of it solar panels do not work outside daylight hours or if
|
||||
-- built below 0m
|
||||
local pos1 = {x=pos.x, y=pos.y+1, z=pos.z}
|
||||
local pos1 = { x = pos.x, y = pos.y + 1, z = pos.z }
|
||||
local machine_name = S("Small Solar %s Generator"):format("LV")
|
||||
|
||||
local light = minetest.get_node_light(pos1, nil)
|
||||
@ -44,11 +43,18 @@ local run = function(pos, node)
|
||||
end
|
||||
|
||||
minetest.register_node("technic:solar_panel", {
|
||||
tiles = {"technic_solar_panel_top.png", "technic_solar_panel_bottom.png", "technic_solar_panel_side.png",
|
||||
"technic_solar_panel_side.png", "technic_solar_panel_side.png", "technic_solar_panel_side.png"},
|
||||
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
|
||||
technic_machine=1, technic_lv=1},
|
||||
connect_sides = {"bottom"},
|
||||
tiles = {
|
||||
"technic_solar_panel_top.png", "technic_solar_panel_bottom.png", "technic_solar_panel_side.png",
|
||||
"technic_solar_panel_side.png", "technic_solar_panel_side.png", "technic_solar_panel_side.png"
|
||||
},
|
||||
groups = {
|
||||
snappy = 2,
|
||||
choppy = 2,
|
||||
oddly_breakable_by_hand = 2,
|
||||
technic_machine = 1,
|
||||
technic_lv = 1
|
||||
},
|
||||
connect_sides = { "bottom" },
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
description = S("Small Solar %s Generator"):format("LV"),
|
||||
active = false,
|
||||
@ -57,7 +63,7 @@ minetest.register_node("technic:solar_panel", {
|
||||
is_ground_content = true,
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
|
||||
fixed = { -0.5, -0.5, -0.5, 0.5, 0, 0.5 },
|
||||
},
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
|
@ -7,11 +7,11 @@ local S = technic.getter
|
||||
minetest.register_alias("water_mill", "technic:water_mill")
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:water_mill',
|
||||
output = "technic:water_mill",
|
||||
recipe = {
|
||||
{'technic:marble', 'default:diamond', 'technic:marble'},
|
||||
{'group:wood', 'technic:machine_casing', 'group:wood'},
|
||||
{'technic:marble', 'technic:lv_cable', 'technic:marble'},
|
||||
{ "technic:marble", "default:diamond", "technic:marble" },
|
||||
{ "group:wood", "technic:machine_casing", "group:wood" },
|
||||
{ "technic:marble", "technic:lv_cable", "technic:marble" },
|
||||
}
|
||||
})
|
||||
|
||||
@ -34,10 +34,10 @@ local run = function(pos, node)
|
||||
-- (plus we want the gen to report 100% if three sides have full flow)
|
||||
|
||||
local positions = {
|
||||
{x=pos.x+1, y=pos.y, z=pos.z},
|
||||
{x=pos.x-1, y=pos.y, z=pos.z},
|
||||
{x=pos.x, y=pos.y, z=pos.z+1},
|
||||
{x=pos.x, y=pos.y, z=pos.z-1},
|
||||
{ x = pos.x + 1, y = pos.y, z = pos.z },
|
||||
{ x = pos.x - 1, y = pos.y, z = pos.z },
|
||||
{ x = pos.x, y = pos.y, z = pos.z + 1 },
|
||||
{ x = pos.x, y = pos.y, z = pos.z - 1 },
|
||||
}
|
||||
|
||||
for _, p in pairs(positions) do
|
||||
@ -59,7 +59,7 @@ local run = function(pos, node)
|
||||
|
||||
if production_level > 0 and
|
||||
minetest.get_node(pos).name == "technic:water_mill" then
|
||||
technic.swap_node (pos, "technic:water_mill_active")
|
||||
technic.swap_node(pos, "technic:water_mill_active")
|
||||
meta:set_int("LV_EU_supply", 0)
|
||||
return
|
||||
end
|
||||
@ -70,12 +70,19 @@ end
|
||||
|
||||
minetest.register_node("technic:water_mill", {
|
||||
description = S("Hydro %s Generator"):format("LV"),
|
||||
tiles = {"technic_water_mill_top.png", "technic_machine_bottom.png",
|
||||
tiles = {
|
||||
"technic_water_mill_top.png", "technic_machine_bottom.png",
|
||||
"technic_water_mill_side.png", "technic_water_mill_side.png",
|
||||
"technic_water_mill_side.png", "technic_water_mill_side.png"},
|
||||
"technic_water_mill_side.png", "technic_water_mill_side.png"
|
||||
},
|
||||
paramtype2 = "facedir",
|
||||
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
|
||||
technic_machine=1, technic_lv=1},
|
||||
groups = {
|
||||
snappy = 2,
|
||||
choppy = 2,
|
||||
oddly_breakable_by_hand = 2,
|
||||
technic_machine = 1,
|
||||
technic_lv = 1
|
||||
},
|
||||
legacy_facedir_simple = true,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
on_construct = function(pos)
|
||||
@ -88,12 +95,20 @@ minetest.register_node("technic:water_mill", {
|
||||
|
||||
minetest.register_node("technic:water_mill_active", {
|
||||
description = S("Hydro %s Generator"):format("LV"),
|
||||
tiles = {"technic_water_mill_top_active.png", "technic_machine_bottom.png",
|
||||
tiles = {
|
||||
"technic_water_mill_top_active.png", "technic_machine_bottom.png",
|
||||
"technic_water_mill_side.png", "technic_water_mill_side.png",
|
||||
"technic_water_mill_side.png", "technic_water_mill_side.png"},
|
||||
"technic_water_mill_side.png", "technic_water_mill_side.png"
|
||||
},
|
||||
paramtype2 = "facedir",
|
||||
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
|
||||
technic_machine=1, technic_lv=1, not_in_creative_inventory=1},
|
||||
groups = {
|
||||
snappy = 2,
|
||||
choppy = 2,
|
||||
oddly_breakable_by_hand = 2,
|
||||
technic_machine = 1,
|
||||
technic_lv = 1,
|
||||
not_in_creative_inventory = 1
|
||||
},
|
||||
legacy_facedir_simple = true,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
drop = "technic:water_mill",
|
||||
|
@ -1,14 +1,14 @@
|
||||
-- MV alloy furnace
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:mv_alloy_furnace',
|
||||
output = "technic:mv_alloy_furnace",
|
||||
recipe = {
|
||||
{'technic:stainless_steel_ingot', 'technic:lv_alloy_furnace', 'technic:stainless_steel_ingot'},
|
||||
{'pipeworks:tube_1', 'technic:mv_transformer', 'pipeworks:tube_1'},
|
||||
{'technic:stainless_steel_ingot', 'technic:mv_cable', 'technic:stainless_steel_ingot'},
|
||||
{ "technic:stainless_steel_ingot", "technic:lv_alloy_furnace", "technic:stainless_steel_ingot" },
|
||||
{ "pipeworks:tube_1", "technic:mv_transformer", "pipeworks:tube_1" },
|
||||
{ "technic:stainless_steel_ingot", "technic:mv_cable", "technic:stainless_steel_ingot" },
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
technic.register_alloy_furnace({tier = "MV", speed = 1.5, upgrade = 1, tube = 1, demand = {3000, 2000, 1000}})
|
||||
technic.register_alloy_furnace({ tier = "MV", speed = 1.5, upgrade = 1, tube = 1, demand = { 3000, 2000, 1000 } })
|
||||
|
||||
|
@ -3,9 +3,9 @@
|
||||
minetest.register_craft({
|
||||
output = 'technic:mv_battery_box0',
|
||||
recipe = {
|
||||
{'technic:lv_battery_box0', 'technic:lv_battery_box0', 'technic:lv_battery_box0'},
|
||||
{'technic:lv_battery_box0', 'technic:mv_transformer', 'technic:lv_battery_box0'},
|
||||
{'', 'technic:mv_cable', ''},
|
||||
{ 'technic:lv_battery_box0', 'technic:lv_battery_box0', 'technic:lv_battery_box0' },
|
||||
{ 'technic:lv_battery_box0', "technic:mv_transformer", 'technic:lv_battery_box0' },
|
||||
{ "", "technic:mv_cable", "" },
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -1,12 +1,11 @@
|
||||
|
||||
minetest.register_alias("mv_cable", "technic:mv_cable")
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:mv_cable 3',
|
||||
recipe ={
|
||||
{'technic:rubber', 'technic:rubber', 'technic:rubber'},
|
||||
{'technic:lv_cable', 'technic:lv_cable', 'technic:lv_cable'},
|
||||
{'technic:rubber', 'technic:rubber', 'technic:rubber'},
|
||||
recipe = {
|
||||
{ "technic:rubber", "technic:rubber", "technic:rubber" },
|
||||
{ "technic:lv_cable", "technic:lv_cable", "technic:lv_cable" },
|
||||
{ "technic:rubber", "technic:rubber", "technic:rubber" },
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
minetest.register_craft({
|
||||
output = "technic:mv_centrifuge",
|
||||
recipe = {
|
||||
{"technic:motor", "technic:copper_plate", "technic:diamond_drill_head"},
|
||||
{"technic:copper_plate", "technic:machine_casing", "technic:copper_plate" },
|
||||
{"pipeworks:one_way_tube", "technic:mv_cable", "pipeworks:mese_filter" },
|
||||
{ "technic:motor", "technic:copper_plate", "technic:diamond_drill_head" },
|
||||
{ "technic:copper_plate", "technic:machine_casing", "technic:copper_plate" },
|
||||
{ "pipeworks:one_way_tube", "technic:mv_cable", "pipeworks:mese_filter" },
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
-- MV compressor
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:mv_compressor',
|
||||
output = "technic:mv_compressor",
|
||||
recipe = {
|
||||
{'technic:stainless_steel_ingot', 'technic:lv_compressor', 'technic:stainless_steel_ingot'},
|
||||
{'pipeworks:tube_1', 'technic:mv_transformer', 'pipeworks:tube_1'},
|
||||
{'technic:stainless_steel_ingot', 'technic:mv_cable', 'technic:stainless_steel_ingot'},
|
||||
{ "technic:stainless_steel_ingot", "technic:lv_compressor", "technic:stainless_steel_ingot" },
|
||||
{ "pipeworks:tube_1", "technic:mv_transformer", "pipeworks:tube_1" },
|
||||
{ "technic:stainless_steel_ingot", "technic:mv_cable", "technic:stainless_steel_ingot" },
|
||||
}
|
||||
})
|
||||
|
||||
technic.register_compressor({tier = "MV", demand = {800, 600, 400}, speed = 2, upgrade = 1, tube = 1})
|
||||
technic.register_compressor({ tier = "MV", demand = { 800, 600, 400 }, speed = 2, upgrade = 1, tube = 1 })
|
||||
|
@ -6,13 +6,13 @@
|
||||
|
||||
-- FIXME: kpoppel I'd like to introduce an induction heating element here also
|
||||
minetest.register_craft({
|
||||
output = 'technic:mv_electric_furnace',
|
||||
output = "technic:mv_electric_furnace",
|
||||
recipe = {
|
||||
{'technic:stainless_steel_ingot', 'technic:lv_electric_furnace', 'technic:stainless_steel_ingot'},
|
||||
{'pipeworks:tube_1', 'technic:mv_transformer', 'pipeworks:tube_1'},
|
||||
{'technic:stainless_steel_ingot', 'technic:mv_cable', 'technic:stainless_steel_ingot'},
|
||||
{ "technic:stainless_steel_ingot", "technic:lv_electric_furnace", "technic:stainless_steel_ingot" },
|
||||
{ "pipeworks:tube_1", "technic:mv_transformer", "pipeworks:tube_1" },
|
||||
{ "technic:stainless_steel_ingot", "technic:mv_cable", "technic:stainless_steel_ingot" },
|
||||
}
|
||||
})
|
||||
|
||||
technic.register_electric_furnace({tier="MV", upgrade=1, tube=1, demand={2000, 1000, 500}, speed=4})
|
||||
technic.register_electric_furnace({ tier = "MV", upgrade = 1, tube = 1, demand = { 2000, 1000, 500 }, speed = 4 })
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
-- MV extractor
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:mv_extractor',
|
||||
output = "technic:mv_extractor",
|
||||
recipe = {
|
||||
{'technic:stainless_steel_ingot', 'technic:lv_extractor', 'technic:stainless_steel_ingot'},
|
||||
{'pipeworks:tube_1', 'technic:mv_transformer', 'pipeworks:tube_1'},
|
||||
{'technic:stainless_steel_ingot', 'technic:mv_cable', 'technic:stainless_steel_ingot'},
|
||||
{ "technic:stainless_steel_ingot", "technic:lv_extractor", "technic:stainless_steel_ingot" },
|
||||
{ "pipeworks:tube_1", "technic:mv_transformer", "pipeworks:tube_1" },
|
||||
{ "technic:stainless_steel_ingot", "technic:mv_cable", "technic:stainless_steel_ingot" },
|
||||
}
|
||||
})
|
||||
|
||||
technic.register_extractor({tier = "MV", demand = {800, 600, 400}, speed = 2, upgrade = 1, tube = 1})
|
||||
technic.register_extractor({ tier = "MV", demand = { 800, 600, 400 }, speed = 2, upgrade = 1, tube = 1 })
|
||||
|
@ -1,13 +1,13 @@
|
||||
minetest.register_alias("generator_mv", "technic:generator_mv")
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:mv_generator',
|
||||
output = "technic:mv_generator",
|
||||
recipe = {
|
||||
{'technic:stainless_steel_ingot', 'technic:lv_generator', 'technic:stainless_steel_ingot'},
|
||||
{'pipeworks:tube_1', 'technic:mv_transformer', 'pipeworks:tube_1'},
|
||||
{'technic:stainless_steel_ingot', 'technic:mv_cable', 'technic:stainless_steel_ingot'},
|
||||
{ "technic:stainless_steel_ingot", "technic:lv_generator", "technic:stainless_steel_ingot" },
|
||||
{ "pipeworks:tube_1", "technic:mv_transformer", "pipeworks:tube_1" },
|
||||
{ "technic:stainless_steel_ingot", "technic:mv_cable", "technic:stainless_steel_ingot" },
|
||||
}
|
||||
})
|
||||
|
||||
technic.register_generator({tier="MV", tube=1, supply=600})
|
||||
technic.register_generator({ tier = "MV", tube = 1, supply = 600 })
|
||||
|
||||
|
@ -1,13 +1,13 @@
|
||||
-- MV grinder
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:mv_grinder',
|
||||
output = "technic:mv_grinder",
|
||||
recipe = {
|
||||
{'technic:stainless_steel_ingot', 'technic:lv_grinder', 'technic:stainless_steel_ingot'},
|
||||
{'pipeworks:tube_1', 'technic:mv_transformer', 'pipeworks:tube_1'},
|
||||
{'technic:stainless_steel_ingot', 'technic:mv_cable', 'technic:stainless_steel_ingot'},
|
||||
{ "technic:stainless_steel_ingot", "technic:lv_grinder", "technic:stainless_steel_ingot" },
|
||||
{ "pipeworks:tube_1", "technic:mv_transformer", "pipeworks:tube_1" },
|
||||
{ "technic:stainless_steel_ingot", "technic:mv_cable", "technic:stainless_steel_ingot" },
|
||||
}
|
||||
})
|
||||
|
||||
technic.register_grinder({tier="MV", demand={600, 450, 300}, speed=2, upgrade=1, tube=1})
|
||||
technic.register_grinder({ tier = "MV", demand = { 600, 450, 300 }, speed = 2, upgrade = 1, tube = 1 })
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
technic.register_tier("MV", "Medium Voltage")
|
||||
|
||||
local path = technic.modpath.."/machines/MV"
|
||||
|
@ -9,7 +9,7 @@ if (minetest.get_modpath("intllib")) then
|
||||
dofile(minetest.get_modpath("intllib").."/intllib.lua")
|
||||
S = intllib.Getter(minetest.get_current_modname())
|
||||
else
|
||||
S = function (s) return s end
|
||||
S = function(s) return s end
|
||||
end
|
||||
|
||||
function technic_homedecor_node_is_owned(pos, placer)
|
||||
@ -38,15 +38,15 @@ function technic_homedecor_node_is_owned(pos, placer)
|
||||
end
|
||||
|
||||
if ownername ~= false then
|
||||
minetest.chat_send_player(placer:get_player_name(), S("Sorry, %s owns that spot."):format(ownername) )
|
||||
minetest.chat_send_player(placer:get_player_name(), S("Sorry, %s owns that spot."):format(ownername))
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
local dirs1 = {20, 23, 22, 21}
|
||||
local dirs2 = {9, 18, 7, 12}
|
||||
local dirs1 = { 20, 23, 22, 21 }
|
||||
local dirs2 = { 9, 18, 7, 12 }
|
||||
|
||||
local technic_homedecor_rotate_and_place = function(itemstack, placer, pointed_thing)
|
||||
if not technic_homedecor_node_is_owned(pointed_thing.under, placer)
|
||||
@ -77,11 +77,11 @@ local technic_homedecor_rotate_and_place = function(itemstack, placer, pointed_t
|
||||
if not minetest.registered_nodes[minetest.get_node(pos1).name]["buildable_to"] then return end
|
||||
|
||||
if iswall then
|
||||
minetest.add_node(pos1, {name = wield_name, param2 = dirs2[fdir+1] }) -- place wall variant
|
||||
minetest.add_node(pos1, { name = wield_name, param2 = dirs2[fdir + 1] }) -- place wall variant
|
||||
elseif isceiling then
|
||||
minetest.add_node(pos1, {name = wield_name, param2 = 20 }) -- place upside down variant
|
||||
minetest.add_node(pos1, { name = wield_name, param2 = 20 }) -- place upside down variant
|
||||
else
|
||||
minetest.add_node(pos1, {name = wield_name, param2 = 0 }) -- place right side up
|
||||
minetest.add_node(pos1, { name = wield_name, param2 = 0 }) -- place right side up
|
||||
end
|
||||
|
||||
if not homedecor_expect_infinite_stacks then
|
||||
@ -96,7 +96,7 @@ local technic_homedecor_rotate_and_place = function(itemstack, placer, pointed_t
|
||||
end
|
||||
|
||||
-- Yellow -- Half node
|
||||
minetest.register_node('technic:homedecor_glowlight_half_yellow', {
|
||||
minetest.register_node("technic:homedecor_glowlight_half_yellow", {
|
||||
description = S("Yellow Glowlight (thick)"),
|
||||
drawtype = "nodebox",
|
||||
tiles = {
|
||||
@ -115,13 +115,11 @@ minetest.register_node('technic:homedecor_glowlight_half_yellow', {
|
||||
type = "fixed",
|
||||
fixed = { -0.5, -0.5, -0.5, 0.5, 0, 0.5 }
|
||||
},
|
||||
|
||||
sunlight_propagates = false,
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
walkable = true,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
|
||||
groups = { snappy = 3 },
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
technic_homedecor_rotate_and_place(itemstack, placer, pointed_thing)
|
||||
@ -135,7 +133,7 @@ minetest.register_node('technic:homedecor_glowlight_half_yellow', {
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node('technic:homedecor_glowlight_half_yellow_active', {
|
||||
minetest.register_node("technic:homedecor_glowlight_half_yellow_active", {
|
||||
description = S("Yellow Glowlight (thick)"),
|
||||
drawtype = "nodebox",
|
||||
tiles = {
|
||||
@ -154,16 +152,14 @@ minetest.register_node('technic:homedecor_glowlight_half_yellow_active', {
|
||||
type = "fixed",
|
||||
fixed = { -0.5, -0.5, -0.5, 0.5, 0, 0.5 }
|
||||
},
|
||||
|
||||
sunlight_propagates = false,
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
walkable = true,
|
||||
light_source = LIGHT_MAX,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
|
||||
groups = { snappy = 3, not_in_creative_inventory=1},
|
||||
drop="technic:homedecor_glowlight_half_yellow",
|
||||
groups = { snappy = 3, not_in_creative_inventory = 1 },
|
||||
drop = "technic:homedecor_glowlight_half_yellow",
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
technic_homedecor_rotate_and_place(itemstack, placer, pointed_thing)
|
||||
return itemstack
|
||||
@ -177,7 +173,7 @@ minetest.register_node('technic:homedecor_glowlight_half_yellow_active', {
|
||||
})
|
||||
|
||||
-- Yellow -- Quarter node
|
||||
minetest.register_node('technic:homedecor_glowlight_quarter_yellow', {
|
||||
minetest.register_node("technic:homedecor_glowlight_quarter_yellow", {
|
||||
description = S("Yellow Glowlight (thin)"),
|
||||
drawtype = "nodebox",
|
||||
tiles = {
|
||||
@ -196,13 +192,11 @@ minetest.register_node('technic:homedecor_glowlight_quarter_yellow', {
|
||||
type = "fixed",
|
||||
fixed = { -0.5, -0.5, -0.5, 0.5, -0.25, 0.5 }
|
||||
},
|
||||
|
||||
sunlight_propagates = false,
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
walkable = true,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
|
||||
groups = { snappy = 3 },
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
technic_homedecor_rotate_and_place(itemstack, placer, pointed_thing)
|
||||
@ -216,7 +210,7 @@ minetest.register_node('technic:homedecor_glowlight_quarter_yellow', {
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node('technic:homedecor_glowlight_quarter_yellow_active', {
|
||||
minetest.register_node("technic:homedecor_glowlight_quarter_yellow_active", {
|
||||
description = S("Yellow Glowlight (thin)"),
|
||||
drawtype = "nodebox",
|
||||
tiles = {
|
||||
@ -235,16 +229,14 @@ minetest.register_node('technic:homedecor_glowlight_quarter_yellow_active', {
|
||||
type = "fixed",
|
||||
fixed = { -0.5, -0.5, -0.5, 0.5, -0.25, 0.5 }
|
||||
},
|
||||
|
||||
sunlight_propagates = false,
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
walkable = true,
|
||||
light_source = LIGHT_MAX-1,
|
||||
light_source = LIGHT_MAX - 1,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
|
||||
groups = { snappy = 3, not_in_creative_inventory=1},
|
||||
drop="technic:homedecor_glowlight_quarter_yellow",
|
||||
groups = { snappy = 3, not_in_creative_inventory = 1 },
|
||||
drop = "technic:homedecor_glowlight_quarter_yellow",
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
technic_homedecor_rotate_and_place(itemstack, placer, pointed_thing)
|
||||
return itemstack
|
||||
@ -259,7 +251,7 @@ minetest.register_node('technic:homedecor_glowlight_quarter_yellow_active', {
|
||||
|
||||
|
||||
-- White -- half node
|
||||
minetest.register_node('technic:homedecor_glowlight_half_white', {
|
||||
minetest.register_node("technic:homedecor_glowlight_half_white", {
|
||||
description = S("White Glowlight (thick)"),
|
||||
drawtype = "nodebox",
|
||||
tiles = {
|
||||
@ -278,13 +270,11 @@ minetest.register_node('technic:homedecor_glowlight_half_white', {
|
||||
type = "fixed",
|
||||
fixed = { -0.5, -0.5, -0.5, 0.5, 0, 0.5 }
|
||||
},
|
||||
|
||||
sunlight_propagates = false,
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
walkable = true,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
|
||||
groups = { snappy = 3 },
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
technic_homedecor_rotate_and_place(itemstack, placer, pointed_thing)
|
||||
@ -298,7 +288,7 @@ minetest.register_node('technic:homedecor_glowlight_half_white', {
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node('technic:homedecor_glowlight_half_white_active', {
|
||||
minetest.register_node("technic:homedecor_glowlight_half_white_active", {
|
||||
description = S("White Glowlight (thick)"),
|
||||
drawtype = "nodebox",
|
||||
tiles = {
|
||||
@ -317,16 +307,14 @@ minetest.register_node('technic:homedecor_glowlight_half_white_active', {
|
||||
type = "fixed",
|
||||
fixed = { -0.5, -0.5, -0.5, 0.5, 0, 0.5 }
|
||||
},
|
||||
|
||||
sunlight_propagates = false,
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
walkable = true,
|
||||
light_source = LIGHT_MAX,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
|
||||
groups = { snappy = 3, not_in_creative_inventory=1},
|
||||
drop="technic:homedecor_glowlight_half_white",
|
||||
groups = { snappy = 3, not_in_creative_inventory = 1 },
|
||||
drop = "technic:homedecor_glowlight_half_white",
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
technic_homedecor_rotate_and_place(itemstack, placer, pointed_thing)
|
||||
return itemstack
|
||||
@ -340,7 +328,7 @@ minetest.register_node('technic:homedecor_glowlight_half_white_active', {
|
||||
})
|
||||
|
||||
-- White -- Quarter node
|
||||
minetest.register_node('technic:homedecor_glowlight_quarter_white', {
|
||||
minetest.register_node("technic:homedecor_glowlight_quarter_white", {
|
||||
description = S("White Glowlight (thin)"),
|
||||
drawtype = "nodebox",
|
||||
tiles = {
|
||||
@ -359,13 +347,11 @@ minetest.register_node('technic:homedecor_glowlight_quarter_white', {
|
||||
type = "fixed",
|
||||
fixed = { -0.5, -0.5, -0.5, 0.5, -0.25, 0.5 }
|
||||
},
|
||||
|
||||
sunlight_propagates = false,
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
walkable = true,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
|
||||
groups = { snappy = 3 },
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
technic_homedecor_rotate_and_place(itemstack, placer, pointed_thing)
|
||||
@ -379,7 +365,7 @@ minetest.register_node('technic:homedecor_glowlight_quarter_white', {
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node('technic:homedecor_glowlight_quarter_white_active', {
|
||||
minetest.register_node("technic:homedecor_glowlight_quarter_white_active", {
|
||||
description = S("White Glowlight (thin)"),
|
||||
drawtype = "nodebox",
|
||||
tiles = {
|
||||
@ -398,16 +384,14 @@ minetest.register_node('technic:homedecor_glowlight_quarter_white_active', {
|
||||
type = "fixed",
|
||||
fixed = { -0.5, -0.5, -0.5, 0.5, -0.25, 0.5 }
|
||||
},
|
||||
|
||||
sunlight_propagates = false,
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
walkable = true,
|
||||
light_source = LIGHT_MAX-1,
|
||||
light_source = LIGHT_MAX - 1,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
|
||||
groups = { snappy = 3, not_in_creative_inventory=1},
|
||||
drop="technic:homedecor_glowlight_quarter_white",
|
||||
groups = { snappy = 3, not_in_creative_inventory = 1 },
|
||||
drop = "technic:homedecor_glowlight_quarter_white",
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
technic_homedecor_rotate_and_place(itemstack, placer, pointed_thing)
|
||||
return itemstack
|
||||
@ -421,7 +405,7 @@ minetest.register_node('technic:homedecor_glowlight_quarter_white_active', {
|
||||
})
|
||||
|
||||
-- Glowlight "cubes" - yellow
|
||||
minetest.register_node('technic:homedecor_glowlight_small_cube_yellow', {
|
||||
minetest.register_node("technic:homedecor_glowlight_small_cube_yellow", {
|
||||
description = S("Yellow Glowlight (small cube)"),
|
||||
drawtype = "nodebox",
|
||||
tiles = {
|
||||
@ -440,13 +424,11 @@ minetest.register_node('technic:homedecor_glowlight_small_cube_yellow', {
|
||||
type = "fixed",
|
||||
fixed = { -0.25, -0.5, -0.25, 0.25, 0, 0.25 }
|
||||
},
|
||||
|
||||
sunlight_propagates = false,
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
walkable = true,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
|
||||
groups = { snappy = 3 },
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
technic_homedecor_rotate_and_place(itemstack, placer, pointed_thing)
|
||||
@ -460,7 +442,7 @@ minetest.register_node('technic:homedecor_glowlight_small_cube_yellow', {
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node('technic:homedecor_glowlight_small_cube_yellow_active', {
|
||||
minetest.register_node("technic:homedecor_glowlight_small_cube_yellow_active", {
|
||||
description = S("Yellow Glowlight (small cube)"),
|
||||
drawtype = "nodebox",
|
||||
tiles = {
|
||||
@ -479,16 +461,14 @@ minetest.register_node('technic:homedecor_glowlight_small_cube_yellow_active', {
|
||||
type = "fixed",
|
||||
fixed = { -0.25, -0.5, -0.25, 0.25, 0, 0.25 }
|
||||
},
|
||||
|
||||
sunlight_propagates = false,
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
walkable = true,
|
||||
light_source = LIGHT_MAX-1,
|
||||
light_source = LIGHT_MAX - 1,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
|
||||
groups = { snappy = 3, not_in_creative_inventory=1},
|
||||
drop="technic:homedecor_glowlight_small_cube_yellow",
|
||||
groups = { snappy = 3, not_in_creative_inventory = 1 },
|
||||
drop = "technic:homedecor_glowlight_small_cube_yellow",
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
technic_homedecor_rotate_and_place(itemstack, placer, pointed_thing)
|
||||
return itemstack
|
||||
@ -502,7 +482,7 @@ minetest.register_node('technic:homedecor_glowlight_small_cube_yellow_active', {
|
||||
})
|
||||
|
||||
-- Glowlight "cubes" - white
|
||||
minetest.register_node('technic:homedecor_glowlight_small_cube_white', {
|
||||
minetest.register_node("technic:homedecor_glowlight_small_cube_white", {
|
||||
description = S("White Glowlight (small cube)"),
|
||||
drawtype = "nodebox",
|
||||
tiles = {
|
||||
@ -521,13 +501,11 @@ minetest.register_node('technic:homedecor_glowlight_small_cube_white', {
|
||||
type = "fixed",
|
||||
fixed = { -0.25, -0.5, -0.25, 0.25, 0, 0.25 }
|
||||
},
|
||||
|
||||
sunlight_propagates = false,
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
walkable = true,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
|
||||
groups = { snappy = 3 },
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
technic_homedecor_rotate_and_place(itemstack, placer, pointed_thing)
|
||||
@ -541,7 +519,7 @@ minetest.register_node('technic:homedecor_glowlight_small_cube_white', {
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node('technic:homedecor_glowlight_small_cube_white_active', {
|
||||
minetest.register_node("technic:homedecor_glowlight_small_cube_white_active", {
|
||||
description = S("White Glowlight (small cube)"),
|
||||
drawtype = "nodebox",
|
||||
tiles = {
|
||||
@ -560,16 +538,14 @@ minetest.register_node('technic:homedecor_glowlight_small_cube_white_active', {
|
||||
type = "fixed",
|
||||
fixed = { -0.25, -0.5, -0.25, 0.25, 0, 0.25 }
|
||||
},
|
||||
|
||||
sunlight_propagates = false,
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
walkable = true,
|
||||
light_source = LIGHT_MAX-1,
|
||||
light_source = LIGHT_MAX - 1,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
|
||||
groups = { snappy = 3, not_in_creative_inventory=1},
|
||||
drop="technic:homedecor_glowlight_small_cube_white",
|
||||
groups = { snappy = 3, not_in_creative_inventory = 1 },
|
||||
drop = "technic:homedecor_glowlight_small_cube_white",
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
technic_homedecor_rotate_and_place(itemstack, placer, pointed_thing)
|
||||
return itemstack
|
||||
|
@ -16,9 +16,9 @@ local power_radius = 12
|
||||
minetest.register_craft({
|
||||
output = 'technic:power_radiator 1',
|
||||
recipe = {
|
||||
{'technic:stainless_steel_ingot', 'technic:mv_transformer', 'technic:stainless_steel_ingot'},
|
||||
{'technic:copper_coil', 'technic:machine_casing', 'technic:copper_coil'},
|
||||
{'technic:rubber', 'technic:mv_cable', 'technic:rubber'},
|
||||
{ "technic:stainless_steel_ingot", "technic:mv_transformer", "technic:stainless_steel_ingot" },
|
||||
{ "technic:copper_coil", "technic:machine_casing", "technic:copper_coil" },
|
||||
{ "technic:rubber", "technic:mv_cable", "technic:rubber" },
|
||||
}
|
||||
})
|
||||
|
||||
@ -55,7 +55,7 @@ technic.inductive_on_punch_off = function(pos, eu_charge, swapnode)
|
||||
if meta:get_string("has_supply") ~= "" then
|
||||
technic.swap_node(pos, swapnode)
|
||||
meta:set_int("active", 1)
|
||||
meta:set_int("EU_charge",eu_charge)
|
||||
meta:set_int("EU_charge", eu_charge)
|
||||
--print("-----------")
|
||||
--print("Turn on:")
|
||||
--print("EU_charge: "..meta:get_int("EU_charge"))
|
||||
@ -68,7 +68,7 @@ technic.inductive_on_punch_on = function(pos, eu_charge, swapnode)
|
||||
local meta = minetest.get_meta(pos)
|
||||
technic.swap_node(pos, swapnode)
|
||||
meta:set_int("active", 0)
|
||||
meta:set_int("EU_charge",eu_charge)
|
||||
meta:set_int("EU_charge", eu_charge)
|
||||
--print("-----------")
|
||||
--print("Turn off:")
|
||||
--print("EU_charge: "..meta:get_int("EU_charge"))
|
||||
@ -81,9 +81,8 @@ local shutdown_inductive_appliances = function(pos)
|
||||
local rad = power_radius
|
||||
-- If the radiator is removed. turn off all appliances in region
|
||||
-- If another radiator is near it will turn on the appliances again
|
||||
local positions = minetest.find_nodes_in_area(
|
||||
{x=pos.x-rad, y=pos.y-rad, z=pos.z-rad},
|
||||
{x=pos.x+rad, y=pos.y+rad, z=pos.z+rad},
|
||||
local positions = minetest.find_nodes_in_area({ x = pos.x - rad, y = pos.y - rad, z = pos.z - rad },
|
||||
{ x = pos.x + rad, y = pos.y + rad, z = pos.z + rad },
|
||||
technic.inductive_nodes)
|
||||
for _, pos1 in pairs(positions) do
|
||||
local meta1 = minetest.get_meta(pos1)
|
||||
@ -105,9 +104,8 @@ local toggle_on_off_inductive_appliances = function(pos, node, puncher)
|
||||
if pos == nil then return end
|
||||
-- The supply radius
|
||||
local rad = power_radius
|
||||
local positions = minetest.find_nodes_in_area(
|
||||
{x=pos.x-rad, y=pos.y-rad, z=pos.z-rad},
|
||||
{x=pos.x+rad, y=pos.y+rad, z=pos.z+rad},
|
||||
local positions = minetest.find_nodes_in_area({ x = pos.x - rad, y = pos.y - rad, z = pos.z - rad },
|
||||
{ x = pos.x + rad, y = pos.y + rad, z = pos.z + rad },
|
||||
technic.inductive_nodes)
|
||||
for _, pos1 in pairs(positions) do
|
||||
local meta1 = minetest.get_meta(pos1)
|
||||
@ -119,21 +117,23 @@ end
|
||||
|
||||
minetest.register_node("technic:power_radiator", {
|
||||
description = "MV Power Radiator",
|
||||
tiles = {"technic_lv_cable.png", "technic_lv_cable.png", "technic_lv_cable.png",
|
||||
"technic_lv_cable.png", "technic_lv_cable.png", "technic_lv_cable.png"},
|
||||
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2},
|
||||
tiles = {
|
||||
"technic_lv_cable.png", "technic_lv_cable.png", "technic_lv_cable.png",
|
||||
"technic_lv_cable.png", "technic_lv_cable.png", "technic_lv_cable.png"
|
||||
},
|
||||
groups = { snappy = 2, choppy = 2, oddly_breakable_by_hand = 2 },
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
is_ground_content = true,
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
|
||||
fixed = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 },
|
||||
},
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_int("MV_EU_demand",1) -- Demand on the primary side when idle
|
||||
meta:set_int("connected_EU_demand",0) -- Potential demand of connected appliances
|
||||
meta:set_int("MV_EU_demand", 1) -- Demand on the primary side when idle
|
||||
meta:set_int("connected_EU_demand", 0) -- Potential demand of connected appliances
|
||||
meta:set_string("infotext", "MV Power Radiator")
|
||||
end,
|
||||
on_dig = function(pos, node, digger)
|
||||
@ -146,7 +146,7 @@ minetest.register_node("technic:power_radiator", {
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"technic:power_radiator"},
|
||||
nodenames = { "technic:power_radiator" },
|
||||
interval = 1,
|
||||
chance = 1,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
@ -163,7 +163,7 @@ minetest.register_abm({
|
||||
-- meta:set_int("active", 1) -- used for setting textures someday maybe
|
||||
shutdown_inductive_appliances(pos)
|
||||
meta:set_int("connected_EU_demand", 0)
|
||||
meta:set_int("MV_EU_demand",1)
|
||||
meta:set_int("MV_EU_demand", 1)
|
||||
elseif eu_input == eu_demand then
|
||||
-- Powered and ready
|
||||
|
||||
@ -181,9 +181,8 @@ minetest.register_abm({
|
||||
local used_charge = 0
|
||||
|
||||
-- Index all nodes within supply range
|
||||
local positions = minetest.find_nodes_in_area(
|
||||
{x=pos.x-rad, y=pos.y-rad, z=pos.z-rad},
|
||||
{x=pos.x+rad, y=pos.y+rad, z=pos.z+rad},
|
||||
local positions = minetest.find_nodes_in_area({ x = pos.x - rad, y = pos.y - rad, z = pos.z - rad },
|
||||
{ x = pos.x + rad, y = pos.y + rad, z = pos.z + rad },
|
||||
technic.inductive_nodes)
|
||||
for _, pos1 in pairs(positions) do
|
||||
local meta1 = minetest.get_meta(pos1)
|
||||
@ -203,8 +202,8 @@ minetest.register_abm({
|
||||
used_charge = used_charge + math.floor(meta1:get_int("EU_charge") / eff_factor)
|
||||
end
|
||||
meta:set_string("infotext", "MV Power Radiator is powered ("
|
||||
..math.floor(used_charge / max_charge * 100)
|
||||
.."% of maximum power)");
|
||||
.. math.floor(used_charge / max_charge * 100)
|
||||
.. "% of maximum power)");
|
||||
if used_charge == 0 then
|
||||
meta:set_int("MV_EU_demand", 1) -- Still idle
|
||||
else
|
||||
|
@ -1,14 +1,13 @@
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:solar_array_mv 1',
|
||||
recipe = {
|
||||
{'technic:solar_array_lv', 'technic:solar_array_lv', 'technic:solar_array_lv'},
|
||||
{'technic:carbon_steel_ingot', 'technic:mv_transformer', 'technic:carbon_steel_ingot'},
|
||||
{'', 'technic:mv_cable', ''},
|
||||
{ "technic:solar_array_lv", "technic:solar_array_lv", "technic:solar_array_lv" },
|
||||
{ "technic:carbon_steel_ingot", "technic:mv_transformer", "technic:carbon_steel_ingot" },
|
||||
{ "", "technic:mv_cable", "" },
|
||||
}
|
||||
})
|
||||
|
||||
technic.register_solar_array({tier="MV", power=30})
|
||||
technic.register_solar_array({ tier = "MV", power = 30 })
|
||||
|
||||
-- compatibility alias for upgrading from old versions of technic
|
||||
minetest.register_alias("technic:solar_panel_mv", "technic:solar_array_mv")
|
||||
|
@ -6,18 +6,18 @@ minetest.register_alias("tool_workshop", "technic:tool_workshop")
|
||||
local S = technic.getter
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:tool_workshop',
|
||||
output = "technic:tool_workshop",
|
||||
recipe = {
|
||||
{'group:wood', 'default:diamond', 'group:wood'},
|
||||
{'mesecons_pistons:piston_sticky_off', 'technic:machine_casing', 'technic:carbon_cloth'},
|
||||
{'default:obsidian', 'technic:mv_cable', 'default:obsidian'},
|
||||
{ "group:wood", "default:diamond", "group:wood" },
|
||||
{ "mesecons_pistons:piston_sticky_off", "technic:machine_casing", "technic:carbon_cloth" },
|
||||
{ "default:obsidian", "technic:mv_cable", "default:obsidian" },
|
||||
}
|
||||
})
|
||||
|
||||
local workshop_demand = {5000, 3500, 2000}
|
||||
local workshop_demand = { 5000, 3500, 2000 }
|
||||
|
||||
local workshop_formspec =
|
||||
"invsize[8,9;]"..
|
||||
"invsize[8,9;]"..
|
||||
"list[current_name;src;3,1;1,1;]"..
|
||||
"label[0,0;"..S("%s Tool Workshop"):format("MV").."]"..
|
||||
"list[current_name;upgrade1;1,3;1,1;]"..
|
||||
@ -59,7 +59,7 @@ local run = function(pos, node)
|
||||
repairable = true
|
||||
end
|
||||
end
|
||||
technic.handle_machine_pipeworks(pos, tube_upgrade, function (pos, x_velocity, z_velocity)
|
||||
technic.handle_machine_pipeworks(pos, tube_upgrade, function(pos, x_velocity, z_velocity)
|
||||
if not repairable then
|
||||
technic.send_items(pos, x_velocity, z_velocity, "src")
|
||||
end
|
||||
@ -70,24 +70,33 @@ local run = function(pos, node)
|
||||
return
|
||||
end
|
||||
|
||||
if eu_input < workshop_demand[EU_upgrade+1] then
|
||||
if eu_input < workshop_demand[EU_upgrade + 1] then
|
||||
meta:set_string("infotext", S("%s Unpowered"):format(machine_name))
|
||||
elseif eu_input >= workshop_demand[EU_upgrade+1] then
|
||||
elseif eu_input >= workshop_demand[EU_upgrade + 1] then
|
||||
meta:set_string("infotext", S("%s Active"):format(machine_name))
|
||||
srcstack:add_wear(-1000)
|
||||
inv:set_stack("src", 1, srcstack)
|
||||
end
|
||||
meta:set_int("MV_EU_demand", workshop_demand[EU_upgrade+1])
|
||||
meta:set_int("MV_EU_demand", workshop_demand[EU_upgrade + 1])
|
||||
end
|
||||
|
||||
minetest.register_node("technic:tool_workshop", {
|
||||
description = S("%s Tool Workshop"):format("MV"),
|
||||
paramtype2 = "facedir",
|
||||
tiles = {"technic_workshop_top.png", "technic_machine_bottom.png", "technic_workshop_side.png",
|
||||
"technic_workshop_side.png", "technic_workshop_side.png", "technic_workshop_side.png"},
|
||||
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
|
||||
technic_machine=1, technic_mv=1, tubedevice=1, tubedevice_receiver=1},
|
||||
connect_sides = {"bottom", "back", "left", "right"},
|
||||
tiles = {
|
||||
"technic_workshop_top.png", "technic_machine_bottom.png", "technic_workshop_side.png",
|
||||
"technic_workshop_side.png", "technic_workshop_side.png", "technic_workshop_side.png"
|
||||
},
|
||||
groups = {
|
||||
snappy = 2,
|
||||
choppy = 2,
|
||||
oddly_breakable_by_hand = 2,
|
||||
technic_machine = 1,
|
||||
technic_mv = 1,
|
||||
tubedevice = 1,
|
||||
tubedevice_receiver = 1
|
||||
},
|
||||
connect_sides = { "bottom", "back", "left", "right" },
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
@ -102,13 +111,13 @@ minetest.register_node("technic:tool_workshop", {
|
||||
allow_metadata_inventory_put = technic.machine_inventory_put,
|
||||
allow_metadata_inventory_take = technic.machine_inventory_take,
|
||||
tube = {
|
||||
can_insert = function (pos, node, stack, direction)
|
||||
can_insert = function(pos, node, stack, direction)
|
||||
return minetest.get_meta(pos):get_inventory():room_for_item("src", stack)
|
||||
end,
|
||||
insert_object = function (pos, node, stack, direction)
|
||||
insert_object = function(pos, node, stack, direction)
|
||||
return minetest.get_meta(pos):get_inventory():add_item("src", stack)
|
||||
end,
|
||||
connect_sides = {left = 1, right = 1, back = 1, top = 1, bottom = 1},
|
||||
connect_sides = { left = 1, right = 1, back = 1, top = 1, bottom = 1 },
|
||||
},
|
||||
technic_run = run,
|
||||
after_place_node = pipeworks.after_place,
|
||||
|
@ -1,30 +1,29 @@
|
||||
|
||||
local S = technic.getter
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:wind_mill_frame 5',
|
||||
recipe = {
|
||||
{'technic:carbon_steel_ingot', '', 'technic:carbon_steel_ingot'},
|
||||
{'', 'technic:carbon_steel_ingot', ''},
|
||||
{'technic:carbon_steel_ingot', '', 'technic:carbon_steel_ingot'},
|
||||
{ "technic:carbon_steel_ingot", "", "technic:carbon_steel_ingot" },
|
||||
{ "", "technic:carbon_steel_ingot", "" },
|
||||
{ "technic:carbon_steel_ingot", "", "technic:carbon_steel_ingot" },
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:wind_mill',
|
||||
output = "technic:wind_mill",
|
||||
recipe = {
|
||||
{'', 'technic:motor', ''},
|
||||
{'technic:carbon_steel_ingot', 'technic:carbon_steel_block', 'technic:carbon_steel_ingot'},
|
||||
{'', 'technic:mv_cable', ''},
|
||||
{ "", "technic:motor", "" },
|
||||
{ "technic:carbon_steel_ingot", "technic:carbon_steel_block", "technic:carbon_steel_ingot" },
|
||||
{ "", "technic:mv_cable", "" },
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_node("technic:wind_mill_frame", {
|
||||
description = S("Wind Mill Frame"),
|
||||
drawtype = "glasslike_framed",
|
||||
tiles = {"technic_carbon_steel_block.png", "default_glass.png"},
|
||||
tiles = { "technic_carbon_steel_block.png", "default_glass.png" },
|
||||
sunlight_propagates = true,
|
||||
groups = {cracky=3},
|
||||
groups = { cracky = 3 },
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
paramtype = "light",
|
||||
})
|
||||
@ -33,7 +32,7 @@ local function check_wind_mill(pos)
|
||||
if pos.y < 30 then
|
||||
return false
|
||||
end
|
||||
pos = {x=pos.x, y=pos.y, z=pos.z}
|
||||
pos = { x = pos.x, y = pos.y, z = pos.z }
|
||||
for i = 1, 20 do
|
||||
pos.y = pos.y - 1
|
||||
local node = minetest.get_node_or_nil(pos)
|
||||
@ -67,20 +66,20 @@ end
|
||||
|
||||
minetest.register_node("technic:wind_mill", {
|
||||
description = S("Wind %s Generator"):format("MV"),
|
||||
tiles = {"technic_carbon_steel_block.png"},
|
||||
tiles = { "technic_carbon_steel_block.png" },
|
||||
paramtype2 = "facedir",
|
||||
groups = {cracky=1, technic_machine=1, technic_mv=1},
|
||||
connect_sides = {"top", "bottom", "back", "left", "right"},
|
||||
groups = { cracky = 1, technic_machine = 1, technic_mv = 1 },
|
||||
connect_sides = { "top", "bottom", "back", "left", "right" },
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, -- Main box
|
||||
{-0.1, -0.1, -0.5, 0.1, 0.1, -0.6}, -- Shaft
|
||||
{-0.1, -1, -0.6, 0.1, 1, -0.7}, -- Vertical blades
|
||||
{-1, -0.1, -0.6, 1, 0.1, -0.7}, -- Horizontal blades
|
||||
{ -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 }, -- Main box
|
||||
{ -0.1, -0.1, -0.5, 0.1, 0.1, -0.6 }, -- Shaft
|
||||
{ -0.1, -1, -0.6, 0.1, 1, -0.7 }, -- Vertical blades
|
||||
{ -1, -0.1, -0.6, 1, 0.1, -0.7 }, -- Horizontal blades
|
||||
}
|
||||
},
|
||||
on_construct = function(pos)
|
||||
|
@ -8,9 +8,9 @@ local function compute_forceload_positions(pos, meta)
|
||||
local maxpos = vector.add(pos, vector.new(radius, radius, radius))
|
||||
local minbpos = {}
|
||||
local maxbpos = {}
|
||||
for _, coord in ipairs({"x","y","z"}) do
|
||||
minbpos[coord] = math.floor(minpos[coord] / 16) * 16
|
||||
maxbpos[coord] = math.floor(maxpos[coord] / 16) * 16
|
||||
for _, coord in ipairs({ "x", "y", "z" }) do
|
||||
minbpos[coord] = math.floor(minpos[coord]/16) * 16
|
||||
maxbpos[coord] = math.floor(maxpos[coord]/16) * 16
|
||||
end
|
||||
local flposes = {}
|
||||
for x = minbpos.x, maxbpos.x, 16 do
|
||||
@ -67,26 +67,26 @@ end
|
||||
minetest.register_node("technic:admin_anchor", {
|
||||
description = desc,
|
||||
drawtype = "normal",
|
||||
tiles = {"technic_admin_anchor.png"},
|
||||
tiles = { "technic_admin_anchor.png" },
|
||||
is_ground_content = true,
|
||||
groups = {cracky=3, not_in_creative_inventory=1},
|
||||
groups = { cracky = 3, not_in_creative_inventory = 1 },
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
after_place_node = function (pos, placer)
|
||||
after_place_node = function(pos, placer)
|
||||
local meta = minetest.get_meta(pos)
|
||||
if placer and placer:is_player() then
|
||||
meta:set_string("owner", placer:get_player_name())
|
||||
end
|
||||
set_display(pos, meta)
|
||||
end,
|
||||
can_dig = function (pos, player)
|
||||
can_dig = function(pos, player)
|
||||
local meta = minetest.get_meta(pos)
|
||||
return meta:get_int("locked") == 0 or (player and player:is_player() and player:get_player_name() == meta:get_string("owner"))
|
||||
end,
|
||||
on_destruct = function (pos)
|
||||
on_destruct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
forceload_off(meta)
|
||||
end,
|
||||
on_receive_fields = function (pos, formname, fields, sender)
|
||||
on_receive_fields = function(pos, formname, fields, sender)
|
||||
local meta = minetest.get_meta(pos)
|
||||
if (meta:get_int("locked") ~= 0 or fields.lock) and
|
||||
not (sender and sender:is_player() and
|
||||
|
@ -1,20 +1,19 @@
|
||||
|
||||
-- Fuel driven alloy furnace. This uses no EUs:
|
||||
|
||||
local S = technic.getter
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:coal_alloy_furnace',
|
||||
output = "technic:coal_alloy_furnace",
|
||||
recipe = {
|
||||
{'default:brick', 'default:brick', 'default:brick'},
|
||||
{'default:brick', '', 'default:brick'},
|
||||
{'default:brick', 'default:brick', 'default:brick'},
|
||||
{ "default:brick", "default:brick", "default:brick" },
|
||||
{ "default:brick", "", "default:brick" },
|
||||
{ "default:brick", "default:brick", "default:brick" },
|
||||
}
|
||||
})
|
||||
|
||||
local machine_name = S("Fuel-Fired Alloy Furnace")
|
||||
local formspec =
|
||||
"size[8,9]"..
|
||||
"size[8,9]"..
|
||||
"label[0,0;"..machine_name.."]"..
|
||||
"image[2,2;1,1;default_furnace_fire_bg.png]"..
|
||||
"list[current_name;fuel;2,3;1,1;]"..
|
||||
@ -30,11 +29,13 @@ local formspec =
|
||||
|
||||
minetest.register_node("technic:coal_alloy_furnace", {
|
||||
description = machine_name,
|
||||
tiles = {"technic_coal_alloy_furnace_top.png", "technic_coal_alloy_furnace_bottom.png",
|
||||
tiles = {
|
||||
"technic_coal_alloy_furnace_top.png", "technic_coal_alloy_furnace_bottom.png",
|
||||
"technic_coal_alloy_furnace_side.png", "technic_coal_alloy_furnace_side.png",
|
||||
"technic_coal_alloy_furnace_side.png", "technic_coal_alloy_furnace_front.png"},
|
||||
"technic_coal_alloy_furnace_side.png", "technic_coal_alloy_furnace_front.png"
|
||||
},
|
||||
paramtype2 = "facedir",
|
||||
groups = {cracky=2},
|
||||
groups = { cracky = 2 },
|
||||
legacy_facedir_simple = true,
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
on_construct = function(pos)
|
||||
@ -54,13 +55,15 @@ minetest.register_node("technic:coal_alloy_furnace", {
|
||||
|
||||
minetest.register_node("technic:coal_alloy_furnace_active", {
|
||||
description = machine_name,
|
||||
tiles = {"technic_coal_alloy_furnace_top.png", "technic_coal_alloy_furnace_bottom.png",
|
||||
tiles = {
|
||||
"technic_coal_alloy_furnace_top.png", "technic_coal_alloy_furnace_bottom.png",
|
||||
"technic_coal_alloy_furnace_side.png", "technic_coal_alloy_furnace_side.png",
|
||||
"technic_coal_alloy_furnace_side.png", "technic_coal_alloy_furnace_front_active.png"},
|
||||
"technic_coal_alloy_furnace_side.png", "technic_coal_alloy_furnace_front_active.png"
|
||||
},
|
||||
paramtype2 = "facedir",
|
||||
light_source = 8,
|
||||
drop = "technic:coal_alloy_furnace",
|
||||
groups = {cracky=2, not_in_creative_inventory=1},
|
||||
groups = { cracky = 2, not_in_creative_inventory = 1 },
|
||||
legacy_facedir_simple = true,
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
can_dig = technic.machine_can_dig,
|
||||
@ -70,7 +73,7 @@ minetest.register_node("technic:coal_alloy_furnace_active", {
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"technic:coal_alloy_furnace", "technic:coal_alloy_furnace_active"},
|
||||
nodenames = { "technic:coal_alloy_furnace", "technic:coal_alloy_furnace_active" },
|
||||
interval = 1,
|
||||
chance = 1,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
@ -89,7 +92,8 @@ minetest.register_abm({
|
||||
"fuel_totaltime",
|
||||
"fuel_time",
|
||||
"src_totaltime",
|
||||
"src_time"}) do
|
||||
"src_time"
|
||||
}) do
|
||||
if not meta:get_float(name) then
|
||||
meta:set_float(name, 0.0)
|
||||
end
|
||||
@ -158,7 +162,7 @@ minetest.register_abm({
|
||||
local fuellist = inv:get_list("fuel")
|
||||
|
||||
if fuellist then
|
||||
fuel, afterfuel = minetest.get_craft_result({method = "fuel", width = 1, items = fuellist})
|
||||
fuel, afterfuel = minetest.get_craft_result({ method = "fuel", width = 1, items = fuellist })
|
||||
end
|
||||
|
||||
if fuel.time <= 0 then
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
local S = technic.getter
|
||||
|
||||
local function deploy_node(inv, slot_name, pos, node, machine_node)
|
||||
@ -46,7 +45,7 @@ local function deploy_node(inv, slot_name, pos, node, machine_node)
|
||||
-- Fake pointed_thing
|
||||
type = "node",
|
||||
above = pos,
|
||||
under = {x=pos.x, y=pos.y-1, z=pos.z},
|
||||
under = { x = pos.x, y = pos.y - 1, z = pos.z },
|
||||
})
|
||||
if ok then
|
||||
inv:set_stack(slot_name, 1, stk or stack)
|
||||
@ -67,21 +66,18 @@ end
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = 'technic:constructor_mk1_off 1',
|
||||
recipe = {'technic:nodebreaker_off', 'technic:deployer_off'},
|
||||
|
||||
recipe = { "technic:nodebreaker_off", "technic:deployer_off" },
|
||||
})
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = 'technic:constructor_mk2_off 1',
|
||||
recipe = {'technic:constructor_mk1_off', 'technic:constructor_mk1_off'},
|
||||
|
||||
recipe = { "technic:constructor_mk1_off", "technic:constructor_mk1_off" },
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = 'technic:constructor_mk3_off 1',
|
||||
recipe = {'technic:constructor_mk2_off', 'technic:constructor_mk2_off'},
|
||||
|
||||
recipe = { "technic:constructor_mk2_off", "technic:constructor_mk2_off" },
|
||||
})
|
||||
|
||||
local function make_on(mark, length)
|
||||
@ -111,7 +107,7 @@ end
|
||||
local function make_off(mark)
|
||||
return function(pos, node)
|
||||
if node.name == "technic:constructor_mk"..mark.."_on" then
|
||||
technic.swap_node(pos,"technic:constructor_mk"..mark.."_off")
|
||||
technic.swap_node(pos, "technic:constructor_mk"..mark.."_off")
|
||||
nodeupdate(pos)
|
||||
end
|
||||
end
|
||||
@ -121,15 +117,17 @@ end
|
||||
local function make_constructor(mark, length)
|
||||
minetest.register_node("technic:constructor_mk"..mark.."_off", {
|
||||
description = S("Constructor Mk%d"):format(mark),
|
||||
tiles = {"technic_constructor_mk"..mark.."_top_off.png",
|
||||
tiles = {
|
||||
"technic_constructor_mk"..mark.."_top_off.png",
|
||||
"technic_constructor_mk"..mark.."_bottom_off.png",
|
||||
"technic_constructor_mk"..mark.."_side2_off.png",
|
||||
"technic_constructor_mk"..mark.."_side1_off.png",
|
||||
"technic_constructor_back.png",
|
||||
"technic_constructor_front_off.png"},
|
||||
"technic_constructor_front_off.png"
|
||||
},
|
||||
paramtype2 = "facedir",
|
||||
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, mesecon = 2},
|
||||
mesecons = {effector = {action_on = make_on(mark, length)}},
|
||||
groups = { snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, mesecon = 2 },
|
||||
mesecons = { effector = { action_on = make_on(mark, length) } },
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
@ -138,9 +136,9 @@ local function make_constructor(mark, length)
|
||||
"list[current_player;main;0,5;8,4;]"
|
||||
for i = 1, length do
|
||||
formspec = formspec
|
||||
.."label[5,"..(i - 1)..";"..S("Slot %d"):format(i).."]"
|
||||
.."list[current_name;slot"..i
|
||||
..";6,"..(i - 1)..";1,1;]"
|
||||
.. "label[5,"..(i - 1)..";"..S("Slot %d"):format(i).."]"
|
||||
.. "list[current_name;slot"..i
|
||||
.. ";6,"..(i - 1)..";1,1;]"
|
||||
end
|
||||
meta:set_string("formspec", formspec)
|
||||
meta:set_string("infotext", S("Constructor Mk%d"):format(mark))
|
||||
@ -165,17 +163,24 @@ local function make_constructor(mark, length)
|
||||
})
|
||||
|
||||
minetest.register_node("technic:constructor_mk"..mark.."_on", {
|
||||
tiles = {"technic_constructor_mk"..mark.."_top_on.png",
|
||||
tiles = {
|
||||
"technic_constructor_mk"..mark.."_top_on.png",
|
||||
"technic_constructor_mk"..mark.."_bottom_on.png",
|
||||
"technic_constructor_mk"..mark.."_side2_on.png",
|
||||
"technic_constructor_mk"..mark.."_side1_on.png",
|
||||
"technic_constructor_back.png",
|
||||
"technic_constructor_front_on.png"},
|
||||
"technic_constructor_front_on.png"
|
||||
},
|
||||
paramtype2 = "facedir",
|
||||
drop = "technic:constructor_mk"..mark.."_off",
|
||||
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
|
||||
mesecon=2, not_in_creative_inventory=1},
|
||||
mesecons= {effector = {action_off = make_off(mark)}},
|
||||
groups = {
|
||||
snappy = 2,
|
||||
choppy = 2,
|
||||
oddly_breakable_by_hand = 2,
|
||||
mesecon = 2,
|
||||
not_in_creative_inventory = 1
|
||||
},
|
||||
mesecons = { effector = { action_off = make_off(mark) } },
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
allow_metadata_inventory_put = technic.machine_inventory_put,
|
||||
allow_metadata_inventory_take = technic.machine_inventory_take,
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
local S = technic.getter
|
||||
|
||||
frames = {}
|
||||
@ -9,47 +8,48 @@ local frames_pos = {}
|
||||
|
||||
-- Helpers
|
||||
|
||||
local function get_face(pos,ppos,pvect)
|
||||
local function get_face(pos, ppos, pvect)
|
||||
-- Raytracer to get which face has been clicked
|
||||
ppos={x=ppos.x-pos.x,y=ppos.y-pos.y+1.5,z=ppos.z-pos.z}
|
||||
if pvect.x>0 then
|
||||
local t=(-0.5-ppos.x)/pvect.x
|
||||
local y_int=ppos.y+t*pvect.y
|
||||
local z_int=ppos.z+t*pvect.z
|
||||
if y_int>-0.45 and y_int<0.45 and z_int>-0.45 and z_int<0.45 then return 1 end
|
||||
elseif pvect.x<0 then
|
||||
local t=(0.5-ppos.x)/pvect.x
|
||||
local y_int=ppos.y+t*pvect.y
|
||||
local z_int=ppos.z+t*pvect.z
|
||||
if y_int>-0.45 and y_int<0.45 and z_int>-0.45 and z_int<0.45 then return 2 end
|
||||
ppos = { x = ppos.x - pos.x, y = ppos.y - pos.y + 1.5, z = ppos.z - pos.z }
|
||||
if pvect.x > 0 then
|
||||
local t = (-0.5 - ppos.x) / pvect.x
|
||||
local y_int = ppos.y + t * pvect.y
|
||||
local z_int = ppos.z + t * pvect.z
|
||||
if y_int > -0.45 and y_int < 0.45 and z_int > -0.45 and z_int < 0.45 then return 1 end
|
||||
elseif pvect.x < 0 then
|
||||
local t = (0.5 - ppos.x) / pvect.x
|
||||
local y_int = ppos.y + t * pvect.y
|
||||
local z_int = ppos.z + t * pvect.z
|
||||
if y_int > -0.45 and y_int < 0.45 and z_int > -0.45 and z_int < 0.45 then return 2 end
|
||||
end
|
||||
if pvect.y>0 then
|
||||
local t=(-0.5-ppos.y)/pvect.y
|
||||
local x_int=ppos.x+t*pvect.x
|
||||
local z_int=ppos.z+t*pvect.z
|
||||
if x_int>-0.45 and x_int<0.45 and z_int>-0.45 and z_int<0.45 then return 3 end
|
||||
elseif pvect.y<0 then
|
||||
local t=(0.5-ppos.y)/pvect.y
|
||||
local x_int=ppos.x+t*pvect.x
|
||||
local z_int=ppos.z+t*pvect.z
|
||||
if x_int>-0.45 and x_int<0.45 and z_int>-0.45 and z_int<0.45 then return 4 end
|
||||
if pvect.y > 0 then
|
||||
local t = (-0.5 - ppos.y) / pvect.y
|
||||
local x_int = ppos.x + t * pvect.x
|
||||
local z_int = ppos.z + t * pvect.z
|
||||
if x_int > -0.45 and x_int < 0.45 and z_int > -0.45 and z_int < 0.45 then return 3 end
|
||||
elseif pvect.y < 0 then
|
||||
local t = (0.5 - ppos.y) / pvect.y
|
||||
local x_int = ppos.x + t * pvect.x
|
||||
local z_int = ppos.z + t * pvect.z
|
||||
if x_int > -0.45 and x_int < 0.45 and z_int > -0.45 and z_int < 0.45 then return 4 end
|
||||
end
|
||||
if pvect.z>0 then
|
||||
local t=(-0.5-ppos.z)/pvect.z
|
||||
local x_int=ppos.x+t*pvect.x
|
||||
local y_int=ppos.y+t*pvect.y
|
||||
if x_int>-0.45 and x_int<0.45 and y_int>-0.45 and y_int<0.45 then return 5 end
|
||||
elseif pvect.z<0 then
|
||||
local t=(0.5-ppos.z)/pvect.z
|
||||
local x_int=ppos.x+t*pvect.x
|
||||
local y_int=ppos.y+t*pvect.y
|
||||
if x_int>-0.45 and x_int<0.45 and y_int>-0.45 and y_int<0.45 then return 6 end
|
||||
if pvect.z > 0 then
|
||||
local t = (-0.5 - ppos.z) / pvect.z
|
||||
local x_int = ppos.x + t * pvect.x
|
||||
local y_int = ppos.y + t * pvect.y
|
||||
if x_int > -0.45 and x_int < 0.45 and y_int > -0.45 and y_int < 0.45 then return 5 end
|
||||
elseif pvect.z < 0 then
|
||||
local t = (0.5 - ppos.z) / pvect.z
|
||||
local x_int = ppos.x + t * pvect.x
|
||||
local y_int = ppos.y + t * pvect.y
|
||||
if x_int > -0.45 and x_int < 0.45 and y_int > -0.45 and y_int < 0.45 then return 6 end
|
||||
end
|
||||
end
|
||||
|
||||
local function lines(str)
|
||||
local t = {}
|
||||
local function helper(line) table.insert(t, line) return "" end
|
||||
|
||||
helper((str:gsub("(.-)\r?\n", helper)))
|
||||
return t
|
||||
end
|
||||
@ -63,12 +63,12 @@ end
|
||||
|
||||
local function pos_from_string(str)
|
||||
local l = lines(str)
|
||||
return {x = tonumber(l[1]), y = tonumber(l[2]), z = tonumber(l[3])}
|
||||
return { x = tonumber(l[1]), y = tonumber(l[2]), z = tonumber(l[3]) }
|
||||
end
|
||||
|
||||
local function pos_in_list(l,pos)
|
||||
for _,p in ipairs(l) do
|
||||
if p.x==pos.x and p.y==pos.y and p.z==pos.z then return true end
|
||||
local function pos_in_list(l, pos)
|
||||
for _, p in ipairs(l) do
|
||||
if p.x == pos.x and p.y == pos.y and p.z == pos.z then return true end
|
||||
end
|
||||
return false
|
||||
end
|
||||
@ -80,30 +80,30 @@ local function table_empty(table)
|
||||
return true
|
||||
end
|
||||
|
||||
local function add_table(table,toadd)
|
||||
local function add_table(table, toadd)
|
||||
local i = 1
|
||||
while true do
|
||||
o = table[i]
|
||||
if o == toadd then return end
|
||||
if o == nil then break end
|
||||
i = i+1
|
||||
i = i + 1
|
||||
end
|
||||
table[i] = toadd
|
||||
end
|
||||
|
||||
local function move_nodes_vect(poslist,vect,must_not_move,owner)
|
||||
local function move_nodes_vect(poslist, vect, must_not_move, owner)
|
||||
if minetest.is_protected then
|
||||
for _,pos in ipairs(poslist) do
|
||||
local npos=vector.add(pos,vect)
|
||||
for _, pos in ipairs(poslist) do
|
||||
local npos = vector.add(pos, vect)
|
||||
if minetest.is_protected(pos, owner) or minetest.is_protected(npos, owner) then
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
for _,pos in ipairs(poslist) do
|
||||
local npos=vector.add(pos,vect)
|
||||
for _, pos in ipairs(poslist) do
|
||||
local npos = vector.add(pos, vect)
|
||||
local name = minetest.get_node(npos).name
|
||||
if ((name~="air" and minetest.registered_nodes[name].liquidtype=="none") or frames_pos[pos_to_string(npos)]) and not(pos_in_list(poslist,npos)) then
|
||||
if ((name ~= "air" and minetest.registered_nodes[name].liquidtype == "none") or frames_pos[pos_to_string(npos)]) and not (pos_in_list(poslist, npos)) then
|
||||
return
|
||||
end
|
||||
--[[if pos.x==must_not_move.x and pos.y==must_not_move.y and pos.z==must_not_move.z then
|
||||
@ -114,11 +114,11 @@ local function move_nodes_vect(poslist,vect,must_not_move,owner)
|
||||
for _, pos in ipairs(poslist) do
|
||||
local node = minetest.get_node(pos)
|
||||
local meta = minetest.get_meta(pos):to_table()
|
||||
nodelist[#(nodelist)+1] = {oldpos = pos, pos = vector.add(pos, vect), node = node, meta = meta}
|
||||
nodelist[#(nodelist) + 1] = { oldpos = pos, pos = vector.add(pos, vect), node = node, meta = meta }
|
||||
end
|
||||
local objects = {}
|
||||
for _, pos in ipairs(poslist) do
|
||||
for _,object in ipairs(minetest.get_objects_inside_radius(pos, 1)) do
|
||||
for _, object in ipairs(minetest.get_objects_inside_radius(pos, 1)) do
|
||||
local entity = object:get_luaentity()
|
||||
if not entity or not mesecon.is_mvps_unmov(entity.name) then
|
||||
add_table(objects, object)
|
||||
@ -128,12 +128,12 @@ local function move_nodes_vect(poslist,vect,must_not_move,owner)
|
||||
for _, obj in ipairs(objects) do
|
||||
obj:setpos(vector.add(obj:getpos(), vect))
|
||||
end
|
||||
for _,n in ipairs(nodelist) do
|
||||
for _, n in ipairs(nodelist) do
|
||||
local npos = n.pos
|
||||
minetest.set_node(npos, n.node)
|
||||
local meta = minetest.get_meta(npos)
|
||||
meta:from_table(n.meta)
|
||||
for __,pos in ipairs(poslist) do
|
||||
for __, pos in ipairs(poslist) do
|
||||
if npos.x == pos.x and npos.y == pos.y and npos.z == pos.z then
|
||||
table.remove(poslist, __)
|
||||
break
|
||||
@ -154,16 +154,16 @@ end
|
||||
|
||||
|
||||
-- Frames
|
||||
for xm=0,1 do
|
||||
for xp=0,1 do
|
||||
for ym=0,1 do
|
||||
for yp=0,1 do
|
||||
for zm=0,1 do
|
||||
for zp=0,1 do
|
||||
for xm = 0, 1 do
|
||||
for xp = 0, 1 do
|
||||
for ym = 0, 1 do
|
||||
for yp = 0, 1 do
|
||||
for zm = 0, 1 do
|
||||
for zp = 0, 1 do
|
||||
|
||||
local a=8/16
|
||||
local b=7/16
|
||||
local nodeboxes= {
|
||||
local a = 8/16
|
||||
local b = 7/16
|
||||
local nodeboxes = {
|
||||
{ -a, -a, -a, -b, a, -b },
|
||||
{ -a, -a, b, -b, a, a },
|
||||
{ b, -a, b, a, a, a },
|
||||
@ -182,77 +182,77 @@ local nodeboxes= {
|
||||
{ -a, -a, -b, -b, -b, b },
|
||||
}
|
||||
|
||||
if yp==0 then
|
||||
table.insert(nodeboxes, {-b,b,-b, b,a,b})
|
||||
if yp == 0 then
|
||||
table.insert(nodeboxes, { -b, b, -b, b, a, b })
|
||||
end
|
||||
if ym==0 then
|
||||
table.insert(nodeboxes, {-b,-a,-b, b,-b,b})
|
||||
if ym == 0 then
|
||||
table.insert(nodeboxes, { -b, -a, -b, b, -b, b })
|
||||
end
|
||||
if xp==0 then
|
||||
table.insert(nodeboxes, {b,b,b,a,-b,-b})
|
||||
if xp == 0 then
|
||||
table.insert(nodeboxes, { b, b, b, a, -b, -b })
|
||||
end
|
||||
if xm==0 then
|
||||
table.insert(nodeboxes, {-a,-b,-b,-b,b,b})
|
||||
if xm == 0 then
|
||||
table.insert(nodeboxes, { -a, -b, -b, -b, b, b })
|
||||
end
|
||||
if zp==0 then
|
||||
table.insert(nodeboxes, {-b,-b,b, b,b,a})
|
||||
if zp == 0 then
|
||||
table.insert(nodeboxes, { -b, -b, b, b, b, a })
|
||||
end
|
||||
if zm==0 then
|
||||
table.insert(nodeboxes, {-b,-b,-a, b,b,-b})
|
||||
if zm == 0 then
|
||||
table.insert(nodeboxes, { -b, -b, -a, b, b, -b })
|
||||
end
|
||||
|
||||
local nameext=tostring(xm)..tostring(xp)..tostring(ym)..tostring(yp)..tostring(zm)..tostring(zp)
|
||||
local groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}
|
||||
if nameext~="111111" then groups.not_in_creative_inventory=1 end
|
||||
local nameext = tostring(xm)..tostring(xp)..tostring(ym)..tostring(yp)..tostring(zm)..tostring(zp)
|
||||
local groups = { snappy = 2, choppy = 2, oddly_breakable_by_hand = 2 }
|
||||
if nameext ~= "111111" then groups.not_in_creative_inventory = 1 end
|
||||
|
||||
|
||||
minetest.register_node("technic:frame_"..nameext,{
|
||||
minetest.register_node("technic:frame_"..nameext, {
|
||||
description = S("Frame"),
|
||||
tiles = {"technic_frame.png"},
|
||||
groups=groups,
|
||||
tiles = { "technic_frame.png" },
|
||||
groups = groups,
|
||||
drawtype = "nodebox",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed=nodeboxes,
|
||||
fixed = nodeboxes,
|
||||
},
|
||||
selection_box = {
|
||||
type="fixed",
|
||||
fixed={-0.5,-0.5,-0.5,0.5,0.5,0.5}
|
||||
type = "fixed",
|
||||
fixed = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 }
|
||||
},
|
||||
paramtype = "light",
|
||||
frame=1,
|
||||
drop="technic:frame_111111",
|
||||
frame = 1,
|
||||
drop = "technic:frame_111111",
|
||||
sunlight_propagates = true,
|
||||
frame_connect_all=function(nodename)
|
||||
l2={}
|
||||
l1={{x=-1,y=0,z=0},{x=1,y=0,z=0},{x=0,y=-1,z=0},{x=0,y=1,z=0},{x=0,y=0,z=-1},{x=0,y=0,z=1}}
|
||||
for i,dir in ipairs(l1) do
|
||||
if string.sub(nodename,-7+i,-7+i)=="1" then
|
||||
l2[#(l2)+1]=dir
|
||||
frame_connect_all = function(nodename)
|
||||
l2 = {}
|
||||
l1 = { { x = -1, y = 0, z = 0 }, { x = 1, y = 0, z = 0 }, { x = 0, y = -1, z = 0 }, { x = 0, y = 1, z = 0 }, { x = 0, y = 0, z = -1 }, { x = 0, y = 0, z = 1 } }
|
||||
for i, dir in ipairs(l1) do
|
||||
if string.sub(nodename, -7 + i, -7 + i) == "1" then
|
||||
l2[#(l2) + 1] = dir
|
||||
end
|
||||
end
|
||||
return l2
|
||||
end,
|
||||
on_punch=function(pos,node,puncher)
|
||||
local ppos=puncher:getpos()
|
||||
local pvect=puncher:get_look_dir()
|
||||
local pface=get_face(pos,ppos,pvect)
|
||||
if pface==nil then return end
|
||||
local nodename=node.name
|
||||
local newstate=tostring(1-tonumber(string.sub(nodename,-7+pface,-7+pface)))
|
||||
if pface<=5 then
|
||||
nodename=string.sub(nodename,1,-7+pface-1)..newstate..string.sub(nodename,-7+pface+1)
|
||||
on_punch = function(pos, node, puncher)
|
||||
local ppos = puncher:getpos()
|
||||
local pvect = puncher:get_look_dir()
|
||||
local pface = get_face(pos, ppos, pvect)
|
||||
if pface == nil then return end
|
||||
local nodename = node.name
|
||||
local newstate = tostring(1 - tonumber(string.sub(nodename, -7 + pface, -7 + pface)))
|
||||
if pface <= 5 then
|
||||
nodename = string.sub(nodename, 1, -7 + pface - 1)..newstate..string.sub(nodename, -7 + pface + 1)
|
||||
else
|
||||
nodename=string.sub(nodename,1,-2)..newstate
|
||||
nodename = string.sub(nodename, 1, -2)..newstate
|
||||
end
|
||||
node.name=nodename
|
||||
minetest.set_node(pos,node)
|
||||
node.name = nodename
|
||||
minetest.set_node(pos, node)
|
||||
end,
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
local pos = pointed_thing.above
|
||||
if minetest.is_protected(pos, placer:get_player_name()) then
|
||||
minetest.log("action", placer:get_player_name()
|
||||
.. " tried to place " .. itemstack:get_name()
|
||||
.. " tried to place "..itemstack:get_name()
|
||||
.. " at protected position "
|
||||
.. minetest.pos_to_string(pos))
|
||||
minetest.record_protection_violation(pos, placer:get_player_name())
|
||||
@ -263,10 +263,10 @@ local nodeboxes= {
|
||||
if node.name ~= "air" then
|
||||
if is_supported_node(node.name) then
|
||||
obj = minetest.add_entity(pos, "technic:frame_entity")
|
||||
obj:get_luaentity():set_node({name=itemstack:get_name()})
|
||||
obj:get_luaentity():set_node({ name = itemstack:get_name() })
|
||||
end
|
||||
else
|
||||
minetest.set_node(pos, {name = itemstack:get_name()})
|
||||
minetest.set_node(pos, { name = itemstack:get_name() })
|
||||
end
|
||||
if not infinite_stacks then
|
||||
itemstack:take_item()
|
||||
@ -277,21 +277,21 @@ local nodeboxes= {
|
||||
if is_supported_node(itemstack:get_name()) then
|
||||
if minetest.is_protected(pos, placer:get_player_name()) then
|
||||
minetest.log("action", placer:get_player_name()
|
||||
.. " tried to place " .. itemstack:get_name()
|
||||
.. " tried to place "..itemstack:get_name()
|
||||
.. " at protected position "
|
||||
.. minetest.pos_to_string(pos))
|
||||
minetest.record_protection_violation(pos, placer:get_player_name())
|
||||
return itemstack
|
||||
end
|
||||
|
||||
minetest.set_node(pos, {name = itemstack:get_name()})
|
||||
minetest.set_node(pos, { name = itemstack:get_name() })
|
||||
|
||||
local take_item = true
|
||||
local def = minetest.registered_items[itemstack:get_name()]
|
||||
-- Run callback
|
||||
if def.after_place_node then
|
||||
-- Copy place_to because callback can modify it
|
||||
local pos_copy = {x=pos.x, y=pos.y, z=pos.z}
|
||||
local pos_copy = { x = pos.x, y = pos.y, z = pos.z }
|
||||
if def.after_place_node(pos_copy, placer, itemstack) then
|
||||
take_item = false
|
||||
end
|
||||
@ -301,9 +301,9 @@ local nodeboxes= {
|
||||
local _, callback
|
||||
for _, callback in ipairs(minetest.registered_on_placenodes) do
|
||||
-- Copy pos and node because callback can modify them
|
||||
local pos_copy = {x=pos.x, y=pos.y, z=pos.z}
|
||||
local newnode_copy = {name=def.name, param1=0, param2=0}
|
||||
local oldnode_copy = {name="air", param1=0, param2=0}
|
||||
local pos_copy = { x = pos.x, y = pos.y, z = pos.z }
|
||||
local newnode_copy = { name = def.name, param1 = 0, param2 = 0 }
|
||||
local oldnode_copy = { name = "air", param1 = 0, param2 = 0 }
|
||||
if callback(pos_copy, newnode_copy, placer, oldnode_copy, itemstack) then
|
||||
take_item = false
|
||||
end
|
||||
@ -314,7 +314,7 @@ local nodeboxes= {
|
||||
end
|
||||
|
||||
obj = minetest.add_entity(pos, "technic:frame_entity")
|
||||
obj:get_luaentity():set_node({name=node.name})
|
||||
obj:get_luaentity():set_node({ name = node.name })
|
||||
|
||||
return itemstack
|
||||
else
|
||||
@ -325,29 +325,26 @@ local nodeboxes= {
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_entity("technic:frame_entity", {
|
||||
initial_properties = {
|
||||
physical = true,
|
||||
collisionbox = {-0.5,-0.5,-0.5, 0.5,0.5,0.5},
|
||||
collisionbox = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 },
|
||||
visual = "wielditem",
|
||||
textures = {},
|
||||
visual_size = {x=0.667, y=0.667},
|
||||
visual_size = { x = 0.667, y = 0.667 },
|
||||
},
|
||||
|
||||
node = {},
|
||||
|
||||
set_node = function(self, node)
|
||||
self.node = node
|
||||
local pos = self.object:getpos()
|
||||
pos = {x = math.floor(pos.x+0.5), y = math.floor(pos.y+0.5), z = math.floor(pos.z+0.5)}
|
||||
pos = { x = math.floor(pos.x + 0.5), y = math.floor(pos.y + 0.5), z = math.floor(pos.z + 0.5) }
|
||||
frames_pos[pos_to_string(pos)] = node.name
|
||||
local stack = ItemStack(node.name)
|
||||
local itemtable = stack:to_table()
|
||||
@ -363,28 +360,24 @@ minetest.register_entity("technic:frame_entity", {
|
||||
end
|
||||
prop = {
|
||||
is_visible = true,
|
||||
textures = {node.name},
|
||||
textures = { node.name },
|
||||
}
|
||||
self.object:set_properties(prop)
|
||||
end,
|
||||
|
||||
get_staticdata = function(self)
|
||||
return self.node.name
|
||||
end,
|
||||
|
||||
on_activate = function(self, staticdata)
|
||||
self.object:set_armor_groups({immortal=1})
|
||||
self:set_node({name=staticdata})
|
||||
self.object:set_armor_groups({ immortal = 1 })
|
||||
self:set_node({ name = staticdata })
|
||||
end,
|
||||
|
||||
dig = function(self)
|
||||
minetest.handle_node_drops(self.object:getpos(), {ItemStack("technic:frame_111111")}, self.last_puncher)
|
||||
minetest.handle_node_drops(self.object:getpos(), { ItemStack("technic:frame_111111") }, self.last_puncher)
|
||||
local pos = self.object:getpos()
|
||||
pos = {x = math.floor(pos.x+0.5), y = math.floor(pos.y+0.5), z = math.floor(pos.z+0.5)}
|
||||
pos = { x = math.floor(pos.x + 0.5), y = math.floor(pos.y + 0.5), z = math.floor(pos.z + 0.5) }
|
||||
frames_pos[pos_to_string(pos)] = nil
|
||||
self.object:remove()
|
||||
end,
|
||||
|
||||
on_punch = function(self, puncher, time_from_last_punch, tool_capabilities, dir)
|
||||
local pos = self.object:getpos()
|
||||
if self.damage_object == nil then
|
||||
@ -399,30 +392,29 @@ minetest.register_entity("technic:frame_entity", {
|
||||
self.last_puncher = puncher
|
||||
local ppos = puncher:getpos()
|
||||
local pvect = puncher:get_look_dir()
|
||||
local pface = get_face(pos,ppos,pvect)
|
||||
local pface = get_face(pos, ppos, pvect)
|
||||
if pface == nil then return end
|
||||
local nodename = self.node.name
|
||||
local newstate = tostring(1-tonumber(string.sub(nodename, -7+pface, -7+pface)))
|
||||
local newstate = tostring(1 - tonumber(string.sub(nodename, -7 + pface, -7 + pface)))
|
||||
if pface <= 5 then
|
||||
nodename = string.sub(nodename, 1, -7+pface-1)..newstate..string.sub(nodename, -7+pface+1)
|
||||
nodename = string.sub(nodename, 1, -7 + pface - 1)..newstate..string.sub(nodename, -7 + pface + 1)
|
||||
else
|
||||
nodename = string.sub(nodename, 1, -2)..newstate
|
||||
end
|
||||
self.node.name = nodename
|
||||
self:set_node(self.node)
|
||||
end,
|
||||
|
||||
on_rightclick = function(self, clicker)
|
||||
local pos = self.object:getpos()
|
||||
local ppos = clicker:getpos()
|
||||
local pvect = clicker:get_look_dir()
|
||||
local pface = get_face(pos, ppos, pvect)
|
||||
if pface == nil then return end
|
||||
local pos_under = {x = math.floor(pos.x+0.5), y = math.floor(pos.y+0.5), z = math.floor(pos.z+0.5)}
|
||||
local pos_above = {x = pos_under.x, y = pos_under.y, z = pos_under.z}
|
||||
local index = ({"x", "y", "z"})[math.floor((pface+1)/2)]
|
||||
pos_above[index] = pos_above[index] + 2*((pface+1)%2) - 1
|
||||
local pointed_thing = {type = "node", under = pos_under, above = pos_above}
|
||||
local pos_under = { x = math.floor(pos.x + 0.5), y = math.floor(pos.y + 0.5), z = math.floor(pos.z + 0.5) }
|
||||
local pos_above = { x = pos_under.x, y = pos_under.y, z = pos_under.z }
|
||||
local index = ({ "x", "y", "z" })[math.floor((pface + 1) / 2)]
|
||||
pos_above[index] = pos_above[index] + 2 * ((pface + 1) % 2) - 1
|
||||
local pointed_thing = { type = "node", under = pos_under, above = pos_above }
|
||||
local itemstack = clicker:get_wielded_item()
|
||||
local itemdef = minetest.registered_items[itemstack:get_name()]
|
||||
if itemdef ~= nil then
|
||||
@ -435,9 +427,9 @@ local crack = "crack_anylength.png^[verticalframe:5:0"
|
||||
minetest.register_entity("technic:damage_entity", {
|
||||
initial_properties = {
|
||||
visual = "cube",
|
||||
visual_size = {x=1.01, y=1.01},
|
||||
textures = {crack, crack, crack, crack, crack, crack},
|
||||
collisionbox = {0, 0, 0, 0, 0, 0},
|
||||
visual_size = { x = 1.01, y = 1.01 },
|
||||
textures = { crack, crack, crack, crack, crack, crack },
|
||||
collisionbox = { 0, 0, 0, 0, 0, 0 },
|
||||
physical = false,
|
||||
},
|
||||
on_step = function(self, dtime)
|
||||
@ -460,7 +452,7 @@ minetest.register_entity("technic:damage_entity", {
|
||||
self.frame_object:dig()
|
||||
end
|
||||
local ct = "crack_anylength.png^[verticalframe:5:"..self.texture_index
|
||||
self.object:set_properties({textures = {ct, ct, ct, ct, ct, ct}})
|
||||
self.object:set_properties({ textures = { ct, ct, ct, ct, ct, ct } })
|
||||
end
|
||||
end,
|
||||
})
|
||||
@ -471,7 +463,7 @@ mesecon.register_on_mvps_move(function(moved_nodes)
|
||||
local to_move = {}
|
||||
for _, n in ipairs(moved_nodes) do
|
||||
if frames_pos[pos_to_string(n.oldpos)] ~= nil then
|
||||
to_move[#to_move+1] = {pos = n.pos, oldpos = n.oldpos, name = frames_pos[pos_to_string(n.oldpos)]}
|
||||
to_move[#to_move + 1] = { pos = n.pos, oldpos = n.oldpos, name = frames_pos[pos_to_string(n.oldpos)] }
|
||||
frames_pos[pos_to_string(n.oldpos)] = nil
|
||||
end
|
||||
end
|
||||
@ -491,7 +483,7 @@ end)
|
||||
|
||||
minetest.register_on_dignode(function(pos, node)
|
||||
if frames_pos[pos_to_string(pos)] ~= nil then
|
||||
minetest.set_node(pos, {name = frames_pos[pos_to_string(pos)]})
|
||||
minetest.set_node(pos, { name = frames_pos[pos_to_string(pos)] })
|
||||
frames_pos[pos_to_string(pos)] = nil
|
||||
local objects = minetest.get_objects_inside_radius(pos, 0.1)
|
||||
for _, obj in ipairs(objects) do
|
||||
@ -504,40 +496,40 @@ minetest.register_on_dignode(function(pos, node)
|
||||
end)
|
||||
|
||||
-- Frame motor
|
||||
local function connected(pos,c,adj)
|
||||
for _,vect in ipairs(adj) do
|
||||
local pos1=vector.add(pos,vect)
|
||||
local nodename=minetest.get_node(pos1).name
|
||||
local function connected(pos, c, adj)
|
||||
for _, vect in ipairs(adj) do
|
||||
local pos1 = vector.add(pos, vect)
|
||||
local nodename = minetest.get_node(pos1).name
|
||||
if frames_pos[pos_to_string(pos1)] then
|
||||
nodename = frames_pos[pos_to_string(pos1)]
|
||||
end
|
||||
if not(pos_in_list(c,pos1)) and nodename~="air" and
|
||||
(minetest.registered_nodes[nodename].frames_can_connect==nil or
|
||||
minetest.registered_nodes[nodename].frames_can_connect(pos1,vect)) then
|
||||
c[#(c)+1]=pos1
|
||||
if minetest.registered_nodes[nodename].frame==1 then
|
||||
local adj=minetest.registered_nodes[nodename].frame_connect_all(nodename)
|
||||
connected(pos1,c,adj)
|
||||
if not (pos_in_list(c, pos1)) and nodename ~= "air" and
|
||||
(minetest.registered_nodes[nodename].frames_can_connect == nil or
|
||||
minetest.registered_nodes[nodename].frames_can_connect(pos1, vect)) then
|
||||
c[#(c) + 1] = pos1
|
||||
if minetest.registered_nodes[nodename].frame == 1 then
|
||||
local adj = minetest.registered_nodes[nodename].frame_connect_all(nodename)
|
||||
connected(pos1, c, adj)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function get_connected_nodes(pos)
|
||||
c={pos}
|
||||
local nodename=minetest.get_node(pos).name
|
||||
c = { pos }
|
||||
local nodename = minetest.get_node(pos).name
|
||||
if frames_pos[pos_to_string(pos)] then
|
||||
nodename = frames_pos[pos_to_string(pos)]
|
||||
end
|
||||
connected(pos,c,minetest.registered_nodes[nodename].frame_connect_all(nodename))
|
||||
connected(pos, c, minetest.registered_nodes[nodename].frame_connect_all(nodename))
|
||||
return c
|
||||
end
|
||||
|
||||
local function frame_motor_on(pos, node)
|
||||
local dirs = {{x=0,y=1,z=0},{x=0,y=0,z=1},{x=0,y=0,z=-1},{x=1,y=0,z=0},{x=-1,y=0,z=0},{x=0,y=-1,z=0}}
|
||||
local nnodepos = vector.add(pos, dirs[math.floor(node.param2/4)+1])
|
||||
local dirs = { { x = 0, y = 1, z = 0 }, { x = 0, y = 0, z = 1 }, { x = 0, y = 0, z = -1 }, { x = 1, y = 0, z = 0 }, { x = -1, y = 0, z = 0 }, { x = 0, y = -1, z = 0 } }
|
||||
local nnodepos = vector.add(pos, dirs[math.floor(node.param2 / 4) + 1])
|
||||
local dir = minetest.facedir_to_dir(node.param2)
|
||||
local nnode=minetest.get_node(nnodepos)
|
||||
local nnode = minetest.get_node(nnodepos)
|
||||
if frames_pos[pos_to_string(nnodepos)] then
|
||||
nnode.name = frames_pos[pos_to_string(nnodepos)]
|
||||
end
|
||||
@ -546,45 +538,47 @@ local function frame_motor_on(pos, node)
|
||||
return
|
||||
end
|
||||
local owner = meta:get_string("owner")
|
||||
if minetest.registered_nodes[nnode.name].frame==1 then
|
||||
local connected_nodes=get_connected_nodes(nnodepos)
|
||||
move_nodes_vect(connected_nodes,dir,pos,owner)
|
||||
if minetest.registered_nodes[nnode.name].frame == 1 then
|
||||
local connected_nodes = get_connected_nodes(nnodepos)
|
||||
move_nodes_vect(connected_nodes, dir, pos, owner)
|
||||
end
|
||||
minetest.get_meta(vector.add(pos, dir)):set_int("last_moved", minetest.get_gametime())
|
||||
end
|
||||
|
||||
minetest.register_node("technic:frame_motor",{
|
||||
minetest.register_node("technic:frame_motor", {
|
||||
description = S("Frame Motor"),
|
||||
tiles = {"pipeworks_filter_top.png^[transformR90", "technic_lv_cable.png", "technic_lv_cable.png",
|
||||
"technic_lv_cable.png", "technic_lv_cable.png", "technic_lv_cable.png"},
|
||||
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,mesecon=2},
|
||||
tiles = {
|
||||
"pipeworks_filter_top.png^[transformR90", "technic_lv_cable.png", "technic_lv_cable.png",
|
||||
"technic_lv_cable.png", "technic_lv_cable.png", "technic_lv_cable.png"
|
||||
},
|
||||
groups = { snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, mesecon = 2 },
|
||||
paramtype2 = "facedir",
|
||||
mesecons={effector={action_on=frame_motor_on}},
|
||||
mesecons = { effector = { action_on = frame_motor_on } },
|
||||
after_place_node = function(pos, placer, itemstack)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("owner", placer:get_player_name())
|
||||
end,
|
||||
frames_can_connect=function(pos,dir)
|
||||
frames_can_connect = function(pos, dir)
|
||||
local node = minetest.get_node(pos)
|
||||
local dir2 = ({{x=0,y=1,z=0},{x=0,y=0,z=1},{x=0,y=0,z=-1},{x=1,y=0,z=0},{x=-1,y=0,z=0},{x=0,y=-1,z=0}})[math.floor(node.param2/4)+1]
|
||||
return dir2.x~=-dir.x or dir2.y~=-dir.y or dir2.z~=-dir.z
|
||||
local dir2 = ({ { x = 0, y = 1, z = 0 }, { x = 0, y = 0, z = 1 }, { x = 0, y = 0, z = -1 }, { x = 1, y = 0, z = 0 }, { x = -1, y = 0, z = 0 }, { x = 0, y = -1, z = 0 } })[math.floor(node.param2 / 4) + 1]
|
||||
return dir2.x ~= -dir.x or dir2.y ~= -dir.y or dir2.z ~= -dir.z
|
||||
end
|
||||
})
|
||||
|
||||
|
||||
|
||||
-- Templates
|
||||
local function template_connected(pos,c,connectors)
|
||||
for _,vect in ipairs({{x=0,y=1,z=0},{x=0,y=0,z=1},{x=0,y=0,z=-1},{x=1,y=0,z=0},{x=-1,y=0,z=0},{x=0,y=-1,z=0}}) do
|
||||
local pos1=vector.add(pos,vect)
|
||||
local nodename=minetest.get_node(pos1).name
|
||||
if not(pos_in_list(c,pos1)) and (nodename=="technic:template" or nodename == "technic:template_connector")then
|
||||
local function template_connected(pos, c, connectors)
|
||||
for _, vect in ipairs({ { x = 0, y = 1, z = 0 }, { x = 0, y = 0, z = 1 }, { x = 0, y = 0, z = -1 }, { x = 1, y = 0, z = 0 }, { x = -1, y = 0, z = 0 }, { x = 0, y = -1, z = 0 } }) do
|
||||
local pos1 = vector.add(pos, vect)
|
||||
local nodename = minetest.get_node(pos1).name
|
||||
if not (pos_in_list(c, pos1)) and (nodename == "technic:template" or nodename == "technic:template_connector") then
|
||||
local meta = minetest.get_meta(pos1)
|
||||
if meta:get_string("connected") == "" then
|
||||
c[#(c)+1]=pos1
|
||||
template_connected(pos1,c,connectors)
|
||||
c[#(c) + 1] = pos1
|
||||
template_connected(pos1, c, connectors)
|
||||
if nodename == "technic:template_connector" then
|
||||
connectors[#connectors+1] = pos1
|
||||
connectors[#connectors + 1] = pos1
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -592,14 +586,14 @@ local function template_connected(pos,c,connectors)
|
||||
end
|
||||
|
||||
local function get_templates(pos)
|
||||
local c = {pos}
|
||||
local c = { pos }
|
||||
local connectors
|
||||
if minetest.get_node(pos).name == "technic:template_connector" then
|
||||
connectors = {pos}
|
||||
connectors = { pos }
|
||||
else
|
||||
connectors = {}
|
||||
end
|
||||
template_connected(pos,c,connectors)
|
||||
template_connected(pos, c, connectors)
|
||||
return c, connectors
|
||||
end
|
||||
|
||||
@ -615,7 +609,7 @@ end
|
||||
local function save_node(pos)
|
||||
local node = minetest.get_node(pos)
|
||||
if node.name == "air" then
|
||||
minetest.set_node(pos, {name="technic:template"})
|
||||
minetest.set_node(pos, { name = "technic:template" })
|
||||
return
|
||||
end
|
||||
if node.name == "technic:template" then
|
||||
@ -632,7 +626,7 @@ local function save_node(pos)
|
||||
end
|
||||
end
|
||||
node.meta = meta0
|
||||
minetest.set_node(pos, {name="technic:template"})
|
||||
minetest.set_node(pos, { name = "technic:template" })
|
||||
return node
|
||||
end
|
||||
|
||||
@ -667,19 +661,19 @@ end
|
||||
local function compress_templates(pos)
|
||||
local templates, connectors = get_templates(pos)
|
||||
if #connectors == 0 then
|
||||
connectors = {pos}
|
||||
connectors = { pos }
|
||||
end
|
||||
for _, cn in ipairs(connectors) do
|
||||
local meta = minetest.get_meta(cn)
|
||||
local c = {}
|
||||
for _,p in ipairs(templates) do
|
||||
for _, p in ipairs(templates) do
|
||||
local np = vector.subtract(p, cn)
|
||||
if not pos_in_list(c,np) then
|
||||
c[#c+1] = np
|
||||
if not pos_in_list(c, np) then
|
||||
c[#c + 1] = np
|
||||
end
|
||||
end
|
||||
local cc = {}
|
||||
for _,p in ipairs(connectors) do
|
||||
for _, p in ipairs(connectors) do
|
||||
local np = vector.subtract(p, cn)
|
||||
if (np.x ~= 0 or np.y ~= 0 or np.z ~= 0) then
|
||||
cc[pos_to_string(np)] = true
|
||||
@ -690,9 +684,9 @@ local function compress_templates(pos)
|
||||
meta:set_string("connectors_connected", minetest.serialize(cc))
|
||||
end
|
||||
|
||||
for _,p in ipairs(templates) do
|
||||
for _, p in ipairs(templates) do
|
||||
if not pos_in_list(connectors, p) then
|
||||
minetest.set_node(p, {name = "air"})
|
||||
minetest.set_node(p, { name = "air" })
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -702,10 +696,10 @@ local function template_drops(pos, node, oldmeta, digger)
|
||||
local cc = oldmeta.fields.connectors_connected
|
||||
local drops
|
||||
if c == "" or c == nil then
|
||||
drops = {"technic:template 1"}
|
||||
drops = { "technic:template 1" }
|
||||
else
|
||||
if cc == "" or cc == nil then
|
||||
drops = {"technic:template 1"}
|
||||
drops = { "technic:template 1" }
|
||||
else
|
||||
local dcc = minetest.deserialize(cc)
|
||||
if not table_empty(dcc) then
|
||||
@ -716,7 +710,7 @@ local function template_drops(pos, node, oldmeta, digger)
|
||||
local meta = minetest.get_meta(p)
|
||||
local d = minetest.deserialize(meta:get_string("connectors_connected"))
|
||||
if d ~= nil then
|
||||
d[pos_to_string({x=-ssp.x, y=-ssp.y, z=-ssp.z})] = nil
|
||||
d[pos_to_string({ x = -ssp.x, y = -ssp.y, z = -ssp.z })] = nil
|
||||
meta:set_string("connectors_connected", minetest.serialize(d))
|
||||
end
|
||||
end
|
||||
@ -725,10 +719,10 @@ local function template_drops(pos, node, oldmeta, digger)
|
||||
local num = #(minetest.deserialize(c))
|
||||
drops = {}
|
||||
while num > stack_max do
|
||||
drops[#drops+1] = "technic:template "..stack_max
|
||||
drops[#drops + 1] = "technic:template "..stack_max
|
||||
num = num - stack_max
|
||||
end
|
||||
drops[#drops+1] = "technic:template "..num
|
||||
drops[#drops + 1] = "technic:template "..num
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -744,44 +738,44 @@ local function template_on_destruct(pos, node)
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_node("technic:template",{
|
||||
minetest.register_node("technic:template", {
|
||||
description = S("Template"),
|
||||
tiles = {"technic_mv_cable.png"},
|
||||
tiles = { "technic_mv_cable.png" },
|
||||
drop = "",
|
||||
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
|
||||
groups = { snappy = 2, choppy = 2, oddly_breakable_by_hand = 2 },
|
||||
on_destruct = template_on_destruct,
|
||||
after_dig_node = template_drops,
|
||||
on_punch = function(pos,node,puncher)
|
||||
on_punch = function(pos, node, puncher)
|
||||
swap_template(pos, "technic:template_disabled")
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("technic:template_disabled",{
|
||||
minetest.register_node("technic:template_disabled", {
|
||||
description = S("Template"),
|
||||
tiles = {"technic_hv_cable.png"},
|
||||
tiles = { "technic_hv_cable.png" },
|
||||
drop = "",
|
||||
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,not_in_creative_inventory=1},
|
||||
groups = { snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, not_in_creative_inventory = 1 },
|
||||
on_destruct = template_on_destruct,
|
||||
after_dig_node = template_drops,
|
||||
on_punch = function(pos,node,puncher)
|
||||
on_punch = function(pos, node, puncher)
|
||||
local meta = minetest.get_meta(pos)
|
||||
swap_template(pos, "technic:template_connector")
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("technic:template_connector",{
|
||||
minetest.register_node("technic:template_connector", {
|
||||
description = S("Template"),
|
||||
tiles = {"technic_lv_cable.png"},
|
||||
tiles = { "technic_lv_cable.png" },
|
||||
drop = "",
|
||||
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,not_in_creative_inventory=1},
|
||||
groups = { snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, not_in_creative_inventory = 1 },
|
||||
on_destruct = template_on_destruct,
|
||||
after_dig_node = template_drops,
|
||||
on_punch = function(pos,node,puncher)
|
||||
on_punch = function(pos, node, puncher)
|
||||
swap_template(pos, "technic:template")
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_craftitem("technic:template_replacer",{
|
||||
minetest.register_craftitem("technic:template_replacer", {
|
||||
description = S("Template (replacing)"),
|
||||
inventory_image = "technic_template_replacer.png",
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
@ -801,7 +795,7 @@ minetest.register_craftitem("technic:template_replacer",{
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_tool("technic:template_tool",{
|
||||
minetest.register_tool("technic:template_tool", {
|
||||
description = S("Template Tool"),
|
||||
inventory_image = "technic_template_tool.png",
|
||||
on_use = function(itemstack, puncher, pointed_thing)
|
||||
@ -818,7 +812,6 @@ minetest.register_tool("technic:template_tool",{
|
||||
else
|
||||
compress_templates(pos)
|
||||
end
|
||||
|
||||
end
|
||||
})
|
||||
|
||||
@ -831,40 +824,42 @@ local function get_template_nodes(pos)
|
||||
if connected == "" then return {} end
|
||||
local adj = minetest.deserialize(connected)
|
||||
local c = {}
|
||||
for _,vect in ipairs(adj) do
|
||||
local pos1=vector.add(pos,vect)
|
||||
local nodename=minetest.get_node(pos1).name
|
||||
if not(pos_in_list(c,pos1)) and nodename~="air" then
|
||||
c[#(c)+1]=pos1
|
||||
for _, vect in ipairs(adj) do
|
||||
local pos1 = vector.add(pos, vect)
|
||||
local nodename = minetest.get_node(pos1).name
|
||||
if not (pos_in_list(c, pos1)) and nodename ~= "air" then
|
||||
c[#(c) + 1] = pos1
|
||||
end
|
||||
end
|
||||
return c
|
||||
end
|
||||
|
||||
local function template_motor_on(pos, node)
|
||||
local dirs = {{x=0,y=1,z=0},{x=0,y=0,z=1},{x=0,y=0,z=-1},{x=1,y=0,z=0},{x=-1,y=0,z=0},{x=0,y=-1,z=0}}
|
||||
local nnodepos = vector.add(pos, dirs[math.floor(node.param2/4)+1])
|
||||
local dirs = { { x = 0, y = 1, z = 0 }, { x = 0, y = 0, z = 1 }, { x = 0, y = 0, z = -1 }, { x = 1, y = 0, z = 0 }, { x = -1, y = 0, z = 0 }, { x = 0, y = -1, z = 0 } }
|
||||
local nnodepos = vector.add(pos, dirs[math.floor(node.param2 / 4) + 1])
|
||||
local dir = minetest.facedir_to_dir(node.param2)
|
||||
local nnode=minetest.get_node(nnodepos)
|
||||
local nnode = minetest.get_node(nnodepos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
if meta:get_int("last_moved") == minetest.get_gametime() then
|
||||
return
|
||||
end
|
||||
local owner = meta:get_string("owner")
|
||||
if nnode.name == "technic:template" then
|
||||
local connected_nodes=get_template_nodes(nnodepos)
|
||||
move_nodes_vect(connected_nodes,dir,pos,owner)
|
||||
local connected_nodes = get_template_nodes(nnodepos)
|
||||
move_nodes_vect(connected_nodes, dir, pos, owner)
|
||||
end
|
||||
minetest.get_meta(vector.add(pos, dir)):set_int("last_moved", minetest.get_gametime())
|
||||
end
|
||||
|
||||
minetest.register_node("technic:template_motor",{
|
||||
minetest.register_node("technic:template_motor", {
|
||||
description = S("Template Motor"),
|
||||
tiles = {"pipeworks_filter_top.png^[transformR90", "technic_lv_cable.png", "technic_lv_cable.png",
|
||||
"technic_lv_cable.png", "technic_lv_cable.png", "technic_lv_cable.png"},
|
||||
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,mesecon=2},
|
||||
tiles = {
|
||||
"pipeworks_filter_top.png^[transformR90", "technic_lv_cable.png", "technic_lv_cable.png",
|
||||
"technic_lv_cable.png", "technic_lv_cable.png", "technic_lv_cable.png"
|
||||
},
|
||||
groups = { snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, mesecon = 2 },
|
||||
paramtype2 = "facedir",
|
||||
mesecons={effector={action_on=template_motor_on}},
|
||||
mesecons = { effector = { action_on = template_motor_on } },
|
||||
after_place_node = function(pos, placer, itemstack)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("owner", placer:get_player_name())
|
||||
@ -873,56 +868,56 @@ minetest.register_node("technic:template_motor",{
|
||||
|
||||
-- Crafts
|
||||
minetest.register_craft({
|
||||
output = 'technic:frame_111111',
|
||||
output = "technic:frame_111111",
|
||||
recipe = {
|
||||
{'', 'default:stick', ''},
|
||||
{'default:stick', 'technic:brass_ingot', 'default:stick'},
|
||||
{'', 'default:stick', ''},
|
||||
{ "", "default:stick", "" },
|
||||
{ "default:stick", "technic:brass_ingot", "default:stick" },
|
||||
{ "", "default:stick", "" },
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:frame_motor',
|
||||
output = "technic:frame_motor",
|
||||
recipe = {
|
||||
{'', 'technic:frame_111111', ''},
|
||||
{'group:mesecon_conductor_craftable', 'technic:motor', 'group:mesecon_conductor_craftable'},
|
||||
{'', 'technic:frame_111111', ''},
|
||||
{ "", "technic:frame_111111", "" },
|
||||
{ "group:mesecon_conductor_craftable", "technic:motor", "group:mesecon_conductor_craftable" },
|
||||
{ "", "technic:frame_111111", "" },
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:template 10',
|
||||
recipe = {
|
||||
{'', 'technic:brass_ingot', ''},
|
||||
{'technic:brass_ingot', 'default:mese_crystal', 'technic:brass_ingot'},
|
||||
{'', 'technic:brass_ingot', ''},
|
||||
{ "", "technic:brass_ingot", "" },
|
||||
{ "technic:brass_ingot", "default:mese_crystal", "technic:brass_ingot" },
|
||||
{ "", "technic:brass_ingot", "" },
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:template_replacer',
|
||||
recipe = {{'technic:template'}}
|
||||
output = "technic:template_replacer",
|
||||
recipe = { { "technic:template" } }
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:template',
|
||||
recipe = {{'technic:template_replacer'}}
|
||||
output = "technic:template",
|
||||
recipe = { { "technic:template_replacer" } }
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:template_motor',
|
||||
output = "technic:template_motor",
|
||||
recipe = {
|
||||
{'', 'technic:template', ''},
|
||||
{'group:mesecon_conductor_craftable', 'technic:motor', 'group:mesecon_conductor_craftable'},
|
||||
{'', 'technic:template', ''},
|
||||
{ "", "technic:template", "" },
|
||||
{ "group:mesecon_conductor_craftable", "technic:motor", "group:mesecon_conductor_craftable" },
|
||||
{ "", "technic:template", "" },
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:template_tool',
|
||||
output = "technic:template_tool",
|
||||
recipe = {
|
||||
{'', 'technic:template', ''},
|
||||
{'default:mese_crystal', 'default:stick', 'default:mese_crystal'},
|
||||
{'', 'default:stick', ''},
|
||||
{ "", "technic:template", "" },
|
||||
{ "default:mese_crystal", "default:stick", "default:mese_crystal" },
|
||||
{ "", "default:stick", "" },
|
||||
}
|
||||
})
|
||||
|
@ -1,16 +1,15 @@
|
||||
|
||||
local S = technic.getter
|
||||
|
||||
local function inject_items (pos)
|
||||
local meta=minetest.get_meta(pos)
|
||||
local function inject_items(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local inv = meta:get_inventory()
|
||||
local mode=meta:get_string("mode")
|
||||
if mode=="single items" then
|
||||
local i=0
|
||||
for _,stack in ipairs(inv:get_list("main")) do
|
||||
i=i+1
|
||||
local mode = meta:get_string("mode")
|
||||
if mode == "single items" then
|
||||
local i = 0
|
||||
for _, stack in ipairs(inv:get_list("main")) do
|
||||
i = i + 1
|
||||
if stack then
|
||||
local item0=stack:to_table()
|
||||
local item0 = stack:to_table()
|
||||
if item0 then
|
||||
item0["count"] = "1"
|
||||
technic.tube_inject_item(pos, pos, vector.new(0, -1, 0), item0)
|
||||
@ -21,12 +20,12 @@ local function inject_items (pos)
|
||||
end
|
||||
end
|
||||
end
|
||||
if mode=="whole stacks" then
|
||||
local i=0
|
||||
for _,stack in ipairs(inv:get_list("main")) do
|
||||
i=i+1
|
||||
if mode == "whole stacks" then
|
||||
local i = 0
|
||||
for _, stack in ipairs(inv:get_list("main")) do
|
||||
i = i + 1
|
||||
if stack then
|
||||
local item0=stack:to_table()
|
||||
local item0 = stack:to_table()
|
||||
if item0 then
|
||||
technic.tube_inject_item(pos, pos, vector.new(0, -1, 0), item0)
|
||||
stack:clear()
|
||||
@ -36,15 +35,14 @@ local function inject_items (pos)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:injector 1',
|
||||
recipe = {
|
||||
{'', 'technic:control_logic_unit',''},
|
||||
{'', 'default:chest',''},
|
||||
{'', 'pipeworks:tube_1',''},
|
||||
{ "", "technic:control_logic_unit", "" },
|
||||
{ "", "default:chest", "" },
|
||||
{ "", "pipeworks:tube_1", "" },
|
||||
}
|
||||
})
|
||||
|
||||
@ -64,28 +62,30 @@ end
|
||||
|
||||
minetest.register_node("technic:injector", {
|
||||
description = S("Self-Contained Injector"),
|
||||
tiles = {"technic_injector_top.png", "technic_injector_bottom.png", "technic_injector_side.png",
|
||||
"technic_injector_side.png", "technic_injector_side.png", "technic_injector_side.png"},
|
||||
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, tubedevice=1, tubedevice_receiver=1},
|
||||
tiles = {
|
||||
"technic_injector_top.png", "technic_injector_bottom.png", "technic_injector_side.png",
|
||||
"technic_injector_side.png", "technic_injector_side.png", "technic_injector_side.png"
|
||||
},
|
||||
groups = { snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, tubedevice = 1, tubedevice_receiver = 1 },
|
||||
tube = {
|
||||
can_insert = function(pos, node, stack, direction)
|
||||
return minetest.get_meta(pos):get_inventory():room_for_item("main",stack)
|
||||
return minetest.get_meta(pos):get_inventory():room_for_item("main", stack)
|
||||
end,
|
||||
insert_object = function(pos, node, stack, direction)
|
||||
return minetest.get_meta(pos):get_inventory():add_item("main",stack)
|
||||
return minetest.get_meta(pos):get_inventory():add_item("main", stack)
|
||||
end,
|
||||
connect_sides = {left=1, right=1, front=1, back=1, top=1, bottom=1},
|
||||
connect_sides = { left = 1, right = 1, front = 1, back = 1, top = 1, bottom = 1 },
|
||||
},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("infotext", S("Self-Contained Injector"))
|
||||
local inv = meta:get_inventory()
|
||||
inv:set_size("main", 8*4)
|
||||
meta:set_string("mode","single items")
|
||||
inv:set_size("main", 8 * 4)
|
||||
meta:set_string("mode", "single items")
|
||||
set_injector_formspec(meta)
|
||||
end,
|
||||
can_dig = function(pos,player)
|
||||
can_dig = function(pos, player)
|
||||
local meta = minetest.get_meta(pos);
|
||||
local inv = meta:get_inventory()
|
||||
return inv:is_empty("main")
|
||||
@ -104,7 +104,7 @@ minetest.register_node("technic:injector", {
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"technic:injector"},
|
||||
nodenames = { "technic:injector" },
|
||||
interval = 1,
|
||||
chance = 1,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
|
@ -7,13 +7,13 @@ local S = technic.getter
|
||||
minetest.register_craft({
|
||||
output = "technic:power_monitor",
|
||||
recipe = {
|
||||
{"", "", ""},
|
||||
{"", "technic:machine_casing", "default:copper_ingot"},
|
||||
{"technic:lv_cable", "technic:lv_cable", "technic:lv_cable"}
|
||||
{ "", "", "" },
|
||||
{ "", "technic:machine_casing", "default:copper_ingot" },
|
||||
{ "technic:lv_cable", "technic:lv_cable", "technic:lv_cable" }
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_node("technic:power_monitor",{
|
||||
minetest.register_node("technic:power_monitor", {
|
||||
description = S("Power Monitor"),
|
||||
tiles = {
|
||||
"technic_power_monitor_sides.png",
|
||||
@ -24,8 +24,8 @@ minetest.register_node("technic:power_monitor",{
|
||||
"technic_power_monitor_front.png"
|
||||
},
|
||||
paramtype2 = "facedir",
|
||||
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_all_tiers=1, technic_machine=1},
|
||||
connect_sides = {"bottom", "back"},
|
||||
groups = { snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, technic_all_tiers = 1, technic_machine = 1 },
|
||||
connect_sides = { "bottom", "back" },
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
@ -34,7 +34,7 @@ minetest.register_node("technic:power_monitor",{
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"technic:power_monitor"},
|
||||
nodenames = { "technic:power_monitor" },
|
||||
label = "Power Monitor",
|
||||
interval = 1,
|
||||
chance = 1,
|
||||
@ -42,10 +42,10 @@ minetest.register_abm({
|
||||
local meta = minetest.get_meta(pos)
|
||||
local network_hash = technic.cables[minetest.hash_node_position(pos)]
|
||||
local network = network_hash and minetest.get_position_from_hash(network_hash)
|
||||
local sw_pos = network and {x=network.x,y=network.y+1,z=network.z}
|
||||
local sw_pos = network and { x = network.x, y = network.y + 1, z = network.z }
|
||||
local timeout = 0
|
||||
for tier in pairs(technic.machines) do
|
||||
timeout = math.max(meta:get_int(tier.."_EU_timeout"),timeout)
|
||||
timeout = math.max(meta:get_int(tier.."_EU_timeout"), timeout)
|
||||
end
|
||||
if timeout > 0 and sw_pos and minetest.get_node(sw_pos).name == "technic:switching_station" then
|
||||
local sw_meta = minetest.get_meta(sw_pos)
|
||||
@ -55,7 +55,7 @@ minetest.register_abm({
|
||||
S("Power Monitor. Supply: @1 Demand: @2",
|
||||
technic.pretty_num(supply), technic.pretty_num(demand)))
|
||||
else
|
||||
meta:set_string("infotext",S("Power Monitor Has No Network"))
|
||||
meta:set_string("infotext", S("Power Monitor Has No Network"))
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
local S = technic.getter
|
||||
|
||||
function technic.register_alloy_furnace(data)
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
local S = technic.getter
|
||||
|
||||
technic.register_recipe_type("alloy", {
|
||||
@ -12,24 +11,24 @@ function technic.register_alloy_recipe(data)
|
||||
end
|
||||
|
||||
local recipes = {
|
||||
{"technic:copper_dust 3", "technic:tin_dust", "technic:bronze_dust 4"},
|
||||
{"default:copper_ingot 3", "moreores:tin_ingot", "default:bronze_ingot 4"},
|
||||
{"technic:wrought_iron_dust", "technic:coal_dust", "technic:carbon_steel_dust", 3},
|
||||
{"technic:wrought_iron_ingot", "technic:coal_dust", "technic:carbon_steel_ingot", 3},
|
||||
{"technic:carbon_steel_dust", "technic:coal_dust", "technic:cast_iron_dust", 3},
|
||||
{"technic:carbon_steel_ingot", "technic:coal_dust", "technic:cast_iron_ingot", 3},
|
||||
{"technic:carbon_steel_dust 3", "technic:chromium_dust", "technic:stainless_steel_dust 4"},
|
||||
{"technic:carbon_steel_ingot 3", "technic:chromium_ingot", "technic:stainless_steel_ingot 4"},
|
||||
{"technic:copper_dust 2", "technic:zinc_dust", "technic:brass_dust 3"},
|
||||
{"default:copper_ingot 2", "technic:zinc_ingot", "technic:brass_ingot 3"},
|
||||
{"default:sand 2", "technic:coal_dust 2", "technic:silicon_wafer"},
|
||||
{"technic:silicon_wafer", "technic:gold_dust", "technic:doped_silicon_wafer"},
|
||||
{ "technic:copper_dust 3", "technic:tin_dust", "technic:bronze_dust 4" },
|
||||
{ "default:copper_ingot 3", "moreores:tin_ingot", "default:bronze_ingot 4" },
|
||||
{ "technic:wrought_iron_dust", "technic:coal_dust", "technic:carbon_steel_dust", 3 },
|
||||
{ "technic:wrought_iron_ingot", "technic:coal_dust", "technic:carbon_steel_ingot", 3 },
|
||||
{ "technic:carbon_steel_dust", "technic:coal_dust", "technic:cast_iron_dust", 3 },
|
||||
{ "technic:carbon_steel_ingot", "technic:coal_dust", "technic:cast_iron_ingot", 3 },
|
||||
{ "technic:carbon_steel_dust 3", "technic:chromium_dust", "technic:stainless_steel_dust 4" },
|
||||
{ "technic:carbon_steel_ingot 3", "technic:chromium_ingot", "technic:stainless_steel_ingot 4" },
|
||||
{ "technic:copper_dust 2", "technic:zinc_dust", "technic:brass_dust 3" },
|
||||
{ "default:copper_ingot 2", "technic:zinc_ingot", "technic:brass_ingot 3" },
|
||||
{ "default:sand 2", "technic:coal_dust 2", "technic:silicon_wafer" },
|
||||
{ "technic:silicon_wafer", "technic:gold_dust", "technic:doped_silicon_wafer" },
|
||||
-- from https://en.wikipedia.org/wiki/Carbon_black
|
||||
-- The highest volume use of carbon black is as a reinforcing filler in rubber products, especially tires.
|
||||
-- "[Compounding a] pure gum vulcanizate … with 50% of its weight of carbon black improves its tensile strength and wear resistance …"
|
||||
{"technic:raw_latex 4", "technic:coal_dust 2", "technic:rubber 6", 2},
|
||||
{ "technic:raw_latex 4", "technic:coal_dust 2", "technic:rubber 6", 2 },
|
||||
}
|
||||
|
||||
for _, data in pairs(recipes) do
|
||||
technic.register_alloy_recipe({input = {data[1], data[2]}, output = data[3], time = data[4]})
|
||||
technic.register_alloy_recipe({ input = { data[1], data[2] }, output = data[3], time = data[4] })
|
||||
end
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
local S = technic.getter
|
||||
|
||||
technic.register_power_tool("technic:battery", 10000)
|
||||
@ -7,11 +6,11 @@ technic.register_power_tool("technic:green_energy_crystal", 150000)
|
||||
technic.register_power_tool("technic:blue_energy_crystal", 450000)
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:battery',
|
||||
output = "technic:battery",
|
||||
recipe = {
|
||||
{'group:wood', 'default:copper_ingot', 'group:wood'},
|
||||
{'group:wood', 'moreores:tin_ingot', 'group:wood'},
|
||||
{'group:wood', 'default:copper_ingot', 'group:wood'},
|
||||
{ "group:wood", "default:copper_ingot", "group:wood" },
|
||||
{ "group:wood", "moreores:tin_ingot", "group:wood" },
|
||||
{ "group:wood", "default:copper_ingot", "group:wood" },
|
||||
}
|
||||
})
|
||||
|
||||
@ -24,7 +23,7 @@ minetest.register_tool("technic:battery", {
|
||||
charge = 0,
|
||||
max_drop_level = 0,
|
||||
groupcaps = {
|
||||
fleshy = {times={}, uses=10000, maxlevel=0}
|
||||
fleshy = { times = {}, uses = 10000, maxlevel = 0 }
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -54,7 +53,7 @@ local tube = {
|
||||
return inv:room_for_item("dst", stack)
|
||||
end
|
||||
end,
|
||||
connect_sides = {left=1, right=1, back=1, top=1, bottom=1},
|
||||
connect_sides = { left = 1, right = 1, back = 1, top = 1, bottom = 1 },
|
||||
}
|
||||
|
||||
function technic.register_battery_box(data)
|
||||
@ -139,7 +138,7 @@ function technic.register_battery_box(data)
|
||||
charge_count = math.max(charge_count, 0)
|
||||
local last_count = meta:get_float("last_side_shown")
|
||||
if charge_count ~= last_count then
|
||||
technic.swap_node(pos,"technic:"..ltier.."_battery_box"..charge_count)
|
||||
technic.swap_node(pos, "technic:"..ltier.."_battery_box"..charge_count)
|
||||
meta:set_float("last_side_shown", charge_count)
|
||||
end
|
||||
|
||||
@ -147,8 +146,8 @@ function technic.register_battery_box(data)
|
||||
meta:set_string("formspec",
|
||||
formspec..
|
||||
"image[1,1;1,2;technic_power_meter_bg.png"
|
||||
.."^[lowpart:"..charge_percent
|
||||
..":technic_power_meter_fg.png]")
|
||||
.. "^[lowpart:"..charge_percent
|
||||
.. ":technic_power_meter_fg.png]")
|
||||
|
||||
local infotext = S("@1 Battery Box: @2/@3", tier,
|
||||
technic.pretty_num(current_charge), technic.pretty_num(max_charge))
|
||||
@ -159,8 +158,13 @@ function technic.register_battery_box(data)
|
||||
end
|
||||
|
||||
for i = 0, 8 do
|
||||
local groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
|
||||
technic_machine=1, ["technic_"..ltier]=1}
|
||||
local groups = {
|
||||
snappy = 2,
|
||||
choppy = 2,
|
||||
oddly_breakable_by_hand = 2,
|
||||
technic_machine = 1,
|
||||
["technic_"..ltier] = 1
|
||||
}
|
||||
if i ~= 0 then
|
||||
groups.not_in_creative_inventory = 1
|
||||
end
|
||||
@ -172,14 +176,16 @@ function technic.register_battery_box(data)
|
||||
|
||||
minetest.register_node("technic:"..ltier.."_battery_box"..i, {
|
||||
description = S("%s Battery Box"):format(tier),
|
||||
tiles = {"technic_"..ltier.."_battery_box_top.png",
|
||||
tiles = {
|
||||
"technic_"..ltier.."_battery_box_top.png",
|
||||
"technic_"..ltier.."_battery_box_bottom.png",
|
||||
"technic_"..ltier.."_battery_box_side.png^technic_power_meter"..i..".png",
|
||||
"technic_"..ltier.."_battery_box_side.png^technic_power_meter"..i..".png",
|
||||
"technic_"..ltier.."_battery_box_side.png^technic_power_meter"..i..".png",
|
||||
"technic_"..ltier.."_battery_box_side.png^technic_power_meter"..i..".png"},
|
||||
"technic_"..ltier.."_battery_box_side.png^technic_power_meter"..i..".png"
|
||||
},
|
||||
groups = groups,
|
||||
connect_sides = {"bottom"},
|
||||
connect_sides = { "bottom" },
|
||||
tube = data.tube and tube or nil,
|
||||
paramtype2 = "facedir",
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
@ -215,8 +221,9 @@ function technic.register_battery_box(data)
|
||||
for i = 0, 8 do
|
||||
technic.register_machine(tier, "technic:"..ltier.."_battery_box"..i, technic.battery)
|
||||
end
|
||||
end
|
||||
|
||||
end -- End registration
|
||||
-- End registration
|
||||
|
||||
|
||||
function technic.charge_tools(meta, batt_charge, charge_step)
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
local S = technic.getter
|
||||
|
||||
local cable_tier = {}
|
||||
@ -14,23 +13,24 @@ end
|
||||
local function check_connections(pos)
|
||||
-- Build a table of all machines
|
||||
local machines = {}
|
||||
for tier,list in pairs(technic.machines) do
|
||||
for k,v in pairs(list) do
|
||||
for tier, list in pairs(technic.machines) do
|
||||
for k, v in pairs(list) do
|
||||
machines[k] = v
|
||||
end
|
||||
end
|
||||
local connections = {}
|
||||
local positions = {
|
||||
{x=pos.x+1, y=pos.y, z=pos.z},
|
||||
{x=pos.x-1, y=pos.y, z=pos.z},
|
||||
{x=pos.x, y=pos.y+1, z=pos.z},
|
||||
{x=pos.x, y=pos.y-1, z=pos.z},
|
||||
{x=pos.x, y=pos.y, z=pos.z+1},
|
||||
{x=pos.x, y=pos.y, z=pos.z-1}}
|
||||
for _,connected_pos in pairs(positions) do
|
||||
{ x = pos.x + 1, y = pos.y, z = pos.z },
|
||||
{ x = pos.x - 1, y = pos.y, z = pos.z },
|
||||
{ x = pos.x, y = pos.y + 1, z = pos.z },
|
||||
{ x = pos.x, y = pos.y - 1, z = pos.z },
|
||||
{ x = pos.x, y = pos.y, z = pos.z + 1 },
|
||||
{ x = pos.x, y = pos.y, z = pos.z - 1 }
|
||||
}
|
||||
for _, connected_pos in pairs(positions) do
|
||||
local name = minetest.get_node(connected_pos).name
|
||||
if machines[name] or technic.get_cable_tier(name) then
|
||||
table.insert(connections,connected_pos)
|
||||
table.insert(connections, connected_pos)
|
||||
end
|
||||
end
|
||||
return connections
|
||||
@ -43,7 +43,7 @@ local function clear_networks(pos)
|
||||
local positions = check_connections(pos)
|
||||
if #positions < 1 then return end
|
||||
local dead_end = #positions == 1
|
||||
for _,connected_pos in pairs(positions) do
|
||||
for _, connected_pos in pairs(positions) do
|
||||
local net = technic.cables[minetest.hash_node_position(connected_pos)]
|
||||
if net and technic.networks[net] then
|
||||
if dead_end and placed then
|
||||
@ -64,22 +64,22 @@ local function clear_networks(pos)
|
||||
technic.cables[minetest.hash_node_position(pos)] = network_id
|
||||
pos.visited = 1
|
||||
if technic.is_tier_cable(name, tier) then
|
||||
table.insert(network.all_nodes,pos)
|
||||
table.insert(network.all_nodes, pos)
|
||||
elseif technic.machines[tier][node.name] then
|
||||
meta:set_string(tier.."_network",minetest.pos_to_string(sw_pos))
|
||||
meta:set_string(tier.."_network", minetest.pos_to_string(sw_pos))
|
||||
if technic.machines[tier][node.name] == technic.producer then
|
||||
table.insert(network.PR_nodes,pos)
|
||||
table.insert(network.PR_nodes, pos)
|
||||
elseif technic.machines[tier][node.name] == technic.receiver then
|
||||
table.insert(network.RE_nodes,pos)
|
||||
table.insert(network.RE_nodes, pos)
|
||||
elseif technic.machines[tier][node.name] == technic.producer_receiver then
|
||||
table.insert(network.PR_nodes,pos)
|
||||
table.insert(network.RE_nodes,pos)
|
||||
table.insert(network.PR_nodes, pos)
|
||||
table.insert(network.RE_nodes, pos)
|
||||
elseif technic.machines[tier][node.name] == "SPECIAL" and
|
||||
(pos.x ~= sw_pos.x or pos.y ~= sw_pos.y or pos.z ~= sw_pos.z) and
|
||||
from_below then
|
||||
table.insert(network.SP_nodes,pos)
|
||||
table.insert(network.SP_nodes, pos)
|
||||
elseif technic.machines[tier][node.name] == technic.battery then
|
||||
table.insert(network.BA_nodes,pos)
|
||||
table.insert(network.BA_nodes, pos)
|
||||
end
|
||||
end
|
||||
elseif dead_end and not placed then
|
||||
@ -94,9 +94,9 @@ local function clear_networks(pos)
|
||||
|
||||
-- Search for and remove machine
|
||||
technic.cables[minetest.hash_node_position(pos)] = nil
|
||||
for tblname,table in pairs(network) do
|
||||
for tblname, table in pairs(network) do
|
||||
if tblname ~= "tier" then
|
||||
for machinenum,machine in pairs(table) do
|
||||
for machinenum, machine in pairs(table) do
|
||||
if machine.x == pos.x
|
||||
and machine.y == pos.y
|
||||
and machine.z == pos.z then
|
||||
@ -107,7 +107,7 @@ local function clear_networks(pos)
|
||||
end
|
||||
else
|
||||
-- Not a dead end, so the whole network needs to be recalculated
|
||||
for _,v in pairs(technic.networks[net].all_nodes) do
|
||||
for _, v in pairs(technic.networks[net].all_nodes) do
|
||||
local pos1 = minetest.hash_node_position(v)
|
||||
technic.cables[pos1] = nil
|
||||
end
|
||||
@ -121,22 +121,22 @@ function technic.register_cable(tier, size)
|
||||
local ltier = string.lower(tier)
|
||||
cable_tier["technic:"..ltier.."_cable"] = tier
|
||||
|
||||
local groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2}
|
||||
local groups = { snappy = 2, choppy = 2, oddly_breakable_by_hand = 2 }
|
||||
|
||||
local node_box = {
|
||||
type = "connected",
|
||||
fixed = {-size, -size, -size, size, size, size},
|
||||
connect_top = {-size, -size, -size, size, 0.5, size}, -- y+
|
||||
connect_bottom = {-size, -0.5, -size, size, size, size}, -- y-
|
||||
connect_front = {-size, -size, -0.5, size, size, size}, -- z-
|
||||
connect_back = {-size, -size, size, size, size, 0.5 }, -- z+
|
||||
connect_left = {-0.5, -size, -size, size, size, size}, -- x-
|
||||
connect_right = {-size, -size, -size, 0.5, size, size}, -- x+
|
||||
fixed = { -size, -size, -size, size, size, size },
|
||||
connect_top = { -size, -size, -size, size, 0.5, size }, -- y+
|
||||
connect_bottom = { -size, -0.5, -size, size, size, size }, -- y-
|
||||
connect_front = { -size, -size, -0.5, size, size, size }, -- z-
|
||||
connect_back = { -size, -size, size, size, size, 0.5 }, -- z+
|
||||
connect_left = { -0.5, -size, -size, size, size, size }, -- x-
|
||||
connect_right = { -size, -size, -size, 0.5, size, size }, -- x+
|
||||
}
|
||||
|
||||
minetest.register_node("technic:"..ltier.."_cable", {
|
||||
description = S("%s Cable"):format(tier),
|
||||
tiles = {"technic_"..ltier.."_cable.png"},
|
||||
tiles = { "technic_"..ltier.."_cable.png" },
|
||||
inventory_image = "technic_"..ltier.."_cable_wield.png",
|
||||
wield_image = "technic_"..ltier.."_cable_wield.png",
|
||||
groups = groups,
|
||||
@ -146,8 +146,10 @@ function technic.register_cable(tier, size)
|
||||
sunlight_propagates = true,
|
||||
drawtype = "nodebox",
|
||||
node_box = node_box,
|
||||
connects_to = {"technic:"..ltier.."_cable",
|
||||
"group:technic_"..ltier, "group:technic_all_tiers"},
|
||||
connects_to = {
|
||||
"technic:"..ltier.."_cable",
|
||||
"group:technic_"..ltier, "group:technic_all_tiers"
|
||||
},
|
||||
on_construct = clear_networks,
|
||||
on_destruct = clear_networks,
|
||||
})
|
||||
|
@ -21,8 +21,9 @@ local recipes = {
|
||||
local function uranium_dust(p)
|
||||
return "technic:uranium"..(p == 7 and "" or p).."_dust"
|
||||
end
|
||||
|
||||
for p = 1, 34 do
|
||||
table.insert(recipes, { uranium_dust(p).." 2", uranium_dust(p-1), uranium_dust(p+1) })
|
||||
table.insert(recipes, { uranium_dust(p).." 2", uranium_dust(p - 1), uranium_dust(p + 1) })
|
||||
end
|
||||
|
||||
if minetest.get_modpath("bushes_classic") then
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
local S = technic.getter
|
||||
|
||||
-- handles the machine upgrades every tick
|
||||
@ -93,7 +92,7 @@ function technic.smelt_item(meta, result, speed)
|
||||
end
|
||||
local result
|
||||
local afterfuel
|
||||
result, afterfuel = minetest.get_craft_result({method = "cooking", width = 1, items = inv:get_list("src")})
|
||||
result, afterfuel = minetest.get_craft_result({ method = "cooking", width = 1, items = inv:get_list("src") })
|
||||
|
||||
if result and result.item then
|
||||
meta:set_int("cook_time", 0)
|
||||
@ -207,7 +206,7 @@ function technic.machine_inventory_take(pos, listname, index, stack, player)
|
||||
end
|
||||
|
||||
function technic.machine_inventory_move(pos, from_list, from_index,
|
||||
to_list, to_index, count, player)
|
||||
to_list, to_index, count, player)
|
||||
local stack = minetest.get_meta(pos):get_inventory():get_stack(from_list, from_index)
|
||||
return inv_change(pos, player, count, from_list, to_list, stack)
|
||||
end
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
local S = technic.getter
|
||||
|
||||
function technic.register_compressor(data)
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
local S = technic.getter
|
||||
|
||||
technic.register_recipe_type("compressing", { description = S("Compressing") })
|
||||
@ -9,26 +8,26 @@ function technic.register_compressor_recipe(data)
|
||||
end
|
||||
|
||||
local recipes = {
|
||||
{"default:snowblock", "default:ice"},
|
||||
{"default:sand 2", "default:sandstone"},
|
||||
{"default:desert_sand", "default:desert_stone"},
|
||||
{"technic:mixed_metal_ingot", "technic:composite_plate"},
|
||||
{"default:copper_ingot 5", "technic:copper_plate"},
|
||||
{"technic:coal_dust 4", "technic:graphite"},
|
||||
{"technic:carbon_cloth", "technic:carbon_plate"},
|
||||
{"technic:uranium35_ingot 5", "technic:uranium_fuel"},
|
||||
{ "default:snowblock", "default:ice" },
|
||||
{ "default:sand 2", "default:sandstone" },
|
||||
{ "default:desert_sand", "default:desert_stone" },
|
||||
{ "technic:mixed_metal_ingot", "technic:composite_plate" },
|
||||
{ "default:copper_ingot 5", "technic:copper_plate" },
|
||||
{ "technic:coal_dust 4", "technic:graphite" },
|
||||
{ "technic:carbon_cloth", "technic:carbon_plate" },
|
||||
{ "technic:uranium35_ingot 5", "technic:uranium_fuel" },
|
||||
}
|
||||
|
||||
-- defuse the default sandstone recipe, since we have the compressor to take over in a more realistic manner
|
||||
minetest.register_craft({
|
||||
output = "default:sand 0",
|
||||
recipe = {
|
||||
{'group:sand', 'group:sand'},
|
||||
{'group:sand', 'group:sand'}
|
||||
{ "group:sand", "group:sand" },
|
||||
{ "group:sand", "group:sand" }
|
||||
},
|
||||
})
|
||||
|
||||
for _, data in pairs(recipes) do
|
||||
technic.register_compressor_recipe({input = {data[1]}, output = data[2]})
|
||||
technic.register_compressor_recipe({ input = { data[1] }, output = data[2] })
|
||||
end
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
local S = technic.getter
|
||||
|
||||
function technic.register_electric_furnace(data)
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
local S = technic.getter
|
||||
|
||||
function technic.register_extractor(data)
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
local S = technic.getter
|
||||
|
||||
technic.register_recipe_type("extracting", { description = S("Extracting") })
|
||||
@ -14,46 +13,45 @@ if minetest.get_modpath("dye") then
|
||||
|
||||
-- register recipes with the same crafting ratios as `dye` provides
|
||||
local dye_recipes = {
|
||||
{"technic:coal_dust", "dye:black 2"},
|
||||
{"default:grass_1", "dye:green 1"},
|
||||
{"default:dry_shrub", "dye:brown 1"},
|
||||
{"default:junglegrass", "dye:green 2"},
|
||||
{"default:cactus", "dye:green 4"},
|
||||
{"flowers:geranium", "dye:blue 4"},
|
||||
{"flowers:dandelion_white", "dye:white 4"},
|
||||
{"flowers:dandelion_yellow", "dye:yellow 4"},
|
||||
{"flowers:tulip", "dye:orange 4"},
|
||||
{"flowers:rose", "dye:red 4"},
|
||||
{"flowers:viola", "dye:violet 4"},
|
||||
{"bushes:blackberry", unifieddyes and "unifieddyes:magenta_s50 4" or "dye:violet 4"},
|
||||
{"bushes:blueberry", unifieddyes and "unifieddyes:magenta_s50 4" or "dye:magenta 4"},
|
||||
{ "technic:coal_dust", "dye:black 2" },
|
||||
{ "default:grass_1", "dye:green 1" },
|
||||
{ "default:dry_shrub", "dye:brown 1" },
|
||||
{ "default:junglegrass", "dye:green 2" },
|
||||
{ "default:cactus", "dye:green 4" },
|
||||
{ "flowers:geranium", "dye:blue 4" },
|
||||
{ "flowers:dandelion_white", "dye:white 4" },
|
||||
{ "flowers:dandelion_yellow", "dye:yellow 4" },
|
||||
{ "flowers:tulip", "dye:orange 4" },
|
||||
{ "flowers:rose", "dye:red 4" },
|
||||
{ "flowers:viola", "dye:violet 4" },
|
||||
{ "bushes:blackberry", unifieddyes and "unifieddyes:magenta_s50 4" or "dye:violet 4" },
|
||||
{ "bushes:blueberry", unifieddyes and "unifieddyes:magenta_s50 4" or "dye:magenta 4" },
|
||||
}
|
||||
|
||||
for _, data in ipairs(dye_recipes) do
|
||||
technic.register_extractor_recipe({input = {data[1]}, output = data[2]})
|
||||
technic.register_extractor_recipe({ input = { data[1] }, output = data[2] })
|
||||
end
|
||||
|
||||
-- overwrite the existing crafting recipes
|
||||
local dyes = {"white", "red", "yellow", "blue", "violet", "orange"}
|
||||
local dyes = { "white", "red", "yellow", "blue", "violet", "orange" }
|
||||
for _, color in ipairs(dyes) do
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "dye:"..color.." 1",
|
||||
recipe = {"group:flower,color_"..color},
|
||||
recipe = { "group:flower,color_"..color },
|
||||
})
|
||||
|
||||
end
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "dye:black 1",
|
||||
recipe = {"group:coal"},
|
||||
recipe = { "group:coal" },
|
||||
})
|
||||
|
||||
if unifieddyes then
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "dye:green 1",
|
||||
recipe = {"default:cactus"},
|
||||
recipe = { "default:cactus" },
|
||||
})
|
||||
end
|
||||
end
|
||||
|
@ -11,20 +11,25 @@ local tube = {
|
||||
local inv = meta:get_inventory()
|
||||
return inv:room_for_item("src", stack)
|
||||
end,
|
||||
connect_sides = {left=1, right=1, back=1, top=1, bottom=1},
|
||||
connect_sides = { left = 1, right = 1, back = 1, top = 1, bottom = 1 },
|
||||
}
|
||||
|
||||
function technic.register_generator(data)
|
||||
local tier = data.tier
|
||||
local ltier = string.lower(tier)
|
||||
|
||||
local groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
|
||||
technic_machine=1, ["technic_"..ltier]=1}
|
||||
local groups = {
|
||||
snappy = 2,
|
||||
choppy = 2,
|
||||
oddly_breakable_by_hand = 2,
|
||||
technic_machine = 1,
|
||||
["technic_"..ltier] = 1
|
||||
}
|
||||
if data.tube then
|
||||
groups.tubedevice = 1
|
||||
groups.tubedevice_receiver = 1
|
||||
end
|
||||
local active_groups = {not_in_creative_inventory = 1}
|
||||
local active_groups = { not_in_creative_inventory = 1 }
|
||||
for k, v in pairs(groups) do active_groups[k] = v end
|
||||
|
||||
local generator_formspec =
|
||||
@ -54,9 +59,11 @@ function technic.register_generator(data)
|
||||
local fuellist = inv:get_list("src")
|
||||
local fuel
|
||||
local afterfuel
|
||||
fuel, afterfuel = minetest.get_craft_result(
|
||||
{method = "fuel", width = 1,
|
||||
items = fuellist})
|
||||
fuel, afterfuel = minetest.get_craft_result({
|
||||
method = "fuel",
|
||||
width = 1,
|
||||
items = fuellist
|
||||
})
|
||||
if not fuel or fuel.time == 0 then
|
||||
meta:set_string("infotext", S("%s Out Of Fuel"):format(desc))
|
||||
technic.swap_node(pos, "technic:"..ltier.."_generator")
|
||||
@ -88,12 +95,14 @@ function technic.register_generator(data)
|
||||
|
||||
minetest.register_node("technic:"..ltier.."_generator", {
|
||||
description = desc,
|
||||
tiles = {"technic_"..ltier.."_generator_top.png", "technic_machine_bottom.png",
|
||||
tiles = {
|
||||
"technic_"..ltier.."_generator_top.png", "technic_machine_bottom.png",
|
||||
"technic_"..ltier.."_generator_side.png", "technic_"..ltier.."_generator_side.png",
|
||||
"technic_"..ltier.."_generator_side.png", "technic_"..ltier.."_generator_front.png"},
|
||||
"technic_"..ltier.."_generator_side.png", "technic_"..ltier.."_generator_front.png"
|
||||
},
|
||||
paramtype2 = "facedir",
|
||||
groups = groups,
|
||||
connect_sides = {"bottom", "back", "left", "right"},
|
||||
connect_sides = { "bottom", "back", "left", "right" },
|
||||
legacy_facedir_simple = true,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
tube = data.tube and tube or nil,
|
||||
@ -118,12 +127,14 @@ function technic.register_generator(data)
|
||||
|
||||
minetest.register_node("technic:"..ltier.."_generator_active", {
|
||||
description = desc,
|
||||
tiles = {"technic_"..ltier.."_generator_top.png", "technic_machine_bottom.png",
|
||||
tiles = {
|
||||
"technic_"..ltier.."_generator_top.png", "technic_machine_bottom.png",
|
||||
"technic_"..ltier.."_generator_side.png", "technic_"..ltier.."_generator_side.png",
|
||||
"technic_"..ltier.."_generator_side.png", "technic_"..ltier.."_generator_front_active.png"},
|
||||
"technic_"..ltier.."_generator_side.png", "technic_"..ltier.."_generator_front_active.png"
|
||||
},
|
||||
paramtype2 = "facedir",
|
||||
groups = active_groups,
|
||||
connect_sides = {"bottom"},
|
||||
connect_sides = { "bottom" },
|
||||
legacy_facedir_simple = true,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
tube = data.tube and tube or nil,
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
local S = technic.getter
|
||||
|
||||
function technic.register_grinder(data)
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
local S = technic.getter
|
||||
|
||||
technic.register_recipe_type("grinding", { description = S("Grinding") })
|
||||
@ -10,69 +9,69 @@ end
|
||||
|
||||
local recipes = {
|
||||
-- Dusts
|
||||
{"default:coal_lump", "technic:coal_dust 2"},
|
||||
{"default:copper_lump", "technic:copper_dust 2"},
|
||||
{"default:desert_stone", "default:desert_sand"},
|
||||
{"default:gold_lump", "technic:gold_dust 2"},
|
||||
{"default:iron_lump", "technic:wrought_iron_dust 2"},
|
||||
{"technic:chromium_lump", "technic:chromium_dust 2"},
|
||||
{"technic:uranium_lump", "technic:uranium_dust 2"},
|
||||
{"technic:zinc_lump", "technic:zinc_dust 2"},
|
||||
{"technic:lead_lump", "technic:lead_dust 2"},
|
||||
{"technic:sulfur_lump", "technic:sulfur_dust 2"},
|
||||
{"default:stone", "technic:stone_dust"},
|
||||
{"default:sand", "technic:stone_dust"},
|
||||
{ "default:coal_lump", "technic:coal_dust 2" },
|
||||
{ "default:copper_lump", "technic:copper_dust 2" },
|
||||
{ "default:desert_stone", "default:desert_sand" },
|
||||
{ "default:gold_lump", "technic:gold_dust 2" },
|
||||
{ "default:iron_lump", "technic:wrought_iron_dust 2" },
|
||||
{ "technic:chromium_lump", "technic:chromium_dust 2" },
|
||||
{ "technic:uranium_lump", "technic:uranium_dust 2" },
|
||||
{ "technic:zinc_lump", "technic:zinc_dust 2" },
|
||||
{ "technic:lead_lump", "technic:lead_dust 2" },
|
||||
{ "technic:sulfur_lump", "technic:sulfur_dust 2" },
|
||||
{ "default:stone", "technic:stone_dust" },
|
||||
{ "default:sand", "technic:stone_dust" },
|
||||
|
||||
-- Other
|
||||
{"default:cobble", "default:gravel"},
|
||||
{"default:gravel", "default:sand"},
|
||||
{"default:sandstone", "default:sand 2"}, -- reverse recipe can be found in the compressor
|
||||
{ "default:cobble", "default:gravel" },
|
||||
{ "default:gravel", "default:sand" },
|
||||
{ "default:sandstone", "default:sand 2" }, -- reverse recipe can be found in the compressor
|
||||
}
|
||||
|
||||
-- defuse the sandstone -> 4 sand recipe to avoid infinite sand bugs (also consult the inverse compressor recipe)
|
||||
minetest.register_craft({
|
||||
output = "default:sandstone 0",
|
||||
recipe = {
|
||||
{'default:sandstone'}
|
||||
{ "default:sandstone" }
|
||||
},
|
||||
})
|
||||
|
||||
if minetest.get_modpath("farming") then
|
||||
table.insert(recipes, {"farming:seed_wheat", "farming:flour 1"})
|
||||
table.insert(recipes, { "farming:seed_wheat", "farming:flour 1" })
|
||||
end
|
||||
|
||||
if minetest.get_modpath("moreores") then
|
||||
table.insert(recipes, {"moreores:mithril_lump", "technic:mithril_dust 2"})
|
||||
table.insert(recipes, {"moreores:silver_lump", "technic:silver_dust 2"})
|
||||
table.insert(recipes, {"moreores:tin_lump", "technic:tin_dust 2"})
|
||||
table.insert(recipes, { "moreores:mithril_lump", "technic:mithril_dust 2" })
|
||||
table.insert(recipes, { "moreores:silver_lump", "technic:silver_dust 2" })
|
||||
table.insert(recipes, { "moreores:tin_lump", "technic:tin_dust 2" })
|
||||
end
|
||||
|
||||
if minetest.get_modpath("gloopores") or minetest.get_modpath("glooptest") then
|
||||
table.insert(recipes, {"gloopores:alatro_lump", "technic:alatro_dust 2"})
|
||||
table.insert(recipes, {"gloopores:kalite_lump", "technic:kalite_dust 2"})
|
||||
table.insert(recipes, {"gloopores:arol_lump", "technic:arol_dust 2"})
|
||||
table.insert(recipes, {"gloopores:talinite_lump", "technic:talinite_dust 2"})
|
||||
table.insert(recipes, {"gloopores:akalin_lump", "technic:akalin_dust 2"})
|
||||
table.insert(recipes, { "gloopores:alatro_lump", "technic:alatro_dust 2" })
|
||||
table.insert(recipes, { "gloopores:kalite_lump", "technic:kalite_dust 2" })
|
||||
table.insert(recipes, { "gloopores:arol_lump", "technic:arol_dust 2" })
|
||||
table.insert(recipes, { "gloopores:talinite_lump", "technic:talinite_dust 2" })
|
||||
table.insert(recipes, { "gloopores:akalin_lump", "technic:akalin_dust 2" })
|
||||
end
|
||||
|
||||
if minetest.get_modpath("homedecor") then
|
||||
table.insert(recipes, {"home_decor:brass_ingot", "technic:brass_dust 1"})
|
||||
table.insert(recipes, { "home_decor:brass_ingot", "technic:brass_dust 1" })
|
||||
end
|
||||
|
||||
for _, data in pairs(recipes) do
|
||||
technic.register_grinder_recipe({input = {data[1]}, output = data[2]})
|
||||
technic.register_grinder_recipe({ input = { data[1] }, output = data[2] })
|
||||
end
|
||||
|
||||
-- defuse common grinder unfriendly recipes
|
||||
if minetest.get_modpath("fake_fire") then -- from homedecor_modpack
|
||||
minetest.register_craft({ output='default:cobble 0', recipe={{'default:cobble'}}})
|
||||
minetest.register_craft({ output='default:gravel 0', recipe={{'default:gravel'}}})
|
||||
minetest.register_craft({ output = 'default:cobble 0', recipe = { { "default:cobble" } } })
|
||||
minetest.register_craft({ output = 'default:gravel 0', recipe = { { "default:gravel" } } })
|
||||
end
|
||||
|
||||
-- dusts
|
||||
local function register_dust(name, ingot)
|
||||
local lname = string.lower(name)
|
||||
lname = string.gsub(lname, ' ', '_')
|
||||
lname = string.gsub(lname, ' ', "_")
|
||||
minetest.register_craftitem("technic:"..lname.."_dust", {
|
||||
description = S("%s Dust"):format(S(name)),
|
||||
inventory_image = "technic_"..lname.."_dust.png",
|
||||
@ -83,7 +82,7 @@ local function register_dust(name, ingot)
|
||||
recipe = "technic:"..lname.."_dust",
|
||||
output = ingot,
|
||||
})
|
||||
technic.register_grinder_recipe({ input = {ingot}, output = "technic:"..lname.."_dust 1" })
|
||||
technic.register_grinder_recipe({ input = { ingot }, output = "technic:"..lname.."_dust 1" })
|
||||
end
|
||||
end
|
||||
|
||||
@ -120,25 +119,26 @@ for p = 0, 35 do
|
||||
local ingot = "technic:uranium"..psuffix.."_ingot"
|
||||
local dust = "technic:uranium"..psuffix.."_dust"
|
||||
minetest.register_craftitem(dust, {
|
||||
description = S("%s Dust"):format(string.format(S("%.1f%%-Fissile Uranium"), p/10)),
|
||||
description = S("%s Dust"):format(string.format(S("%.1f%%-Fissile Uranium"), p / 10)),
|
||||
inventory_image = "technic_uranium_dust.png",
|
||||
on_place_on_ground = minetest.craftitem_place_item,
|
||||
groups = {uranium_dust=1, not_in_creative_inventory=nici},
|
||||
groups = { uranium_dust = 1, not_in_creative_inventory = nici },
|
||||
})
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
recipe = dust,
|
||||
output = ingot,
|
||||
})
|
||||
technic.register_grinder_recipe({ input = {ingot}, output = dust })
|
||||
technic.register_grinder_recipe({ input = { ingot }, output = dust })
|
||||
end
|
||||
|
||||
local function uranium_dust(p)
|
||||
return "technic:uranium"..(p == 7 and "" or p).."_dust"
|
||||
end
|
||||
|
||||
for pa = 0, 34 do
|
||||
for pb = pa+1, 35 do
|
||||
local pc = (pa+pb)/2
|
||||
for pb = pa + 1, 35 do
|
||||
local pc = (pa + pb) / 2
|
||||
if pc == math.floor(pc) then
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
|
@ -10,16 +10,16 @@ minetest.register_craftitem(sawdust, {
|
||||
inventory_image = "technic_sawdust.png",
|
||||
})
|
||||
minetest.register_craft({ type = "fuel", recipe = sawdust, burntime = 6 })
|
||||
technic.register_compressor_recipe({ input = {sawdust .. " 4"}, output = "default:wood" })
|
||||
technic.register_compressor_recipe({ input = { sawdust.." 4" }, output = "default:wood" })
|
||||
|
||||
-- tree/wood grindings
|
||||
local function register_tree_grinding(name, tree, wood, extract, grinding_color)
|
||||
local lname = string.lower(name)
|
||||
lname = string.gsub(lname, ' ', '_')
|
||||
lname = string.gsub(lname, ' ', "_")
|
||||
local grindings_name = "technic:"..lname.."_grindings"
|
||||
local inventory_image = "technic_"..lname.."_grindings.png"
|
||||
if grinding_color then
|
||||
inventory_image = inventory_image .. "^[colorize:" .. grinding_color
|
||||
inventory_image = inventory_image.."^[colorize:"..grinding_color
|
||||
end
|
||||
minetest.register_craftitem(grindings_name, {
|
||||
description = S("%s Grinding"):format(S(name)),
|
||||
@ -30,16 +30,16 @@ local function register_tree_grinding(name, tree, wood, extract, grinding_color)
|
||||
recipe = grindings_name,
|
||||
burntime = 8,
|
||||
})
|
||||
technic.register_grinder_recipe({ input = { tree }, output = grindings_name .. " 4" })
|
||||
technic.register_grinder_recipe({ input = { grindings_name }, output = sawdust .. " 4" })
|
||||
technic.register_grinder_recipe({ input = { tree }, output = grindings_name.." 4" })
|
||||
technic.register_grinder_recipe({ input = { grindings_name }, output = sawdust.." 4" })
|
||||
if wood then
|
||||
technic.register_grinder_recipe({ input = { wood }, output = grindings_name })
|
||||
end
|
||||
if extract then
|
||||
technic.register_extractor_recipe({ input = { grindings_name .. " 4" }, output = extract})
|
||||
technic.register_extractor_recipe({ input = { grindings_name.." 4" }, output = extract })
|
||||
technic.register_separating_recipe({
|
||||
input = { grindings_name .. " 4" },
|
||||
output = { sawdust .. " 4", extract }
|
||||
input = { grindings_name.." 4" },
|
||||
output = { sawdust.." 4", extract }
|
||||
})
|
||||
end
|
||||
end
|
||||
@ -48,8 +48,8 @@ local rubber_tree_planks = moretrees and "moretrees:rubber_tree_planks"
|
||||
local default_extract = dye and "dye:brown 2"
|
||||
|
||||
local grinding_recipes = {
|
||||
{"Common Tree", "group:tree", "group:wood", default_extract },
|
||||
{"Rubber Tree", "moretrees:rubber_tree_trunk", rubber_tree_planks, "technic:raw_latex"}
|
||||
{ "Common Tree", "group:tree", "group:wood", default_extract },
|
||||
{ "Rubber Tree", "moretrees:rubber_tree_trunk", rubber_tree_planks, "technic:raw_latex" }
|
||||
}
|
||||
|
||||
for _, data in pairs(grinding_recipes) do
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
local S = technic.getter
|
||||
|
||||
local tube = {
|
||||
@ -12,10 +11,10 @@ local tube = {
|
||||
local inv = meta:get_inventory()
|
||||
return inv:room_for_item("src", stack)
|
||||
end,
|
||||
connect_sides = {left = 1, right = 1, back = 1, top = 1, bottom = 1},
|
||||
connect_sides = { left = 1, right = 1, back = 1, top = 1, bottom = 1 },
|
||||
}
|
||||
|
||||
local connect_default = {"bottom", "back", "left", "right"}
|
||||
local connect_default = { "bottom", "back", "left", "right" }
|
||||
|
||||
local function round(v)
|
||||
return math.floor(v + 0.5)
|
||||
@ -29,17 +28,17 @@ function technic.register_base_machine(data)
|
||||
local tier = data.tier
|
||||
local ltier = string.lower(tier)
|
||||
|
||||
local groups = {cracky = 2, technic_machine = 1, ["technic_"..ltier] = 1}
|
||||
local groups = { cracky = 2, technic_machine = 1, ["technic_"..ltier] = 1 }
|
||||
if data.tube then
|
||||
groups.tubedevice = 1
|
||||
groups.tubedevice_receiver = 1
|
||||
end
|
||||
local active_groups = {not_in_creative_inventory = 1}
|
||||
local active_groups = { not_in_creative_inventory = 1 }
|
||||
for k, v in pairs(groups) do active_groups[k] = v end
|
||||
|
||||
local formspec =
|
||||
"invsize[8,9;]"..
|
||||
"list[current_name;src;"..(4-input_size)..",1;"..input_size..",1;]"..
|
||||
"list[current_name;src;"..(4 - input_size)..",1;"..input_size..",1;]"..
|
||||
"list[current_name;dst;5,1;2,2;]"..
|
||||
"list[current_player;main;0,5;8,4;]"..
|
||||
"label[0,0;"..machine_desc:format(tier).."]"..
|
||||
@ -82,9 +81,9 @@ function technic.register_base_machine(data)
|
||||
technic.handle_machine_pipeworks(pos, tube_upgrade)
|
||||
end
|
||||
|
||||
local powered = eu_input >= machine_demand[EU_upgrade+1]
|
||||
local powered = eu_input >= machine_demand[EU_upgrade + 1]
|
||||
if powered then
|
||||
meta:set_int("src_time", meta:get_int("src_time") + round(data.speed*10))
|
||||
meta:set_int("src_time", meta:get_int("src_time") + round(data.speed * 10))
|
||||
end
|
||||
while true do
|
||||
local result = technic.get_recipe(typename, inv:get_list("src"))
|
||||
@ -95,10 +94,10 @@ function technic.register_base_machine(data)
|
||||
meta:set_int("src_time", 0)
|
||||
return
|
||||
end
|
||||
meta:set_int(tier.."_EU_demand", machine_demand[EU_upgrade+1])
|
||||
meta:set_int(tier.."_EU_demand", machine_demand[EU_upgrade + 1])
|
||||
technic.swap_node(pos, machine_node.."_active")
|
||||
meta:set_string("infotext", S("%s Active"):format(machine_desc_tier))
|
||||
if meta:get_int("src_time") < round(result.time*10) then
|
||||
if meta:get_int("src_time") < round(result.time * 10) then
|
||||
if not powered then
|
||||
technic.swap_node(pos, machine_node)
|
||||
meta:set_string("infotext", S("%s Unpowered"):format(machine_desc_tier))
|
||||
@ -125,10 +124,10 @@ function technic.register_base_machine(data)
|
||||
technic.swap_node(pos, machine_node)
|
||||
meta:set_string("infotext", S("%s Idle"):format(machine_desc_tier))
|
||||
meta:set_int(tier.."_EU_demand", 0)
|
||||
meta:set_int("src_time", round(result.time*10))
|
||||
meta:set_int("src_time", round(result.time * 10))
|
||||
return
|
||||
end
|
||||
meta:set_int("src_time", meta:get_int("src_time") - round(result.time*10))
|
||||
meta:set_int("src_time", meta:get_int("src_time") - round(result.time * 10))
|
||||
inv:set_list("src", result.new_input)
|
||||
inv:set_list("dst", inv:get_list("dst_tmp"))
|
||||
end
|
||||
@ -136,12 +135,14 @@ function technic.register_base_machine(data)
|
||||
|
||||
minetest.register_node("technic:"..ltier.."_"..machine_name, {
|
||||
description = machine_desc:format(tier),
|
||||
tiles = {"technic_"..ltier.."_"..machine_name.."_top.png",
|
||||
tiles = {
|
||||
"technic_"..ltier.."_"..machine_name.."_top.png",
|
||||
"technic_"..ltier.."_"..machine_name.."_bottom.png",
|
||||
"technic_"..ltier.."_"..machine_name.."_side.png",
|
||||
"technic_"..ltier.."_"..machine_name.."_side.png",
|
||||
"technic_"..ltier.."_"..machine_name.."_side.png",
|
||||
"technic_"..ltier.."_"..machine_name.."_front.png"},
|
||||
"technic_"..ltier.."_"..machine_name.."_front.png"
|
||||
},
|
||||
paramtype2 = "facedir",
|
||||
groups = groups,
|
||||
tube = data.tube and tube or nil,
|
||||
@ -169,14 +170,16 @@ function technic.register_base_machine(data)
|
||||
after_dig_node = technic.machine_after_dig_node
|
||||
})
|
||||
|
||||
minetest.register_node("technic:"..ltier.."_"..machine_name.."_active",{
|
||||
minetest.register_node("technic:"..ltier.."_"..machine_name.."_active", {
|
||||
description = machine_desc:format(tier),
|
||||
tiles = {"technic_"..ltier.."_"..machine_name.."_top.png",
|
||||
tiles = {
|
||||
"technic_"..ltier.."_"..machine_name.."_top.png",
|
||||
"technic_"..ltier.."_"..machine_name.."_bottom.png",
|
||||
"technic_"..ltier.."_"..machine_name.."_side.png",
|
||||
"technic_"..ltier.."_"..machine_name.."_side.png",
|
||||
"technic_"..ltier.."_"..machine_name.."_side.png",
|
||||
"technic_"..ltier.."_"..machine_name.."_front_active.png"},
|
||||
"technic_"..ltier.."_"..machine_name.."_front_active.png"
|
||||
},
|
||||
paramtype2 = "facedir",
|
||||
drop = "technic:"..ltier.."_"..machine_name,
|
||||
groups = active_groups,
|
||||
@ -194,6 +197,7 @@ function technic.register_base_machine(data)
|
||||
|
||||
technic.register_machine(tier, "technic:"..ltier.."_"..machine_name, technic.receiver)
|
||||
technic.register_machine(tier, "technic:"..ltier.."_"..machine_name.."_active", technic.receiver)
|
||||
end
|
||||
|
||||
end -- End registration
|
||||
-- End registration
|
||||
|
||||
|
@ -40,7 +40,7 @@ local function register_recipe(typename, data)
|
||||
data.output = ItemStack(data.output):to_string()
|
||||
end
|
||||
|
||||
local recipe = {time = data.time, input = {}, output = data.output}
|
||||
local recipe = { time = data.time, input = {}, output = data.output }
|
||||
local index = get_recipe_index(data.input)
|
||||
if not index then
|
||||
print("[Technic] ignored registration of garbage recipe!")
|
||||
@ -70,14 +70,17 @@ function technic.get_recipe(typename, items)
|
||||
local result, new_input = minetest.get_craft_result({
|
||||
method = "cooking",
|
||||
width = 1,
|
||||
items = items})
|
||||
items = items
|
||||
})
|
||||
-- Compatibility layer
|
||||
if not result or result.time == 0 then
|
||||
return nil
|
||||
else
|
||||
return {time = result.time,
|
||||
return {
|
||||
time = result.time,
|
||||
new_input = new_input.items,
|
||||
output = result.item}
|
||||
output = result.item
|
||||
}
|
||||
end
|
||||
end
|
||||
local index = get_recipe_index(items)
|
||||
@ -96,9 +99,11 @@ function technic.get_recipe(typename, items)
|
||||
new_input[i]:take_item(recipe.input[stack:get_name()])
|
||||
end
|
||||
end
|
||||
return {time = recipe.time,
|
||||
return {
|
||||
time = recipe.time,
|
||||
new_input = new_input,
|
||||
output = recipe.output}
|
||||
output = recipe.output
|
||||
}
|
||||
else
|
||||
return nil
|
||||
end
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
local S = technic.getter
|
||||
|
||||
function technic.register_solar_array(data)
|
||||
@ -39,11 +38,13 @@ function technic.register_solar_array(data)
|
||||
end
|
||||
|
||||
minetest.register_node("technic:solar_array_"..ltier, {
|
||||
tiles = {"technic_"..ltier.."_solar_array_top.png", "technic_"..ltier.."_solar_array_bottom.png",
|
||||
tiles = {
|
||||
"technic_"..ltier.."_solar_array_top.png", "technic_"..ltier.."_solar_array_bottom.png",
|
||||
"technic_"..ltier.."_solar_array_side.png", "technic_"..ltier.."_solar_array_side.png",
|
||||
"technic_"..ltier.."_solar_array_side.png", "technic_"..ltier.."_solar_array_side.png"},
|
||||
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1, ["technic_"..ltier]=1},
|
||||
connect_sides = {"bottom"},
|
||||
"technic_"..ltier.."_solar_array_side.png", "technic_"..ltier.."_solar_array_side.png"
|
||||
},
|
||||
groups = { snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, technic_machine = 1, ["technic_"..ltier] = 1 },
|
||||
connect_sides = { "bottom" },
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
description = S("Arrayed Solar %s Generator"):format(tier),
|
||||
active = false,
|
||||
@ -51,7 +52,7 @@ function technic.register_solar_array(data)
|
||||
paramtype = "light",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
|
||||
fixed = { -0.5, -0.5, -0.5, 0.5, 0, 0.5 },
|
||||
},
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
|
@ -79,8 +79,8 @@ local run = function(pos, node, run_stage)
|
||||
enabled = enabled and (meta:get_int("mesecon_mode") == 0 or meta:get_int("mesecon_effect") ~= 0)
|
||||
local demand = enabled and meta:get_int("power") or 0
|
||||
|
||||
local pos_up = {x=pos.x, y=pos.y+1, z=pos.z}
|
||||
local pos_down = {x=pos.x, y=pos.y-1, z=pos.z}
|
||||
local pos_up = { x = pos.x, y = pos.y + 1, z = pos.z }
|
||||
local pos_down = { x = pos.x, y = pos.y - 1, z = pos.z }
|
||||
local name_up = minetest.get_node(pos_up).name
|
||||
local name_down = minetest.get_node(pos_down).name
|
||||
|
||||
@ -104,17 +104,23 @@ local run = function(pos, node, run_stage)
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
minetest.register_node("technic:supply_converter", {
|
||||
description = S("Supply Converter"),
|
||||
tiles = {"technic_supply_converter_top.png", "technic_supply_converter_bottom.png",
|
||||
tiles = {
|
||||
"technic_supply_converter_top.png", "technic_supply_converter_bottom.png",
|
||||
"technic_supply_converter_side.png", "technic_supply_converter_side.png",
|
||||
"technic_supply_converter_side.png", "technic_supply_converter_side.png"},
|
||||
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
|
||||
technic_machine=1, technic_all_tiers=1},
|
||||
connect_sides = {"top", "bottom"},
|
||||
"technic_supply_converter_side.png", "technic_supply_converter_side.png"
|
||||
},
|
||||
groups = {
|
||||
snappy = 2,
|
||||
choppy = 2,
|
||||
oddly_breakable_by_hand = 2,
|
||||
technic_machine = 1,
|
||||
technic_all_tiers = 1
|
||||
},
|
||||
connect_sides = { "top", "bottom" },
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
on_receive_fields = supply_converter_receive_fields,
|
||||
on_construct = function(pos)
|
||||
@ -134,9 +140,9 @@ minetest.register_node("technic:supply_converter", {
|
||||
minetest.register_craft({
|
||||
output = 'technic:supply_converter 1',
|
||||
recipe = {
|
||||
{'technic:fine_gold_wire', 'technic:rubber', 'technic:doped_silicon_wafer'},
|
||||
{'technic:mv_transformer', 'technic:machine_casing', 'technic:lv_transformer'},
|
||||
{'technic:mv_cable', 'technic:rubber', 'technic:lv_cable'},
|
||||
{ "technic:fine_gold_wire", "technic:rubber", "technic:doped_silicon_wafer" },
|
||||
{ "technic:mv_transformer", "technic:machine_casing", "technic:lv_transformer" },
|
||||
{ "technic:mv_cable", "technic:rubber", "technic:lv_cable" },
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -42,19 +42,21 @@ local S = technic.getter
|
||||
minetest.register_craft({
|
||||
output = "technic:switching_station",
|
||||
recipe = {
|
||||
{"", "technic:lv_transformer", ""},
|
||||
{"default:copper_ingot", "technic:machine_casing", "default:copper_ingot"},
|
||||
{"technic:lv_cable", "technic:lv_cable", "technic:lv_cable"}
|
||||
{ "", "technic:lv_transformer", "" },
|
||||
{ "default:copper_ingot", "technic:machine_casing", "default:copper_ingot" },
|
||||
{ "technic:lv_cable", "technic:lv_cable", "technic:lv_cable" }
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_node("technic:switching_station",{
|
||||
minetest.register_node("technic:switching_station", {
|
||||
description = S("Switching Station"),
|
||||
tiles = {"technic_water_mill_top_active.png", "technic_water_mill_top_active.png",
|
||||
tiles = {
|
||||
"technic_water_mill_top_active.png", "technic_water_mill_top_active.png",
|
||||
"technic_water_mill_top_active.png", "technic_water_mill_top_active.png"},
|
||||
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_all_tiers=1},
|
||||
connect_sides = {"bottom"},
|
||||
"technic_water_mill_top_active.png", "technic_water_mill_top_active.png",
|
||||
"technic_water_mill_top_active.png", "technic_water_mill_top_active.png"
|
||||
},
|
||||
groups = { snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, technic_all_tiers = 1 },
|
||||
connect_sides = { "bottom" },
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
@ -80,11 +82,13 @@ minetest.register_node("technic:switching_station",{
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("channel", fields.channel)
|
||||
end,
|
||||
mesecons = {effector = {
|
||||
mesecons = {
|
||||
effector = {
|
||||
rules = mesecon.rules.default,
|
||||
}},
|
||||
}
|
||||
},
|
||||
digiline = {
|
||||
receptor = {action = function() end},
|
||||
receptor = { action = function() end },
|
||||
effector = {
|
||||
action = function(pos, node, channel, msg)
|
||||
if msg ~= "GET" and msg ~= "get" then
|
||||
@ -118,7 +122,7 @@ local add_new_cable_node = function(nodes, pos, network_id)
|
||||
return false
|
||||
end
|
||||
end
|
||||
table.insert(nodes, {x=pos.x, y=pos.y, z=pos.z, visited=1})
|
||||
table.insert(nodes, { x = pos.x, y = pos.y, z = pos.z, visited = 1 })
|
||||
return true
|
||||
end
|
||||
|
||||
@ -129,10 +133,10 @@ local check_node_subp = function(PR_nodes, RE_nodes, BA_nodes, SP_nodes, all_nod
|
||||
local name = minetest.get_node(pos).name
|
||||
|
||||
if technic.is_tier_cable(name, tier) then
|
||||
add_new_cable_node(all_nodes, pos,network_id)
|
||||
add_new_cable_node(all_nodes, pos, network_id)
|
||||
elseif machines[name] then
|
||||
--dprint(name.." is a "..machines[name])
|
||||
meta:set_string(tier.."_network",minetest.pos_to_string(sw_pos))
|
||||
meta:set_string(tier.."_network", minetest.pos_to_string(sw_pos))
|
||||
if machines[name] == technic.producer then
|
||||
add_new_cable_node(PR_nodes, pos, network_id)
|
||||
elseif machines[name] == technic.receiver then
|
||||
@ -158,12 +162,13 @@ end
|
||||
local traverse_network = function(PR_nodes, RE_nodes, BA_nodes, SP_nodes, all_nodes, i, machines, tier, sw_pos, network_id)
|
||||
local pos = all_nodes[i]
|
||||
local positions = {
|
||||
{x=pos.x+1, y=pos.y, z=pos.z},
|
||||
{x=pos.x-1, y=pos.y, z=pos.z},
|
||||
{x=pos.x, y=pos.y+1, z=pos.z},
|
||||
{x=pos.x, y=pos.y-1, z=pos.z},
|
||||
{x=pos.x, y=pos.y, z=pos.z+1},
|
||||
{x=pos.x, y=pos.y, z=pos.z-1}}
|
||||
{ x = pos.x + 1, y = pos.y, z = pos.z },
|
||||
{ x = pos.x - 1, y = pos.y, z = pos.z },
|
||||
{ x = pos.x, y = pos.y + 1, z = pos.z },
|
||||
{ x = pos.x, y = pos.y - 1, z = pos.z },
|
||||
{ x = pos.x, y = pos.y, z = pos.z + 1 },
|
||||
{ x = pos.x, y = pos.y, z = pos.z - 1 }
|
||||
}
|
||||
--print("ON")
|
||||
for i, cur_pos in pairs(positions) do
|
||||
check_node_subp(PR_nodes, RE_nodes, BA_nodes, SP_nodes, all_nodes, cur_pos, machines, tier, sw_pos, i == 3, network_id)
|
||||
@ -195,14 +200,20 @@ local get_network = function(sw_pos, pos1, tier)
|
||||
local BA_nodes = {}
|
||||
local RE_nodes = {}
|
||||
local SP_nodes = {}
|
||||
local all_nodes = {pos1}
|
||||
local all_nodes = { pos1 }
|
||||
repeat
|
||||
traverse_network(PR_nodes, RE_nodes, BA_nodes, SP_nodes, all_nodes,
|
||||
i, technic.machines[tier], tier, sw_pos, minetest.hash_node_position(pos1))
|
||||
i = i + 1
|
||||
until all_nodes[i] == nil
|
||||
technic.networks[minetest.hash_node_position(pos1)] = {tier = tier, PR_nodes = PR_nodes,
|
||||
RE_nodes = RE_nodes, BA_nodes = BA_nodes, SP_nodes = SP_nodes, all_nodes = all_nodes}
|
||||
technic.networks[minetest.hash_node_position(pos1)] = {
|
||||
tier = tier,
|
||||
PR_nodes = PR_nodes,
|
||||
RE_nodes = RE_nodes,
|
||||
BA_nodes = BA_nodes,
|
||||
SP_nodes = SP_nodes,
|
||||
all_nodes = all_nodes
|
||||
}
|
||||
return PR_nodes, BA_nodes, RE_nodes
|
||||
end
|
||||
|
||||
@ -210,7 +221,7 @@ end
|
||||
-- The action code for the switching station --
|
||||
-----------------------------------------------
|
||||
minetest.register_abm({
|
||||
nodenames = {"technic:switching_station"},
|
||||
nodenames = { "technic:switching_station" },
|
||||
label = "Switching Station", -- allows the mtt profiler to profile this abm individually
|
||||
interval = 1,
|
||||
chance = 1,
|
||||
@ -230,13 +241,13 @@ minetest.register_abm({
|
||||
local machine_name = S("Switching Station")
|
||||
|
||||
-- Which kind of network are we on:
|
||||
pos1 = {x=pos.x, y=pos.y-1, z=pos.z}
|
||||
pos1 = { x = pos.x, y = pos.y - 1, z = pos.z }
|
||||
|
||||
--Disable if necessary
|
||||
if meta:get_int("active") ~= 1 then
|
||||
minetest.forceload_free_block(pos)
|
||||
minetest.forceload_free_block(pos1)
|
||||
meta:set_string("infotext",S("%s Already Present"):format(machine_name))
|
||||
meta:set_string("infotext", S("%s Already Present"):format(machine_name))
|
||||
return
|
||||
end
|
||||
|
||||
@ -353,8 +364,8 @@ minetest.register_abm({
|
||||
end
|
||||
|
||||
-- Data that will be used by the power monitor
|
||||
meta:set_int("supply",PR_eu_supply)
|
||||
meta:set_int("demand",RE_eu_demand)
|
||||
meta:set_int("supply", PR_eu_supply)
|
||||
meta:set_int("demand", RE_eu_demand)
|
||||
|
||||
-- If the PR supply is enough for the RE demand supply them all
|
||||
if PR_eu_supply >= RE_eu_demand then
|
||||
@ -394,7 +405,7 @@ minetest.register_abm({
|
||||
if BA_eu_supply > 0 then
|
||||
charge_factor = (PR_eu_supply - RE_eu_demand) / BA_eu_supply
|
||||
end
|
||||
for n,pos1 in pairs(BA_nodes) do
|
||||
for n, pos1 in pairs(BA_nodes) do
|
||||
meta1 = minetest.get_meta(pos1)
|
||||
local eu_supply = meta1:get_int(eu_supply_str)
|
||||
meta1:set_int(eu_input_str, math.floor(eu_supply * charge_factor))
|
||||
@ -417,7 +428,6 @@ minetest.register_abm({
|
||||
meta1 = minetest.get_meta(pos1)
|
||||
meta1:set_int(eu_input_str, 0)
|
||||
end
|
||||
|
||||
end,
|
||||
})
|
||||
|
||||
@ -435,8 +445,9 @@ local function switching_station_timeout_count(pos, tier)
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"group:technic_machine"},
|
||||
nodenames = { "group:technic_machine" },
|
||||
interval = 1,
|
||||
chance = 1,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
@ -461,17 +472,17 @@ minetest.register_abm({
|
||||
|
||||
--Re-enable disabled switching station if necessary, similar to the timeout above
|
||||
minetest.register_abm({
|
||||
nodenames = {"technic:switching_station"},
|
||||
nodenames = { "technic:switching_station" },
|
||||
interval = 1,
|
||||
chance = 1,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local pos1 = {x=pos.x,y=pos.y-1,z=pos.z}
|
||||
local pos1 = { x = pos.x, y = pos.y - 1, z = pos.z }
|
||||
local tier = technic.get_cable_tier(minetest.get_node(pos1).name)
|
||||
if not tier then return end
|
||||
if switching_station_timeout_count(pos, tier) then
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_int("active",1)
|
||||
meta:set_int("active", 1)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
@ -303,9 +303,9 @@ end
|
||||
|
||||
local function calculate_object_center(object)
|
||||
if object:is_player() then
|
||||
return {x=0, y=abdomen_offset, z=0}
|
||||
return { x = 0, y = abdomen_offset, z = 0 }
|
||||
end
|
||||
return {x=0, y=0, z=0}
|
||||
return { x = 0, y = 0, z = 0 }
|
||||
end
|
||||
|
||||
local function dmg_object(pos, object, strength)
|
||||
@ -346,7 +346,7 @@ end
|
||||
|
||||
if minetest.setting_getbool("enable_damage") then
|
||||
minetest.register_abm({
|
||||
nodenames = {"group:radioactive"},
|
||||
nodenames = { "group:radioactive" },
|
||||
interval = 1,
|
||||
chance = 1,
|
||||
action = dmg_abm,
|
||||
@ -379,11 +379,12 @@ end
|
||||
-- Radioactive materials that can result from destroying a reactor
|
||||
local griefing = technic.config:get_bool("enable_corium_griefing")
|
||||
|
||||
for _, state in pairs({"flowing", "source"}) do
|
||||
for _, state in pairs({ "flowing", "source" }) do
|
||||
minetest.register_node("technic:corium_"..state, {
|
||||
description = S(state == "source" and "Corium Source" or "Flowing Corium"),
|
||||
drawtype = (state == "source" and "liquid" or "flowingliquid"),
|
||||
[state == "source" and "tiles" or "special_tiles"] = {{
|
||||
[state == "source" and "tiles" or "special_tiles"] = {
|
||||
{
|
||||
name = "technic_corium_"..state.."_animated.png",
|
||||
animation = {
|
||||
type = "vertical_frames",
|
||||
@ -391,7 +392,8 @@ for _, state in pairs({"flowing", "source"}) do
|
||||
aspect_h = 16,
|
||||
length = 3.0,
|
||||
},
|
||||
}},
|
||||
}
|
||||
},
|
||||
paramtype = "light",
|
||||
paramtype2 = (state == "flowing" and "flowingliquid" or nil),
|
||||
light_source = (state == "source" and 8 or 5),
|
||||
@ -407,7 +409,7 @@ for _, state in pairs({"flowing", "source"}) do
|
||||
liquid_viscosity = LAVA_VISC,
|
||||
liquid_renewable = false,
|
||||
damage_per_second = 6,
|
||||
post_effect_color = {a=192, r=80, g=160, b=80},
|
||||
post_effect_color = { a = 192, r = 80, g = 160, b = 80 },
|
||||
groups = {
|
||||
liquid = 2,
|
||||
hot = 3,
|
||||
@ -419,27 +421,25 @@ for _, state in pairs({"flowing", "source"}) do
|
||||
end
|
||||
|
||||
if rawget(_G, "bucket") and bucket.register_liquid then
|
||||
bucket.register_liquid(
|
||||
"technic:corium_source",
|
||||
bucket.register_liquid("technic:corium_source",
|
||||
"technic:corium_flowing",
|
||||
"technic:bucket_corium",
|
||||
"technic_bucket_corium.png",
|
||||
"Corium Bucket"
|
||||
)
|
||||
"Corium Bucket")
|
||||
end
|
||||
|
||||
minetest.register_node("technic:chernobylite_block", {
|
||||
description = S("Chernobylite Block"),
|
||||
tiles = {"technic_chernobylite_block.png"},
|
||||
tiles = { "technic_chernobylite_block.png" },
|
||||
is_ground_content = true,
|
||||
groups = {cracky=1, radioactive=4, level=2},
|
||||
groups = { cracky = 1, radioactive = 4, level = 2 },
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
light_source = 2,
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"group:water"},
|
||||
neighbors = {"technic:corium_source"},
|
||||
nodenames = { "group:water" },
|
||||
neighbors = { "technic:corium_source" },
|
||||
interval = 1,
|
||||
chance = 1,
|
||||
action = function(pos, node)
|
||||
@ -448,36 +448,36 @@ minetest.register_abm({
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"technic:corium_flowing"},
|
||||
neighbors = {"group:water"},
|
||||
nodenames = { "technic:corium_flowing" },
|
||||
neighbors = { "group:water" },
|
||||
interval = 1,
|
||||
chance = 1,
|
||||
action = function(pos, node)
|
||||
minetest.set_node(pos, {name="technic:chernobylite_block"})
|
||||
minetest.set_node(pos, { name = "technic:chernobylite_block" })
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"technic:corium_flowing"},
|
||||
nodenames = { "technic:corium_flowing" },
|
||||
interval = 5,
|
||||
chance = (griefing and 10 or 1),
|
||||
action = function(pos, node)
|
||||
minetest.set_node(pos, {name="technic:chernobylite_block"})
|
||||
minetest.set_node(pos, { name = "technic:chernobylite_block" })
|
||||
end,
|
||||
})
|
||||
|
||||
if griefing then
|
||||
minetest.register_abm({
|
||||
nodenames = {"technic:corium_source", "technic:corium_flowing"},
|
||||
nodenames = { "technic:corium_source", "technic:corium_flowing" },
|
||||
interval = 4,
|
||||
chance = 4,
|
||||
action = function(pos, node)
|
||||
for _, offset in ipairs({
|
||||
vector.new(1,0,0),
|
||||
vector.new(-1,0,0),
|
||||
vector.new(0,0,1),
|
||||
vector.new(0,0,-1),
|
||||
vector.new(0,-1,0),
|
||||
vector.new(1, 0, 0),
|
||||
vector.new(-1, 0, 0),
|
||||
vector.new(0, 0, 1),
|
||||
vector.new(0, 0, -1),
|
||||
vector.new(0, -1, 0),
|
||||
}) do
|
||||
if math.random(8) == 1 then
|
||||
minetest.dig_node(vector.add(pos, offset))
|
||||
|
@ -63,7 +63,7 @@ function technic.register_can(d)
|
||||
minetest.log("action", user:get_player_name().." tried to place "..data.liquid_source_name.." at protected position "..minetest.pos_to_string(pos).." with a "..data.can_name)
|
||||
return
|
||||
end
|
||||
minetest.set_node(pos, {name=data.liquid_source_name})
|
||||
minetest.set_node(pos, { name = data.liquid_source_name })
|
||||
charge = charge - 1
|
||||
itemstack:set_metadata(tostring(charge))
|
||||
set_can_wear(itemstack, charge, data.can_capacity)
|
||||
@ -89,9 +89,9 @@ technic.register_can({
|
||||
minetest.register_craft({
|
||||
output = 'technic:water_can 1',
|
||||
recipe = {
|
||||
{'technic:zinc_ingot', 'technic:rubber','technic:zinc_ingot'},
|
||||
{'technic:carbon_steel_ingot', '', 'technic:carbon_steel_ingot'},
|
||||
{'technic:zinc_ingot', 'technic:carbon_steel_ingot', 'technic:zinc_ingot'},
|
||||
{ "technic:zinc_ingot", "technic:rubber", "technic:zinc_ingot" },
|
||||
{ "technic:carbon_steel_ingot", "", "technic:carbon_steel_ingot" },
|
||||
{ "technic:zinc_ingot", "technic:carbon_steel_ingot", "technic:zinc_ingot" },
|
||||
}
|
||||
})
|
||||
|
||||
@ -107,8 +107,8 @@ technic.register_can({
|
||||
minetest.register_craft({
|
||||
output = 'technic:lava_can 1',
|
||||
recipe = {
|
||||
{'technic:zinc_ingot', 'technic:stainless_steel_ingot','technic:zinc_ingot'},
|
||||
{'technic:stainless_steel_ingot', '', 'technic:stainless_steel_ingot'},
|
||||
{'technic:zinc_ingot', 'technic:stainless_steel_ingot', 'technic:zinc_ingot'},
|
||||
{ "technic:zinc_ingot", "technic:stainless_steel_ingot", "technic:zinc_ingot" },
|
||||
{ "technic:stainless_steel_ingot", "", "technic:stainless_steel_ingot" },
|
||||
{ "technic:zinc_ingot", "technic:stainless_steel_ingot", "technic:zinc_ingot" },
|
||||
}
|
||||
})
|
||||
|
@ -299,8 +299,11 @@ end
|
||||
local function chainsaw_dig(pos, current_charge)
|
||||
-- Start sawing things down
|
||||
local remaining_charge = recursive_dig(pos, current_charge)
|
||||
minetest.sound_play("chainsaw", {pos = pos, gain = 1.0,
|
||||
max_hear_distance = 10})
|
||||
minetest.sound_play("chainsaw", {
|
||||
pos = pos,
|
||||
gain = 1.0,
|
||||
max_hear_distance = 10
|
||||
})
|
||||
|
||||
-- Now drop items for the player
|
||||
for name, stack in pairs(produced) do
|
||||
@ -362,9 +365,9 @@ local trigger = mesecons_button and "mesecons_button:button_off" or "default:mes
|
||||
minetest.register_craft({
|
||||
output = "technic:chainsaw",
|
||||
recipe = {
|
||||
{"technic:stainless_steel_ingot", trigger, "technic:battery"},
|
||||
{"technic:fine_copper_wire", "technic:motor", "technic:battery"},
|
||||
{"", "", "technic:stainless_steel_ingot"},
|
||||
{ "technic:stainless_steel_ingot", trigger, "technic:battery" },
|
||||
{ "technic:fine_copper_wire", "technic:motor", "technic:battery" },
|
||||
{ "", "", "technic:stainless_steel_ingot" },
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -20,9 +20,9 @@ minetest.register_tool("technic:flashlight", {
|
||||
minetest.register_craft({
|
||||
output = "technic:flashlight",
|
||||
recipe = {
|
||||
{"technic:rubber", "default:glass", "technic:rubber"},
|
||||
{"technic:stainless_steel_ingot", "technic:battery", "technic:stainless_steel_ingot"},
|
||||
{"", "technic:battery", ""}
|
||||
{ "technic:rubber", "default:glass", "technic:rubber" },
|
||||
{ "technic:stainless_steel_ingot", "technic:battery", "technic:stainless_steel_ingot" },
|
||||
{ "", "technic:battery", "" }
|
||||
}
|
||||
})
|
||||
|
||||
@ -97,7 +97,7 @@ minetest.register_globalstep(function(dtime)
|
||||
elseif (player_moved or not was_wielding[player_name]) and flashlight_weared then
|
||||
local node = minetest.get_node_or_nil(rounded_pos)
|
||||
if node and node.name == "air" then
|
||||
minetest.set_node(rounded_pos, {name="technic:light"})
|
||||
minetest.set_node(rounded_pos, { name = "technic:light" })
|
||||
end
|
||||
local node = minetest.get_node_or_nil(old_pos)
|
||||
if node and node.name == "technic:light" then
|
||||
@ -111,9 +111,9 @@ end)
|
||||
|
||||
minetest.register_node("technic:light", {
|
||||
drawtype = "glasslike",
|
||||
tiles = {"technic_light.png"},
|
||||
tiles = { "technic_light.png" },
|
||||
paramtype = "light",
|
||||
groups = {not_in_creative_inventory=1},
|
||||
groups = { not_in_creative_inventory = 1 },
|
||||
drop = "",
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
|
@ -1,141 +1,141 @@
|
||||
local max_charge = {50000, 200000, 650000}
|
||||
local power_usage_per_node = {200, 500, 800}
|
||||
local max_charge = { 50000, 200000, 650000 }
|
||||
local power_usage_per_node = { 200, 500, 800 }
|
||||
|
||||
local S = technic.getter
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:mining_drill',
|
||||
output = "technic:mining_drill",
|
||||
recipe = {
|
||||
{'moreores:tin_ingot', 'technic:diamond_drill_head', 'moreores:tin_ingot'},
|
||||
{'technic:stainless_steel_ingot', 'technic:motor', 'technic:stainless_steel_ingot'},
|
||||
{'', 'technic:red_energy_crystal', 'default:copper_ingot'},
|
||||
{ "moreores:tin_ingot", "technic:diamond_drill_head", "moreores:tin_ingot" },
|
||||
{ "technic:stainless_steel_ingot", "technic:motor", "technic:stainless_steel_ingot" },
|
||||
{ "", "technic:red_energy_crystal", "default:copper_ingot" },
|
||||
}
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = 'technic:mining_drill_mk2',
|
||||
output = "technic:mining_drill_mk2",
|
||||
recipe = {
|
||||
{'technic:diamond_drill_head', 'technic:diamond_drill_head', 'technic:diamond_drill_head'},
|
||||
{'technic:stainless_steel_ingot', 'technic:mining_drill', 'technic:stainless_steel_ingot'},
|
||||
{'', 'technic:green_energy_crystal', ''},
|
||||
{ "technic:diamond_drill_head", "technic:diamond_drill_head", "technic:diamond_drill_head" },
|
||||
{ "technic:stainless_steel_ingot", "technic:mining_drill", "technic:stainless_steel_ingot" },
|
||||
{ "", "technic:green_energy_crystal", "" },
|
||||
}
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = 'technic:mining_drill_mk3',
|
||||
output = "technic:mining_drill_mk3",
|
||||
recipe = {
|
||||
{'technic:diamond_drill_head', 'technic:diamond_drill_head', 'technic:diamond_drill_head'},
|
||||
{'technic:stainless_steel_ingot', 'technic:mining_drill_mk2', 'technic:stainless_steel_ingot'},
|
||||
{'', 'technic:blue_energy_crystal', ''},
|
||||
{ "technic:diamond_drill_head", "technic:diamond_drill_head", "technic:diamond_drill_head" },
|
||||
{ "technic:stainless_steel_ingot", "technic:mining_drill_mk2", "technic:stainless_steel_ingot" },
|
||||
{ "", "technic:blue_energy_crystal", "" },
|
||||
}
|
||||
})
|
||||
for i = 1, 4 do
|
||||
minetest.register_craft({
|
||||
output = 'technic:mining_drill_mk3',
|
||||
output = "technic:mining_drill_mk3",
|
||||
recipe = {
|
||||
{'technic:diamond_drill_head', 'technic:diamond_drill_head', 'technic:diamond_drill_head'},
|
||||
{'technic:stainless_steel_ingot', 'technic:mining_drill_mk2_'..i, 'technic:stainless_steel_ingot'},
|
||||
{'', 'technic:blue_energy_crystal', ''},
|
||||
{ "technic:diamond_drill_head", "technic:diamond_drill_head", "technic:diamond_drill_head" },
|
||||
{ "technic:stainless_steel_ingot", "technic:mining_drill_mk2_"..i, "technic:stainless_steel_ingot" },
|
||||
{ "", "technic:blue_energy_crystal", "" },
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
local mining_drill_mode_text = {
|
||||
{S("Single node.")},
|
||||
{S("3 nodes deep.")},
|
||||
{S("3 nodes wide.")},
|
||||
{S("3 nodes tall.")},
|
||||
{S("3x3 nodes.")},
|
||||
{ S("Single node.") },
|
||||
{ S("3 nodes deep.") },
|
||||
{ S("3 nodes wide.") },
|
||||
{ S("3 nodes tall.") },
|
||||
{ S("3x3 nodes.") },
|
||||
}
|
||||
|
||||
local function drill_dig_it0 (pos,player)
|
||||
local function drill_dig_it0(pos, player)
|
||||
if minetest.is_protected(pos, player:get_player_name()) then
|
||||
minetest.record_protection_violation(pos, player:get_player_name())
|
||||
return
|
||||
end
|
||||
local node=minetest.get_node(pos)
|
||||
local node = minetest.get_node(pos)
|
||||
if node.name == "air" or node.name == "ignore" then return end
|
||||
if node.name == "default:lava_source" then return end
|
||||
if node.name == "default:lava_flowing" then return end
|
||||
if node.name == "default:water_source" then minetest.remove_node(pos) return end
|
||||
if node.name == "default:water_flowing" then minetest.remove_node(pos) return end
|
||||
minetest.node_dig(pos,node,player)
|
||||
minetest.node_dig(pos, node, player)
|
||||
end
|
||||
|
||||
local function drill_dig_it1 (player)
|
||||
local dir=player:get_look_dir()
|
||||
if math.abs(dir.x)>math.abs(dir.z) then
|
||||
if dir.x>0 then return 0 end
|
||||
local function drill_dig_it1(player)
|
||||
local dir = player:get_look_dir()
|
||||
if math.abs(dir.x) > math.abs(dir.z) then
|
||||
if dir.x > 0 then return 0 end
|
||||
return 1
|
||||
end
|
||||
if dir.z>0 then return 2 end
|
||||
if dir.z > 0 then return 2 end
|
||||
return 3
|
||||
end
|
||||
|
||||
local function drill_dig_it2 (pos,player)
|
||||
pos.y=pos.y+1
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.z=pos.z+1
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.z=pos.z-2
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.z=pos.z+1
|
||||
pos.y=pos.y-1
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.z=pos.z+1
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.z=pos.z-2
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.z=pos.z+1
|
||||
pos.y=pos.y-1
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.z=pos.z+1
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.z=pos.z-2
|
||||
drill_dig_it0 (pos,player)
|
||||
local function drill_dig_it2(pos, player)
|
||||
pos.y = pos.y + 1
|
||||
drill_dig_it0(pos, player)
|
||||
pos.z = pos.z + 1
|
||||
drill_dig_it0(pos, player)
|
||||
pos.z = pos.z - 2
|
||||
drill_dig_it0(pos, player)
|
||||
pos.z = pos.z + 1
|
||||
pos.y = pos.y - 1
|
||||
drill_dig_it0(pos, player)
|
||||
pos.z = pos.z + 1
|
||||
drill_dig_it0(pos, player)
|
||||
pos.z = pos.z - 2
|
||||
drill_dig_it0(pos, player)
|
||||
pos.z = pos.z + 1
|
||||
pos.y = pos.y - 1
|
||||
drill_dig_it0(pos, player)
|
||||
pos.z = pos.z + 1
|
||||
drill_dig_it0(pos, player)
|
||||
pos.z = pos.z - 2
|
||||
drill_dig_it0(pos, player)
|
||||
end
|
||||
|
||||
local function drill_dig_it3 (pos,player)
|
||||
pos.y=pos.y+1
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.x=pos.x+1
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.x=pos.x-2
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.x=pos.x+1
|
||||
pos.y=pos.y-1
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.x=pos.x+1
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.x=pos.x-2
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.x=pos.x+1
|
||||
pos.y=pos.y-1
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.x=pos.x+1
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.x=pos.x-2
|
||||
drill_dig_it0 (pos,player)
|
||||
local function drill_dig_it3(pos, player)
|
||||
pos.y = pos.y + 1
|
||||
drill_dig_it0(pos, player)
|
||||
pos.x = pos.x + 1
|
||||
drill_dig_it0(pos, player)
|
||||
pos.x = pos.x - 2
|
||||
drill_dig_it0(pos, player)
|
||||
pos.x = pos.x + 1
|
||||
pos.y = pos.y - 1
|
||||
drill_dig_it0(pos, player)
|
||||
pos.x = pos.x + 1
|
||||
drill_dig_it0(pos, player)
|
||||
pos.x = pos.x - 2
|
||||
drill_dig_it0(pos, player)
|
||||
pos.x = pos.x + 1
|
||||
pos.y = pos.y - 1
|
||||
drill_dig_it0(pos, player)
|
||||
pos.x = pos.x + 1
|
||||
drill_dig_it0(pos, player)
|
||||
pos.x = pos.x - 2
|
||||
drill_dig_it0(pos, player)
|
||||
end
|
||||
|
||||
local function drill_dig_it4 (pos,player)
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.x=pos.x+1
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.x=pos.x-2
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.x=pos.x+1
|
||||
pos.z=pos.z+1
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.x=pos.x+1
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.x=pos.x-2
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.x=pos.x+1
|
||||
pos.z=pos.z-2
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.x=pos.x+1
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.x=pos.x-2
|
||||
drill_dig_it0 (pos,player)
|
||||
local function drill_dig_it4(pos, player)
|
||||
drill_dig_it0(pos, player)
|
||||
pos.x = pos.x + 1
|
||||
drill_dig_it0(pos, player)
|
||||
pos.x = pos.x - 2
|
||||
drill_dig_it0(pos, player)
|
||||
pos.x = pos.x + 1
|
||||
pos.z = pos.z + 1
|
||||
drill_dig_it0(pos, player)
|
||||
pos.x = pos.x + 1
|
||||
drill_dig_it0(pos, player)
|
||||
pos.x = pos.x - 2
|
||||
drill_dig_it0(pos, player)
|
||||
pos.x = pos.x + 1
|
||||
pos.z = pos.z - 2
|
||||
drill_dig_it0(pos, player)
|
||||
pos.x = pos.x + 1
|
||||
drill_dig_it0(pos, player)
|
||||
pos.x = pos.x - 2
|
||||
drill_dig_it0(pos, player)
|
||||
end
|
||||
|
||||
local function cost_to_use(drill_type, mode)
|
||||
@ -166,69 +166,69 @@ local function drill_dig_it(pos, player, mode)
|
||||
end
|
||||
if dir == 1 then -- x-
|
||||
drill_dig_it0(pos, player)
|
||||
pos.x=pos.x-1
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.x=pos.x-1
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.x = pos.x - 1
|
||||
drill_dig_it0(pos, player)
|
||||
pos.x = pos.x - 1
|
||||
drill_dig_it0(pos, player)
|
||||
end
|
||||
if dir==2 then -- z+
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.z=pos.z+1
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.z=pos.z+1
|
||||
drill_dig_it0 (pos,player)
|
||||
if dir == 2 then -- z+
|
||||
drill_dig_it0(pos, player)
|
||||
pos.z = pos.z + 1
|
||||
drill_dig_it0(pos, player)
|
||||
pos.z = pos.z + 1
|
||||
drill_dig_it0(pos, player)
|
||||
end
|
||||
if dir==3 then -- z-
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.z=pos.z-1
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.z=pos.z-1
|
||||
drill_dig_it0 (pos,player)
|
||||
if dir == 3 then -- z-
|
||||
drill_dig_it0(pos, player)
|
||||
pos.z = pos.z - 1
|
||||
drill_dig_it0(pos, player)
|
||||
pos.z = pos.z - 1
|
||||
drill_dig_it0(pos, player)
|
||||
end
|
||||
end
|
||||
|
||||
if mode==3 then -- 3 wide
|
||||
dir=drill_dig_it1(player)
|
||||
if dir==0 or dir==1 then -- x
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.z=pos.z+1
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.z=pos.z-2
|
||||
drill_dig_it0 (pos,player)
|
||||
if mode == 3 then -- 3 wide
|
||||
dir = drill_dig_it1(player)
|
||||
if dir == 0 or dir == 1 then -- x
|
||||
drill_dig_it0(pos, player)
|
||||
pos.z = pos.z + 1
|
||||
drill_dig_it0(pos, player)
|
||||
pos.z = pos.z - 2
|
||||
drill_dig_it0(pos, player)
|
||||
end
|
||||
if dir==2 or dir==3 then -- z
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.x=pos.x+1
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.x=pos.x-2
|
||||
drill_dig_it0 (pos,player)
|
||||
if dir == 2 or dir == 3 then -- z
|
||||
drill_dig_it0(pos, player)
|
||||
pos.x = pos.x + 1
|
||||
drill_dig_it0(pos, player)
|
||||
pos.x = pos.x - 2
|
||||
drill_dig_it0(pos, player)
|
||||
end
|
||||
end
|
||||
|
||||
if mode==4 then -- 3 tall, selected in the middle
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.y=pos.y-1
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.y=pos.y-1
|
||||
drill_dig_it0 (pos,player)
|
||||
if mode == 4 then -- 3 tall, selected in the middle
|
||||
drill_dig_it0(pos, player)
|
||||
pos.y = pos.y - 1
|
||||
drill_dig_it0(pos, player)
|
||||
pos.y = pos.y - 1
|
||||
drill_dig_it0(pos, player)
|
||||
end
|
||||
|
||||
if mode==5 then -- 3 x 3
|
||||
local dir=player:get_look_dir()
|
||||
if math.abs(dir.y)<0.5 then
|
||||
dir=drill_dig_it1(player)
|
||||
if dir==0 or dir==1 then -- x
|
||||
drill_dig_it2(pos,player)
|
||||
if mode == 5 then -- 3 x 3
|
||||
local dir = player:get_look_dir()
|
||||
if math.abs(dir.y) < 0.5 then
|
||||
dir = drill_dig_it1(player)
|
||||
if dir == 0 or dir == 1 then -- x
|
||||
drill_dig_it2(pos, player)
|
||||
end
|
||||
if dir==2 or dir==3 then -- z
|
||||
drill_dig_it3(pos,player)
|
||||
if dir == 2 or dir == 3 then -- z
|
||||
drill_dig_it3(pos, player)
|
||||
end
|
||||
else
|
||||
drill_dig_it4(pos,player)
|
||||
drill_dig_it4(pos, player)
|
||||
end
|
||||
end
|
||||
|
||||
minetest.sound_play("mining_drill", {pos = pos, gain = 1.0, max_hear_distance = 10,})
|
||||
minetest.sound_play("mining_drill", { pos = pos, gain = 1.0, max_hear_distance = 10, })
|
||||
end
|
||||
|
||||
local function pos_is_pointable(pos)
|
||||
@ -237,48 +237,48 @@ local function pos_is_pointable(pos)
|
||||
return nodedef and nodedef.pointable
|
||||
end
|
||||
|
||||
local function mining_drill_mk2_setmode(user,itemstack)
|
||||
local player_name=user:get_player_name()
|
||||
local item=itemstack:to_table()
|
||||
local meta=minetest.deserialize(item["metadata"])
|
||||
if meta==nil then
|
||||
meta={}
|
||||
mode=0
|
||||
local function mining_drill_mk2_setmode(user, itemstack)
|
||||
local player_name = user:get_player_name()
|
||||
local item = itemstack:to_table()
|
||||
local meta = minetest.deserialize(item["metadata"])
|
||||
if meta == nil then
|
||||
meta = {}
|
||||
mode = 0
|
||||
end
|
||||
if meta["mode"]==nil then
|
||||
if meta["mode"] == nil then
|
||||
minetest.chat_send_player(player_name, S("Use while sneaking to change Mining Drill Mk%d modes."):format(2))
|
||||
meta["mode"]=0
|
||||
mode=0
|
||||
meta["mode"] = 0
|
||||
mode = 0
|
||||
end
|
||||
mode=(meta["mode"])
|
||||
mode=mode+1
|
||||
if mode>=5 then mode=1 end
|
||||
mode = (meta["mode"])
|
||||
mode = mode + 1
|
||||
if mode >= 5 then mode = 1 end
|
||||
minetest.chat_send_player(player_name, S("Mining Drill Mk%d Mode %d"):format(2, mode)..": "..mining_drill_mode_text[mode][1])
|
||||
itemstack:set_name("technic:mining_drill_mk2_"..mode);
|
||||
meta["mode"]=mode
|
||||
meta["mode"] = mode
|
||||
itemstack:set_metadata(minetest.serialize(meta))
|
||||
return itemstack
|
||||
end
|
||||
|
||||
local function mining_drill_mk3_setmode(user,itemstack)
|
||||
local player_name=user:get_player_name()
|
||||
local item=itemstack:to_table()
|
||||
local meta=minetest.deserialize(item["metadata"])
|
||||
if meta==nil then
|
||||
meta={}
|
||||
mode=0
|
||||
local function mining_drill_mk3_setmode(user, itemstack)
|
||||
local player_name = user:get_player_name()
|
||||
local item = itemstack:to_table()
|
||||
local meta = minetest.deserialize(item["metadata"])
|
||||
if meta == nil then
|
||||
meta = {}
|
||||
mode = 0
|
||||
end
|
||||
if meta["mode"]==nil then
|
||||
if meta["mode"] == nil then
|
||||
minetest.chat_send_player(player_name, S("Use while sneaking to change Mining Drill Mk%d modes."):format(3))
|
||||
meta["mode"]=0
|
||||
mode=0
|
||||
meta["mode"] = 0
|
||||
mode = 0
|
||||
end
|
||||
mode=(meta["mode"])
|
||||
mode=mode+1
|
||||
if mode>=6 then mode=1 end
|
||||
mode = (meta["mode"])
|
||||
mode = mode + 1
|
||||
if mode >= 6 then mode = 1 end
|
||||
minetest.chat_send_player(player_name, S("Mining Drill Mk%d Mode %d"):format(3, mode)..": "..mining_drill_mode_text[mode][1])
|
||||
itemstack:set_name("technic:mining_drill_mk3_"..mode);
|
||||
meta["mode"]=mode
|
||||
meta["mode"] = mode
|
||||
itemstack:set_metadata(minetest.serialize(meta))
|
||||
return itemstack
|
||||
end
|
||||
@ -381,7 +381,7 @@ for i = 1, 4 do
|
||||
wield_image = "technic_mining_drill_mk2.png",
|
||||
wear_represents = "technic_RE_charge",
|
||||
on_refill = technic.refill_RE_charge,
|
||||
groups = {not_in_creative_inventory=1},
|
||||
groups = { not_in_creative_inventory = 1 },
|
||||
on_use = function(itemstack, user, pointed_thing)
|
||||
mining_drill_mk2_handler(itemstack, user, pointed_thing)
|
||||
return itemstack
|
||||
@ -395,14 +395,14 @@ minetest.register_tool("technic:mining_drill_mk3", {
|
||||
wear_represents = "technic_RE_charge",
|
||||
on_refill = technic.refill_RE_charge,
|
||||
on_use = function(itemstack, user, pointed_thing)
|
||||
mining_drill_mk3_handler(itemstack,user,pointed_thing)
|
||||
mining_drill_mk3_handler(itemstack, user, pointed_thing)
|
||||
return itemstack
|
||||
end,
|
||||
})
|
||||
|
||||
technic.register_power_tool("technic:mining_drill_mk3", max_charge[3])
|
||||
|
||||
for i=1,5,1 do
|
||||
for i = 1, 5, 1 do
|
||||
technic.register_power_tool("technic:mining_drill_mk3_"..i, max_charge[3])
|
||||
minetest.register_tool("technic:mining_drill_mk3_"..i, {
|
||||
description = S("Mining Drill Mk%d Mode %d"):format(3, i),
|
||||
@ -410,9 +410,9 @@ for i=1,5,1 do
|
||||
wield_image = "technic_mining_drill_mk3.png",
|
||||
wear_represents = "technic_RE_charge",
|
||||
on_refill = technic.refill_RE_charge,
|
||||
groups = {not_in_creative_inventory=1},
|
||||
groups = { not_in_creative_inventory = 1 },
|
||||
on_use = function(itemstack, user, pointed_thing)
|
||||
mining_drill_mk3_handler(itemstack,user,pointed_thing)
|
||||
mining_drill_mk3_handler(itemstack, user, pointed_thing)
|
||||
return itemstack
|
||||
end,
|
||||
})
|
||||
|
@ -1,34 +1,34 @@
|
||||
local mining_lasers_list = {
|
||||
-- {<num>, <range of the laser shots>, <max_charge>, <charge_per_shot>},
|
||||
{"1", 7, 50000, 1000},
|
||||
{"2", 14, 200000, 2000},
|
||||
{"3", 21, 650000, 3000},
|
||||
-- {<num>, <range of the laser shots>, <max_charge>, <charge_per_shot>},
|
||||
{ "1", 7, 50000, 1000 },
|
||||
{ "2", 14, 200000, 2000 },
|
||||
{ "3", 21, 650000, 3000 },
|
||||
}
|
||||
|
||||
local S = technic.getter
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:laser_mk1',
|
||||
output = "technic:laser_mk1",
|
||||
recipe = {
|
||||
{'default:diamond', 'technic:brass_ingot', 'default:obsidian_glass'},
|
||||
{'', 'technic:brass_ingot', 'technic:red_energy_crystal'},
|
||||
{'', '', 'default:copper_ingot'},
|
||||
{ "default:diamond", "technic:brass_ingot", "default:obsidian_glass" },
|
||||
{ "", "technic:brass_ingot", "technic:red_energy_crystal" },
|
||||
{ "", "", "default:copper_ingot" },
|
||||
}
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = 'technic:laser_mk2',
|
||||
output = "technic:laser_mk2",
|
||||
recipe = {
|
||||
{'default:diamond', 'technic:carbon_steel_ingot', 'technic:laser_mk1'},
|
||||
{'', 'technic:carbon_steel_ingot', 'technic:green_energy_crystal'},
|
||||
{'', '', 'default:copper_ingot'},
|
||||
{ "default:diamond", "technic:carbon_steel_ingot", "technic:laser_mk1" },
|
||||
{ "", "technic:carbon_steel_ingot", "technic:green_energy_crystal" },
|
||||
{ "", "", "default:copper_ingot" },
|
||||
}
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = 'technic:laser_mk3',
|
||||
output = "technic:laser_mk3",
|
||||
recipe = {
|
||||
{'default:diamond', 'technic:carbon_steel_ingot', 'technic:laser_mk2'},
|
||||
{'', 'technic:carbon_steel_ingot', 'technic:blue_energy_crystal'},
|
||||
{'', '', 'default:copper_ingot'},
|
||||
{ "default:diamond", "technic:carbon_steel_ingot", "technic:laser_mk2" },
|
||||
{ "", "technic:carbon_steel_ingot", "technic:blue_energy_crystal" },
|
||||
{ "", "", "default:copper_ingot" },
|
||||
}
|
||||
})
|
||||
|
||||
@ -38,11 +38,11 @@ local function laser_node(pos, node, player)
|
||||
minetest.remove_node(pos)
|
||||
minetest.add_particle({
|
||||
pos = pos,
|
||||
velocity = {x=0, y=2, z=0},
|
||||
acceleration = {x=0, y=-1, z=0},
|
||||
velocity = { x = 0, y = 2, z = 0 },
|
||||
acceleration = { x = 0, y = -1, z = 0 },
|
||||
expirationtime = 1.5,
|
||||
size = 6 + math.random() * 2,
|
||||
texture = "smoke_puff.png^[transform" .. math.random(0, 7),
|
||||
texture = "smoke_puff.png^[transform"..math.random(0, 7),
|
||||
})
|
||||
return
|
||||
end
|
||||
@ -68,9 +68,9 @@ local function laser_shoot(player, range, particle_texture, sound)
|
||||
acceleration = vector.multiply(dir, 50),
|
||||
expirationtime = range / 11,
|
||||
size = 1,
|
||||
texture = particle_texture .. "^[transform" .. math.random(0, 7),
|
||||
texture = particle_texture.."^[transform"..math.random(0, 7),
|
||||
})
|
||||
minetest.sound_play(sound, {pos = player_pos, max_hear_distance = range})
|
||||
minetest.sound_play(sound, { pos = player_pos, max_hear_distance = range })
|
||||
for pos in technic.trace_node_ray_fat(start_pos, dir, range) do
|
||||
if minetest.is_protected(pos, player_name) then
|
||||
minetest.record_protection_violation(pos, player_name)
|
||||
|
@ -35,13 +35,13 @@ minetest.register_tool("technic:prospector", {
|
||||
end
|
||||
local start_pos = pointed_thing.under
|
||||
local forward = minetest.facedir_to_dir(minetest.dir_to_facedir(user:get_look_dir(), true))
|
||||
local right = forward.x ~= 0 and { x=0, y=1, z=0 } or (forward.y ~= 0 and { x=0, y=0, z=1 } or { x=1, y=0, z=0 })
|
||||
local up = forward.x ~= 0 and { x=0, y=0, z=1 } or (forward.y ~= 0 and { x=1, y=0, z=0 } or { x=0, y=1, z=0 })
|
||||
local base_pos = vector.add(start_pos, vector.multiply(vector.add(right, up), - toolmeta.look_radius))
|
||||
local right = forward.x ~= 0 and { x = 0, y = 1, z = 0 } or (forward.y ~= 0 and { x = 0, y = 0, z = 1 } or { x = 1, y = 0, z = 0 })
|
||||
local up = forward.x ~= 0 and { x = 0, y = 0, z = 1 } or (forward.y ~= 0 and { x = 1, y = 0, z = 0 } or { x = 0, y = 1, z = 0 })
|
||||
local base_pos = vector.add(start_pos, vector.multiply(vector.add(right, up), -toolmeta.look_radius))
|
||||
local found = false
|
||||
for f = 0, toolmeta.look_depth-1 do
|
||||
for r = 0, look_diameter-1 do
|
||||
for u = 0, look_diameter-1 do
|
||||
for f = 0, toolmeta.look_depth - 1 do
|
||||
for r = 0, look_diameter - 1 do
|
||||
for u = 0, look_diameter - 1 do
|
||||
if minetest.get_node(vector.add(vector.add(vector.add(base_pos, vector.multiply(forward, f)), vector.multiply(right, r)), vector.multiply(up, u))).name == toolmeta.target then found = true end
|
||||
end
|
||||
end
|
||||
@ -121,8 +121,8 @@ end)
|
||||
minetest.register_craft({
|
||||
output = "technic:prospector",
|
||||
recipe = {
|
||||
{"moreores:pick_silver", "moreores:mithril_block", "pipeworks:teleport_tube_1"},
|
||||
{"technic:brass_ingot", "technic:control_logic_unit", "technic:brass_ingot"},
|
||||
{"", "technic:blue_energy_crystal", ""},
|
||||
{ "moreores:pick_silver", "moreores:mithril_block", "pipeworks:teleport_tube_1" },
|
||||
{ "technic:brass_ingot", "technic:control_logic_unit", "technic:brass_ingot" },
|
||||
{ "", "technic:blue_energy_crystal", "" },
|
||||
}
|
||||
})
|
||||
|
@ -46,7 +46,7 @@ local function screwdriver_handler(itemstack, user, pointed_thing, mode)
|
||||
return
|
||||
end
|
||||
|
||||
minetest.sound_play("technic_sonic_screwdriver", {pos = pos, gain = 0.3, max_hear_distance = 10})
|
||||
minetest.sound_play("technic_sonic_screwdriver", { pos = pos, gain = 0.3, max_hear_distance = 10 })
|
||||
|
||||
-- Set param2
|
||||
local rotationPart = node.param2 % 32 -- get first 4 bits
|
||||
@ -90,9 +90,9 @@ minetest.register_tool("technic:sonic_screwdriver", {
|
||||
minetest.register_craft({
|
||||
output = "technic:sonic_screwdriver",
|
||||
recipe = {
|
||||
{"", "default:diamond", ""},
|
||||
{"mesecons_materials:fiber", "technic:battery", "mesecons_materials:fiber"},
|
||||
{"mesecons_materials:fiber", "moreores:mithril_ingot", "mesecons_materials:fiber"}
|
||||
{ "", "default:diamond", "" },
|
||||
{ "mesecons_materials:fiber", "technic:battery", "mesecons_materials:fiber" },
|
||||
{ "mesecons_materials:fiber", "moreores:mithril_ingot", "mesecons_materials:fiber" }
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
local S = technic.getter
|
||||
local mesecons_materials = minetest.get_modpath("mesecons_materials")
|
||||
|
||||
@ -21,7 +20,7 @@ minetest.register_tool("technic:treetap", {
|
||||
end
|
||||
node.name = "moretrees:rubber_tree_trunk_empty"
|
||||
minetest.swap_node(pos, node)
|
||||
minetest.handle_node_drops(pointed_thing.above, {"technic:raw_latex"}, user)
|
||||
minetest.handle_node_drops(pointed_thing.above, { "technic:raw_latex" }, user)
|
||||
if not technic.creative_mode then
|
||||
local item_wear = tonumber(itemstack:get_wear())
|
||||
item_wear = item_wear + 819
|
||||
@ -38,8 +37,8 @@ minetest.register_tool("technic:treetap", {
|
||||
minetest.register_craft({
|
||||
output = "technic:treetap",
|
||||
recipe = {
|
||||
{"pipeworks:tube_1", "group:wood", "default:stick"},
|
||||
{"", "default:stick", "default:stick"}
|
||||
{ "pipeworks:tube_1", "group:wood", "default:stick" },
|
||||
{ "", "default:stick", "default:stick" }
|
||||
},
|
||||
})
|
||||
|
||||
@ -62,11 +61,11 @@ minetest.register_craftitem("technic:rubber", {
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"moretrees:rubber_tree_trunk_empty"},
|
||||
nodenames = { "moretrees:rubber_tree_trunk_empty" },
|
||||
interval = 60,
|
||||
chance = 15,
|
||||
action = function(pos, node)
|
||||
if minetest.find_node_near(pos, (moretrees and moretrees.leafdecay_radius) or 5, {"moretrees:rubber_tree_leaves"}) then
|
||||
if minetest.find_node_near(pos, (moretrees and moretrees.leafdecay_radius) or 5, { "moretrees:rubber_tree_leaves" }) then
|
||||
node.name = "moretrees:rubber_tree_trunk"
|
||||
minetest.swap_node(pos, node)
|
||||
end
|
||||
|
@ -52,10 +52,10 @@ minetest.register_tool("technic:vacuum", {
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:vacuum',
|
||||
output = "technic:vacuum",
|
||||
recipe = {
|
||||
{'pipeworks:tube_1', 'pipeworks:filter', 'technic:battery'},
|
||||
{'pipeworks:tube_1', 'technic:motor', 'technic:battery'},
|
||||
{'technic:stainless_steel_ingot', '', ''},
|
||||
{ "pipeworks:tube_1", "pipeworks:filter", "technic:battery" },
|
||||
{ "pipeworks:tube_1", "technic:motor", "technic:battery" },
|
||||
{ "technic:stainless_steel_ingot", "", "" },
|
||||
}
|
||||
})
|
||||
|
@ -1,22 +1,32 @@
|
||||
|
||||
technic.chests.groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
|
||||
tubedevice=1, tubedevice_receiver=1}
|
||||
technic.chests.groups_noinv = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
|
||||
tubedevice=1, tubedevice_receiver=1, not_in_creative_inventory=1}
|
||||
technic.chests.groups = {
|
||||
snappy = 2,
|
||||
choppy = 2,
|
||||
oddly_breakable_by_hand = 2,
|
||||
tubedevice = 1,
|
||||
tubedevice_receiver = 1
|
||||
}
|
||||
technic.chests.groups_noinv = {
|
||||
snappy = 2,
|
||||
choppy = 2,
|
||||
oddly_breakable_by_hand = 2,
|
||||
tubedevice = 1,
|
||||
tubedevice_receiver = 1,
|
||||
not_in_creative_inventory = 1
|
||||
}
|
||||
|
||||
technic.chests.tube = {
|
||||
insert_object = function(pos, node, stack, direction)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local inv = meta:get_inventory()
|
||||
return inv:add_item("main",stack)
|
||||
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)
|
||||
return inv:room_for_item("main", stack)
|
||||
end,
|
||||
input_inventory = "main",
|
||||
connect_sides = {left=1, right=1, front=1, back=1, top=1, bottom=1},
|
||||
connect_sides = { left = 1, right = 1, front = 1, back = 1, top = 1, bottom = 1 },
|
||||
}
|
||||
|
||||
technic.chests.can_dig = function(pos, player)
|
||||
@ -35,9 +45,11 @@ end
|
||||
function technic.chests.inv_move(pos, from_list, from_index, to_list, to_index, count, player)
|
||||
return inv_change(pos, count, player)
|
||||
end
|
||||
|
||||
function technic.chests.inv_put(pos, listname, index, stack, player)
|
||||
return inv_change(pos, stack:get_count(), player)
|
||||
end
|
||||
|
||||
function technic.chests.inv_take(pos, listname, index, stack, player)
|
||||
return inv_change(pos, stack:get_count(), player)
|
||||
end
|
||||
@ -45,18 +57,18 @@ end
|
||||
function technic.chests.on_inv_move(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))
|
||||
.. minetest.pos_to_string(pos))
|
||||
end
|
||||
|
||||
function technic.chests.on_inv_put(pos, listname, index, stack, player)
|
||||
minetest.log("action", player:get_player_name() ..
|
||||
" moves " .. stack:get_name() ..
|
||||
" to chest at " .. minetest.pos_to_string(pos))
|
||||
minetest.log("action", player:get_player_name()..
|
||||
" moves "..stack:get_name()..
|
||||
" to chest at "..minetest.pos_to_string(pos))
|
||||
end
|
||||
|
||||
function technic.chests.on_inv_take(pos, listname, index, stack, player)
|
||||
minetest.log("action", player:get_player_name() ..
|
||||
" takes " .. stack:get_name() ..
|
||||
" from chest at " .. minetest.pos_to_string(pos))
|
||||
minetest.log("action", player:get_player_name()..
|
||||
" takes "..stack:get_name()..
|
||||
" from chest at "..minetest.pos_to_string(pos))
|
||||
end
|
||||
|
||||
|
@ -1,26 +1,26 @@
|
||||
minetest.register_craft({
|
||||
output = 'technic:copper_chest 1',
|
||||
recipe = {
|
||||
{'default:copper_ingot','default:copper_ingot','default:copper_ingot'},
|
||||
{'default:copper_ingot','technic:iron_chest','default:copper_ingot'},
|
||||
{'default:copper_ingot','default:copper_ingot','default:copper_ingot'},
|
||||
{ "default:copper_ingot", "default:copper_ingot", "default:copper_ingot" },
|
||||
{ "default:copper_ingot", "technic:iron_chest", "default:copper_ingot" },
|
||||
{ "default:copper_ingot", "default:copper_ingot", "default:copper_ingot" },
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:copper_locked_chest 1',
|
||||
recipe = {
|
||||
{'default:copper_ingot','default:copper_ingot','default:copper_ingot'},
|
||||
{'default:copper_ingot','technic:iron_locked_chest','default:copper_ingot'},
|
||||
{'default:copper_ingot','default:copper_ingot','default:copper_ingot'},
|
||||
{ "default:copper_ingot", "default:copper_ingot", "default:copper_ingot" },
|
||||
{ "default:copper_ingot", "technic:iron_locked_chest", "default:copper_ingot" },
|
||||
{ "default:copper_ingot", "default:copper_ingot", "default:copper_ingot" },
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:copper_locked_chest 1',
|
||||
recipe = {
|
||||
{'default:steel_ingot'},
|
||||
{'technic:copper_chest'},
|
||||
{ "default:steel_ingot" },
|
||||
{ "technic:copper_chest" },
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -1,37 +1,36 @@
|
||||
|
||||
local material_list
|
||||
if minetest.get_modpath("moreores") then
|
||||
material_list = { 'silver' }
|
||||
material_list = { "silver" }
|
||||
else
|
||||
-- Make the gold chest obtainable for mere mortals (the silver chest is not obtainable)
|
||||
material_list = { 'copper', 'silver' }
|
||||
material_list = { "copper", "silver" }
|
||||
end
|
||||
|
||||
for _, material in ipairs(material_list) do
|
||||
minetest.register_craft({
|
||||
output = 'technic:gold_chest',
|
||||
output = "technic:gold_chest",
|
||||
recipe = {
|
||||
{'default:gold_ingot','default:gold_ingot','default:gold_ingot'},
|
||||
{'default:gold_ingot',"technic:"..material.."_chest",'default:gold_ingot'},
|
||||
{'default:gold_ingot','default:gold_ingot','default:gold_ingot'},
|
||||
{ "default:gold_ingot", "default:gold_ingot", "default:gold_ingot" },
|
||||
{ "default:gold_ingot", "technic:"..material.."_chest", "default:gold_ingot" },
|
||||
{ "default:gold_ingot", "default:gold_ingot", "default:gold_ingot" },
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:gold_locked_chest',
|
||||
output = "technic:gold_locked_chest",
|
||||
recipe = {
|
||||
{'default:gold_ingot','default:gold_ingot','default:gold_ingot'},
|
||||
{'default:gold_ingot',"technic:"..material.."_locked_chest",'default:gold_ingot'},
|
||||
{'default:gold_ingot','default:gold_ingot','default:gold_ingot'},
|
||||
{ "default:gold_ingot", "default:gold_ingot", "default:gold_ingot" },
|
||||
{ "default:gold_ingot", "technic:"..material.."_locked_chest", "default:gold_ingot" },
|
||||
{ "default:gold_ingot", "default:gold_ingot", "default:gold_ingot" },
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:gold_locked_chest',
|
||||
output = "technic:gold_locked_chest",
|
||||
recipe = {
|
||||
{'default:steel_ingot'},
|
||||
{'technic:gold_chest'},
|
||||
{ "default:steel_ingot" },
|
||||
{ "technic:gold_chest" },
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -8,26 +8,26 @@ end
|
||||
minetest.register_craft({
|
||||
output = 'technic:iron_chest 1',
|
||||
recipe = {
|
||||
{cast_iron_ingot,cast_iron_ingot,cast_iron_ingot},
|
||||
{cast_iron_ingot,'default:chest',cast_iron_ingot},
|
||||
{cast_iron_ingot,cast_iron_ingot,cast_iron_ingot},
|
||||
{ cast_iron_ingot, cast_iron_ingot, cast_iron_ingot },
|
||||
{ cast_iron_ingot, "default:chest", cast_iron_ingot },
|
||||
{ cast_iron_ingot, cast_iron_ingot, cast_iron_ingot },
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:iron_locked_chest 1',
|
||||
recipe = {
|
||||
{cast_iron_ingot,cast_iron_ingot,cast_iron_ingot},
|
||||
{cast_iron_ingot,'default:chest_locked',cast_iron_ingot},
|
||||
{cast_iron_ingot,cast_iron_ingot,cast_iron_ingot},
|
||||
{ cast_iron_ingot, cast_iron_ingot, cast_iron_ingot },
|
||||
{ cast_iron_ingot, "default:chest_locked", cast_iron_ingot },
|
||||
{ cast_iron_ingot, cast_iron_ingot, cast_iron_ingot },
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:iron_locked_chest 1',
|
||||
recipe = {
|
||||
{'default:steel_ingot'},
|
||||
{'technic:iron_chest'},
|
||||
{ "default:steel_ingot" },
|
||||
{ "technic:iron_chest" },
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -2,18 +2,18 @@ if minetest.get_modpath("moreores") then
|
||||
minetest.register_craft({
|
||||
output = 'technic:mithril_chest 1',
|
||||
recipe = {
|
||||
{'moreores:mithril_ingot','moreores:mithril_ingot','moreores:mithril_ingot'},
|
||||
{'moreores:mithril_ingot','technic:gold_chest','moreores:mithril_ingot'},
|
||||
{'moreores:mithril_ingot','moreores:mithril_ingot','moreores:mithril_ingot'},
|
||||
{ "moreores:mithril_ingot", "moreores:mithril_ingot", "moreores:mithril_ingot" },
|
||||
{ "moreores:mithril_ingot", "technic:gold_chest", "moreores:mithril_ingot" },
|
||||
{ "moreores:mithril_ingot", "moreores:mithril_ingot", "moreores:mithril_ingot" },
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:mithril_locked_chest 1',
|
||||
recipe = {
|
||||
{'moreores:mithril_ingot','moreores:mithril_ingot','moreores:mithril_ingot'},
|
||||
{'moreores:mithril_ingot','technic:gold_locked_chest','moreores:mithril_ingot'},
|
||||
{'moreores:mithril_ingot','moreores:mithril_ingot','moreores:mithril_ingot'},
|
||||
{ "moreores:mithril_ingot", "moreores:mithril_ingot", "moreores:mithril_ingot" },
|
||||
{ "moreores:mithril_ingot", "technic:gold_locked_chest", "moreores:mithril_ingot" },
|
||||
{ "moreores:mithril_ingot", "moreores:mithril_ingot", "moreores:mithril_ingot" },
|
||||
}
|
||||
})
|
||||
end
|
||||
@ -21,8 +21,8 @@ end
|
||||
minetest.register_craft({
|
||||
output = 'technic:mithril_locked_chest 1',
|
||||
recipe = {
|
||||
{'default:steel_ingot'},
|
||||
{'technic:mithril_chest'},
|
||||
{ "default:steel_ingot" },
|
||||
{ "technic:mithril_chest" },
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -18,21 +18,21 @@ if not minetest.get_modpath("pipeworks") then
|
||||
end
|
||||
|
||||
local chest_mark_colors = {
|
||||
{"black", S("Black")},
|
||||
{"blue", S("Blue")},
|
||||
{"brown", S("Brown")},
|
||||
{"cyan", S("Cyan")},
|
||||
{"dark_green", S("Dark Green")},
|
||||
{"dark_grey", S("Dark Grey")},
|
||||
{"green", S("Green")},
|
||||
{"grey", S("Grey")},
|
||||
{"magenta", S("Magenta")},
|
||||
{"orange", S("Orange")},
|
||||
{"pink", S("Pink")},
|
||||
{"red", S("Red")},
|
||||
{"violet", S("Violet")},
|
||||
{"white", S("White")},
|
||||
{"yellow", S("Yellow")},
|
||||
{ "black", S("Black") },
|
||||
{ "blue", S("Blue") },
|
||||
{ "brown", S("Brown") },
|
||||
{ "cyan", S("Cyan") },
|
||||
{ "dark_green", S("Dark Green") },
|
||||
{ "dark_grey", S("Dark Grey") },
|
||||
{ "green", S("Green") },
|
||||
{ "grey", S("Grey") },
|
||||
{ "magenta", S("Magenta") },
|
||||
{ "orange", S("Orange") },
|
||||
{ "pink", S("Pink") },
|
||||
{ "red", S("Red") },
|
||||
{ "violet", S("Violet") },
|
||||
{ "white", S("White") },
|
||||
{ "yellow", S("Yellow") },
|
||||
}
|
||||
|
||||
|
||||
@ -47,9 +47,9 @@ local function get_color_buttons(coleft, lotop)
|
||||
for x = 0, 3 do
|
||||
local file_name = "technic_colorbutton"..(y * 4 + x)..".png"
|
||||
buttons_string = buttons_string.."image_button["
|
||||
..(coleft + 0.1 + x * 0.7)..","..(lotop + 0.1 + y * 0.7)
|
||||
..";0.8,0.8;"..file_name..";color_button"
|
||||
..(y * 4 + x + 1)..";]"
|
||||
.. (coleft + 0.1 + x * 0.7)..","..(lotop + 0.1 + y * 0.7)
|
||||
.. ";0.8,0.8;"..file_name..";color_button"
|
||||
.. (y * 4 + x + 1)..";]"
|
||||
end
|
||||
end
|
||||
return buttons_string
|
||||
@ -74,20 +74,20 @@ local function set_formspec(pos, data, page)
|
||||
local formspec = data.base_formspec
|
||||
if data.autosort then
|
||||
local status = meta:get_int("autosort")
|
||||
formspec = formspec.."button["..(data.hileft+2)..","..(data.height+1.1)..";3,0.8;autosort_to_"..(1-status)..";"..S("Auto-sort is %s"):format(status == 1 and S("On") or S("Off")).."]"
|
||||
formspec = formspec.."button["..(data.hileft + 2)..","..(data.height + 1.1)..";3,0.8;autosort_to_"..(1 - status)..";"..S("Auto-sort is %s"):format(status == 1 and S("On") or S("Off")).."]"
|
||||
end
|
||||
if data.infotext then
|
||||
local formspec_infotext = minetest.formspec_escape(meta:get_string("infotext"))
|
||||
if page == "main" then
|
||||
formspec = formspec.."image_button["..(data.hileft+2.1)..",0.1;0.8,0.8;"
|
||||
.."technic_pencil_icon.png;edit_infotext;]"
|
||||
.."label["..(data.hileft+3)..",0;"..formspec_infotext.."]"
|
||||
formspec = formspec.."image_button["..(data.hileft + 2.1)..",0.1;0.8,0.8;"
|
||||
.. "technic_pencil_icon.png;edit_infotext;]"
|
||||
.. "label["..(data.hileft + 3)..",0;"..formspec_infotext.."]"
|
||||
elseif page == "edit_infotext" then
|
||||
formspec = formspec.."image_button["..(data.hileft+2.1)..",0.1;0.8,0.8;"
|
||||
.."technic_checkmark_icon.png;save_infotext;]"
|
||||
.."field["..(data.hileft+3.3)..",0.2;4.8,1;"
|
||||
.."infotext_box;"..S("Edit chest description:")..";"
|
||||
..formspec_infotext.."]"
|
||||
formspec = formspec.."image_button["..(data.hileft + 2.1)..",0.1;0.8,0.8;"
|
||||
.. "technic_checkmark_icon.png;save_infotext;]"
|
||||
.. "field["..(data.hileft + 3.3)..",0.2;4.8,1;"
|
||||
.. "infotext_box;"..S("Edit chest description:")..";"
|
||||
.. formspec_infotext.."]"
|
||||
end
|
||||
end
|
||||
if data.color then
|
||||
@ -98,7 +98,7 @@ local function set_formspec(pos, data, page)
|
||||
else
|
||||
colorName = S("None")
|
||||
end
|
||||
formspec = formspec.."label["..(data.coleft+0.2)..","..(data.lotop+3)..";"..S("Color Filter: %s"):format(colorName).."]"
|
||||
formspec = formspec.."label["..(data.coleft + 0.2)..","..(data.lotop + 3)..";"..S("Color Filter: %s"):format(colorName).."]"
|
||||
end
|
||||
meta:set_string("formspec", formspec)
|
||||
end
|
||||
@ -202,17 +202,17 @@ function technic.chests:definition(name, data)
|
||||
data.ovheight = data.lotop + 4
|
||||
|
||||
local locked_after_place = nil
|
||||
local front = {"technic_"..lname.."_chest_front.png"}
|
||||
local front = { "technic_"..lname.."_chest_front.png" }
|
||||
data.base_formspec = "size["..data.ovwidth..","..data.ovheight.."]"..
|
||||
"label[0,0;"..S("%s Chest"):format(name).."]"..
|
||||
"list[context;main;"..data.hileft..",1;"..data.width..","..data.height..";]"..
|
||||
"list[current_player;main;"..data.loleft..","..data.lotop..";8,4;]"..
|
||||
"background[-0.19,-0.25;"..(data.ovwidth+0.4)..","..(data.ovheight+0.75)..";technic_chest_form_bg.png]"..
|
||||
"background[-0.19,-0.25;"..(data.ovwidth + 0.4)..","..(data.ovheight + 0.75)..";technic_chest_form_bg.png]"..
|
||||
"background["..data.hileft..",1;"..data.width..","..data.height..";technic_"..lname.."_chest_inventory.png]"..
|
||||
"background["..data.loleft..","..data.lotop..";8,4;technic_main_inventory.png]"..
|
||||
"listring[]"
|
||||
if data.sort then
|
||||
data.base_formspec = data.base_formspec.."button["..data.hileft..","..(data.height+1.1)..";1,0.8;sort;"..S("Sort").."]"
|
||||
data.base_formspec = data.base_formspec.."button["..data.hileft..","..(data.height + 1.1)..";1,0.8;sort;"..S("Sort").."]"
|
||||
end
|
||||
if data.color then
|
||||
data.base_formspec = data.base_formspec..get_color_buttons(data.coleft, data.lotop)
|
||||
@ -223,8 +223,7 @@ function technic.chests:definition(name, data)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("owner", placer:get_player_name() or "")
|
||||
meta:set_string("infotext",
|
||||
S("%s Locked Chest (owned by %s)")
|
||||
:format(name, meta:get_string("owner")))
|
||||
S("%s Locked Chest (owned by %s)"):format(name, meta:get_string("owner")))
|
||||
pipeworks.after_place(pos)
|
||||
end
|
||||
table.insert(front, "technic_"..lname.."_chest_lock_overlay.png")
|
||||
@ -241,9 +240,11 @@ function technic.chests:definition(name, data)
|
||||
|
||||
local def = {
|
||||
description = desc,
|
||||
tiles = {"technic_"..lname.."_chest_top.png", "technic_"..lname.."_chest_top.png",
|
||||
tiles = {
|
||||
"technic_"..lname.."_chest_top.png", "technic_"..lname.."_chest_top.png",
|
||||
"technic_"..lname.."_chest_side.png", "technic_"..lname.."_chest_side.png",
|
||||
"technic_"..lname.."_chest_side.png", table.concat(front, "^")},
|
||||
"technic_"..lname.."_chest_side.png", table.concat(front, "^")
|
||||
},
|
||||
paramtype2 = "facedir",
|
||||
groups = self.groups,
|
||||
tube = self.tube,
|
||||
@ -251,7 +252,6 @@ function technic.chests:definition(name, data)
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
after_place_node = locked_after_place,
|
||||
after_dig_node = pipeworks.after_dig,
|
||||
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("infotext", S("%s Chest"):format(name))
|
||||
@ -267,7 +267,7 @@ function technic.chests:definition(name, data)
|
||||
on_blast = function(pos)
|
||||
local drops = {}
|
||||
default.get_inventory_drops(pos, "main", drops)
|
||||
drops[#drops+1] = "technic:"..name:lower()..(data.locked and "_locked" or "").."_chest"
|
||||
drops[#drops + 1] = "technic:"..name:lower()..(data.locked and "_locked" or "").."_chest"
|
||||
minetest.remove_node(pos)
|
||||
return drops
|
||||
end,
|
||||
@ -277,7 +277,7 @@ function technic.chests:definition(name, data)
|
||||
def.allow_metadata_inventory_put = self.inv_put
|
||||
def.allow_metadata_inventory_take = self.inv_take
|
||||
def.on_blast = function() end
|
||||
def.can_dig = function(pos,player)
|
||||
def.can_dig = function(pos, player)
|
||||
local meta = minetest.get_meta(pos);
|
||||
local inv = meta:get_inventory()
|
||||
return inv:is_empty("main") and default.can_interact_with_node(player, pos)
|
||||
@ -315,9 +315,9 @@ function technic.chests:register(name, data)
|
||||
if data.color then
|
||||
local mk_front
|
||||
if string.find(def.tiles[6], "%^") then
|
||||
mk_front = function (overlay) return def.tiles[6]:gsub("%^", "^"..overlay.."^") end
|
||||
mk_front = function(overlay) return def.tiles[6]:gsub("%^", "^"..overlay.."^") end
|
||||
else
|
||||
mk_front = function (overlay) return def.tiles[6].."^"..overlay end
|
||||
mk_front = function(overlay) return def.tiles[6].."^"..overlay end
|
||||
end
|
||||
for i = 1, 15 do
|
||||
local postfix = colorid_to_postfix(i)
|
||||
@ -331,6 +331,5 @@ function technic.chests:register(name, data)
|
||||
minetest.register_node(":"..nn..postfix, colordef)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
@ -1,28 +1,28 @@
|
||||
if minetest.get_modpath("moreores") then
|
||||
minetest.register_craft({
|
||||
output = 'technic:silver_chest',
|
||||
output = "technic:silver_chest",
|
||||
recipe = {
|
||||
{'moreores:silver_ingot','moreores:silver_ingot','moreores:silver_ingot'},
|
||||
{'moreores:silver_ingot','technic:copper_chest','moreores:silver_ingot'},
|
||||
{'moreores:silver_ingot','moreores:silver_ingot','moreores:silver_ingot'},
|
||||
{ "moreores:silver_ingot", "moreores:silver_ingot", "moreores:silver_ingot" },
|
||||
{ "moreores:silver_ingot", "technic:copper_chest", "moreores:silver_ingot" },
|
||||
{ "moreores:silver_ingot", "moreores:silver_ingot", "moreores:silver_ingot" },
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:silver_locked_chest',
|
||||
output = "technic:silver_locked_chest",
|
||||
recipe = {
|
||||
{'moreores:silver_ingot','moreores:silver_ingot','moreores:silver_ingot'},
|
||||
{'moreores:silver_ingot','technic:copper_locked_chest','moreores:silver_ingot'},
|
||||
{'moreores:silver_ingot','moreores:silver_ingot','moreores:silver_ingot'},
|
||||
{ "moreores:silver_ingot", "moreores:silver_ingot", "moreores:silver_ingot" },
|
||||
{ "moreores:silver_ingot", "technic:copper_locked_chest", "moreores:silver_ingot" },
|
||||
{ "moreores:silver_ingot", "moreores:silver_ingot", "moreores:silver_ingot" },
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:silver_locked_chest',
|
||||
output = "technic:silver_locked_chest",
|
||||
recipe = {
|
||||
{'default:steel_ingot'},
|
||||
{'technic:silver_chest'},
|
||||
{ "default:steel_ingot" },
|
||||
{ "technic:silver_chest" },
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
local S = technic.worldgen.gettext
|
||||
|
||||
minetest.register_craftitem(":technic:uranium_lump", {
|
||||
@ -10,7 +9,7 @@ minetest.register_alias("technic:uranium", "technic:uranium_lump")
|
||||
minetest.register_craftitem(":technic:uranium_ingot", {
|
||||
description = S("Uranium Ingot"),
|
||||
inventory_image = "technic_uranium_ingot.png",
|
||||
groups = {uranium_ingot=1},
|
||||
groups = { uranium_ingot = 1 },
|
||||
})
|
||||
|
||||
minetest.register_craftitem(":technic:chromium_lump", {
|
||||
@ -79,16 +78,16 @@ local function register_block(block, ingot)
|
||||
minetest.register_craft({
|
||||
output = block,
|
||||
recipe = {
|
||||
{ingot, ingot, ingot},
|
||||
{ingot, ingot, ingot},
|
||||
{ingot, ingot, ingot},
|
||||
{ ingot, ingot, ingot },
|
||||
{ ingot, ingot, ingot },
|
||||
{ ingot, ingot, ingot },
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = ingot.." 9",
|
||||
recipe = {
|
||||
{block}
|
||||
{ block }
|
||||
}
|
||||
})
|
||||
end
|
||||
@ -103,45 +102,45 @@ register_block("technic:carbon_steel_block", "technic:carbon_steel_ingot")
|
||||
register_block("technic:stainless_steel_block", "technic:stainless_steel_ingot")
|
||||
|
||||
minetest.register_craft({
|
||||
type = 'cooking',
|
||||
type = "cooking",
|
||||
recipe = "technic:zinc_lump",
|
||||
output = "technic:zinc_ingot",
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = 'cooking',
|
||||
type = "cooking",
|
||||
recipe = "technic:chromium_lump",
|
||||
output = "technic:chromium_ingot",
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = 'cooking',
|
||||
type = "cooking",
|
||||
recipe = "technic:uranium_lump",
|
||||
output = "technic:uranium_ingot",
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = 'cooking',
|
||||
type = "cooking",
|
||||
recipe = "technic:lead_lump",
|
||||
output = "technic:lead_ingot",
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
type = 'cooking',
|
||||
type = "cooking",
|
||||
recipe = minetest.registered_aliases["technic:wrought_iron_ingot"],
|
||||
output = "technic:cast_iron_ingot",
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = 'cooking',
|
||||
type = "cooking",
|
||||
recipe = "technic:cast_iron_ingot",
|
||||
cooktime = 2,
|
||||
output = "technic:wrought_iron_ingot",
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = 'cooking',
|
||||
type = "cooking",
|
||||
recipe = "technic:carbon_steel_ingot",
|
||||
cooktime = 2,
|
||||
output = "technic:wrought_iron_ingot",
|
||||
|
@ -72,7 +72,7 @@ if technic.config:get_bool("enable_granite_generation") then
|
||||
tmin = 3,
|
||||
tmax = 6,
|
||||
threshhold = 0.4,
|
||||
noise_params = {offset=0, scale=15, spread={x=130, y=130, z=130}, seed=24, octaves=3, persist=0.70}
|
||||
noise_params = { offset = 0, scale = 15, spread = { x = 130, y = 130, z = 130 }, seed = 24, octaves = 3, persist = 0.70 }
|
||||
})
|
||||
end
|
||||
|
||||
@ -85,6 +85,6 @@ if technic.config:get_bool("enable_marble_generation") then
|
||||
tmin = 3,
|
||||
tmax = 6,
|
||||
threshhold = 0.4,
|
||||
noise_params = {offset=0, scale=15, spread={x=130, y=130, z=130}, seed=23, octaves=3, persist=0.70}
|
||||
noise_params = { offset = 0, scale = 15, spread = { x = 130, y = 130, z = 130 }, seed = 23, octaves = 3, persist = 0.70 }
|
||||
})
|
||||
end
|
||||
|
@ -1,72 +1,71 @@
|
||||
|
||||
local S = technic.worldgen.gettext
|
||||
|
||||
minetest.register_node( ":technic:mineral_uranium", {
|
||||
minetest.register_node(":technic:mineral_uranium", {
|
||||
description = S("Uranium Ore"),
|
||||
tiles = { "default_stone.png^technic_mineral_uranium.png" },
|
||||
is_ground_content = true,
|
||||
groups = {cracky=3, radioactive=1},
|
||||
groups = { cracky = 3, radioactive = 1 },
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
drop = "technic:uranium_lump",
|
||||
})
|
||||
|
||||
minetest.register_node( ":technic:mineral_chromium", {
|
||||
minetest.register_node(":technic:mineral_chromium", {
|
||||
description = S("Chromium Ore"),
|
||||
tiles = { "default_stone.png^technic_mineral_chromium.png" },
|
||||
is_ground_content = true,
|
||||
groups = {cracky=3},
|
||||
groups = { cracky = 3 },
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
drop = "technic:chromium_lump",
|
||||
})
|
||||
|
||||
minetest.register_node( ":technic:mineral_zinc", {
|
||||
minetest.register_node(":technic:mineral_zinc", {
|
||||
description = S("Zinc Ore"),
|
||||
tiles = { "default_stone.png^technic_mineral_zinc.png" },
|
||||
is_ground_content = true,
|
||||
groups = {cracky=3},
|
||||
groups = { cracky = 3 },
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
drop = "technic:zinc_lump",
|
||||
})
|
||||
|
||||
minetest.register_node( ":technic:mineral_lead", {
|
||||
minetest.register_node(":technic:mineral_lead", {
|
||||
description = S("Lead Ore"),
|
||||
tiles = { "default_stone.png^technic_mineral_lead.png" },
|
||||
is_ground_content = true,
|
||||
groups = {cracky=3},
|
||||
groups = { cracky = 3 },
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
drop = "technic:lead_lump",
|
||||
})
|
||||
|
||||
minetest.register_node( ":technic:mineral_sulfur", {
|
||||
minetest.register_node(":technic:mineral_sulfur", {
|
||||
description = S("Sulfur Ore"),
|
||||
tiles = { "default_stone.png^technic_mineral_sulfur.png" },
|
||||
is_ground_content = true,
|
||||
groups = {cracky=3},
|
||||
groups = { cracky = 3 },
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
drop = "technic:sulfur_lump",
|
||||
})
|
||||
|
||||
minetest.register_node( ":technic:granite", {
|
||||
minetest.register_node(":technic:granite", {
|
||||
description = S("Granite"),
|
||||
tiles = { "technic_granite.png" },
|
||||
is_ground_content = true,
|
||||
groups = {cracky=1},
|
||||
groups = { cracky = 1 },
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node( ":technic:marble", {
|
||||
minetest.register_node(":technic:marble", {
|
||||
description = S("Marble"),
|
||||
tiles = { "technic_marble.png" },
|
||||
is_ground_content = true,
|
||||
groups = {cracky=3, marble=1},
|
||||
groups = { cracky = 3, marble = 1 },
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node( ":technic:marble_bricks", {
|
||||
minetest.register_node(":technic:marble_bricks", {
|
||||
description = S("Marble Bricks"),
|
||||
tiles = { "technic_marble_bricks.png" },
|
||||
is_ground_content = true,
|
||||
groups = {cracky=3},
|
||||
groups = { cracky = 3 },
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
@ -74,7 +73,7 @@ minetest.register_node(":technic:uranium_block", {
|
||||
description = S("Uranium Block"),
|
||||
tiles = { "technic_uranium_block.png" },
|
||||
is_ground_content = true,
|
||||
groups = {uranium_block=1, cracky=1, level=2, radioactive=2},
|
||||
groups = { uranium_block = 1, cracky = 1, level = 2, radioactive = 2 },
|
||||
sounds = default.node_sound_stone_defaults()
|
||||
})
|
||||
|
||||
@ -82,7 +81,7 @@ minetest.register_node(":technic:chromium_block", {
|
||||
description = S("Chromium Block"),
|
||||
tiles = { "technic_chromium_block.png" },
|
||||
is_ground_content = true,
|
||||
groups = {cracky=1, level=2},
|
||||
groups = { cracky = 1, level = 2 },
|
||||
sounds = default.node_sound_stone_defaults()
|
||||
})
|
||||
|
||||
@ -90,7 +89,7 @@ minetest.register_node(":technic:zinc_block", {
|
||||
description = S("Zinc Block"),
|
||||
tiles = { "technic_zinc_block.png" },
|
||||
is_ground_content = true,
|
||||
groups = {cracky=1, level=2},
|
||||
groups = { cracky = 1, level = 2 },
|
||||
sounds = default.node_sound_stone_defaults()
|
||||
})
|
||||
|
||||
@ -98,7 +97,7 @@ minetest.register_node(":technic:lead_block", {
|
||||
description = S("Lead Block"),
|
||||
tiles = { "technic_lead_block.png" },
|
||||
is_ground_content = true,
|
||||
groups = {cracky=1, level=2},
|
||||
groups = { cracky = 1, level = 2 },
|
||||
sounds = default.node_sound_stone_defaults()
|
||||
})
|
||||
|
||||
@ -113,7 +112,7 @@ minetest.register_node(":technic:cast_iron_block", {
|
||||
description = S("Cast Iron Block"),
|
||||
tiles = { "technic_cast_iron_block.png" },
|
||||
is_ground_content = true,
|
||||
groups = {cracky=1, level=2},
|
||||
groups = { cracky = 1, level = 2 },
|
||||
sounds = default.node_sound_stone_defaults()
|
||||
})
|
||||
|
||||
@ -121,7 +120,7 @@ minetest.register_node(":technic:carbon_steel_block", {
|
||||
description = S("Carbon Steel Block"),
|
||||
tiles = { "technic_carbon_steel_block.png" },
|
||||
is_ground_content = true,
|
||||
groups = {cracky=1, level=2},
|
||||
groups = { cracky = 1, level = 2 },
|
||||
sounds = default.node_sound_stone_defaults()
|
||||
})
|
||||
|
||||
@ -129,7 +128,7 @@ minetest.register_node(":technic:stainless_steel_block", {
|
||||
description = S("Stainless Steel Block"),
|
||||
tiles = { "technic_stainless_steel_block.png" },
|
||||
is_ground_content = true,
|
||||
groups = {cracky=1, level=2},
|
||||
groups = { cracky = 1, level = 2 },
|
||||
sounds = default.node_sound_stone_defaults()
|
||||
})
|
||||
|
||||
@ -137,15 +136,15 @@ minetest.register_node(":technic:brass_block", {
|
||||
description = S("Brass Block"),
|
||||
tiles = { "technic_brass_block.png" },
|
||||
is_ground_content = true,
|
||||
groups = {cracky=1, level=2},
|
||||
groups = { cracky = 1, level = 2 },
|
||||
sounds = default.node_sound_stone_defaults()
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:marble_bricks 4',
|
||||
recipe = {
|
||||
{'technic:marble','technic:marble'},
|
||||
{'technic:marble','technic:marble'}
|
||||
{ "technic:marble", "technic:marble" },
|
||||
{ "technic:marble", "technic:marble" }
|
||||
}
|
||||
})
|
||||
|
||||
@ -177,7 +176,7 @@ for_each_registered_node(function(node_name, node_def)
|
||||
local new_tiles = {}
|
||||
local do_override = false
|
||||
if type(tiles) == "string" then
|
||||
tiles = {tiles}
|
||||
tiles = { tiles }
|
||||
end
|
||||
for i, t in ipairs(tiles) do
|
||||
if type(t) == "string" and t == "default_steel_block.png" then
|
||||
|
@ -1,20 +1,20 @@
|
||||
local uranium_params = {offset = 0, scale = 1, spread = {x = 100, y = 100, z = 100}, seed = 420, octaves = 3, persist = 0.7}
|
||||
local uranium_params = { offset = 0, scale = 1, spread = { x = 100, y = 100, z = 100 }, seed = 420, octaves = 3, persist = 0.7 }
|
||||
local uranium_threshhold = 0.55
|
||||
|
||||
local chromium_params = {offset = 0, scale = 1, spread = {x = 100, y = 100, z = 100}, seed = 421, octaves = 3, persist = 0.7}
|
||||
local chromium_params = { offset = 0, scale = 1, spread = { x = 100, y = 100, z = 100 }, seed = 421, octaves = 3, persist = 0.7 }
|
||||
local chromium_threshhold = 0.55
|
||||
|
||||
local zinc_params = {offset = 0, scale = 1, spread = {x = 100, y = 100, z = 100}, seed = 422, octaves = 3, persist = 0.7}
|
||||
local zinc_params = { offset = 0, scale = 1, spread = { x = 100, y = 100, z = 100 }, seed = 422, octaves = 3, persist = 0.7 }
|
||||
local zinc_threshhold = 0.5
|
||||
|
||||
local lead_params = {offset = 0, scale = 1, spread = {x = 100, y = 100, z = 100}, seed = 423, octaves = 3, persist = 0.7}
|
||||
local lead_params = { offset = 0, scale = 1, spread = { x = 100, y = 100, z = 100 }, seed = 423, octaves = 3, persist = 0.7 }
|
||||
local lead_threshhold = 0.3
|
||||
|
||||
minetest.register_ore({
|
||||
ore_type = "scatter",
|
||||
ore = "technic:mineral_uranium",
|
||||
wherein = "default:stone",
|
||||
clust_scarcity = 8*8*8,
|
||||
clust_scarcity = 8 * 8 * 8,
|
||||
clust_num_ores = 4,
|
||||
clust_size = 3,
|
||||
y_min = -300,
|
||||
@ -27,7 +27,7 @@ minetest.register_ore({
|
||||
ore_type = "scatter",
|
||||
ore = "technic:mineral_chromium",
|
||||
wherein = "default:stone",
|
||||
clust_scarcity = 8*8*8,
|
||||
clust_scarcity = 8 * 8 * 8,
|
||||
clust_num_ores = 2,
|
||||
clust_size = 3,
|
||||
y_min = -200,
|
||||
@ -40,7 +40,7 @@ minetest.register_ore({
|
||||
ore_type = "scatter",
|
||||
ore = "technic:mineral_chromium",
|
||||
wherein = "default:stone",
|
||||
clust_scarcity = 6*6*6,
|
||||
clust_scarcity = 6 * 6 * 6,
|
||||
clust_num_ores = 2,
|
||||
clust_size = 3,
|
||||
y_min = -31000,
|
||||
@ -54,7 +54,7 @@ minetest.register_ore({
|
||||
ore_type = "scatter",
|
||||
ore = "technic:mineral_zinc",
|
||||
wherein = "default:stone",
|
||||
clust_scarcity = 8*8*8,
|
||||
clust_scarcity = 8 * 8 * 8,
|
||||
clust_num_ores = 5,
|
||||
clust_size = 7,
|
||||
y_min = -32,
|
||||
@ -65,7 +65,7 @@ minetest.register_ore({
|
||||
ore_type = "scatter",
|
||||
ore = "technic:mineral_zinc",
|
||||
wherein = "default:stone",
|
||||
clust_scarcity = 6*6*6,
|
||||
clust_scarcity = 6 * 6 * 6,
|
||||
clust_num_ores = 4,
|
||||
clust_size = 3,
|
||||
y_min = -31000,
|
||||
@ -79,7 +79,7 @@ minetest.register_ore({
|
||||
ore_type = "scatter",
|
||||
ore = "technic:mineral_lead",
|
||||
wherein = "default:stone",
|
||||
clust_scarcity = 9*9*9,
|
||||
clust_scarcity = 9 * 9 * 9,
|
||||
clust_num_ores = 5,
|
||||
clust_size = 3,
|
||||
y_min = -16,
|
||||
@ -92,7 +92,7 @@ minetest.register_ore({
|
||||
ore_type = "scatter",
|
||||
ore = "technic:mineral_lead",
|
||||
wherein = "default:stone",
|
||||
clust_scarcity = 8*8*8,
|
||||
clust_scarcity = 8 * 8 * 8,
|
||||
clust_num_ores = 5,
|
||||
clust_size = 3,
|
||||
y_min = -128,
|
||||
@ -105,7 +105,7 @@ minetest.register_ore({
|
||||
ore_type = "scatter",
|
||||
ore = "technic:mineral_lead",
|
||||
wherein = "default:stone",
|
||||
clust_scarcity = 6*6*6,
|
||||
clust_scarcity = 6 * 6 * 6,
|
||||
clust_num_ores = 5,
|
||||
clust_size = 3,
|
||||
y_min = -31000,
|
||||
@ -118,9 +118,9 @@ minetest.register_ore({
|
||||
-- Sulfur
|
||||
minetest.register_on_generated(function(minp, maxp, seed)
|
||||
local vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
|
||||
local a = VoxelArea:new{
|
||||
MinEdge = {x = emin.x, y = emin.y, z = emin.z},
|
||||
MaxEdge = {x = emax.x, y = emax.y, z = emax.z},
|
||||
local a = VoxelArea:new {
|
||||
MinEdge = { x = emin.x, y = emin.y, z = emin.z },
|
||||
MaxEdge = { x = emax.x, y = emax.y, z = emax.z },
|
||||
}
|
||||
local data = vm:get_data()
|
||||
local pr = PseudoRandom(17 * minp.x + 42 * minp.y + 101 * minp.z)
|
||||
@ -136,7 +136,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
||||
for y = minp.y + math.floor(grid_size / 2), maxp.y, grid_size do
|
||||
for z = minp.z + math.floor(grid_size / 2), maxp.z, grid_size do
|
||||
local c = data[a:index(x, y, z)]
|
||||
if (c == c_lava or c == c_lava_flowing) and noise:get3d({x = x, y = z, z = z}) >= 0.4 then
|
||||
if (c == c_lava or c == c_lava_flowing) and noise:get3d({ x = x, y = z, z = z }) >= 0.4 then
|
||||
for xx = math.max(minp.x, x - grid_size), math.min(maxp.x, x + grid_size) do
|
||||
for yy = math.max(minp.y, y - grid_size), math.min(maxp.y, y + grid_size) do
|
||||
for zz = math.max(minp.z, z - grid_size), math.min(maxp.z, z + grid_size) do
|
||||
@ -158,7 +158,7 @@ end)
|
||||
|
||||
|
||||
if technic.config:get_bool("enable_marble_generation") then
|
||||
minetest.register_ore({
|
||||
minetest.register_ore({
|
||||
ore_type = "sheet",
|
||||
ore = "technic:marble",
|
||||
wherein = "default:stone",
|
||||
@ -168,12 +168,12 @@ minetest.register_ore({
|
||||
y_min = -31000,
|
||||
y_max = -50,
|
||||
noise_threshhold = 0.4,
|
||||
noise_params = {offset=0, scale=15, spread={x=150, y=150, z=150}, seed=23, octaves=3, persist=0.70}
|
||||
})
|
||||
noise_params = { offset = 0, scale = 15, spread = { x = 150, y = 150, z = 150 }, seed = 23, octaves = 3, persist = 0.70 }
|
||||
})
|
||||
end
|
||||
|
||||
if technic.config:get_bool("enable_granite_generation") then
|
||||
minetest.register_ore({
|
||||
minetest.register_ore({
|
||||
ore_type = "sheet",
|
||||
ore = "technic:granite",
|
||||
wherein = "default:stone",
|
||||
@ -183,7 +183,7 @@ minetest.register_ore({
|
||||
y_min = -31000,
|
||||
y_max = -150,
|
||||
noise_threshhold = 0.4,
|
||||
noise_params = {offset=0, scale=15, spread={x=130, y=130, z=130}, seed=24, octaves=3, persist=0.70}
|
||||
})
|
||||
noise_params = { offset = 0, scale = 15, spread = { x = 130, y = 130, z = 130 }, seed = 24, octaves = 3, persist = 0.70 }
|
||||
})
|
||||
end
|
||||
|
||||
|
@ -5,12 +5,12 @@ local S = technic.worldgen.gettext
|
||||
minetest.register_node(":moretrees:rubber_tree_sapling", {
|
||||
description = S("Rubber Tree Sapling"),
|
||||
drawtype = "plantlike",
|
||||
tiles = {"technic_rubber_sapling.png"},
|
||||
tiles = { "technic_rubber_sapling.png" },
|
||||
inventory_image = "technic_rubber_sapling.png",
|
||||
wield_image = "technic_rubber_sapling.png",
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
groups = {dig_immediate=3, flammable=2},
|
||||
groups = { dig_immediate = 3, flammable = 2 },
|
||||
sounds = default.node_sound_defaults(),
|
||||
})
|
||||
|
||||
@ -22,43 +22,59 @@ minetest.register_craft({
|
||||
|
||||
minetest.register_node(":moretrees:rubber_tree_trunk", {
|
||||
description = S("Rubber Tree"),
|
||||
tiles = {"default_tree_top.png", "default_tree_top.png",
|
||||
"technic_rubber_tree_full.png"},
|
||||
groups = {tree=1, snappy=1, choppy=2, oddly_breakable_by_hand=1,
|
||||
flammable=2},
|
||||
tiles = {
|
||||
"default_tree_top.png", "default_tree_top.png",
|
||||
"technic_rubber_tree_full.png"
|
||||
},
|
||||
groups = {
|
||||
tree = 1,
|
||||
snappy = 1,
|
||||
choppy = 2,
|
||||
oddly_breakable_by_hand = 1,
|
||||
flammable = 2
|
||||
},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node(":moretrees:rubber_tree_trunk_empty", {
|
||||
description = S("Rubber Tree"),
|
||||
tiles = {"default_tree_top.png", "default_tree_top.png",
|
||||
"technic_rubber_tree_empty.png"},
|
||||
groups = {tree=1, snappy=1, choppy=2, oddly_breakable_by_hand=1,
|
||||
flammable=2, not_in_creative_inventory=1},
|
||||
tiles = {
|
||||
"default_tree_top.png", "default_tree_top.png",
|
||||
"technic_rubber_tree_empty.png"
|
||||
},
|
||||
groups = {
|
||||
tree = 1,
|
||||
snappy = 1,
|
||||
choppy = 2,
|
||||
oddly_breakable_by_hand = 1,
|
||||
flammable = 2,
|
||||
not_in_creative_inventory = 1
|
||||
},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node(":moretrees:rubber_tree_leaves", {
|
||||
drawtype = "allfaces_optional",
|
||||
description = S("Rubber Tree Leaves"),
|
||||
tiles = {"technic_rubber_leaves.png"},
|
||||
tiles = { "technic_rubber_leaves.png" },
|
||||
paramtype = "light",
|
||||
groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
|
||||
groups = { snappy = 3, leafdecay = 3, flammable = 2, leaves = 1 },
|
||||
drop = {
|
||||
max_items = 1,
|
||||
items = {{
|
||||
items = {"moretrees:rubber_tree_sapling"},
|
||||
items = {
|
||||
{
|
||||
items = { "moretrees:rubber_tree_sapling" },
|
||||
rarity = 20,
|
||||
},
|
||||
{
|
||||
items = {"moretrees:rubber_tree_leaves"},
|
||||
items = { "moretrees:rubber_tree_leaves" },
|
||||
}
|
||||
}
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
technic.rubber_tree_model={
|
||||
technic.rubber_tree_model = {
|
||||
axiom = "FFFFA",
|
||||
rules_a = "[&FFBFA]////[&BFFFA]////[&FBFFA]",
|
||||
rules_b = "[&FFA]////[&FFA]////[&FFA]",
|
||||
@ -72,7 +88,7 @@ technic.rubber_tree_model={
|
||||
}
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"moretrees:rubber_tree_sapling"},
|
||||
nodenames = { "moretrees:rubber_tree_sapling" },
|
||||
interval = 60,
|
||||
chance = 20,
|
||||
action = function(pos, node)
|
||||
@ -89,11 +105,12 @@ if technic.config:get_bool("enable_rubber_tree_generation") then
|
||||
local tmp = {
|
||||
x = (maxp.x - minp.x) / 2 + minp.x,
|
||||
y = (maxp.y - minp.y) / 2 + minp.y,
|
||||
z = (maxp.z - minp.z) / 2 + minp.z}
|
||||
z = (maxp.z - minp.z) / 2 + minp.z
|
||||
}
|
||||
local pos = minetest.find_node_near(tmp, maxp.x - minp.x,
|
||||
{"default:dirt_with_grass"})
|
||||
{ "default:dirt_with_grass" })
|
||||
if pos ~= nil then
|
||||
minetest.spawn_tree({x=pos.x, y=pos.y+1, z=pos.z}, technic.rubber_tree_model)
|
||||
minetest.spawn_tree({ x = pos.x, y = pos.y + 1, z = pos.z }, technic.rubber_tree_model)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
@ -40,7 +40,7 @@ local function restore(pos, placer, itemstack)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local inv = meta:get_inventory()
|
||||
local data = minetest.deserialize(itemstack:get_metadata())
|
||||
minetest.set_node(pos, {name = data.name, param2 = node.param2})
|
||||
minetest.set_node(pos, { name = data.name, param2 = node.param2 })
|
||||
local lists = data.lists
|
||||
for name, value in pairs(data.metas) do
|
||||
local meta_type = get_meta_type(data.name, name)
|
||||
@ -84,12 +84,15 @@ minetest.register_tool("wrench:wrench", {
|
||||
full_punch_interval = 0.9,
|
||||
max_drop_level = 0,
|
||||
groupcaps = {
|
||||
crumbly = {times={[2]=3.00, [3]=0.70}, uses=0, maxlevel=1},
|
||||
snappy = {times={[3]=0.40}, uses=0, maxlevel=1},
|
||||
oddly_breakable_by_hand = {times={[1]=7.00,[2]=4.00,[3]=1.40},
|
||||
uses=0, maxlevel=3}
|
||||
crumbly = { times = { [2] = 3.00, [3] = 0.70 }, uses = 0, maxlevel = 1 },
|
||||
snappy = { times = { [3] = 0.40 }, uses = 0, maxlevel = 1 },
|
||||
oddly_breakable_by_hand = {
|
||||
times = { [1] = 7.00, [2] = 4.00, [3] = 1.40 },
|
||||
uses = 0,
|
||||
maxlevel = 3
|
||||
}
|
||||
},
|
||||
damage_groups = {fleshy=1},
|
||||
damage_groups = { fleshy = 1 },
|
||||
},
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
local pos = pointed_thing.under
|
||||
|
@ -20,40 +20,48 @@ wrench.META_TYPE_FLOAT = 1
|
||||
wrench.META_TYPE_STRING = 2
|
||||
|
||||
local INT, STRING, FLOAT =
|
||||
wrench.META_TYPE_INT,
|
||||
wrench.META_TYPE_STRING,
|
||||
wrench.META_TYPE_FLOAT
|
||||
wrench.META_TYPE_INT,
|
||||
wrench.META_TYPE_STRING,
|
||||
wrench.META_TYPE_FLOAT
|
||||
|
||||
wrench.registered_nodes = {
|
||||
["default:chest"] = {
|
||||
lists = {"main"},
|
||||
lists = { "main" },
|
||||
},
|
||||
["default:chest_locked"] = {
|
||||
lists = {"main"},
|
||||
metas = {owner = STRING,
|
||||
infotext = STRING},
|
||||
lists = { "main" },
|
||||
metas = {
|
||||
owner = STRING,
|
||||
infotext = STRING
|
||||
},
|
||||
owned = true,
|
||||
},
|
||||
["default:furnace"] = {
|
||||
lists = {"fuel", "src", "dst"},
|
||||
metas = {infotext = STRING,
|
||||
lists = { "fuel", "src", "dst" },
|
||||
metas = {
|
||||
infotext = STRING,
|
||||
fuel_totaltime = FLOAT,
|
||||
fuel_time = FLOAT,
|
||||
src_totaltime = FLOAT,
|
||||
src_time = FLOAT},
|
||||
src_time = FLOAT
|
||||
},
|
||||
},
|
||||
["default:furnace_active"] = {
|
||||
lists = {"fuel", "src", "dst"},
|
||||
metas = {infotext = STRING,
|
||||
lists = { "fuel", "src", "dst" },
|
||||
metas = {
|
||||
infotext = STRING,
|
||||
fuel_totaltime = FLOAT,
|
||||
fuel_time = FLOAT,
|
||||
src_totaltime = FLOAT,
|
||||
src_time = FLOAT},
|
||||
src_time = FLOAT
|
||||
},
|
||||
store_meta_always = true,
|
||||
},
|
||||
["default:sign_wall"] = {
|
||||
metas = {infotext = STRING,
|
||||
text = STRING},
|
||||
metas = {
|
||||
infotext = STRING,
|
||||
text = STRING
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -1,324 +1,393 @@
|
||||
|
||||
local INT, STRING, FLOAT =
|
||||
wrench.META_TYPE_INT,
|
||||
wrench.META_TYPE_STRING,
|
||||
wrench.META_TYPE_FLOAT
|
||||
wrench.META_TYPE_INT,
|
||||
wrench.META_TYPE_STRING,
|
||||
wrench.META_TYPE_FLOAT
|
||||
|
||||
wrench:register_node("technic:iron_chest", {
|
||||
lists = {"main"},
|
||||
lists = { "main" },
|
||||
})
|
||||
wrench:register_node("technic:iron_locked_chest", {
|
||||
lists = {"main"},
|
||||
metas = {infotext = STRING,
|
||||
owner = STRING},
|
||||
lists = { "main" },
|
||||
metas = {
|
||||
infotext = STRING,
|
||||
owner = STRING
|
||||
},
|
||||
owned = true,
|
||||
})
|
||||
wrench:register_node("technic:copper_chest", {
|
||||
lists = {"main"},
|
||||
lists = { "main" },
|
||||
})
|
||||
wrench:register_node("technic:copper_locked_chest", {
|
||||
lists = {"main"},
|
||||
metas = {infotext = STRING,
|
||||
owner = STRING},
|
||||
lists = { "main" },
|
||||
metas = {
|
||||
infotext = STRING,
|
||||
owner = STRING
|
||||
},
|
||||
owned = true,
|
||||
})
|
||||
wrench:register_node("technic:silver_chest", {
|
||||
lists = {"main"},
|
||||
metas = {infotext = STRING,
|
||||
formspec = STRING},
|
||||
lists = { "main" },
|
||||
metas = {
|
||||
infotext = STRING,
|
||||
formspec = STRING
|
||||
},
|
||||
})
|
||||
wrench:register_node("technic:silver_locked_chest", {
|
||||
lists = {"main"},
|
||||
metas = {infotext = STRING,
|
||||
lists = { "main" },
|
||||
metas = {
|
||||
infotext = STRING,
|
||||
owner = STRING,
|
||||
formspec = STRING},
|
||||
formspec = STRING
|
||||
},
|
||||
owned = true,
|
||||
})
|
||||
wrench:register_node("technic:gold_chest", {
|
||||
lists = {"main"},
|
||||
metas = {infotext = STRING,
|
||||
formspec = STRING},
|
||||
lists = { "main" },
|
||||
metas = {
|
||||
infotext = STRING,
|
||||
formspec = STRING
|
||||
},
|
||||
})
|
||||
wrench:register_node("technic:gold_locked_chest", {
|
||||
lists = {"main"},
|
||||
metas = {infotext = STRING,
|
||||
lists = { "main" },
|
||||
metas = {
|
||||
infotext = STRING,
|
||||
owner = STRING,
|
||||
formspec = STRING},
|
||||
formspec = STRING
|
||||
},
|
||||
owned = true,
|
||||
})
|
||||
wrench:register_node("technic:mithril_chest", {
|
||||
lists = {"main"},
|
||||
metas = {infotext = STRING,
|
||||
formspec = STRING},
|
||||
lists = { "main" },
|
||||
metas = {
|
||||
infotext = STRING,
|
||||
formspec = STRING
|
||||
},
|
||||
})
|
||||
wrench:register_node("technic:mithril_locked_chest", {
|
||||
lists = {"main"},
|
||||
metas = {infotext = STRING,
|
||||
lists = { "main" },
|
||||
metas = {
|
||||
infotext = STRING,
|
||||
owner = STRING,
|
||||
formspec = STRING},
|
||||
formspec = STRING
|
||||
},
|
||||
owned = true,
|
||||
})
|
||||
wrench:register_node("technic:lv_electric_furnace", {
|
||||
lists = {"src", "dst"},
|
||||
metas = {infotext = STRING,
|
||||
lists = { "src", "dst" },
|
||||
metas = {
|
||||
infotext = STRING,
|
||||
formspec = STRING,
|
||||
LV_EU_demand = INT,
|
||||
LV_EU_input = INT,
|
||||
src_time = INT},
|
||||
src_time = INT
|
||||
},
|
||||
})
|
||||
wrench:register_node("technic:lv_electric_furnace_active", {
|
||||
lists = {"src", "dst"},
|
||||
metas = {infotext = STRING,
|
||||
lists = { "src", "dst" },
|
||||
metas = {
|
||||
infotext = STRING,
|
||||
formspec = STRING,
|
||||
LV_EU_demand = INT,
|
||||
LV_EU_input = INT,
|
||||
src_time = INT},
|
||||
src_time = INT
|
||||
},
|
||||
})
|
||||
wrench:register_node("technic:mv_electric_furnace", {
|
||||
lists = {"src", "dst", "upgrade1", "upgrade2"},
|
||||
metas = {infotext = STRING,
|
||||
lists = { "src", "dst", "upgrade1", "upgrade2" },
|
||||
metas = {
|
||||
infotext = STRING,
|
||||
formspec = STRING,
|
||||
MV_EU_demand = INT,
|
||||
MV_EU_input = INT,
|
||||
tube_time = INT,
|
||||
src_time = INT},
|
||||
src_time = INT
|
||||
},
|
||||
})
|
||||
wrench:register_node("technic:mv_electric_furnace_active", {
|
||||
lists = {"src", "dst", "upgrade1", "upgrade2"},
|
||||
metas = {infotext = STRING,
|
||||
lists = { "src", "dst", "upgrade1", "upgrade2" },
|
||||
metas = {
|
||||
infotext = STRING,
|
||||
formspec = STRING,
|
||||
MV_EU_demand = INT,
|
||||
MV_EU_input = INT,
|
||||
tube_time = INT,
|
||||
src_time = INT},
|
||||
src_time = INT
|
||||
},
|
||||
})
|
||||
wrench:register_node("technic:coal_alloy_furnace", {
|
||||
lists = {"fuel", "src", "dst"},
|
||||
metas = {infotext = STRING,
|
||||
lists = { "fuel", "src", "dst" },
|
||||
metas = {
|
||||
infotext = STRING,
|
||||
fuel_totaltime = FLOAT,
|
||||
fuel_time = FLOAT,
|
||||
src_totaltime = FLOAT,
|
||||
src_time = FLOAT},
|
||||
src_time = FLOAT
|
||||
},
|
||||
})
|
||||
wrench:register_node("technic:coal_alloy_furnace_active", {
|
||||
lists = {"fuel", "src", "dst"},
|
||||
metas = {infotext = STRING,
|
||||
lists = { "fuel", "src", "dst" },
|
||||
metas = {
|
||||
infotext = STRING,
|
||||
fuel_totaltime = FLOAT,
|
||||
fuel_time = FLOAT,
|
||||
src_totaltime = FLOAT,
|
||||
src_time = FLOAT},
|
||||
src_time = FLOAT
|
||||
},
|
||||
})
|
||||
wrench:register_node("technic:alloy_furnace", {
|
||||
lists = {"src", "dst"},
|
||||
metas = {infotext = STRING,
|
||||
lists = { "src", "dst" },
|
||||
metas = {
|
||||
infotext = STRING,
|
||||
formspec = STRING,
|
||||
LV_EU_demand = INT,
|
||||
LV_EU_input = INT,
|
||||
tube_time = INT,
|
||||
src_time = INT},
|
||||
src_time = INT
|
||||
},
|
||||
})
|
||||
wrench:register_node("technic:alloy_furnace_active", {
|
||||
lists = {"src", "dst"},
|
||||
metas = {infotext = STRING,
|
||||
lists = { "src", "dst" },
|
||||
metas = {
|
||||
infotext = STRING,
|
||||
formspec = STRING,
|
||||
LV_EU_demand = INT,
|
||||
LV_EU_input = INT,
|
||||
tube_time = INT,
|
||||
src_time = INT},
|
||||
src_time = INT
|
||||
},
|
||||
})
|
||||
wrench:register_node("technic:mv_alloy_furnace", {
|
||||
lists = {"src", "dst", "upgrade1", "upgrade2"},
|
||||
metas = {infotext = STRING,
|
||||
lists = { "src", "dst", "upgrade1", "upgrade2" },
|
||||
metas = {
|
||||
infotext = STRING,
|
||||
formspec = STRING,
|
||||
MV_EU_demand = INT,
|
||||
MV_EU_input = INT,
|
||||
tube_time = INT,
|
||||
src_time = INT},
|
||||
src_time = INT
|
||||
},
|
||||
})
|
||||
wrench:register_node("technic:mv_alloy_furnace_active", {
|
||||
lists = {"src", "dst", "upgrade1", "upgrade2"},
|
||||
metas = {infotext = STRING,
|
||||
lists = { "src", "dst", "upgrade1", "upgrade2" },
|
||||
metas = {
|
||||
infotext = STRING,
|
||||
formspec = STRING,
|
||||
MV_EU_demand = INT,
|
||||
MV_EU_input = INT,
|
||||
tube_time = INT,
|
||||
src_time = INT},
|
||||
src_time = INT
|
||||
},
|
||||
})
|
||||
wrench:register_node("technic:tool_workshop", {
|
||||
lists = {"src", "upgrade1", "upgrade2"},
|
||||
metas = {infotext = STRING,
|
||||
lists = { "src", "upgrade1", "upgrade2" },
|
||||
metas = {
|
||||
infotext = STRING,
|
||||
formspec = STRING,
|
||||
MV_EU_demand = INT,
|
||||
MV_EU_input = INT,
|
||||
tube_time = INT},
|
||||
tube_time = INT
|
||||
},
|
||||
})
|
||||
wrench:register_node("technic:grinder", {
|
||||
lists = {"src", "dst"},
|
||||
metas = {infotext = STRING,
|
||||
lists = { "src", "dst" },
|
||||
metas = {
|
||||
infotext = STRING,
|
||||
formspec = STRING,
|
||||
LV_EU_demand = INT,
|
||||
LV_EU_input = INT,
|
||||
src_time = INT},
|
||||
src_time = INT
|
||||
},
|
||||
})
|
||||
wrench:register_node("technic:grinder_active", {
|
||||
lists = {"src", "dst"},
|
||||
metas = {infotext = STRING,
|
||||
lists = { "src", "dst" },
|
||||
metas = {
|
||||
infotext = STRING,
|
||||
formspec = STRING,
|
||||
LV_EU_demand = INT,
|
||||
LV_EU_input = INT,
|
||||
src_time = INT},
|
||||
src_time = INT
|
||||
},
|
||||
})
|
||||
wrench:register_node("technic:mv_grinder", {
|
||||
lists = {"src", "dst", "upgrade1", "upgrade2"},
|
||||
metas = {infotext = STRING,
|
||||
lists = { "src", "dst", "upgrade1", "upgrade2" },
|
||||
metas = {
|
||||
infotext = STRING,
|
||||
formspec = STRING,
|
||||
MV_EU_demand = INT,
|
||||
MV_EU_input = INT,
|
||||
tube_time = INT,
|
||||
src_time = INT},
|
||||
src_time = INT
|
||||
},
|
||||
})
|
||||
wrench:register_node("technic:mv_grinder_active", {
|
||||
lists = {"src", "dst", "upgrade1", "upgrade2"},
|
||||
metas = {infotext = STRING,
|
||||
lists = { "src", "dst", "upgrade1", "upgrade2" },
|
||||
metas = {
|
||||
infotext = STRING,
|
||||
formspec = STRING,
|
||||
MV_EU_demand = INT,
|
||||
MV_EU_input = INT,
|
||||
tube_time = INT,
|
||||
src_time = INT},
|
||||
src_time = INT
|
||||
},
|
||||
})
|
||||
wrench:register_node("technic:extractor", {
|
||||
lists = {"src", "dst"},
|
||||
metas = {infotext = STRING,
|
||||
lists = { "src", "dst" },
|
||||
metas = {
|
||||
infotext = STRING,
|
||||
formspec = STRING,
|
||||
LV_EU_demand = INT,
|
||||
LV_EU_input = INT,
|
||||
src_time = INT},
|
||||
src_time = INT
|
||||
},
|
||||
})
|
||||
wrench:register_node("technic:extractor_active", {
|
||||
lists = {"src", "dst"},
|
||||
metas = {infotext = STRING,
|
||||
lists = { "src", "dst" },
|
||||
metas = {
|
||||
infotext = STRING,
|
||||
formspec = STRING,
|
||||
LV_EU_demand = INT,
|
||||
LV_EU_input = INT,
|
||||
src_time = INT},
|
||||
src_time = INT
|
||||
},
|
||||
})
|
||||
wrench:register_node("technic:mv_extractor", {
|
||||
lists = {"src", "dst", "upgrade1", "upgrade2"},
|
||||
metas = {infotext = STRING,
|
||||
lists = { "src", "dst", "upgrade1", "upgrade2" },
|
||||
metas = {
|
||||
infotext = STRING,
|
||||
formspec = STRING,
|
||||
MV_EU_demand = INT,
|
||||
MV_EU_input = INT,
|
||||
tube_time = INT,
|
||||
src_time = INT},
|
||||
src_time = INT
|
||||
},
|
||||
})
|
||||
wrench:register_node("technic:mv_extractor_active", {
|
||||
lists = {"src", "dst", "upgrade1", "upgrade2"},
|
||||
metas = {infotext = STRING,
|
||||
lists = { "src", "dst", "upgrade1", "upgrade2" },
|
||||
metas = {
|
||||
infotext = STRING,
|
||||
formspec = STRING,
|
||||
MV_EU_demand = INT,
|
||||
MV_EU_input = INT,
|
||||
tube_time = INT,
|
||||
src_time = INT},
|
||||
src_time = INT
|
||||
},
|
||||
})
|
||||
wrench:register_node("technic:compressor", {
|
||||
lists = {"src", "dst"},
|
||||
metas = {infotext = STRING,
|
||||
lists = { "src", "dst" },
|
||||
metas = {
|
||||
infotext = STRING,
|
||||
formspec = STRING,
|
||||
LV_EU_demand = INT,
|
||||
LV_EU_input = INT,
|
||||
src_time = INT},
|
||||
src_time = INT
|
||||
},
|
||||
})
|
||||
wrench:register_node("technic:compressor_active", {
|
||||
lists = {"src", "dst"},
|
||||
metas = {infotext = STRING,
|
||||
lists = { "src", "dst" },
|
||||
metas = {
|
||||
infotext = STRING,
|
||||
formspec = STRING,
|
||||
LV_EU_demand = INT,
|
||||
LV_EU_input = INT,
|
||||
src_time = INT},
|
||||
src_time = INT
|
||||
},
|
||||
})
|
||||
wrench:register_node("technic:mv_compressor", {
|
||||
lists = {"src", "dst", "upgrade1", "upgrade2"},
|
||||
metas = {infotext = STRING,
|
||||
lists = { "src", "dst", "upgrade1", "upgrade2" },
|
||||
metas = {
|
||||
infotext = STRING,
|
||||
formspec = STRING,
|
||||
MV_EU_demand = INT,
|
||||
MV_EU_input = INT,
|
||||
tube_time = INT,
|
||||
src_time = INT},
|
||||
src_time = INT
|
||||
},
|
||||
})
|
||||
wrench:register_node("technic:mv_compressor_active", {
|
||||
lists = {"src", "dst", "upgrade1", "upgrade2"},
|
||||
metas = {infotext = STRING,
|
||||
lists = { "src", "dst", "upgrade1", "upgrade2" },
|
||||
metas = {
|
||||
infotext = STRING,
|
||||
formspec = STRING,
|
||||
MV_EU_demand = INT,
|
||||
MV_EU_input = INT,
|
||||
tube_time = INT,
|
||||
src_time = INT},
|
||||
src_time = INT
|
||||
},
|
||||
})
|
||||
wrench:register_node("technic:cnc", {
|
||||
lists = {"src", "dst"},
|
||||
metas = {infotext = STRING,
|
||||
lists = { "src", "dst" },
|
||||
metas = {
|
||||
infotext = STRING,
|
||||
formspec = STRING,
|
||||
LV_EU_demand = INT,
|
||||
LV_EU_input = INT,
|
||||
src_time = INT,
|
||||
cnc_product = STRING},
|
||||
cnc_product = STRING
|
||||
},
|
||||
})
|
||||
wrench:register_node("technic:cnc_active", {
|
||||
lists = {"src", "dst"},
|
||||
metas = {infotext = STRING,
|
||||
lists = { "src", "dst" },
|
||||
metas = {
|
||||
infotext = STRING,
|
||||
formspec = STRING,
|
||||
LV_EU_demand = INT,
|
||||
LV_EU_input = INT,
|
||||
src_time = INT,
|
||||
cnc_product = STRING},
|
||||
cnc_product = STRING
|
||||
},
|
||||
})
|
||||
wrench:register_node("technic:mv_centrifuge", {
|
||||
lists = {"src", "dst", "upgrade1", "upgrade2"},
|
||||
metas = {infotext = STRING,
|
||||
lists = { "src", "dst", "upgrade1", "upgrade2" },
|
||||
metas = {
|
||||
infotext = STRING,
|
||||
formspec = STRING,
|
||||
MV_EU_demand = INT,
|
||||
MV_EU_input = INT,
|
||||
tube_time = INT,
|
||||
src_time = INT},
|
||||
src_time = INT
|
||||
},
|
||||
})
|
||||
wrench:register_node("technic:mv_centrifuge_active", {
|
||||
lists = {"src", "dst", "upgrade1", "upgrade2"},
|
||||
metas = {infotext = STRING,
|
||||
lists = { "src", "dst", "upgrade1", "upgrade2" },
|
||||
metas = {
|
||||
infotext = STRING,
|
||||
formspec = STRING,
|
||||
MV_EU_demand = INT,
|
||||
MV_EU_input = INT,
|
||||
tube_time = INT,
|
||||
src_time = INT},
|
||||
src_time = INT
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
local chest_mark_colors = {
|
||||
'_black',
|
||||
'_blue',
|
||||
'_brown',
|
||||
'_cyan',
|
||||
'_dark_green',
|
||||
'_dark_grey',
|
||||
'_green',
|
||||
'_grey',
|
||||
'_magenta',
|
||||
'_orange',
|
||||
'_pink',
|
||||
'_red',
|
||||
'_violet',
|
||||
'_white',
|
||||
'_yellow',
|
||||
'',
|
||||
"_black",
|
||||
"_blue",
|
||||
"_brown",
|
||||
"_cyan",
|
||||
"_dark_green",
|
||||
"_dark_grey",
|
||||
"_green",
|
||||
"_grey",
|
||||
"_magenta",
|
||||
"_orange",
|
||||
"_pink",
|
||||
"_red",
|
||||
"_violet",
|
||||
"_white",
|
||||
"_yellow",
|
||||
"",
|
||||
}
|
||||
|
||||
for i = 1, 15 do
|
||||
wrench:register_node("technic:gold_chest"..chest_mark_colors[i], {
|
||||
lists = {"main"},
|
||||
metas = {infotext = STRING,formspec = STRING},
|
||||
lists = { "main" },
|
||||
metas = { infotext = STRING, formspec = STRING },
|
||||
})
|
||||
wrench:register_node("technic:gold_locked_chest"..chest_mark_colors[i], {
|
||||
lists = {"main"},
|
||||
metas = {infotext = STRING,owner = STRING,formspec = STRING},
|
||||
lists = { "main" },
|
||||
metas = { infotext = STRING, owner = STRING, formspec = STRING },
|
||||
owned = true,
|
||||
})
|
||||
end
|
||||
@ -328,14 +397,16 @@ if minetest.get_modpath("technic") then
|
||||
local ltier = tier:lower()
|
||||
for i = 0, 8 do
|
||||
wrench:register_node("technic:"..ltier.."_battery_box"..i, {
|
||||
lists = {"src", "dst"},
|
||||
metas = {infotext = STRING,
|
||||
lists = { "src", "dst" },
|
||||
metas = {
|
||||
infotext = STRING,
|
||||
formspec = STRING,
|
||||
[tier.."_EU_demand"] = INT,
|
||||
[tier.."_EU_supply"] = INT,
|
||||
[tier.."_EU_input"] = INT,
|
||||
internal_EU_charge = INT,
|
||||
last_side_shown = INT},
|
||||
last_side_shown = INT
|
||||
},
|
||||
})
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user