diff --git a/mods/moreblocks/_config.txt b/mods/moreblocks/_config.txt deleted file mode 100644 index a7e6fcd..0000000 --- a/mods/moreblocks/_config.txt +++ /dev/null @@ -1,17 +0,0 @@ ------------------------------------------------------------------------------- ------------------------------- CONFIGURATION --------------------------------- ------------------------------------------------------------------------------- - ------------------------------------------------------------------------------- --------- Change settings by changing the values after the "=". --------------- ------------------------------------------------------------------------------- - - --- Whether to direct wood based on player yaw when placing the block (true or false) -wood_facedir = true - --- Allow stair/slab crafting without a circular saw or not (true or false) -allow_stair_slab_crafting = true - --- Show stairs/slabs/panels/microblocks in creative inventory (true or false) -show_stairsplus_creative_inv = false diff --git a/mods/moreblocks/circular_saw.lua b/mods/moreblocks/circular_saw.lua index c8dc2ad..b220359 100644 --- a/mods/moreblocks/circular_saw.lua +++ b/mods/moreblocks/circular_saw.lua @@ -122,7 +122,7 @@ function circular_saw:update_inventory(pos, amount) end local node_name = stack:get_name() - local name_parts = circular_saw.known_nodes[node_name] + local name_parts = circular_saw.known_nodes[node_name] or "" local modname = name_parts[1] local material = name_parts[2] diff --git a/mods/moreblocks/stairsplus.lua b/mods/moreblocks/stairsplus.lua deleted file mode 100644 index 3f85902..0000000 --- a/mods/moreblocks/stairsplus.lua +++ /dev/null @@ -1,415 +0,0 @@ -dofile(minetest.get_modpath("moreblocks").."/_config.txt") - --- Nodes will be called :{stair,slab,panel,micro}_ - -if minetest.get_modpath("unified_inventory") or not minetest.setting_getbool("creative_mode") then - stairsplus_expect_infinite_stacks = false -else - stairsplus_expect_infinite_stacks = true -end - --- These vales are in order: facedir in degrees = 90, 0, 270, 180, 90 - -local dirs1 = { 21, 20, 23, 22, 21 } -local dirs2 = { 15, 8, 17, 6, 15 } -local dirs3 = { 14, 11, 16, 5, 14 } - -stairsplus_can_it_stack = function(itemstack, placer, pointed_thing) - return false ---[[ - if pointed_thing.type ~= "node" then - return itemstack - end - - -- If it's being placed on an another similar one, replace it with - -- a full block - local slabpos = nil - local slabnode = nil - local p1 = pointed_thing.above - p1 = {x = p1.x, y = p1.y - 1, z = p1.z} - local n1 = minetest.env:get_node(p1) - if n1.name == modname .. ":slab_" .. subname then - slabpos = p1 - slabnode = n1 - end - if slabpos then - -- Remove the slab at slabpos - minetest.env:remove_node(slabpos) - -- Make a fake stack of a single item and try to place it - local fakestack = ItemStack(recipeitem) - pointed_thing.above = slabpos - fakestack = minetest.item_place(fakestack, placer, pointed_thing) - -- If the item was taken from the fake stack, decrement original - if not fakestack or fakestack:is_empty() then - itemstack:take_item(1) - -- Else put old node back - else - minetest.env:set_node(slabpos, slabnode) - end - return itemstack - end - - if n1.name == modname .. ":slab_" .. subname .. "_quarter" then - slabpos = p1 - slabnode = n1 - end - if slabpos then - -- Remove the slab at slabpos - minetest.env:remove_node(slabpos) - -- Make a fake stack of a single item and try to place it - local fakestack = ItemStack(modname .. ":slab_" .. subname .. "_three_quarter") - pointed_thing.above = slabpos - fakestack = minetest.item_place(fakestack, placer, pointed_thing) - -- If the item was taken from the fake stack, decrement original - if not fakestack or fakestack:is_empty() then - itemstack:take_item(1) - -- Else put old node back - else - minetest.env:set_node(slabpos, slabnode) - end - return itemstack - end - - -- Otherwise place regularly - return minetest.item_place(itemstack, placer, pointed_thing) - -]]-- - -end - -local function get_nodedef_field(nodename, fieldname) - if not minetest.registered_nodes[nodename] then - return nil - end - return minetest.registered_nodes[nodename][fieldname] -end - ---[[ - -function(itemstack, placer, pointed_thing) - local keys=placer:get_player_control() - stairsplus_rotate_and_place(itemstack, placer, pointed_thing, keys["sneak"]) - return itemstack - end - -]]-- - -function stairsplus_rotate_and_place(itemstack, placer, pointed_thing) - if not moreblocks.node_is_owned(pointed_thing.under, placer) then - local keys=placer:get_player_control() - minetest.rotate_and_place(itemstack, placer, pointed_thing, - stairsplus_expect_infinite_stacks, {force_wall = keys.sneak}) - end - return itemstack -end - -function register_stair_slab_panel_micro(modname, subname, recipeitem, groups, images, description, drop, light) - if show_stairsplus_creative_inv then - groups.not_in_creative_inventory = 0 - else - groups.not_in_creative_inventory = 1 - end - register_stair(modname, subname, recipeitem, groups, images, description, drop, light) - register_slab( modname, subname, recipeitem, groups, images, description, drop, light) - register_panel(modname, subname, recipeitem, groups, images, description, drop, light) - register_micro(modname, subname, recipeitem, groups, images, description, drop, light) - register_6dfacedir_conversion(modname, subname) -end - --- Default stairs/slabs/panels/microblocks. - -register_stair_slab_panel_micro("moreblocks", "wood", "default:wood", - {snappy=1, choppy=2, oddly_breakable_by_hand=2, flammable=3}, - {"default_wood.png"}, - "Wooden", - "wood", - 0) - -register_stair_slab_panel_micro("moreblocks", "stone", "default:stone", - {cracky=3}, - {"default_stone.png"}, - "Stone", - "cobble", - 0) - -register_stair_slab_panel_micro("moreblocks", "cobble", "default:cobble", - {cracky=3}, - {"default_cobble.png"}, - "Cobblestone", - "cobble", - 0) - -register_stair_slab_panel_micro("moreblocks", "mossycobble", "default:mossycobble", - {cracky=3}, - {"default_mossycobble.png"}, - "Mossy Cobblestone", - "mossycobble", - 0) - -register_stair_slab_panel_micro("moreblocks", "brick", "default:brick", - {cracky=3}, - {"default_brick.png"}, - "Brick", - "brick", - 0) - -register_stair_slab_panel_micro("moreblocks", "sandstone", "default:sandstone", - {crumbly=2, cracky=2}, - {"default_sandstone.png"}, - "Sandstone", - "sandstone", - 0) - -register_stair_slab_panel_micro("moreblocks", "steelblock", "default:steelblock", - {cracky=1, level=2}, - {"default_steel_block.png"}, - "Steel Block", - "steelblock", - 0) - -register_stair_slab_panel_micro("moreblocks", "goldblock", "default:goldblock", - {cracky=1}, - {"default_gold_block.png"}, - "Gold Block", - "goldblock", - 0) - -register_stair_slab_panel_micro("moreblocks", "copperblock", "default:copperblock", - {cracky=1, level=2}, - {"default_copper_block.png"}, - "Copper Block", - "copperblock", - 0) - -register_stair_slab_panel_micro("moreblocks", "bronzeblock", "default:bronzeblock", - {cracky=1, level=2}, - {"default_bronze_block.png"}, - "Bronze Block", - "bronzeblock", - 0) - -register_stair_slab_panel_micro("moreblocks", "diamondblock", "default:diamondblock", - {cracky=1, level=3}, - {"default_diamond_block.png"}, - "Diamond Block", - "diamondblock", - 0) - -register_stair_slab_panel_micro("moreblocks", "desert_stone", "default:desert_stone", - {cracky=3}, - {"default_desert_stone.png"}, - "Desert Stone", - "desert_stone", - 0) - -register_stair_slab_panel_micro("moreblocks", "glass", "default:glass", - {snappy=2, cracky=3, oddly_breakable_by_hand=3}, - {"moreblocks_glass_stairsplus.png"}, - "Glass", - "glass", - 0) - -register_stair_slab_panel_micro("moreblocks", "tree", "default:tree", - {tree=1, snappy=1, choppy=2, oddly_breakable_by_hand=1, flammable=2}, - {"default_tree_top.png", "default_tree_top.png", "default_tree.png"}, - "Tree", - "tree", - 0) - -register_stair_slab_panel_micro("moreblocks", "jungletree", "default:jungletree", - {tree=1, snappy=1, choppy=2, oddly_breakable_by_hand=1, flammable=2}, - {"default_jungletree_top.png", "default_jungletree_top.png", "default_jungletree.png"}, - "Jungle Tree", - "jungletree", - 0) - -register_stair_slab_panel_micro("moreblocks", "obsidian", "default:obsidian", - {cracky=1, level=2}, - {"default_obsidian.png"}, - "Obsidian", - "obsidian", - 0) - -register_stair_slab_panel_micro("moreblocks", "obsidian_glass", "default:obsidian_glass", - {cracky=3, oddly_breakable_by_hand=3}, - {"moreblocks_obsidian_glass_stairsplus.png"}, - "Obsidian Glass", - "obsidian_glass", - 0) - -register_stair_slab_panel_micro("moreblocks", "stonebrick", "default:stonebrick", - {cracky=3}, - {"default_stone_brick.png"}, - "Stone Bricks", - "stonebrick", - 0) - -register_stair_slab_panel_micro("moreblocks", "desert_stonebrick", "default:desert_stonebrick", - {cracky=3}, - {"default_desert_stone_brick.png"}, - "Desert Stone Bricks", - "desert_stonebrick", - 0) - -register_stair_slab_panel_micro("moreblocks", "sandstonebrick", "default:sandstonebrick", - {cracky=3}, - {"default_sandstone_brick.png"}, - "Sandstone Bricks", - "sandstonebrick", - 0) - --- More Blocks stairs/slabs/panels/microblocks - -register_stair_slab_panel_micro("moreblocks", "invisible", "air", - {unbreakable=1, not_in_creative_inventory=1}, - {"invisible.png"}, - "Invisible", - "invisible", - 0) - -register_stair_slab_panel_micro("moreblocks", "circle_stone_bricks", "moreblocks:circle_stone_bricks", - {cracky=3}, - {"moreblocks_circle_stone_bricks.png"}, - "Circle Stone Bricks", - "circle_stone_bricks", - 0) - -register_stair_slab_panel_micro("moreblocks", "coal_stone_bricks", "moreblocks:coal_stone_bricks", - {cracky=3}, - {"moreblocks_coal_stone_bricks.png"}, - "Coal Stone Bricks", - "Coal_stone_bricks", - 0) - -register_stair_slab_panel_micro("moreblocks", "iron_stone_bricks", "moreblocks:iron_stone_bricks", - {cracky=3}, - {"moreblocks_iron_stone_bricks.png"}, - "Iron Stone Bricks", - "iron_stone_bricks", - 0) - -register_stair_slab_panel_micro("moreblocks", "stone_tile", "moreblocks:stone_tile", - {cracky=3}, - {"moreblocks_stone_tile.png"}, - "Stonesquare", - "stone_tile", - 0) - -register_stair_slab_panel_micro("moreblocks", "split_stone_tile", "moreblocks:split_stone_tile", - {cracky=3}, - {"moreblocks_split_stone_tile_top.png", "moreblocks_split_stone_tile.png"}, - "Split Stonesquare", - "split_stone_tile", - 0) - -register_stair_slab_panel_micro("moreblocks", "jungle_wood", "default:junglewood", -- Compatibility - {snappy=1, choppy=2, oddly_breakable_by_hand=2,flammable=3}, - {"default_junglewood.png"}, - "Jungle Wood", - "jungle_wood", - 0) - -register_stair_slab_panel_micro("moreblocks", "junglewood", "default:junglewood", - {snappy=1, choppy=2, oddly_breakable_by_hand=2,flammable=3}, - {"default_junglewood.png"}, - "Jungle Wood", - "jungle_wood", - 0) - -register_stair_slab_panel_micro("moreblocks", "plankstone", "moreblocks:plankstone", - {cracky=3}, - {"moreblocks_plankstone.png", "moreblocks_plankstone.png", "moreblocks_plankstone.png", - "moreblocks_plankstone.png", "moreblocks_plankstone.png^[transformR90", "moreblocks_plankstone.png^[transformR90"}, - "Plankstone", - "plankstone", - 0) - -register_stair_slab_panel_micro("moreblocks", "coal_checker", "moreblocks:coal_checker", - {cracky=3}, - {"moreblocks_coal_checker.png", "moreblocks_coal_checker.png", "moreblocks_coal_checker.png", - "moreblocks_coal_checker.png", "moreblocks_coal_checker.png^[transformR90", "moreblocks_coal_checker.png^[transformR90"}, - "Coal Checker", - "coal_checker", - 0) - -register_stair_slab_panel_micro("moreblocks", "iron_checker", "moreblocks:iron_checker", - {cracky=3}, - {"moreblocks_iron_checker.png", "moreblocks_iron_checker.png", "moreblocks_iron_checker.png", - "moreblocks_iron_checker.png", "moreblocks_iron_checker.png^[transformR90", "moreblocks_iron_checker.png^[transformR90"}, - "Iron Checker", - "iron_checker", - 0) - -register_stair_slab_panel_micro("moreblocks", "cactus_checker", "moreblocks:cactus_checker", - {cracky=3}, - {"moreblocks_cactus_checker.png", "moreblocks_cactus_checker.png", "moreblocks_cactus_checker.png", - "moreblocks_cactus_checker.png", "moreblocks_cactus_checker.png^[transformR90", "moreblocks_cactus_checker.png^[transformR90"}, - "Cactus Checker", - "cactus_checker", - 0) - -register_stair_slab_panel_micro("moreblocks", "coal_stone", "moreblocks:coal_stone", - {cracky=3}, - {"moreblocks_coal_stone.png"}, - "Coal Stone", - "coal_stone", - 0) - -register_stair_slab_panel_micro("moreblocks", "iron_stone", "moreblocks:iron_stone", - {cracky=3}, - {"moreblocks_iron_stone.png"}, - "Iron Stone", - "iron_stone", - 0) - -register_stair_slab_panel_micro("moreblocks", "glow_glass", "moreblocks:glow_glass", - {snappy=2,cracky=3,oddly_breakable_by_hand=3}, - {"moreblocks_glow_glass_stairsplus.png"}, - "Glow Glass", - "glow_glass", - 11) - -register_stair_slab_panel_micro("moreblocks", "super_glow_glass", "moreblocks:super_glow_glass", - {snappy=2, cracky=3, oddly_breakable_by_hand=3}, - {"moreblocks_super_glow_glass_stairsplus.png"}, - "Super Glow Glass", - "super_glow_glass", - 15) - -register_stair_slab_panel_micro("moreblocks", "coal_glass", "moreblocks:coal_glass", - {snappy=2, cracky=3, oddly_breakable_by_hand=3}, - {"moreblocks_coal_glass_stairsplus.png"}, - "Coal Glass", - "coal_glass", - 0) - -register_stair_slab_panel_micro("moreblocks", "iron_glass", "moreblocks:iron_glass", - {snappy=2, cracky=3, oddly_breakable_by_hand=3}, - {"moreblocks_iron_glass_stairsplus.png"}, - "Iron Glass", - "iron_glass", - 0) - -register_stair_slab_panel_micro("moreblocks", "wood_tile", "moreblocks:wood_tile", - {snappy=1, choppy=2, oddly_breakable_by_hand=2, flammable=3}, - {"moreblocks_wood_tile.png", "moreblocks_wood_tile.png", "moreblocks_wood_tile.png", - "moreblocks_wood_tile.png", "moreblocks_wood_tile.png^[transformR90", "moreblocks_wood_tile.png^[transformR90"}, - "Wooden Tile", - "wood_tile", - 0) - -register_stair_slab_panel_micro("moreblocks", "wood_tile_center", "moreblocks:wood_tile_center", - {snappy=1, choppy=2, oddly_breakable_by_hand=2, flammable=3}, - {"moreblocks_wood_tile_center.png", "moreblocks_wood_tile_center.png", "moreblocks_wood_tile_center.png", - "moreblocks_wood_tile_center.png", "moreblocks_wood_tile_center.png^[transformR90", "moreblocks_wood_tile_center.png^[transformR90"}, - "Centered Wooden Tile", - "wood_tile_center", - 0) - -register_stair_slab_panel_micro("moreblocks", "wood_tile_full", "moreblocks:wood_tile_full", - {snappy=1, choppy=2, oddly_breakable_by_hand=2, flammable=3}, - {"moreblocks_wood_tile_full.png", "moreblocks_wood_tile_full.png", "moreblocks_wood_tile_full.png", - "moreblocks_wood_tile_full.png", "moreblocks_wood_tile_full.png^[transformR90", "moreblocks_wood_tile_full.png^[transformR90"}, - "Full Wooden Tile", - "wood_tile_full", - 0) diff --git a/mods/moreblocks/stairsplus/registrations.lua b/mods/moreblocks/stairsplus/registrations.lua index 8ba7573..cc22d33 100644 --- a/mods/moreblocks/stairsplus/registrations.lua +++ b/mods/moreblocks/stairsplus/registrations.lua @@ -10,7 +10,7 @@ local default_nodes = { -- Default stairs/slabs/panels/microblocks: "bronzeblock", "diamondblock", "desert_stone", - "desert_cobble", +-- "desert_cobble", "glass", "tree", "wood", @@ -46,3 +46,4 @@ for _, name in pairs(default_nodes) do sunlight_propagates = true, }) end + diff --git a/mods/moreblocks/stairsplus_convert.lua b/mods/moreblocks/stairsplus_convert.lua deleted file mode 100644 index 7d6b94b..0000000 --- a/mods/moreblocks/stairsplus_convert.lua +++ /dev/null @@ -1,133 +0,0 @@ --- Function to convert all stairs/slabs/etc nodes from --- inverted, wall, etc to regular + 6d facedir - -local dirs1 = { 21, 20, 23, 22, 21 } -local dirs2 = { 15, 8, 17, 6, 15 } -local dirs3 = { 14, 11, 16, 5, 14 } - -function register_6dfacedir_conversion(modname, material) - --print("Register stairsplus 6d facedir conversion") - --print('ABM for '..modname..' "'..material..'"') - - local objects_list1 = { - modname..":slab_" .. material .. "_inverted", - modname..":slab_" .. material .. "_quarter_inverted", - modname..":slab_" .. material .. "_three_quarter_inverted", - modname..":stair_" .. material .. "_inverted", - modname..":stair_" .. material .. "_wall", - modname..":stair_" .. material .. "_wall_half", - modname..":stair_" .. material .. "_wall_half_inverted", - modname..":stair_" .. material .. "_half_inverted", - modname..":stair_" .. material .. "_right_half_inverted", - modname..":panel_" .. material .. "_vertical", - modname..":panel_" .. material .. "_top", - } - - local objects_list2 = { - modname..":slab_" .. material .. "_wall", - modname..":slab_" .. material .. "_quarter_wall", - modname..":slab_" .. material .. "_three_quarter_wall", - modname..":stair_" .. material .. "_inner_inverted", - modname..":stair_" .. material .. "_outer_inverted", - modname..":micro_" .. material .. "_top" - } - - for j in ipairs(objects_list1) do - local flip_upside_down = false - local flip_to_wall = false - - local object = objects_list1[j] - local dest_object = objects_list1[j] - - if string.find(dest_object, "_inverted") then - flip_upside_down = true - dest_object = string.gsub(dest_object, "_inverted", "") - end - - if string.find(dest_object, "_top") then - flip_upside_down = true - dest_object = string.gsub(dest_object, "_top", "") - end - - if string.find(dest_object, "_wall") then - flip_to_wall = true - dest_object = string.gsub(dest_object, "_wall", "") - end - - if string.find(dest_object, "_vertical") then - flip_to_wall = true - dest_object = string.gsub(dest_object, "_vertical", "") - end - - if string.find(dest_object, "_half") and not string.find(dest_object, "_right_half") then - dest_object = string.gsub(dest_object, "_half", "_right_half") - elseif string.find(dest_object, "_right_half") then - dest_object = string.gsub(dest_object, "_right_half", "_half") - end - - --print(" +---> convert "..object) - --print(" | to "..dest_object) - - minetest.register_abm({ - nodenames = { object }, - interval = 1, - chance = 1, - action = function(pos, node, active_object_count, active_object_count_wider) - local fdir = node.param2 or 0 - - if flip_upside_down and not flip_to_wall then - nfdir = dirs1[fdir+2] - elseif flip_to_wall and not flip_upside_down then - nfdir = dirs2[fdir+1] - elseif flip_to_wall and flip_upside_down then - nfdir = dirs3[fdir+2] - end - minetest.env:add_node(pos, {name = dest_object, param2 = nfdir}) - end - }) - end - - for j in ipairs(objects_list2) do - local flip_upside_down = false - local flip_to_wall = false - - local object = objects_list2[j] - local dest_object = objects_list2[j] - - if string.find(dest_object, "_inverted") then - flip_upside_down = true - dest_object = string.gsub(dest_object, "_inverted", "") - end - - if string.find(dest_object, "_top") then - flip_upside_down = true - dest_object = string.gsub(dest_object, "_top", "") - end - - if string.find(dest_object, "_wall") then - flip_to_wall = true - dest_object = string.gsub(dest_object, "_wall", "") - end - - --print(" +---> convert "..object) - --print(" | to "..dest_object) - - minetest.register_abm({ - nodenames = { object }, - interval = 1, - chance = 1, - action = function(pos, node, active_object_count, active_object_count_wider) - local fdir = node.param2 - local nfdir = 20 - - if flip_upside_down and not flip_to_wall then - nfdir = dirs1[fdir+1] - elseif flip_to_wall and not flip_upside_down then - nfdir = dirs2[fdir+2] - - end - minetest.env:add_node(pos, {name = dest_object, param2 = nfdir}) - end - }) - end -end diff --git a/mods/moreblocks/textures/moreblocks_jungle_wood.png b/mods/moreblocks/textures/moreblocks_jungle_wood.png deleted file mode 100644 index ebc6485..0000000 Binary files a/mods/moreblocks/textures/moreblocks_jungle_wood.png and /dev/null differ diff --git a/mods/moreblocks/textures/moreblocks_wood.png b/mods/moreblocks/textures/moreblocks_wood.png deleted file mode 100644 index 66f2b72..0000000 Binary files a/mods/moreblocks/textures/moreblocks_wood.png and /dev/null differ diff --git a/mods/moreblocks/textures/moreblocks_wood_tile_down.png b/mods/moreblocks/textures/moreblocks_wood_tile_down.png deleted file mode 100644 index aedddfb..0000000 Binary files a/mods/moreblocks/textures/moreblocks_wood_tile_down.png and /dev/null differ diff --git a/mods/moreblocks/textures/moreblocks_wood_tile_flipped.png b/mods/moreblocks/textures/moreblocks_wood_tile_flipped.png deleted file mode 100644 index 66eb5a6..0000000 Binary files a/mods/moreblocks/textures/moreblocks_wood_tile_flipped.png and /dev/null differ diff --git a/mods/moreblocks/textures/moreblocks_wood_tile_left.png b/mods/moreblocks/textures/moreblocks_wood_tile_left.png deleted file mode 100644 index b84166f..0000000 Binary files a/mods/moreblocks/textures/moreblocks_wood_tile_left.png and /dev/null differ diff --git a/mods/moreblocks/textures/moreblocks_wood_tile_right.png b/mods/moreblocks/textures/moreblocks_wood_tile_right.png deleted file mode 100644 index 883f44c..0000000 Binary files a/mods/moreblocks/textures/moreblocks_wood_tile_right.png and /dev/null differ diff --git a/mods/moreores/init.lua b/mods/moreores/init.lua index 32fb5ef..7585d7d 100644 --- a/mods/moreores/init.lua +++ b/mods/moreores/init.lua @@ -9,7 +9,7 @@ if (minetest.get_modpath("intllib")) then end moreores_modpath = minetest.get_modpath("moreores") -dofile(moreores_modpath.."/_config.txt") +dofile(moreores_modpath .. "/_config.txt") --[[ **** @@ -35,58 +35,47 @@ local function hoe_on_use(itemstack, user, pointed_thing, uses) end local under = minetest.get_node(pt.under) - local p = {x=pt.under.x, y=pt.under.y+1, z=pt.under.z} - local above = minetest.get_node(p) + local pos = {x = pt.under.x, y = pt.under.y + 1, z = pt.under.z} + local above = minetest.get_node(pos) - -- return if any of the nodes is not registered - if not minetest.registered_nodes[under.name] then - return - end - if not minetest.registered_nodes[above.name] then - return - end + -- Return if any of the nodes is not registered: + if not minetest.registered_nodes[under.name] then return end + if not minetest.registered_nodes[above.name] then return end - -- check if the node above the pointed thing is air - if above.name ~= "air" then - return - end + -- Check if the node above the pointed thing is air: + if above.name ~= "air" then return end - -- check if pointing at dirt - if minetest.get_item_group(under.name, "soil") ~= 1 then - return - end + -- Check if pointing at dirt: + if minetest.get_item_group(under.name, "soil") ~= 1 then return end - -- turn the node into soil, wear out item and play sound - minetest.set_node(pt.under, {name="farming:soil"}) - minetest.sound_play("default_dig_crumbly", { - pos = pt.under, - gain = 0.5, - }) - itemstack:add_wear(65535/(uses-1)) + -- Turn the node into soil, wear out item and play sound: + minetest.set_node(pt.under, {name ="farming:soil"}) + minetest.sound_play("default_dig_crumbly", {pos = pt.under, gain = 0.5}) + itemstack:add_wear(65535 / (uses - 1)) return itemstack end local function get_recipe(c, name) if name == "sword" then - return {{c},{c},{"default:stick"}} + return {{c}, {c}, {"group:stick"}} end if name == "shovel" then - return {{c},{"default:stick"},{"default:stick"}} + return {{c}, {"group:stick"}, {"group:stick"}} end if name == "axe" then - return {{c,c},{c,"default:stick"},{"","default:stick"}} + return {{c, c}, {c, "group:stick"}, {"", "group:stick"}} end if name == "pick" then - return {{c,c,c},{"","default:stick",""},{"","default:stick",""}} + return {{c, c, c}, {"", "group:stick", ""}, {"", "group:stick", ""}} end if name == "hoe" then - return {{c,c},{"","default:stick"},{"","default:stick"}} + return {{c, c}, {"", "group:stick"}, {"", "group:stick"}} end if name == "block" then - return {{c,c,c},{c,c,c},{c,c,c}} + return {{c, c, c}, {c, c, c}, {c, c, c}} end if name == "lockedchest" then - return {{"default:wood","default:wood","default:wood"},{"default:wood",c,"default:wood"},{"default:wood","default:wood","default:wood"}} + return {{"group:wood", "group:wood", "group:wood"}, {"group:wood", c, "group:wood"}, {"group:wood", "group:wood", "group:wood"}} end end @@ -104,7 +93,7 @@ local function add_ore(modname, description, mineral_name, oredef) minetest.register_node(modname .. ":mineral_"..mineral_name, { description = S("%s Ore"):format(S(description)), tiles = {"default_stone.png^"..modname.."_mineral_"..mineral_name..".png"}, - groups = {cracky=3}, + groups = {cracky = 3}, sounds = default_stone_sounds, drop = lumpitem }) @@ -115,7 +104,7 @@ local function add_ore(modname, description, mineral_name, oredef) minetest.register_node(blockitem, { description = S("%s Block"):format(S(description)), tiles = { img_base .. "_block.png" }, - groups = {snappy=1,bendy=2,cracky=1,melty=2,level=2}, + groups = {snappy = 1,bendy = 2, cracky = 1,melty = 2,level= 2}, sounds = default_stone_sounds }) minetest.register_alias(mineral_name.."_block", blockitem) @@ -158,20 +147,20 @@ local function add_ore(modname, description, mineral_name, oredef) if oredef.makes.chest then minetest.register_craft( { - output = "default:chest_locked 1", + output = "default:chest_locked", recipe = { - { ingot }, - { "default:chest" } + {ingot}, + {"default:chest"} } }) minetest.register_craft( { - output = "default:chest_locked 1", + output = "default:chest_locked", recipe = get_recipe(ingot, "lockedchest") }) end oredef.oredef.ore_type = "scatter" - oredef.oredef.ore = modname..":mineral_"..mineral_name + oredef.oredef.ore = modname .. ":mineral_" .. mineral_name oredef.oredef.wherein = "default:stone" minetest.register_ore(oredef.oredef) @@ -181,25 +170,32 @@ local function add_ore(modname, description, mineral_name, oredef) description = "", inventory_image = toolimg_base .. toolname .. ".png", tool_capabilities = { - max_drop_level=3, - groupcaps=tooldef + max_drop_level = 3, + groupcaps = tooldef } } - + if toolname == "sword" then - tdef.full_punch_interval = oredef.punchint + tdef.tool_capabilities.full_punch_interval = oredef.full_punch_interval + tdef.tool_capabilities.damage_groups = oredef.damage_groups tdef.description = S("%s Sword"):format(S(description)) end - + if toolname == "pick" then + tdef.tool_capabilities.full_punch_interval = oredef.full_punch_interval + tdef.tool_capabilities.damage_groups = oredef.damage_groups tdef.description = S("%s Pickaxe"):format(S(description)) end - + if toolname == "axe" then + tdef.tool_capabilities.full_punch_interval = oredef.full_punch_interval + tdef.tool_capabilities.damage_groups = oredef.damage_groups tdef.description = S("%s Axe"):format(S(description)) end if toolname == "shovel" then + tdef.full_punch_interval = oredef.full_punch_interval + tdef.tool_capabilities.damage_groups = oredef.damage_groups tdef.description = S("%s Shovel"):format(S(description)) end @@ -224,14 +220,13 @@ local function add_ore(modname, description, mineral_name, oredef) end end --- Add everything (compact(ish)!) - +-- Add everything: local modname = "moreores" local oredefs = { silver = { desc = "Silver", - makes = {ore=true, block=true, lump=true, ingot=true, chest=true}, + makes = {ore = true, block = true, lump = true, ingot = true, chest = true}, oredef = {clust_scarcity = moreores_silver_chunk_size * moreores_silver_chunk_size * moreores_silver_chunk_size, clust_num_ores = moreores_silver_ore_per_chunk, clust_size = moreores_silver_chunk_size, @@ -240,29 +235,30 @@ local oredefs = { }, tools = { pick = { - cracky={times={[1]=2.60, [2]=1.00, [3]=0.60}, uses=100, maxlevel=1} + cracky = {times = {[1] = 2.60, [2] = 1.00, [3] = 0.60}, uses = 100, maxlevel= 1} }, hoe = { uses = 300 }, shovel = { - crumbly={times={[1]=1.10, [2]=0.40, [3]=0.25}, uses=100, maxlevel=1} + crumbly = {times = {[1] = 1.10, [2] = 0.40, [3] = 0.25}, uses = 100, maxlevel= 1} }, axe = { - choppy={times={[1]=2.50, [2]=0.80, [3]=0.50}, uses=100, maxlevel=1}, - fleshy={times={[2]=1.10, [3]=0.60}, uses=100, maxlevel=1} + choppy = {times = {[1] = 2.50, [2] = 0.80, [3] = 0.50}, uses = 100, maxlevel= 1}, + fleshy = {times = {[2] = 1.10, [3] = 0.60}, uses = 100, maxlevel= 1} }, sword = { - fleshy={times={[2]=0.70, [3]=0.30}, uses=100, maxlevel=1}, - snappy={times={[2]=0.70, [3]=0.30}, uses=100, maxlevel=1}, - choppy={times={[3]=0.80}, uses=100, maxlevel=0} + fleshy = {times = {[2] = 0.70, [3] = 0.30}, uses = 100, maxlevel= 1}, + snappy = {times = {[2] = 0.70, [3] = 0.30}, uses = 100, maxlevel= 1}, + choppy = {times = {[3] = 0.80}, uses = 100, maxlevel= 0} } }, - punchint = 1.0 + full_punch_interval = 1.0, + damage_groups = {fleshy = 6}, }, tin = { desc = "Tin", - makes = {ore=true, block=true, lump=true, ingot=true, chest=false}, + makes = {ore = true, block = true, lump = true, ingot = true, chest = false}, oredef = {clust_scarcity = moreores_tin_chunk_size * moreores_tin_chunk_size * moreores_tin_chunk_size, clust_num_ores = moreores_tin_ore_per_chunk, clust_size = moreores_tin_chunk_size, @@ -273,7 +269,7 @@ local oredefs = { }, mithril = { desc = "Mithril", - makes = {ore=true, block=true, lump=true, ingot=true, chest=false}, + makes = {ore = true, block = true, lump = true, ingot = true, chest = false}, oredef = {clust_scarcity = moreores_mithril_chunk_size * moreores_mithril_chunk_size * moreores_mithril_chunk_size, clust_num_ores = moreores_mithril_ore_per_chunk, clust_size = moreores_mithril_chunk_size, @@ -282,25 +278,26 @@ local oredefs = { }, tools = { pick = { - cracky={times={[1]=2.25, [2]=0.55, [3]=0.35}, uses=200, maxlevel=1} + cracky = {times = {[1] = 2.25, [2] = 0.55, [3] = 0.35}, uses = 200, maxlevel= 1} }, hoe = { uses = 1000 }, shovel = { - crumbly={times={[1]=0.70, [2]=0.35, [3]=0.20}, uses=200, maxlevel=1} + crumbly = {times = {[1] = 0.70, [2] = 0.35, [3] = 0.20}, uses = 200, maxlevel= 1} }, axe = { - choppy={times={[1]=1.75, [2]=0.45, [3]=0.45}, uses=200, maxlevel=1}, - fleshy={times={[2]=0.95, [3]=0.30}, uses=200, maxlevel=1} + choppy = {times = {[1] = 1.75, [2] = 0.45, [3] = 0.45}, uses = 200, maxlevel= 1}, + fleshy = {times = {[2] = 0.95, [3] = 0.30}, uses = 200, maxlevel= 1} }, sword = { - fleshy={times={[2]=0.65, [3]=0.25}, uses=200, maxlevel=1}, - snappy={times={[2]=0.70, [3]=0.25}, uses=200, maxlevel=1}, - choppy={times={[3]=0.65}, uses=200, maxlevel=0} + fleshy = {times = {[2] = 0.65, [3] = 0.25}, uses = 200, maxlevel= 1}, + snappy = {times = {[2] = 0.70, [3] = 0.25}, uses = 200, maxlevel= 1}, + choppy = {times = {[3] = 0.65}, uses = 200, maxlevel= 0} } }, - punchint = 0.45 + full_punch_interval = 0.45, + damage_groups = {fleshy = 9}, } } @@ -314,13 +311,12 @@ minetest.register_craft({ output = "moreores:copper_rail 16", recipe = { {"default:copper_ingot", "", "default:copper_ingot"}, - {"default:copper_ingot", "default:stick", "default:copper_ingot"}, + {"default:copper_ingot", "group:stick", "default:copper_ingot"}, {"default:copper_ingot", "", "default:copper_ingot"} } }) --- Bronze has some special cases, because it is made from copper and tin - +-- Bronze has some special cases, because it is made from copper and tin: minetest.register_craft( { type = "shapeless", output = "default:bronze_ingot 3", @@ -331,8 +327,7 @@ minetest.register_craft( { } }) --- Unique node - +-- Unique node: minetest.register_node("moreores:copper_rail", { description = S("Copper Rail"), drawtype = "raillike", @@ -346,7 +341,7 @@ minetest.register_node("moreores:copper_rail", { type = "fixed", fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2}, }, - groups = {bendy=2,snappy=1,dig_immediate=2,rail=1,connect_to_raillike=1}, + groups = {bendy = 2,snappy = 1,dig_immediate = 2,rail= 1, connect_to_raillike = 1}, mesecons = { effector = { action_on = function(pos, node) @@ -360,9 +355,11 @@ minetest.register_node("moreores:copper_rail", { }, }) --- mg suppport +-- mg support: if minetest.get_modpath("mg") then dofile(moreores_modpath.."/mg.lua") end -print(S("[moreores] loaded.")) +if minetest.setting_getbool("log_mods") then + print(S("[moreores] loaded.")) +end diff --git a/mods/moreores/locale/de.txt b/mods/moreores/locale/de.txt new file mode 100644 index 0000000..2eb6075 --- /dev/null +++ b/mods/moreores/locale/de.txt @@ -0,0 +1,22 @@ +# Translation by Xanthin + +[moreores] loaded. = [moreores] geladen. + +%s Ore = %serz +%s Lump = %sklumpen +%s Ingot = %sbarren +%s Block = %sblock +%s Pickaxe = %sspitzhacke +%s Shovel = %sschaufel +%s Axe = %saxt +%s Sword = %sschwert +%s Hoe = %shacke + +Copper = Kupfer +Tin = Zinn +Bronze = Bronze +Silver = Silber +Gold = Gold +Mithril = Mithril + +Copper Rail = Kupferschiene diff --git a/mods/moreores/textures/moreores_bronze_block.png b/mods/moreores/textures/moreores_bronze_block.png index de6a34a..3f714df 100644 Binary files a/mods/moreores/textures/moreores_bronze_block.png and b/mods/moreores/textures/moreores_bronze_block.png differ diff --git a/mods/moreores/textures/moreores_bronze_ingot.png b/mods/moreores/textures/moreores_bronze_ingot.png index a7a7382..99b3f02 100644 Binary files a/mods/moreores/textures/moreores_bronze_ingot.png and b/mods/moreores/textures/moreores_bronze_ingot.png differ diff --git a/mods/moreores/textures/moreores_copper_block.png b/mods/moreores/textures/moreores_copper_block.png index c8cdeea..9a164af 100644 Binary files a/mods/moreores/textures/moreores_copper_block.png and b/mods/moreores/textures/moreores_copper_block.png differ diff --git a/mods/moreores/textures/moreores_copper_ingot.png b/mods/moreores/textures/moreores_copper_ingot.png index 0c8ba11..1a4e4e1 100644 Binary files a/mods/moreores/textures/moreores_copper_ingot.png and b/mods/moreores/textures/moreores_copper_ingot.png differ diff --git a/mods/moreores/textures/moreores_copper_lump.png b/mods/moreores/textures/moreores_copper_lump.png index de03dcd..45702a9 100644 Binary files a/mods/moreores/textures/moreores_copper_lump.png and b/mods/moreores/textures/moreores_copper_lump.png differ diff --git a/mods/moreores/textures/moreores_copper_rail.png b/mods/moreores/textures/moreores_copper_rail.png index 0a0b56f..73963f6 100644 Binary files a/mods/moreores/textures/moreores_copper_rail.png and b/mods/moreores/textures/moreores_copper_rail.png differ diff --git a/mods/moreores/textures/moreores_copper_rail_crossing.png b/mods/moreores/textures/moreores_copper_rail_crossing.png index b23058c..6ff1153 100644 Binary files a/mods/moreores/textures/moreores_copper_rail_crossing.png and b/mods/moreores/textures/moreores_copper_rail_crossing.png differ diff --git a/mods/moreores/textures/moreores_copper_rail_curved.png b/mods/moreores/textures/moreores_copper_rail_curved.png index 3bd4682..6cfc8c2 100644 Binary files a/mods/moreores/textures/moreores_copper_rail_curved.png and b/mods/moreores/textures/moreores_copper_rail_curved.png differ diff --git a/mods/moreores/textures/moreores_copper_rail_t_junction.png b/mods/moreores/textures/moreores_copper_rail_t_junction.png index c8ecd91..5775919 100644 Binary files a/mods/moreores/textures/moreores_copper_rail_t_junction.png and b/mods/moreores/textures/moreores_copper_rail_t_junction.png differ diff --git a/mods/moreores/textures/moreores_gold_block.png b/mods/moreores/textures/moreores_gold_block.png index 84dec28..2f54afd 100644 Binary files a/mods/moreores/textures/moreores_gold_block.png and b/mods/moreores/textures/moreores_gold_block.png differ diff --git a/mods/moreores/textures/moreores_gold_ingot.png b/mods/moreores/textures/moreores_gold_ingot.png index fa1de15..b8dbcf8 100644 Binary files a/mods/moreores/textures/moreores_gold_ingot.png and b/mods/moreores/textures/moreores_gold_ingot.png differ diff --git a/mods/moreores/textures/moreores_gold_lump.png b/mods/moreores/textures/moreores_gold_lump.png index 432ba8b..9f79149 100644 Binary files a/mods/moreores/textures/moreores_gold_lump.png and b/mods/moreores/textures/moreores_gold_lump.png differ diff --git a/mods/moreores/textures/moreores_mineral_copper.png b/mods/moreores/textures/moreores_mineral_copper.png index 43cdb11..bc3d9c1 100644 Binary files a/mods/moreores/textures/moreores_mineral_copper.png and b/mods/moreores/textures/moreores_mineral_copper.png differ diff --git a/mods/moreores/textures/moreores_mineral_gold.png b/mods/moreores/textures/moreores_mineral_gold.png index e110b43..c8aede3 100644 Binary files a/mods/moreores/textures/moreores_mineral_gold.png and b/mods/moreores/textures/moreores_mineral_gold.png differ diff --git a/mods/moreores/textures/moreores_mineral_mithril.png b/mods/moreores/textures/moreores_mineral_mithril.png index dcc3822..126daea 100644 Binary files a/mods/moreores/textures/moreores_mineral_mithril.png and b/mods/moreores/textures/moreores_mineral_mithril.png differ diff --git a/mods/moreores/textures/moreores_mineral_silver.png b/mods/moreores/textures/moreores_mineral_silver.png index a81e73f..6b57c62 100644 Binary files a/mods/moreores/textures/moreores_mineral_silver.png and b/mods/moreores/textures/moreores_mineral_silver.png differ diff --git a/mods/moreores/textures/moreores_mineral_tin.png b/mods/moreores/textures/moreores_mineral_tin.png index 591920c..fc71837 100644 Binary files a/mods/moreores/textures/moreores_mineral_tin.png and b/mods/moreores/textures/moreores_mineral_tin.png differ diff --git a/mods/moreores/textures/moreores_mithril_block.png b/mods/moreores/textures/moreores_mithril_block.png index 295af91..1b3398f 100644 Binary files a/mods/moreores/textures/moreores_mithril_block.png and b/mods/moreores/textures/moreores_mithril_block.png differ diff --git a/mods/moreores/textures/moreores_mithril_ingot.png b/mods/moreores/textures/moreores_mithril_ingot.png index 9f0e1ba..6f178d0 100644 Binary files a/mods/moreores/textures/moreores_mithril_ingot.png and b/mods/moreores/textures/moreores_mithril_ingot.png differ diff --git a/mods/moreores/textures/moreores_mithril_lump.png b/mods/moreores/textures/moreores_mithril_lump.png index 9b527b4..3aa7255 100644 Binary files a/mods/moreores/textures/moreores_mithril_lump.png and b/mods/moreores/textures/moreores_mithril_lump.png differ diff --git a/mods/moreores/textures/moreores_silver_block.png b/mods/moreores/textures/moreores_silver_block.png index e0ad5df..556af1c 100644 Binary files a/mods/moreores/textures/moreores_silver_block.png and b/mods/moreores/textures/moreores_silver_block.png differ diff --git a/mods/moreores/textures/moreores_silver_ingot.png b/mods/moreores/textures/moreores_silver_ingot.png index d07fdaa..1357a71 100644 Binary files a/mods/moreores/textures/moreores_silver_ingot.png and b/mods/moreores/textures/moreores_silver_ingot.png differ diff --git a/mods/moreores/textures/moreores_silver_lump.png b/mods/moreores/textures/moreores_silver_lump.png index 5093d9f..f71f5e3 100644 Binary files a/mods/moreores/textures/moreores_silver_lump.png and b/mods/moreores/textures/moreores_silver_lump.png differ diff --git a/mods/moreores/textures/moreores_tin_block.png b/mods/moreores/textures/moreores_tin_block.png index e28c371..9dd053c 100644 Binary files a/mods/moreores/textures/moreores_tin_block.png and b/mods/moreores/textures/moreores_tin_block.png differ diff --git a/mods/moreores/textures/moreores_tin_ingot.png b/mods/moreores/textures/moreores_tin_ingot.png index b56279f..4481928 100644 Binary files a/mods/moreores/textures/moreores_tin_ingot.png and b/mods/moreores/textures/moreores_tin_ingot.png differ diff --git a/mods/moreores/textures/moreores_tin_lump.png b/mods/moreores/textures/moreores_tin_lump.png index 0d815aa..5114985 100644 Binary files a/mods/moreores/textures/moreores_tin_lump.png and b/mods/moreores/textures/moreores_tin_lump.png differ diff --git a/mods/moreores/textures/moreores_tool_bronzeaxe.png b/mods/moreores/textures/moreores_tool_bronzeaxe.png index b6a4175..cea9f35 100644 Binary files a/mods/moreores/textures/moreores_tool_bronzeaxe.png and b/mods/moreores/textures/moreores_tool_bronzeaxe.png differ diff --git a/mods/moreores/textures/moreores_tool_bronzepick.png b/mods/moreores/textures/moreores_tool_bronzepick.png index 71aa983..e9d3ca7 100644 Binary files a/mods/moreores/textures/moreores_tool_bronzepick.png and b/mods/moreores/textures/moreores_tool_bronzepick.png differ diff --git a/mods/moreores/textures/moreores_tool_bronzeshovel.png b/mods/moreores/textures/moreores_tool_bronzeshovel.png index 8e71203..cdc7384 100644 Binary files a/mods/moreores/textures/moreores_tool_bronzeshovel.png and b/mods/moreores/textures/moreores_tool_bronzeshovel.png differ diff --git a/mods/moreores/textures/moreores_tool_bronzesword.png b/mods/moreores/textures/moreores_tool_bronzesword.png index 366b648..aa6adc3 100644 Binary files a/mods/moreores/textures/moreores_tool_bronzesword.png and b/mods/moreores/textures/moreores_tool_bronzesword.png differ diff --git a/mods/moreores/textures/moreores_tool_goldaxe.png b/mods/moreores/textures/moreores_tool_goldaxe.png index 41d4896..0290f3f 100644 Binary files a/mods/moreores/textures/moreores_tool_goldaxe.png and b/mods/moreores/textures/moreores_tool_goldaxe.png differ diff --git a/mods/moreores/textures/moreores_tool_goldpick.png b/mods/moreores/textures/moreores_tool_goldpick.png index 1a65e8e..129e449 100644 Binary files a/mods/moreores/textures/moreores_tool_goldpick.png and b/mods/moreores/textures/moreores_tool_goldpick.png differ diff --git a/mods/moreores/textures/moreores_tool_goldshovel.png b/mods/moreores/textures/moreores_tool_goldshovel.png index fc72a1e..1d07af8 100644 Binary files a/mods/moreores/textures/moreores_tool_goldshovel.png and b/mods/moreores/textures/moreores_tool_goldshovel.png differ diff --git a/mods/moreores/textures/moreores_tool_goldsword.png b/mods/moreores/textures/moreores_tool_goldsword.png index db26f47..e94ec05 100644 Binary files a/mods/moreores/textures/moreores_tool_goldsword.png and b/mods/moreores/textures/moreores_tool_goldsword.png differ diff --git a/mods/moreores/textures/moreores_tool_mithrilaxe.png b/mods/moreores/textures/moreores_tool_mithrilaxe.png index 68ba36e..f243a29 100644 Binary files a/mods/moreores/textures/moreores_tool_mithrilaxe.png and b/mods/moreores/textures/moreores_tool_mithrilaxe.png differ diff --git a/mods/moreores/textures/moreores_tool_mithrilhoe.png b/mods/moreores/textures/moreores_tool_mithrilhoe.png index 6977042..9d226f7 100644 Binary files a/mods/moreores/textures/moreores_tool_mithrilhoe.png and b/mods/moreores/textures/moreores_tool_mithrilhoe.png differ diff --git a/mods/moreores/textures/moreores_tool_mithrilpick.png b/mods/moreores/textures/moreores_tool_mithrilpick.png index 6efb469..ff1ed7c 100644 Binary files a/mods/moreores/textures/moreores_tool_mithrilpick.png and b/mods/moreores/textures/moreores_tool_mithrilpick.png differ diff --git a/mods/moreores/textures/moreores_tool_mithrilshovel.png b/mods/moreores/textures/moreores_tool_mithrilshovel.png index 66916da..18a7de0 100644 Binary files a/mods/moreores/textures/moreores_tool_mithrilshovel.png and b/mods/moreores/textures/moreores_tool_mithrilshovel.png differ diff --git a/mods/moreores/textures/moreores_tool_mithrilsword.png b/mods/moreores/textures/moreores_tool_mithrilsword.png index b9396d9..09a030c 100644 Binary files a/mods/moreores/textures/moreores_tool_mithrilsword.png and b/mods/moreores/textures/moreores_tool_mithrilsword.png differ diff --git a/mods/moreores/textures/moreores_tool_silveraxe.png b/mods/moreores/textures/moreores_tool_silveraxe.png index e49fc75..d33edd5 100644 Binary files a/mods/moreores/textures/moreores_tool_silveraxe.png and b/mods/moreores/textures/moreores_tool_silveraxe.png differ diff --git a/mods/moreores/textures/moreores_tool_silverhoe.png b/mods/moreores/textures/moreores_tool_silverhoe.png index 992c91d..066b908 100644 Binary files a/mods/moreores/textures/moreores_tool_silverhoe.png and b/mods/moreores/textures/moreores_tool_silverhoe.png differ diff --git a/mods/moreores/textures/moreores_tool_silverpick.png b/mods/moreores/textures/moreores_tool_silverpick.png index d58e783..69de097 100644 Binary files a/mods/moreores/textures/moreores_tool_silverpick.png and b/mods/moreores/textures/moreores_tool_silverpick.png differ diff --git a/mods/moreores/textures/moreores_tool_silvershovel.png b/mods/moreores/textures/moreores_tool_silvershovel.png index 614c0a9..d55185b 100644 Binary files a/mods/moreores/textures/moreores_tool_silvershovel.png and b/mods/moreores/textures/moreores_tool_silvershovel.png differ diff --git a/mods/moreores/textures/moreores_tool_silversword.png b/mods/moreores/textures/moreores_tool_silversword.png index 5344f46..220ba2b 100644 Binary files a/mods/moreores/textures/moreores_tool_silversword.png and b/mods/moreores/textures/moreores_tool_silversword.png differ diff --git a/mods/moretrees/depends.txt b/mods/moretrees/depends.txt index 7cab320..a04095c 100644 --- a/mods/moretrees/depends.txt +++ b/mods/moretrees/depends.txt @@ -1,7 +1,5 @@ default - plants_lib - -skylands moreblocks? +skylands \ No newline at end of file diff --git a/mods/moretrees/init.lua b/mods/moretrees/init.lua index 17a2a2c..b9aa270 100644 --- a/mods/moretrees/init.lua +++ b/mods/moretrees/init.lua @@ -60,17 +60,6 @@ else moretrees.expect_infinite_stacks = true end --- node clone, for redefining stuff - -function moretrees:clone_node(name) - node2={} - node=minetest.registered_nodes[name] - for k,v in pairs(node) do - node2[k]=v - end - return node2 -end - -- tables, load other files moretrees.cutting_tools = { @@ -171,7 +160,9 @@ end if moretrees.enable_fir then plantslib:register_generate_plant(moretrees.fir_biome, moretrees.spawn_fir_object) - plantslib:register_generate_plant(moretrees.fir_biome_snow, moretrees.spawn_fir_snow_object) + if minetest.get_modpath("snow") then + plantslib:register_generate_plant(moretrees.fir_biome_snow, moretrees.spawn_fir_snow_object) + end end -- Code to spawn a birch tree diff --git a/mods/moretrees/leafdecay.lua b/mods/moretrees/leafdecay.lua index cf6743f..9d771d7 100644 --- a/mods/moretrees/leafdecay.lua +++ b/mods/moretrees/leafdecay.lua @@ -19,14 +19,13 @@ end if moretrees.enable_leafdecay then for i in ipairs(moretrees.treelist) do local treename = moretrees.treelist[i][1] - if treename ~= "jungletree" and treename ~= "fir" then + if treename ~= "jungletree" and treename ~= "fir" and treename ~= "palm" then minetest.register_abm({ nodenames = "moretrees:"..treename.."_leaves", interval = moretrees.leafdecay_delay, chance = moretrees.leafdecay_chance, action = function(pos, node, active_object_count, active_object_count_wider) - if minetest.find_node_near(pos, moretrees.leafdecay_radius, "moretrees:"..treename.."_trunk") then return end - if minetest.find_node_near(pos, moretrees.leafdecay_radius, "ignore") then return end + if minetest.find_node_near(pos, moretrees.leafdecay_radius, { "ignore", "moretrees:"..treename.."_trunk" }) then return end process_drops(pos, node.name) minetest.remove_node(pos) nodeupdate(pos) @@ -40,8 +39,7 @@ if moretrees.enable_leafdecay then interval = moretrees.leafdecay_delay, chance = moretrees.leafdecay_chance, action = function(pos, node, active_object_count, active_object_count_wider) - if minetest.find_node_near(pos, moretrees.leafdecay_radius, {"default:jungletree", "moretrees:jungletree_trunk"}) then return end - if minetest.find_node_near(pos, moretrees.leafdecay_radius, "ignore") then return end + if minetest.find_node_near(pos, moretrees.leafdecay_radius, {"ignore", "default:jungletree", "moretrees:jungletree_trunk"}) then return end process_drops(pos, node.name) minetest.remove_node(pos) nodeupdate(pos) @@ -53,11 +51,10 @@ if moretrees.enable_leafdecay then interval = moretrees.leafdecay_delay, chance = moretrees.leafdecay_chance, action = function(pos, node, active_object_count, active_object_count_wider) - if minetest.find_node_near(pos, moretrees.leafdecay_radius, "moretrees:fir_trunk") then return end - if minetest.find_node_near(pos, moretrees.leafdecay_radius, "ignore") then return end - process_drops(pos, node.name) - minetest.remove_node(pos) - nodeupdate(pos) + if minetest.find_node_near(pos, moretrees.leafdecay_radius, { "ignore", "moretrees:fir_trunk" }) then return end + process_drops(pos, node.name) + minetest.remove_node(pos) + nodeupdate(pos) end }) @@ -66,11 +63,10 @@ if moretrees.enable_leafdecay then interval = moretrees.leafdecay_delay, chance = moretrees.leafdecay_chance, action = function(pos, node, active_object_count, active_object_count_wider) - if minetest.find_node_near(pos, moretrees.palm_leafdecay_radius, "moretrees:palm_trunk") then return end - if minetest.find_node_near(pos, moretrees.palm_leafdecay_radius, "ignore") then return end - process_drops(pos, node.name) - minetest.remove_node(pos) - nodeupdate(pos) + if minetest.find_node_near(pos, moretrees.palm_leafdecay_radius, { "ignore", "moretrees:palm_trunk" }) then return end + process_drops(pos, node.name) + minetest.remove_node(pos) + nodeupdate(pos) end }) end @@ -82,8 +78,7 @@ if moretrees.enable_default_leafdecay then interval = moretrees.default_leafdecay_delay, chance = moretrees.default_leafdecay_chance, action = function(pos, node, active_object_count, active_object_count_wider) - if minetest.find_node_near(pos, moretrees.default_leafdecay_radius, "default:tree") then return end - if minetest.find_node_near(pos, moretrees.default_leafdecay_radius, "ignore") then return end + if minetest.find_node_near(pos, moretrees.default_leafdecay_radius, { "ignore", "default:tree" }) then return end process_drops(pos, node.name) minetest.remove_node(pos) nodeupdate(pos) @@ -98,8 +93,7 @@ if moretrees.enable_default_jungle_leafdecay then interval = moretrees.default_jungle_leafdecay_delay, chance = moretrees.default_jungle_leafdecay_chance, action = function(pos, node, active_object_count, active_object_count_wider) - if minetest.find_node_near(pos, moretrees.default_jungle_leafdecay_radius, "default:jungletree") then return end - if minetest.find_node_near(pos, moretrees.default_jungle_leafdecay_radius, "ignore") then return end + if minetest.find_node_near(pos, moretrees.default_jungle_leafdecay_radius, { "ignore", "default:jungletree" }) then return end process_drops(pos, node.name) minetest.remove_node(pos) nodeupdate(pos) diff --git a/mods/moretrees/node_defs.lua b/mods/moretrees/node_defs.lua index 682e0c3..890e929 100644 --- a/mods/moretrees/node_defs.lua +++ b/mods/moretrees/node_defs.lua @@ -38,37 +38,45 @@ if moretrees.plantlike_leaves then moretrees_plantlike_leaves_visual_scale = 1.189 end -local new_default_leaves = moretrees:clone_node("default:leaves") - if moretrees.enable_default_leafdecay then - new_default_leaves.groups = {snappy=3, flammable=2, leaves=1} - end - if moretrees.plantlike_leaves then - new_default_leaves.inventory_image = minetest.inventorycube("default_leaves.png") - new_default_leaves.drawtype = "plantlike" - new_default_leaves.visual_scale = moretrees_plantlike_leaves_visual_scale - new_default_leaves.tiles = {"default_leaves_plantlike.png"} - else - new_default_leaves.waving = 1 - end - if moretrees.enable_default_leafdecay or moretrees.plantlike_leaves then - minetest.register_node(":default:leaves", new_default_leaves) - end +-- redefine default leaves to handle plantlike and/or leaf decay options -local new_default_jungleleaves = moretrees:clone_node("default:jungleleaves") - if moretrees.enable_default_leafdecay then - new_default_jungleleaves.groups = {snappy=3, flammable=2, leaves=1} - end - if moretrees.plantlike_leaves then - new_default_jungleleaves.inventory_image = minetest.inventorycube("default_jungleleaves.png") - new_default_jungleleaves.drawtype = "plantlike" - new_default_jungleleaves.visual_scale = moretrees_plantlike_leaves_visual_scale - new_default_jungleleaves.tiles = {"default_jungleleaves_plantlike.png"} - else - new_default_jungleleaves.waving = 1 - end - if moretrees.enable_default_leafdecay or moretrees.plantlike_leaves then - minetest.register_node(":default:jungleleaves", new_default_jungleleaves) - end +if moretrees.enable_default_leafdecay then + minetest.override_item("default:leaves", { + groups = { snappy = 3, flammable = 2, leaves = 1 } + }) +end +if moretrees.plantlike_leaves then + minetest.override_item("default:leaves", { + inventory_image = minetest.inventorycube("default_leaves.png"), + drawtype = "plantlike", + visual_scale = 1.189, + tiles = { "default_leaves_plantlike.png" } + }) +else + minetest.override_item("default:leaves", { + waving = 1 + }) +end + +-- redefine default jungle leaves for same + +if moretrees.enable_default_leafdecay then + minetest.override_item("default:jungleleaves", { + groups = { snappy = 3, flammable = 2, leaves = 1 } + }) +end +if moretrees.plantlike_leaves then + minetest.override_item("default:jungleleaves", { + inventory_image = minetest.inventorycube("default_jungleleaves.png"), + drawtype = "plantlike", + visual_scale = 1.189, + tiles = { "default_jungleleaves_plantlike.png" } + }) +else + minetest.override_item("default:jungleleaves", { + waving = 1 + }) +end for i in ipairs(moretrees.treelist) do local treename = moretrees.treelist[i][1] @@ -348,9 +356,9 @@ minetest.register_node("moretrees:fir_leaves_bright", { }) if moretrees.enable_redefine_apple then - local new_default_apple = moretrees:clone_node("default:apple") - new_default_apple.groups.attached_node = 1 - minetest.register_node(":default:apple", new_default_apple) + minetest.override_item("default:apple", + {groups = { fleshy=3, dig_immediate=3, flammable=2, leafdecay=3, leafdecay_drop=1, attached_node = 1} + }) end table.insert(moretrees.avoidnodes, "default:jungletree") @@ -379,10 +387,6 @@ minetest.register_node("moretrees:rubber_tree_trunk_empty", { sounds = default.node_sound_wood_defaults(), paramtype2 = "facedir", on_place = minetest.rotate_node, - after_place_node = function(pos, placer, itemstack) - local meta = minetest.get_meta(pos) - meta:set_int("placed", 1) - end }) minetest.register_abm({ @@ -400,12 +404,15 @@ minetest.register_abm({ minetest.register_alias("technic:rubber_tree_full", "moretrees:rubber_tree_trunk") minetest.register_alias("farming_plus:rubber_tree_full", "moretrees:rubber_tree_trunk") +minetest.register_alias("farming:rubber_tree_full", "moretrees:rubber_tree_trunk") minetest.register_alias("technic:rubber_leaves", "moretrees:rubber_tree_leaves") minetest.register_alias("farming_plus:rubber_leaves", "moretrees:rubber_tree_leaves") +minetest.register_alias("farming:rubber_leaves", "moretrees:rubber_tree_leaves") -minetest.register_alias("farming_plus:rubber_sapling", "moretrees:rubber_tree_sapling") minetest.register_alias("technic:rubber_tree_sapling", "moretrees:rubber_tree_sapling") +minetest.register_alias("farming_plus:rubber_sapling", "moretrees:rubber_tree_sapling") +minetest.register_alias("farming:rubber_sapling", "moretrees:rubber_tree_sapling") minetest.register_alias("default:junglesapling","moretrees:jungletree_sapling") minetest.register_alias("moretrees:jungletree_trunk_sideways", "moreblocks:horizontal_jungle_tree") diff --git a/mods/pipeworks/autoplace_tubes.lua b/mods/pipeworks/autoplace_tubes.lua index 385458c..42cf98b 100644 --- a/mods/pipeworks/autoplace_tubes.lua +++ b/mods/pipeworks/autoplace_tubes.lua @@ -1,72 +1,38 @@ -- autorouting for pneumatic tubes -local function in_table(table,element) - for _,el in ipairs(table) do - if el==element then return true end - end - return false -end - local function is_tube(nodename) - return in_table(pipeworks.tubenodes,nodename) -end - -if pipeworks == nil then - pipeworks = {} + return table.contains(pipeworks.tubenodes, nodename) end --a function for determining which side of the node we are on local function nodeside(node, tubedir) - if node and (node.param2 < 0 or node.param2 > 23) then node.param2 = 0 end - - --get a vector pointing back - local backdir = minetest.facedir_to_dir(node.param2) - - --check whether the vector is equivalent to the tube direction; if it is, the tube's on the backside - if backdir.x == tubedir.x and backdir.y == tubedir.y and backdir.z == tubedir.z then - return "back" + if node.param2 < 0 or node.param2 > 23 then + node.param2 = 0 end - --check whether the vector is antiparallel with the tube direction; that indicates the front - if backdir.x == -tubedir.x and backdir.y == -tubedir.y and backdir.z == -tubedir.z then + local backdir = minetest.facedir_to_dir(node.param2) + local back = vector.dot(backdir, tubedir) + if back == 1 then + return "back" + elseif back == -1 then return "front" end - --facedir is defined in terms of the top-bottom axis of the node; we'll take advantage of that - local topdir = ({[0]={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)] - - --is this the top? - if topdir.x == tubedir.x and topdir.y == tubedir.y and topdir.z == tubedir.z then + local topdir = minetest.facedir_to_top_dir(node.param2) + local top = vector.dot(topdir, tubedir) + if top == 1 then return "top" - end - - --or the bottom? - if topdir.x == -tubedir.x and topdir.y == -tubedir.y and topdir.z == -tubedir.z then + elseif top == -1 then return "bottom" end - --we shall apply some maths to obtain the right-facing vector - local rightdir = {x=topdir.y*backdir.z - backdir.y*topdir.z, - y=topdir.z*backdir.x - backdir.z*topdir.x, - z=topdir.x*backdir.y - backdir.x*topdir.y} - - --is this the right side? - if rightdir.x == tubedir.x and rightdir.y == tubedir.y and rightdir.z == tubedir.z then + local rightdir = minetest.facedir_to_right_dir(node.param2) + local right = vector.dot(rightdir, tubedir) + if right == 1 then return "right" - end - - --or the left? - if rightdir.x == -tubedir.x and rightdir.y == -tubedir.y and rightdir.z == -tubedir.z then + else return "left" end - - --we should be done by now; initiate panic mode - minetest.log("error", "nodeside has been confused by its parameters; see pipeworks autoplace_tubes.lua, line 78") end local vts = {0, 3, 1, 4, 2, 5} @@ -78,23 +44,23 @@ local function tube_autoroute(pos) if not is_tube(nctr.name) then return end local adjustments = { - { 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 } + {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} } -- xm = 1, xp = 2, ym = 3, yp = 4, zm = 5, zp = 6 local positions = {} local nodes = {} - for i,adj in ipairs(adjustments) do - positions[i] = {x=pos.x+adj.x, y=pos.y+adj.y, z=pos.z+adj.z} + for i, adj in ipairs(adjustments) do + positions[i] = vector.add(pos, adj) nodes[i] = minetest.get_node(positions[i]) end - for i,node in ipairs(nodes) do + for i, node in ipairs(nodes) do local idef = minetest.registered_nodes[node.name] -- handle the tubes themselves if is_tube(node.name) then @@ -102,7 +68,9 @@ local function tube_autoroute(pos) -- handle new style connectors elseif idef and idef.tube and idef.tube.connect_sides then local dir = adjustments[i] - if idef.tube.connect_sides[nodeside(node, {x=-dir.x, y=-dir.y, z=-dir.z})] then active[i] = 1 end + if idef.tube.connect_sides[nodeside(node, vector.multiply(dir, -1))] then + active[i] = 1 + end end end @@ -110,18 +78,17 @@ local function tube_autoroute(pos) local nodedef = minetest.registered_nodes[nctr.name] local basename = nodedef.basename - local newname if nodedef.style == "old" then local nsurround = "" - for i,n in ipairs(active) do - nsurround = nsurround .. n + for i, n in ipairs(active) do + nsurround = nsurround..n end nctr.name = basename.."_"..nsurround elseif nodedef.style == "6d" then local s = 0 - for i,n in ipairs(active) do + for i, n in ipairs(active) do if n == 1 then - s = s+2^vts[i] + s = s + 2^vts[i] end end nctr.name = basename.."_"..tube_table[s] @@ -131,14 +98,9 @@ local function tube_autoroute(pos) end function pipeworks.scan_for_tube_objects(pos) - if pos == nil then return end - tube_autoroute({ x=pos.x-1, y=pos.y , z=pos.z }) - tube_autoroute({ x=pos.x+1, y=pos.y , z=pos.z }) - tube_autoroute({ x=pos.x , y=pos.y-1, z=pos.z }) - tube_autoroute({ x=pos.x , y=pos.y+1, z=pos.z }) - tube_autoroute({ x=pos.x , y=pos.y , z=pos.z-1 }) - tube_autoroute({ x=pos.x , y=pos.y , z=pos.z+1 }) - tube_autoroute(pos) + for side = 0, 6 do + tube_autoroute(vector.add(pos, directions.side_to_dir(side))) + end end minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack) @@ -157,7 +119,7 @@ minetest.register_on_dignode(function(pos, oldnode, digger) end end) -if minetest.get_modpath("mesecons_mvps") ~= nil then +if minetest.get_modpath("mesecons_mvps") then mesecon:register_on_mvps_move(function(moved_nodes) for _, n in ipairs(moved_nodes) do pipeworks.scan_for_tube_objects(n.pos) diff --git a/mods/pipeworks/common.lua b/mods/pipeworks/common.lua new file mode 100644 index 0000000..6a92198 --- /dev/null +++ b/mods/pipeworks/common.lua @@ -0,0 +1,144 @@ +---------------------- +-- Vector functions -- +---------------------- + +function vector.cross(a, b) + return { + x = a.y * b.z - a.z * b.y, + y = a.z * b.x - a.x * b.z, + z = a.x * b.y - a.y * b.x + } +end + +function vector.dot(a, b) + return a.x * b.x + a.y * b.y + a.z * b.z +end + +----------------------- +-- Facedir functions -- +----------------------- + +function minetest.facedir_to_top_dir(facedir) + return ({[0] = {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(facedir / 4)] +end + +function minetest.facedir_to_right_dir(facedir) + return vector.cross( + minetest.facedir_to_top_dir(facedir), + minetest.facedir_to_dir(facedir) + ) +end + +directions = {} +function directions.side_to_dir(side) + return ({[0] = vector.new(), + vector.new( 0, 1, 0), + 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) + })[side] +end + +function directions.dir_to_side(dir) + local c = vector.dot(dir, vector.new(1, 2, 3)) + 4 + return ({6, 2, 4, 0, 3, 1, 5})[c] +end + +---------------------- +-- String functions -- +---------------------- + +--[[function string.split(str, sep) + local fields = {} + local index = 1 + local expr = "([^"..sep.."])+" + string.gsub(str, expr, function(substring) + fields[index] = substring + index = index + 1 + end) + return fields +end]] + +function string.startswith(str, substr) + return str:sub(1, substr:len()) == substr +end + +--------------------- +-- Table functions -- +--------------------- + +function table.contains(tbl, element) + for _, elt in pairs(tbl) do + if elt == element then + return true + end + end + return false +end + +function table.extend(tbl, tbl2) + local index = #tbl + 1 + for _, elt in ipairs(tbl2) do + tbl[index] = elt + index = index + 1 + end +end + +function table.recursive_replace(tbl, pattern, replace_with) + if type(tbl) == "table" then + local tbl2 = {} + for key, value in pairs(tbl) do + tbl2[key] = table.recursive_replace(value, pattern, replace_with) + end + return tbl2 + elseif type(tbl) == "string" then + return tbl:gsub(pattern, replace_with) + else + return tbl + end +end + +------------------------ +-- Formspec functions -- +------------------------ + +fs_helpers = {} +function fs_helpers.on_receive_fields(pos, fields) + local meta = minetest.get_meta(pos) + for field, value in pairs(fields) do + if field:startswith("fs_helpers_cycling:") then + local l = field:split(":") + local new_value = tonumber(l[2]) + local meta_name = l[3] + meta:set_int(meta_name, new_value) + end + end +end + +function fs_helpers.cycling_button(meta, base, meta_name, values) + local current_value = meta:get_int(meta_name) + local new_value = (current_value + 1) % (#values) + local text = values[current_value + 1] + local field = "fs_helpers_cycling:"..new_value..":"..meta_name + return base..";"..field..";"..text.."]" +end + +--------- +-- Env -- +--------- + +function minetest.load_position(pos) + if minetest.get_node_or_nil(pos) then + return + end + local vm = minetest.get_voxel_manip() + vm:read_from_map(pos, pos) +end \ No newline at end of file diff --git a/mods/pipeworks/compat.lua b/mods/pipeworks/compat.lua index e80fa62..a1c1d45 100644 --- a/mods/pipeworks/compat.lua +++ b/mods/pipeworks/compat.lua @@ -1,25 +1,17 @@ -- this bit of code modifies the default chests and furnaces to be compatible -- with pipeworks. -function pipeworks.clone_node(name) - local node2 = {} - local node = minetest.registered_nodes[name] - for k, v in pairs(node) do - node2[k] = v - end - return node2 -end - -local furnace = pipeworks.clone_node("default:furnace") - furnace.tiles[1] = "default_furnace_top.png^pipeworks_tube_connection_stony.png" - furnace.tiles[2] = "default_furnace_bottom.png^pipeworks_tube_connection_stony.png" - furnace.tiles[3] = "default_furnace_side.png^pipeworks_tube_connection_stony.png" - furnace.tiles[4] = "default_furnace_side.png^pipeworks_tube_connection_stony.png" - furnace.tiles[5] = "default_furnace_side.png^pipeworks_tube_connection_stony.png" - -- note we don't redefine entry 6 ( front) - furnace.groups.tubedevice = 1 - furnace.groups.tubedevice_receiver = 1 - furnace.tube = { +minetest.override_item("default:furnace", { + tiles = { + "default_furnace_top.png^pipeworks_tube_connection_stony.png", + "default_furnace_bottom.png^pipeworks_tube_connection_stony.png", + "default_furnace_side.png^pipeworks_tube_connection_stony.png", + "default_furnace_side.png^pipeworks_tube_connection_stony.png", + "default_furnace_side.png^pipeworks_tube_connection_stony.png", + "default_furnace_front.png" + }, + groups = {cracky = 2, tubedevice = 1, tubedevice_receiver = 1}, + tube = { insert_object = function(pos, node, stack, direction) local meta = minetest.get_meta(pos) local inv = meta:get_inventory() @@ -39,27 +31,30 @@ local furnace = pipeworks.clone_node("default:furnace") end end, input_inventory = "dst", - connect_sides = {left=1, right=1, back=1, front=1, bottom=1, top=1} - } - furnace.after_place_node = function(pos) - pipeworks.scan_for_tube_objects(pos) - end - furnace.after_dig_node = function(pos) - pipeworks.scan_for_tube_objects(pos) - end + connect_sides = {left = 1, right = 1, back = 1, front = 1, bottom = 1, top = 1} + }, +}) -minetest.register_node(":default:furnace", furnace) - -local furnace_active = pipeworks.clone_node("default:furnace_active") - furnace_active.tiles[1] = "default_furnace_top.png^pipeworks_tube_connection_stony.png" - furnace_active.tiles[2] = "default_furnace_bottom.png^pipeworks_tube_connection_stony.png" - furnace_active.tiles[3] = "default_furnace_side.png^pipeworks_tube_connection_stony.png" - furnace_active.tiles[4] = "default_furnace_side.png^pipeworks_tube_connection_stony.png" - furnace_active.tiles[5] = "default_furnace_side.png^pipeworks_tube_connection_stony.png" - -- note we don't redefine entry 6 (front) - furnace_active.groups.tubedevice = 1 - furnace_active.groups.tubedevice_receiver = 1 - furnace_active.tube = { +minetest.override_item("default:furnace_active", { + tiles = { + "default_furnace_top.png^pipeworks_tube_connection_stony.png", + "default_furnace_bottom.png^pipeworks_tube_connection_stony.png", + "default_furnace_side.png^pipeworks_tube_connection_stony.png", + "default_furnace_side.png^pipeworks_tube_connection_stony.png", + "default_furnace_side.png^pipeworks_tube_connection_stony.png", + { + image = "default_furnace_front_active.png", + backface_culling = false, + animation = { + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = 1.5 + }, + } + }, + groups = {cracky = 2, tubedevice = 1, tubedevice_receiver = 1, not_in_creative_inventory = 1}, + tube = { insert_object = function(pos,node,stack,direction) local meta = minetest.get_meta(pos) local inv = meta:get_inventory() @@ -79,28 +74,21 @@ local furnace_active = pipeworks.clone_node("default:furnace_active") end end, input_inventory = "dst", - connect_sides = {left=1, right=1, back=1, front=1, bottom=1, top=1} - } - furnace_active.after_place_node= function(pos) - pipeworks.scan_for_tube_objects(pos) - end - furnace_active.after_dig_node = function(pos) - pipeworks.scan_for_tube_objects(pos) - end + connect_sides = {left = 1, right = 1, back = 1, front = 1, bottom = 1, top = 1} + }, +}) -minetest.register_node(":default:furnace_active", furnace_active) - - -local chest = pipeworks.clone_node("default:chest") - chest.tiles[1] = "default_chest_top.png^pipeworks_tube_connection_wooden.png" - chest.tiles[2] = "default_chest_top.png^pipeworks_tube_connection_wooden.png" - chest.tiles[3] = "default_chest_side.png^pipeworks_tube_connection_wooden.png" - chest.tiles[4] = "default_chest_side.png^pipeworks_tube_connection_wooden.png" - chest.tiles[5] = "default_chest_side.png^pipeworks_tube_connection_wooden.png" - -- note we don't redefine entry 6 (front). - chest.groups.tubedevice = 1 - chest.groups.tubedevice_receiver = 1 - chest.tube = { +minetest.override_item("default:chest", { + tiles = { + "default_chest_top.png^pipeworks_tube_connection_wooden.png", + "default_chest_top.png^pipeworks_tube_connection_wooden.png", + "default_chest_side.png^pipeworks_tube_connection_wooden.png", + "default_chest_side.png^pipeworks_tube_connection_wooden.png", + "default_chest_side.png^pipeworks_tube_connection_wooden.png", + "default_chest_front.png" + }, + groups = {choppy = 2, oddly_breakable_by_hand = 2, tubedevice = 1, tubedevice_receiver = 1}, + tube = { insert_object = function(pos, node, stack, direction) local meta = minetest.get_meta(pos) local inv = meta:get_inventory() @@ -112,28 +100,21 @@ local chest = pipeworks.clone_node("default:chest") return inv:room_for_item("main", stack) end, input_inventory = "main", - connect_sides = {left=1, right=1, back=1, front=1, bottom=1, top=1} - } - chest.after_place_node = function(pos) - pipeworks.scan_for_tube_objects(pos) - end - chest.after_dig_node = function(pos) - pipeworks.scan_for_tube_objects(pos) - end + connect_sides = {left = 1, right = 1, back = 1, front = 1, bottom = 1, top = 1} + }, +}) -minetest.register_node(":default:chest", chest) - - -local chest_locked = pipeworks.clone_node("default:chest_locked") - chest_locked.tiles[1] = "default_chest_top.png^pipeworks_tube_connection_wooden.png" - chest_locked.tiles[2] = "default_chest_top.png^pipeworks_tube_connection_wooden.png" - chest_locked.tiles[3] = "default_chest_side.png^pipeworks_tube_connection_wooden.png" - chest_locked.tiles[4] = "default_chest_side.png^pipeworks_tube_connection_wooden.png" - chest_locked.tiles[5] = "default_chest_side.png^pipeworks_tube_connection_wooden.png" - -- note we don't redefine entry 6 (front). - chest_locked.groups.tubedevice = 1 - chest_locked.groups.tubedevice_receiver = 1 - chest_locked.tube = { +minetest.override_item("default:chest_locked", { + tiles = { + "default_chest_top.png^pipeworks_tube_connection_wooden.png", + "default_chest_top.png^pipeworks_tube_connection_wooden.png", + "default_chest_side.png^pipeworks_tube_connection_wooden.png", + "default_chest_side.png^pipeworks_tube_connection_wooden.png", + "default_chest_side.png^pipeworks_tube_connection_wooden.png", + "default_chest_lock.png" + }, + groups = {choppy = 2, oddly_breakable_by_hand = 2, tubedevice = 1, tubedevice_receiver = 1}, + tube = { insert_object = function(pos, node, stack, direction) local meta = minetest.env:get_meta(pos) local inv = meta:get_inventory() @@ -144,15 +125,6 @@ local chest_locked = pipeworks.clone_node("default:chest_locked") local inv = meta:get_inventory() return inv:room_for_item("main", stack) end, - connect_sides = {left=1, right=1, back=1, front=1, bottom=1, top=1} - } - local old_after_place = minetest.registered_nodes["default:chest_locked"].after_place_node - chest_locked.after_place_node = function(pos, placer) - pipeworks.scan_for_tube_objects(pos) - old_after_place(pos, placer) - end - chest_locked.after_dig_node = function(pos) - pipeworks.scan_for_tube_objects(pos) - end - -minetest.register_node(":default:chest_locked", chest_locked) + connect_sides = {left = 1, right = 1, back = 1, front = 1, bottom = 1, top = 1} + }, +}) diff --git a/mods/pipeworks/crafts.lua b/mods/pipeworks/crafts.lua index 8a38daf..12913d7 100644 --- a/mods/pipeworks/crafts.lua +++ b/mods/pipeworks/crafts.lua @@ -38,9 +38,9 @@ minetest.register_craft( { }) minetest.register_craft( { - output = "pipeworks:valve_off 2", + output = "pipeworks:valve_off_empty 2", recipe = { - { "", "default:stick", "" }, + { "", "group:stick", "" }, { "default:steel_ingot", "default:steel_ingot", "default:steel_ingot" }, { "", "default:steel_ingot", "" } }, @@ -59,7 +59,7 @@ minetest.register_craft( { output = "pipeworks:grating 2", recipe = { { "default:steel_ingot", "", "default:steel_ingot" }, - { "", "default:steel_ingot", "" }, + { "", "pipeworks:pipe_1_empty", "" }, { "default:steel_ingot", "", "default:steel_ingot" } }, }) @@ -87,54 +87,72 @@ minetest.register_craft( { if minetest.get_modpath("homedecor") == nil then - minetest.register_craftitem(":homedecor:plastic_sheeting", { - description = "Plastic sheet", - inventory_image = "homedecor_plastic_sheeting.png", + minetest.register_craftitem(":homedecor:oil_extract", { + description = "Oil extract", + inventory_image = "homedecor_oil_extract.png", }) - minetest.register_craftitem(":homedecor:plastic_base", { - description = "Unprocessed Plastic base", - wield_image = "homedecor_plastic_base.png", - inventory_image = "homedecor_plastic_base_inv.png", + minetest.register_craftitem(":homedecor:paraffin", { + description = "Unprocessed paraffin", + inventory_image = "homedecor_paraffin.png", + }) + + minetest.register_alias("homedecor:plastic_base", "homedecor:paraffin") + + minetest.register_craftitem(":homedecor:plastic_sheeting", { + description = "Plastic sheet", + inventory_image = "homedecor_plastic_sheeting.png", }) minetest.register_craft({ type = "shapeless", - output = 'homedecor:plastic_base 4', - recipe = { "default:leaves", - "group:leaves", - "group:leaves", - "group:leaves", - "group:leaves", - "group:leaves" + output = "homedecor:oil_extract 4", + recipe = { + "group:leaves", + "group:leaves", + "group:leaves", + "group:leaves", + "group:leaves", + "group:leaves" } }) minetest.register_craft({ - type = "cooking", - output = "homedecor:plastic_sheeting", - recipe = "homedecor:plastic_base", + type = "cooking", + output = "homedecor:paraffin", + recipe = "homedecor:oil_extract", }) minetest.register_craft({ - type = 'fuel', - recipe = 'homedecor:plastic_base', - burntime = 30, + type = "cooking", + output = "homedecor:plastic_sheeting", + recipe = "homedecor:paraffin", }) minetest.register_craft({ - type = 'fuel', - recipe = 'homedecor:plastic_sheeting', - burntime = 30, + type = "fuel", + recipe = "homedecor:oil_extract", + burntime = 30, }) + minetest.register_craft({ + type = "fuel", + recipe = "homedecor:paraffin", + burntime = 30, + }) + + minetest.register_craft({ + type = "fuel", + recipe = "homedecor:plastic_sheeting", + burntime = 30, + }) end minetest.register_craft( { output = "pipeworks:one_way_tube 2", recipe = { { "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" }, - { "default:stick", "default:mese_crystal", "homedecor:plastic_sheeting" }, + { "group:stick", "default:mese_crystal", "homedecor:plastic_sheeting" }, { "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" } }, }) @@ -277,7 +295,7 @@ minetest.register_craft( { output = "pipeworks:filter 2", recipe = { { "default:steel_ingot", "default:steel_ingot", "homedecor:plastic_sheeting" }, - { "default:stick", "default:mese_crystal", "homedecor:plastic_sheeting" }, + { "group:stick", "default:mese_crystal", "homedecor:plastic_sheeting" }, { "default:steel_ingot", "default:steel_ingot", "homedecor:plastic_sheeting" } }, }) @@ -286,7 +304,7 @@ minetest.register_craft( { output = "pipeworks:mese_filter 2", recipe = { { "default:steel_ingot", "default:steel_ingot", "homedecor:plastic_sheeting" }, - { "default:stick", "default:mese", "homedecor:plastic_sheeting" }, + { "group:stick", "default:mese", "homedecor:plastic_sheeting" }, { "default:steel_ingot", "default:steel_ingot", "homedecor:plastic_sheeting" } }, }) diff --git a/mods/pipeworks/default_settings.txt b/mods/pipeworks/default_settings.txt index f594a16..4aa4150 100644 --- a/mods/pipeworks/default_settings.txt +++ b/mods/pipeworks/default_settings.txt @@ -3,6 +3,7 @@ pipeworks.enable_pipes = true pipeworks.enable_autocrafter = true pipeworks.enable_deployer = true +pipeworks.enable_dispenser = true pipeworks.enable_node_breaker = true pipeworks.enable_teleport_tube = true pipeworks.enable_pipe_devices = true diff --git a/mods/pipeworks/deployer.lua b/mods/pipeworks/deployer.lua deleted file mode 100644 index e67250c..0000000 --- a/mods/pipeworks/deployer.lua +++ /dev/null @@ -1,286 +0,0 @@ - ---register aliases for when someone had technic installed, but then uninstalled it but not pipeworks -minetest.register_alias("technic:deployer_off", "pipeworks:deployer_off") -minetest.register_alias("technic:deployer_on", "pipeworks:deployer_on") - ---define the functions from https://github.com/minetest/minetest/pull/834 while waiting for the devs to notice it -local function dir_to_facedir(dir, is6d) - --account for y if requested - if is6d and math.abs(dir.y) > math.abs(dir.x) and math.abs(dir.y) > math.abs(dir.z) then - - --from above - if dir.y < 0 then - if math.abs(dir.x) > math.abs(dir.z) then - if dir.x < 0 then - return 19 - else - return 13 - end - else - if dir.z < 0 then - return 10 - else - return 4 - end - end - - --from below - else - if math.abs(dir.x) > math.abs(dir.z) then - if dir.x < 0 then - return 15 - else - return 17 - end - else - if dir.z < 0 then - return 6 - else - return 8 - end - end - end - - --otherwise, place horizontally - elseif math.abs(dir.x) > math.abs(dir.z) then - if dir.x < 0 then - return 3 - else - return 1 - end - else - if dir.z < 0 then - return 2 - else - return 0 - end - end -end - -minetest.register_craft({ - output = 'pipeworks:deployer_off 1', - recipe = { - {'group:wood', 'default:chest','group:wood'}, - {'default:stone', 'mesecons:piston','default:stone'}, - {'default:stone', 'mesecons:mesecon','default:stone'}, - } -}) - -local function swap_node(pos, name) - local node = minetest.get_node(pos) - if node.name == name then - return - end - node.name = name - minetest.swap_node(pos, node) -end - -local function delay(x) - return (function() return x end) -end - -local function deployer_on(pos, node) - if node.name ~= "pipeworks:deployer_off" then - return - end - - --locate the above and under positions - local dir = minetest.facedir_to_dir(node.param2) - local pos_under, pos_above = {x = pos.x - dir.x, y = pos.y - dir.y, z = pos.z - dir.z}, {x = pos.x - 2*dir.x, y = pos.y - 2*dir.y, z = pos.z - 2*dir.z} - - swap_node(pos, "pipeworks:deployer_on") - nodeupdate(pos) - - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - local invlist = inv:get_list("main") - for i, stack in ipairs(invlist) do - if stack:get_name() ~= nil and stack:get_name() ~= "" and minetest.get_node(pos_under).name == "air" then --obtain the first non-empty item slot - local pitch - local yaw - if dir.z < 0 then - yaw = 0 - pitch = 0 - elseif dir.z > 0 then - yaw = math.pi - pitch = 0 - elseif dir.x < 0 then - yaw = 3*math.pi/2 - pitch = 0 - elseif dir.x > 0 then - yaw = math.pi/2 - pitch = 0 - elseif dir.y > 0 then - yaw = 0 - pitch = -math.pi/2 - else - yaw = 0 - pitch = math.pi/2 - end - local placer = { - get_inventory_formspec = delay(meta:get_string("formspec")), - get_look_dir = delay({x = -dir.x, y = -dir.y, z = -dir.z}), - get_look_pitch = delay(pitch), - get_look_yaw = delay(yaw), - get_player_control = delay({jump=false, right=false, left=false, LMB=false, RMB=false, sneak=false, aux1=false, down=false, up=false}), - get_player_control_bits = delay(0), - get_player_name = delay("deployer"), - is_player = delay(true), - set_inventory_formspec = delay(), - getpos = delay({x = pos.x, y = pos.y - 1.5, z = pos.z}), -- Player height - get_hp = delay(20), - get_inventory = delay(inv), - get_wielded_item = delay(stack), - get_wield_index = delay(i), - get_wield_list = delay("main"), - moveto = delay(), - punch = delay(), - remove = delay(), - right_click = delay(), - setpos = delay(), - set_hp = delay(), - set_properties = delay(), - set_wielded_item = function(self, item) inv:set_stack("main", i, item) end, - set_animation = delay(), - set_attach = delay(), - set_detach = delay(), - set_bone_position = delay(), - } - local stack2 = minetest.item_place(stack, placer, {type="node", under=pos_under, above=pos_above}) - if minetest.setting_getbool("creative_mode") and not minetest.get_modpath("unified_inventory") then --infinite stacks ahoy! - stack2:take_item() - end - invlist[i] = stack2 - inv:set_list("main", invlist) - return - end - end -end - -local deployer_off = function(pos, node) - if node.name == "pipeworks:deployer_on" then - swap_node(pos, "pipeworks:deployer_off") - nodeupdate(pos) - end -end - -minetest.register_node("pipeworks:deployer_off", { - description = "Deployer", - tile_images = {"pipeworks_deployer_top.png","pipeworks_deployer_bottom.png","pipeworks_deployer_side2.png","pipeworks_deployer_side1.png", - "pipeworks_deployer_back.png","pipeworks_deployer_front_off.png"}, - mesecons = {effector={rules=pipeworks.rules_all,action_on=deployer_on,action_off=deployer_off}}, - 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) - end, - can_insert=function(pos,node,stack,direction) - local meta=minetest.get_meta(pos) - local inv=meta:get_inventory() - return inv:room_for_item("main",stack) - end, - input_inventory="main", - connect_sides={back=1}}, - is_ground_content = true, - paramtype2 = "facedir", - groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2, mesecon = 2,tubedevice=1, tubedevice_receiver=1}, - sounds = default.node_sound_stone_defaults(), - on_construct = function(pos) - local meta = minetest.get_meta(pos) - meta:set_string("formspec", - "invsize[8,9;]".. - "label[0,0;Deployer]".. - "list[current_name;main;4,1;3,3;]".. - "list[current_player;main;0,5;8,4;]") - meta:set_string("infotext", "Deployer") - local inv = meta:get_inventory() - inv:set_size("main", 3*3) - end, - can_dig = function(pos,player) - local meta = minetest.get_meta(pos); - local inv = meta:get_inventory() - return inv:is_empty("main") - end, - after_place_node = function (pos, placer) - pipeworks.scan_for_tube_objects(pos, placer) - local placer_pos = placer:getpos() - - --correct for the player's height - if placer:is_player() then placer_pos.y = placer_pos.y + 1.5 end - - --correct for 6d facedir - if placer_pos then - local dir = { - x = pos.x - placer_pos.x, - y = pos.y - placer_pos.y, - z = pos.z - placer_pos.z - } - local node = minetest.get_node(pos) - node.param2 = dir_to_facedir(dir, true) - minetest.set_node(pos, node) - minetest.log("action", "real (6d) facedir: " .. node.param2) - end - end, - after_dig_node = pipeworks.scan_for_tube_objects, -}) - -minetest.register_node("pipeworks:deployer_on", { - description = "Deployer", - tile_images = {"pipeworks_deployer_top.png","pipeworks_deployer_bottom.png","pipeworks_deployer_side2.png","pipeworks_deployer_side1.png", - "pipeworks_deployer_back.png","pipeworks_deployer_front_on.png"}, - mesecons = {effector={rules=pipeworks.rules_all,action_on=deployer_on,action_off=deployer_off}}, - 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) - end, - can_insert=function(pos,node,stack,direction) - local meta=minetest.get_meta(pos) - local inv=meta:get_inventory() - return inv:room_for_item("main",stack) - end, - input_inventory="main", - connect_sides={back=1}}, - is_ground_content = true, - paramtype2 = "facedir", - tubelike=1, - groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2, mesecon = 2,tubedevice=1, tubedevice_receiver=1,not_in_creative_inventory=1}, - sounds = default.node_sound_stone_defaults(), - on_construct = function(pos) - local meta = minetest.get_meta(pos) - meta:set_string("formspec", - "invsize[8,9;]".. - "label[0,0;Deployer]".. - "list[current_name;main;4,1;3,3;]".. - "list[current_player;main;0,5;8,4;]") - meta:set_string("infotext", "Deployer") - local inv = meta:get_inventory() - inv:set_size("main", 3*3) - end, - can_dig = function(pos,player) - local meta = minetest.get_meta(pos); - local inv = meta:get_inventory() - return inv:is_empty("main") - end, - after_place_node = function (pos, placer) - pipeworks.scan_for_tube_objects(pos, placer) - local placer_pos = placer:getpos() - - --correct for the player's height - if placer:is_player() then placer_pos.y = placer_pos.y + 1.5 end - - --correct for 6d facedir - if placer_pos then - local dir = { - x = pos.x - placer_pos.x, - y = pos.y - placer_pos.y, - z = pos.z - placer_pos.z - } - local node = minetest.get_node(pos) - node.param2 = dir_to_facedir(dir, true) - minetest.set_node(pos, node) - minetest.log("action", "real (6d) facedir: " .. node.param2) - end - end, - after_dig_node = pipeworks.scan_for_tube_objects, -}) diff --git a/mods/pipeworks/devices.lua b/mods/pipeworks/devices.lua index ab14a2d..b7571d3 100644 --- a/mods/pipeworks/devices.lua +++ b/mods/pipeworks/devices.lua @@ -590,7 +590,7 @@ for fill = 0, 10 do groups = {snappy=3, pipe=1, tankfill=fill+1, not_in_creative_inventory=1}, sounds = default.node_sound_wood_defaults(), walkable = true, - drop = "pipeworks:storage_tank_"..fill, + drop = "pipeworks:storage_tank_0", after_place_node = function(pos) pipeworks.look_for_stackable_tanks(pos) pipeworks.scan_for_pipe_objects(pos) @@ -616,6 +616,7 @@ for fill = 0, 10 do groups = sgroups, sounds = default.node_sound_wood_defaults(), walkable = true, + drop = "pipeworks:storage_tank_0", after_place_node = function(pos) pipeworks.look_for_stackable_tanks(pos) pipeworks.scan_for_pipe_objects(pos) diff --git a/mods/pipeworks/init.lua b/mods/pipeworks/init.lua index 6964abc..b6c91d6 100644 --- a/mods/pipeworks/init.lua +++ b/mods/pipeworks/init.lua @@ -106,21 +106,23 @@ end ------------------------------------------- -- Load the various other parts of the mod +dofile(pipeworks.modpath.."/common.lua") dofile(pipeworks.modpath.."/models.lua") dofile(pipeworks.modpath.."/autoplace_pipes.lua") dofile(pipeworks.modpath.."/autoplace_tubes.lua") +dofile(pipeworks.modpath.."/luaentity.lua") dofile(pipeworks.modpath.."/item_transport.lua") dofile(pipeworks.modpath.."/flowing_logic.lua") dofile(pipeworks.modpath.."/crafts.lua") dofile(pipeworks.modpath.."/tubes.lua") +dofile(pipeworks.modpath.."/trashcan.lua") +dofile(pipeworks.modpath.."/wielder.lua") if pipeworks.enable_pipes then dofile(pipeworks.modpath.."/pipes.lua") end if pipeworks.enable_teleport_tube then dofile(pipeworks.modpath.."/teleport_tube.lua") end if pipeworks.enable_pipe_devices then dofile(pipeworks.modpath.."/devices.lua") end if pipeworks.enable_redefines then dofile(pipeworks.modpath.."/compat.lua") end if pipeworks.enable_autocrafter then dofile(pipeworks.modpath.."/autocrafter.lua") end -if pipeworks.enable_deployer then dofile(pipeworks.modpath.."/deployer.lua") end -if pipeworks.enable_node_breaker then dofile(pipeworks.modpath.."/node_breaker.lua") end minetest.register_alias("pipeworks:pipe", "pipeworks:pipe_110000_empty") diff --git a/mods/pipeworks/item_transport.lua b/mods/pipeworks/item_transport.lua index b97d5bb..02ef5f8 100644 --- a/mods/pipeworks/item_transport.lua +++ b/mods/pipeworks/item_transport.lua @@ -1,28 +1,3 @@ -dofile(pipeworks.modpath.."/compat.lua") - ---and an extra function for getting the right-facing vector -local function facedir_to_right_dir(facedir) - - --find the other directions - local backdir = minetest.facedir_to_dir(facedir) - local topdir = ({[0]={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(facedir/4)] - - --return a cross product - return {x=topdir.y*backdir.z - backdir.y*topdir.z, - y=topdir.z*backdir.x - backdir.z*topdir.x, - z=topdir.x*backdir.y - backdir.x*topdir.y} -end - -minetest.register_craftitem("pipeworks:filter", { - description = "Filter", - stack_max = 99, -}) - local fakePlayer = { get_player_name = function() return ":pipeworks" end, -- any other player functions called by allow_metadata_inventory_take anywhere... @@ -30,10 +5,17 @@ local fakePlayer = { } function pipeworks.tube_item(pos, item) + error("obsolete pipeworks.tube_item() called; change caller to use pipeworks.tube_inject_item() instead") +end + +function pipeworks.tube_inject_item(pos, start_pos, velocity, item) -- Take item in any format local stack = ItemStack(item) - local obj = minetest.add_entity(pos, "pipeworks:tubed_item") - obj:get_luaentity():set_item(stack:to_string()) + local obj = luaentity.add_entity(pos, "pipeworks:tubed_item") + obj:set_item(stack:to_string()) + obj.start_pos = vector.new(start_pos) + obj:setvelocity(velocity) + --obj:set_color("red") -- todo: this is test-only code return obj end @@ -43,19 +25,78 @@ end -- both optional w/ sensible defaults and fallback to normal allow_* function -- XXX: possibly change insert_object to insert_item --- sname = the current name to allow for, or nil if it allows anything +local function set_filter_infotext(data, meta) + local infotext = data.wise_desc.." Filter-Injector" + if meta:get_int("slotseq_mode") == 2 then + infotext = infotext .. " (slot #"..meta:get_int("slotseq_index").." next)" + end + meta:set_string("infotext", infotext) +end -local function grabAndFire(frominv,frominvname,frompos,fromnode,sname,tube,idef,dir,all) +local function set_filter_formspec(data, meta) + local itemname = data.wise_desc.." Filter-Injector" + local formspec = "size[8,8.5]".. + "item_image[0,0;1,1;pipeworks:"..data.name.."]".. + "label[1,0;"..minetest.formspec_escape(itemname).."]".. + "label[0,1;Prefer item types:]".. + "list[current_name;main;0,1.5;8,2;]".. + fs_helpers.cycling_button(meta, "button[0,3.5;4,1", "slotseq_mode", + {"Sequence slots by Priority", + "Sequence slots Randomly", + "Sequence slots by Rotation"}).. + "list[current_player;main;0,4.5;8,4;]" + meta:set_string("formspec", formspec) +end + +-- todo SOON: this function has *way too many* parameters +local function grabAndFire(data,slotseq_mode,filtmeta,frominv,frominvname,frompos,fromnode,filtername,fromtube,fromdef,dir,all) + local sposes = {} for spos,stack in ipairs(frominv:get_list(frominvname)) do - if (sname == nil and stack:get_name() ~= "") or stack:get_name() == sname then + local matches + if filtername == "" then + matches = stack:get_name() ~= "" + else + matches = stack:get_name() == filtername + end + if matches then table.insert(sposes, spos) end + end + if #sposes == 0 then return false end + if slotseq_mode == 1 then + for i = #sposes, 2, -1 do + local j = math.random(i) + local t = sposes[j] + sposes[j] = sposes[i] + sposes[i] = t + end + elseif slotseq_mode == 2 then + local headpos = filtmeta:get_int("slotseq_index") + table.sort(sposes, function (a, b) + if a >= headpos then + if b < headpos then return true end + else + if b >= headpos then return false end + end + return a < b + end) + end + for _, spos in ipairs(sposes) do + local stack = frominv:get_stack(frominvname, spos) local doRemove = stack:get_count() - if tube.can_remove then - doRemove = tube.can_remove(frompos, fromnode, stack, dir) - elseif idef.allow_metadata_inventory_take then - doRemove = idef.allow_metadata_inventory_take(frompos,"main",spos, stack, fakePlayer) + if fromtube.can_remove then + doRemove = fromtube.can_remove(frompos, fromnode, stack, dir) + elseif fromdef.allow_metadata_inventory_take then + doRemove = fromdef.allow_metadata_inventory_take(frompos, frominvname,spos, stack, fakePlayer) end -- stupid lack of continue statements grumble if doRemove > 0 then + if slotseq_mode == 2 then + local nextpos = spos + 1 + if nextpos > frominv:get_size(frominvname) then + nextpos = 1 + end + filtmeta:set_int("slotseq_index", nextpos) + set_filter_infotext(data, filtmeta) + end local item local count if all then @@ -63,162 +104,116 @@ local function grabAndFire(frominv,frominvname,frompos,fromnode,sname,tube,idef, else count = 1 end - if tube.remove_items then + if fromtube.remove_items then -- it could be the entire stack... - item = tube.remove_items(frompos, fromnode, stack, dir, count) + item = fromtube.remove_items(frompos, fromnode, stack, dir, count) else item = stack:take_item(count) frominv:set_stack(frominvname, spos, stack) - if idef.on_metadata_inventory_take then - idef.on_metadata_inventory_take(frompos, "main", spos, item, fakePlayer) + if fromdef.on_metadata_inventory_take then + fromdef.on_metadata_inventory_take(frompos, frominvname, spos, item, fakePlayer) end end - local item1 = pipeworks.tube_item(vector.add(frompos, vector.multiply(dir, 1.4)), item) - item1:get_luaentity().start_pos = vector.add(frompos, dir) - item1:setvelocity(dir) - item1:setacceleration({x=0, y=0, z=0}) + local pos = vector.add(frompos, vector.multiply(dir, 1.4)) + local start_pos = vector.add(frompos, dir) + local item1 = pipeworks.tube_inject_item(pos, start_pos, dir, item) return true-- only fire one item, please end - end end return false end -minetest.register_node("pipeworks:filter", { - description = "Filter", - tiles = {"pipeworks_filter_top.png", "pipeworks_filter_top.png", "pipeworks_filter_output.png", - "pipeworks_filter_input.png", "pipeworks_filter_side.png", "pipeworks_filter_top.png"}, - paramtype2 = "facedir", - groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,tubedevice=1,mesecon=2}, - legacy_facedir_simple = true, - sounds = default.node_sound_wood_defaults(), - on_construct = function(pos) - local meta = minetest.get_meta(pos) - meta:set_string("formspec", - "invsize[8,6.5;]".. - "list[current_name;main;0,0;8,2;]".. - "list[current_player;main;0,2.5;8,4;]") - meta:set_string("infotext", "Filter") - local inv = meta:get_inventory() - inv:set_size("main", 8*4) - end, - can_dig = function(pos,player) - local meta = minetest.get_meta(pos); - local inv = meta:get_inventory() - return inv:is_empty("main") - end, - after_place_node = function(pos) - pipeworks.scan_for_tube_objects(pos) - end, - after_dig_node = function(pos) - pipeworks.scan_for_tube_objects(pos) - end, - mesecons={effector={action_on=function(pos,node) - minetest.registered_nodes[node.name].on_punch(pos,node,nil) - end}}, - tube={connect_sides={right=1}}, - on_punch = function (pos, node, puncher) - local meta = minetest.get_meta(pos); - local inv = meta:get_inventory() - local dir = facedir_to_right_dir(node.param2) - local frompos = {x=pos.x - dir.x, y=pos.y - dir.y, z=pos.z - dir.z} - local fromnode=minetest.get_node(frompos) - if not fromnode then return end - local idef = minetest.registered_nodes[fromnode.name] - -- assert(idef) - local tube = idef.tube - if not (tube and tube.input_inventory) then - return - end - local frommeta = minetest.get_meta(frompos) - local frominvname = tube.input_inventory - local frominv = frommeta:get_inventory() - local sname - for _,filter in ipairs(inv:get_list("main")) do - sname = filter:get_name() - if sname ~= "" then - -- XXX: that's a lot of parameters - if grabAndFire(frominv, frominvname, frompos, fromnode, sname, tube, idef, dir) then return end +local function punch_filter(data, filtpos, filtnode) + local filtmeta = minetest.get_meta(filtpos) + local filtinv = filtmeta:get_inventory() + local dir = minetest.facedir_to_right_dir(filtnode.param2) + local frompos = vector.subtract(filtpos, dir) + local fromnode = minetest.get_node(frompos) + if not fromnode then return end + local fromdef = minetest.registered_nodes[fromnode.name] + if not fromdef then return end + local fromtube = fromdef.tube + if not (fromtube and fromtube.input_inventory) then return end + local filters = {} + for _, filterstack in ipairs(filtinv:get_list("main")) do + local filtername = filterstack:get_name() + if filtername ~= "" then table.insert(filters, filtername) end + end + if #filters == 0 then table.insert(filters, "") end + local slotseq_mode = filtmeta:get_int("slotseq_mode") + local frommeta = minetest.get_meta(frompos) + local frominv = frommeta:get_inventory() + if fromtube.before_filter then fromtube.before_filter(frompos) end + for _, frominvname in ipairs(type(fromtube.input_inventory) == "table" and fromtube.input_inventory or {fromtube.input_inventory}) do + local done = false + for _, filtername in ipairs(filters) do + if grabAndFire(data, slotseq_mode, filtmeta, frominv, frominvname, frompos, fromnode, filtername, fromtube, fromdef, dir, data.stackwise) then + done = true + break end end - if inv:is_empty("main") then - grabAndFire(frominv,frominvname,frompos,fromnode,nil,tube,idef,dir) - end - end, -}) - -minetest.register_craftitem("pipeworks:mese_filter", { - description = "Mese filter", - stack_max = 99, -}) - -minetest.register_node("pipeworks:mese_filter", { - description = "Mese filter", - tiles = {"pipeworks_mese_filter_top.png", "pipeworks_mese_filter_top.png", "pipeworks_mese_filter_output.png", - "pipeworks_mese_filter_input.png", "pipeworks_mese_filter_side.png", "pipeworks_mese_filter_top.png"}, - paramtype2 = "facedir", - groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,tubedevice=1,mesecon=2}, - legacy_facedir_simple = true, - sounds = default.node_sound_wood_defaults(), - on_construct = function(pos) - local meta = minetest.get_meta(pos) - meta:set_string("formspec", - "invsize[8,6.5;]".. - "list[current_name;main;0,0;8,2;]".. - "list[current_player;main;0,2.5;8,4;]") - meta:set_string("infotext", "Mese filter") - local inv = meta:get_inventory() - inv:set_size("main", 8*4) - end, - can_dig = function(pos,player) - local meta = minetest.get_meta(pos); - local inv = meta:get_inventory() - return inv:is_empty("main") - end, - after_place_node = function(pos) - pipeworks.scan_for_tube_objects(pos) - end, - after_dig_node = function(pos) - pipeworks.scan_for_tube_objects(pos) - end, - mesecons={effector={action_on=function(pos,node) - minetest.registered_nodes[node.name].on_punch(pos,node,nil) - end}}, - tube={connect_sides={right=1}}, - on_punch = function (pos, node, puncher) - local meta = minetest.get_meta(pos); - local inv = meta:get_inventory() - local dir = facedir_to_right_dir(node.param2) - local frompos = {x=pos.x - dir.x, y=pos.y - dir.y, z=pos.z - dir.z} - local fromnode=minetest.get_node(frompos) - local idef = minetest.registered_nodes[fromnode.name] - -- assert(idef) - local tube = idef.tube - if not (tube and tube.input_inventory) then - return - end - local frommeta = minetest.get_meta(frompos) - local frominvname = minetest.registered_nodes[fromnode.name].tube.input_inventory - local frominv = frommeta:get_inventory() - local sname - for _,filter in ipairs(inv:get_list("main")) do - sname = filter:get_name() - if sname ~= "" then - if grabAndFire(frominv, frominvname, frompos, fromnode, sname, tube, idef, dir, true) then return end - end - end - if inv:is_empty("main") then - grabAndFire(frominv, frominvname, frompos, fromnode, nil, tube, idef, dir, true) - end - end, -}) - -local function roundpos(pos) - return {x=math.floor(pos.x+0.5),y=math.floor(pos.y+0.5),z=math.floor(pos.z+0.5)} + if done then break end + end + if fromtube.after_filter then fromtube.after_filter(frompos) end end -local function addVect(pos,vect) - return {x=pos.x+vect.x,y=pos.y+vect.y,z=pos.z+vect.z} +for _, data in ipairs({ + { + name = "filter", + wise_desc = "Itemwise", + stackwise = false, + }, + { + name = "mese_filter", + wise_desc = "Stackwise", + stackwise = true, + }, +}) do + minetest.register_node("pipeworks:"..data.name, { + description = data.wise_desc.." Filter-Injector", + tiles = { + "pipeworks_"..data.name.."_top.png", + "pipeworks_"..data.name.."_top.png", + "pipeworks_"..data.name.."_output.png", + "pipeworks_"..data.name.."_input.png", + "pipeworks_"..data.name.."_side.png", + "pipeworks_"..data.name.."_top.png", + }, + paramtype2 = "facedir", + groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, mesecon = 2}, + legacy_facedir_simple = true, + sounds = default.node_sound_wood_defaults(), + on_construct = function(pos) + local meta = minetest.get_meta(pos) + set_filter_formspec(data, meta) + set_filter_infotext(data, meta) + local inv = meta:get_inventory() + inv:set_size("main", 8*2) + end, + on_receive_fields = function(pos, formname, fields, sender) + fs_helpers.on_receive_fields(pos, fields) + local meta = minetest.get_meta(pos) + meta:set_int("slotseq_index", 1) + set_filter_formspec(data, meta) + set_filter_infotext(data, meta) + end, + can_dig = function(pos, player) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + return inv:is_empty("main") + end, + mesecons = { + effector = { + action_on = function(pos, node) + punch_filter(data, pos, node) + end, + }, + }, + tube = {connect_sides = {right = 1}}, + on_punch = function (pos, node, puncher) + punch_filter(data, pos, node) + end, + }) end local adjlist={{x=0,y=0,z=1},{x=0,y=0,z=-1},{x=0,y=1,z=0},{x=0,y=-1,z=0},{x=1,y=0,z=0},{x=-1,y=0,z=0}} @@ -232,95 +227,75 @@ function pipeworks.notvel(tbl, vel) end local function go_next(pos, velocity, stack) - local chests = {} - local tubes = {} + local next_positions = {} + local max_priority = 0 local cnode = minetest.get_node(pos) local cmeta = minetest.get_meta(pos) - local n local can_go local speed = math.abs(velocity.x + velocity.y + velocity.z) + if speed == 0 then + speed = 1 + end local vel = {x = velocity.x/speed, y = velocity.y/speed, z = velocity.z/speed,speed=speed} if speed >= 4.1 then speed = 4 elseif speed >= 1.1 then - speed = speed-0.1 + speed = speed - 0.1 else speed = 1 end - vel.speed=speed + vel.speed = speed if minetest.registered_nodes[cnode.name] and minetest.registered_nodes[cnode.name].tube and minetest.registered_nodes[cnode.name].tube.can_go then can_go = minetest.registered_nodes[cnode.name].tube.can_go(pos, cnode, vel, stack) else can_go = pipeworks.notvel(adjlist, vel) end - local meta = nil - for _,vect in ipairs(can_go) do - local npos = addVect(pos,vect) + for _, vect in ipairs(can_go) do + local npos = vector.add(pos, vect) local node = minetest.get_node(npos) - local tube_receiver = minetest.get_item_group(node.name,"tubedevice_receiver") - meta = minetest.get_meta(npos) - local tubelike = meta:get_int("tubelike") - if tube_receiver == 1 then - if minetest.registered_nodes[node.name].tube and - minetest.registered_nodes[node.name].tube.can_insert and - minetest.registered_nodes[node.name].tube.can_insert(npos, node, stack, vect) then - local i = #chests + 1 - chests[i] = {} - chests[i].pos = npos - chests[i].vect = vect + local tubedevice = minetest.get_item_group(node.name, "tubedevice") + local tube_def = minetest.registered_nodes[node.name].tube + local tube_priority = (tube_def and tube_def.priority) or 100 + if tubedevice > 0 and tube_priority >= max_priority then + if not tube_def or not tube_def.can_insert or + tube_def.can_insert(npos, node, stack, vect) then + if tube_priority > max_priority then + max_priority = tube_priority + next_positions = {} + end + next_positions[#next_positions + 1] = {pos = npos, vect = vect} end - elseif tubelike == 1 then - local i = #tubes + 1 - tubes[i] = {} - tubes[i].pos = npos - tubes[i].vect = vect end end - if chests[1] == nil then--no chests found - if tubes[1] == nil then - return 0 - else - n = (cmeta:get_int("tubedir")%(#tubes)) + 1 - if pipeworks.enable_cyclic_mode then - cmeta:set_int("tubedir",n) - end - velocity.x = tubes[n].vect.x*vel.speed - velocity.y = tubes[n].vect.y*vel.speed - velocity.z = tubes[n].vect.z*vel.speed - end - else - n = (cmeta:get_int("tubedir")%(#chests))+1 - if pipeworks.enable_cyclic_mode then - cmeta:set_int("tubedir",n) - end - velocity.x = chests[n].vect.x*speed - velocity.y = chests[n].vect.y*speed - velocity.z = chests[n].vect.z*speed + + if not next_positions[1] then + return false, nil end - return 1 + + local n = (cmeta:get_int("tubedir") % (#next_positions)) + 1 + if pipeworks.enable_cyclic_mode then + cmeta:set_int("tubedir", n) + end + local new_velocity = vector.multiply(next_positions[n].vect, vel.speed) + return true, new_velocity end minetest.register_entity("pipeworks:tubed_item", { initial_properties = { hp_max = 1, physical = false, --- collisionbox = {0,0,0,0,0,0}, - collisionbox = {0.1,0.1,0.1,0.1,0.1,0.1}, - visual = "sprite", - visual_size = {x=0.5, y=0.5}, + collisionbox = {0.1, 0.1, 0.1, 0.1, 0.1, 0.1}, + visual = "wielditem", + visual_size = {x = 0.15, y = 0.15}, textures = {""}, - spritediv = {x=1, y=1}, - initial_sprite_basepos = {x=0, y=0}, + spritediv = {x = 1, y = 1}, + initial_sprite_basepos = {x = 0, y = 0}, is_visible = false, - start_pos={}, - route={} }, - - itemstring = '', + physical_state = false, - set_item = function(self, itemstring) - self.itemstring = itemstring + from_data = function(self, itemstring) local stack = ItemStack(itemstring) local itemtable = stack:to_table() local itemname = nil @@ -333,159 +308,171 @@ minetest.register_entity("pipeworks:tubed_item", { item_texture = minetest.registered_items[itemname].inventory_image item_type = minetest.registered_items[itemname].type end - prop = { + self.object:set_properties({ is_visible = true, - visual = "sprite", - textures = {"unknown_item.png"} - } - if item_texture and item_texture ~= "" then - prop.visual = "sprite" - prop.textures = {item_texture} - prop.visual_size = {x=0.3, y=0.3} - else - prop.visual = "wielditem" - prop.textures = {itemname} - prop.visual_size = {x=0.15, y=0.15} - end - self.object:set_properties(prop) + textures = {stack:get_name()} + }) + local def = stack:get_definition() + self.object:setyaw((def and def.type == "node") and 0 or math.pi * 0.25) end, - get_staticdata = function(self) - if self.start_pos==nil then return end - local velocity=self.object:getvelocity() - --self.object:setvelocity({x=0,y=0,z=0}) - self.object:setpos(self.start_pos) - return minetest.serialize({ - itemstring=self.itemstring, - velocity=velocity, - start_pos=self.start_pos - }) - end, - - on_activate = function(self, staticdata) - if staticdata=="" or staticdata==nil then return end - local item = minetest.deserialize(staticdata) - local stack = ItemStack(item.itemstring) - local itemtable = stack:to_table() - local itemname = nil - if itemtable then - itemname = stack:to_table().name + get_staticdata = luaentity.get_staticdata, + on_activate = function(self, staticdata) -- Legacy code, should be replaced later by luaentity.on_activate + if staticdata == "" or staticdata == nil then + return end - - if itemname then - self.start_pos=item.start_pos - self.object:setvelocity(item.velocity) - self.object:setacceleration({x=0, y=0, z=0}) - self.object:setpos(item.start_pos) - end - self:set_item(item.itemstring) - end, - - on_step = function(self, dtime) - if self.start_pos==nil then - local pos = self.object:getpos() - self.start_pos=roundpos(pos) - end - local pos = self.object:getpos() - local node = minetest.get_node(pos) - local meta = minetest.get_meta(pos) - tubelike=meta:get_int("tubelike") - local stack = ItemStack(self.itemstring) - local drop_pos=nil - - local velocity=self.object:getvelocity() - - if velocity==nil then return end - - local velocitycopy={x=velocity.x,y=velocity.y,z=velocity.z} - - local moved=false - local speed=math.abs(velocity.x+velocity.y+velocity.z) - local vel={x=velocity.x/speed,y=velocity.y/speed,z=velocity.z/speed, speed=speed} - - if math.abs(vel.x)==1 then - local next_node=math.abs(pos.x-self.start_pos.x) - if next_node >= 1 then - self.start_pos.x=self.start_pos.x+vel.x - moved=true - end - elseif math.abs(vel.y)==1 then - local next_node=math.abs(pos.y-self.start_pos.y) - if next_node >= 1 then - self.start_pos.y=self.start_pos.y+vel.y - moved=true - end - elseif math.abs(vel.z)==1 then - local next_node=math.abs(pos.z-self.start_pos.z) - if next_node >= 1 then - self.start_pos.z=self.start_pos.z+vel.z - moved=true - end - end - - local sposcopy={x=self.start_pos.x,y=self.start_pos.y,z=self.start_pos.z} - - node = minetest.get_node(self.start_pos) - if moved and minetest.get_item_group(node.name,"tubedevice_receiver")==1 then - local leftover = nil - if minetest.registered_nodes[node.name].tube and minetest.registered_nodes[node.name].tube.insert_object then - leftover = minetest.registered_nodes[node.name].tube.insert_object(self.start_pos,node,stack,vel) - else - leftover = stack - end - --drop_pos=minetest.find_node_near(self.start_pos,1,"air") - --if drop_pos and not leftover:is_empty() then minetest.item_drop(leftover,"",drop_pos) end - --self.object:remove() - if leftover:is_empty() then + if staticdata == "toremove" then self.object:remove() return end - velocity.x=-velocity.x - velocity.y=-velocity.y - velocity.z=-velocity.z - self.object:setvelocity(velocity) - self:set_item(leftover:to_string()) - return - end - - if moved then - if go_next (self.start_pos, velocity, stack) == 0 then - drop_pos=minetest.find_node_near({x=self.start_pos.x+velocity.x,y=self.start_pos.y+velocity.y,z=self.start_pos.z+velocity.z}, 1, "air") - if drop_pos then - minetest.item_drop(stack, "", drop_pos) - self.object:remove() - end - end - end - - if velocity.x~=velocitycopy.x or velocity.y~=velocitycopy.y or velocity.z~=velocitycopy.z or - self.start_pos.x~=sposcopy.x or self.start_pos.y~=sposcopy.y or self.start_pos.z~=sposcopy.z then - self.object:setpos(self.start_pos) - self.object:setvelocity(velocity) - end - -end + local item = minetest.deserialize(staticdata) + pipeworks.tube_inject_item(self.object:getpos(), item.start_pos, item.velocity, item.itemstring) + self.object:remove() + end, }) -if minetest.get_modpath("mesecons_mvps") ~= nil then - mesecon:register_mvps_unmov("pipeworks:tubed_item") - mesecon:register_on_mvps_move(function(moved_nodes) - local objects_to_move = {} - for _, n in ipairs(moved_nodes) do - local objects = minetest.get_objects_inside_radius(n.oldpos, 1) - for _, obj in ipairs(objects) do - local entity = obj:get_luaentity() - if entity and entity.name == "pipeworks:tubed_item" then - objects_to_move[#objects_to_move+1] = obj +minetest.register_entity("pipeworks:color_entity", { + initial_properties = { + hp_max = 1, + physical = false, + collisionbox = {0.1, 0.1, 0.1, 0.1, 0.1, 0.1}, + visual = "cube", + visual_size = {x = 3.5, y = 3.5, z = 3.5}, -- todo: find correct size + textures = {""}, + is_visible = false, + }, + + physical_state = false, + + from_data = function(self, color) + local t = "pipeworks_color_"..color..".png" + local prop = { + is_visible = true, + visual = "cube", + textures = {t, t, t, t, t, t} -- todo: textures + } + self.object:set_properties(prop) + end, + + get_staticdata = luaentity.get_staticdata, + on_activate = luaentity.on_activate, +}) + +luaentity.register_entity("pipeworks:tubed_item", { + itemstring = '', + item_entity = nil, + color_entity = nil, + color = nil, + start_pos = nil, + + set_item = function(self, item) + local itemstring = ItemStack(item):to_string() -- Accept any input format + if self.itemstring == itemstring then + return + end + if self.item_entity then + self:remove_attached_entity(self.item_entity) + end + self.itemstring = itemstring + self.item_entity = self:add_attached_entity("pipeworks:tubed_item", itemstring) + end, + + set_color = function(self, color) + if self.color == color then + return + end + self.color = color + if self.color_entity then + self:remove_attached_entity(self.color_entity) + end + if color then + self.color_entity = self:add_attached_entity("pipeworks:color_entity", color) + else + self.color_entity = nil + end + end, + + on_step = function(self, dtime) + if self.start_pos == nil then + local pos = self:getpos() + self.start_pos = vector.round(pos) + self:setpos(pos) + end + + local pos = self:getpos() + local stack = ItemStack(self.itemstring) + local drop_pos + + local velocity = self:getvelocity() + + local moved = false + local speed = math.abs(velocity.x + velocity.y + velocity.z) + if speed == 0 then + speed = 1 + moved = true + end + local vel = {x = velocity.x / speed, y = velocity.y / speed, z = velocity.z / speed, speed = speed} + + if vector.distance(pos, self.start_pos) >= 1 then + self.start_pos = vector.add(self.start_pos, vel) + moved = true + end + + minetest.load_position(self.start_pos) + local node = minetest.get_node(self.start_pos) + if moved and minetest.get_item_group(node.name, "tubedevice_receiver") == 1 then + local leftover + if minetest.registered_nodes[node.name].tube and minetest.registered_nodes[node.name].tube.insert_object then + leftover = minetest.registered_nodes[node.name].tube.insert_object(self.start_pos, node, stack, vel) + else + leftover = stack + end + if leftover:is_empty() then + self:remove() + return + end + velocity = vector.multiply(velocity, -1) + self:setvelocity(velocity) + self:set_item(leftover:to_string()) + return + end + + if moved then + local found_next, new_velocity = go_next(self.start_pos, velocity, stack) -- todo: color + if not found_next then + drop_pos = minetest.find_node_near(vector.add(self.start_pos, velocity), 1, "air") + if drop_pos then + minetest.item_drop(stack, "", drop_pos) + self:remove() + return end end + + if new_velocity and not vector.equals(velocity, new_velocity) then + self:setpos(self.start_pos) + self:setvelocity(new_velocity) + end end - if #objects_to_move > 0 then - local dir = vector.subtract(moved_nodes[1].pos, moved_nodes[1].oldpos) - for _, obj in ipairs(objects_to_move) do - local entity = obj:get_luaentity() - obj:setpos(vector.add(obj:getpos(), dir)) - entity.start_pos = vector.add(entity.start_pos, dir) + end +}) + +if minetest.get_modpath("mesecons_mvps") then + mesecon:register_mvps_unmov("pipeworks:tubed_item") + mesecon:register_mvps_unmov("pipeworks:color_entity") + mesecon:register_on_mvps_move(function(moved_nodes) + local moved = {} + for _, n in ipairs(moved_nodes) do + moved[minetest.hash_node_position(n.oldpos)] = vector.subtract(n.pos, n.oldpos) + end + for id, entity in pairs(luaentity.entities) do + if entity.name == "pipeworks:tubed_item" then + local pos = entity:getpos() + local rpos = vector.round(pos) + local dir = moved[minetest.hash_node_position(rpos)] + if dir then + entity:setpos(vector.add(pos, dir)) + entity.start_pos = vector.add(entity.start_pos, dir) + end end end end) diff --git a/mods/pipeworks/legacy.lua b/mods/pipeworks/legacy.lua new file mode 100644 index 0000000..84ae31d --- /dev/null +++ b/mods/pipeworks/legacy.lua @@ -0,0 +1,60 @@ + +if not minetest.get_modpath("auto_tree_tap") and + minetest.get_modpath("technic") then + + minetest.register_abm({ + nodenames = { "auto_tree_tap:off", "auto_tree_tap:on" }, + chance = 1, + interval = 1, + action = function(pos, node, active_object_count, active_object_count_wider) + local fdir = node.param2 + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + inv:set_size("pick", 1) + inv:set_size("ghost_pick", 1) + inv:set_size("main", 100) + minetest.set_node(pos, {name = "pipeworks:nodebreaker_off", param2 = fdir}) + minetest.registered_nodes["pipeworks:nodebreaker_off"].on_punch(pos, node) + inv:set_stack("pick", 1, ItemStack("technic:treetap")) + end + }) + + minetest.register_node(":auto_tree_tap:off", { + description = "Auto-Tap", + tiles = {"pipeworks_nodebreaker_top_off.png","pipeworks_nodebreaker_bottom_off.png","pipeworks_nodebreaker_side2_off.png","pipeworks_nodebreaker_side1_off.png", + "pipeworks_nodebreaker_back.png","pipeworks_nodebreaker_front_off.png"}, + is_ground_content = true, + paramtype2 = "facedir", + groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2, mesecon = 2,tubedevice=1, not_in_creative_inventory=1 }, + mesecons= {effector={rules=pipeworks.rules_all,action_on=node_breaker_on, action_off=node_breaker_off}}, + sounds = default.node_sound_stone_defaults(), + tube = {connect_sides={back=1}}, + on_construct = function(pos) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + inv:set_size("pick", 1) + inv:set_stack("pick", 1, ItemStack("default:pick_mese")) + end, + after_place_node = function (pos, placer) + pipeworks.scan_for_tube_objects(pos, placer) + local placer_pos = placer:getpos() + + --correct for the player's height + if placer:is_player() then placer_pos.y = placer_pos.y + 1.5 end + + --correct for 6d facedir + if placer_pos then + local dir = { + x = pos.x - placer_pos.x, + y = pos.y - placer_pos.y, + z = pos.z - placer_pos.z + } + local node = minetest.get_node(pos) + node.param2 = minetest.dir_to_facedir(dir, true) + minetest.set_node(pos, node) + minetest.log("action", "real (6d) facedir: " .. node.param2) + end + end, + after_dig_node = pipeworks.scan_for_tube_objects, + }) +end diff --git a/mods/pipeworks/luaentity.lua b/mods/pipeworks/luaentity.lua new file mode 100644 index 0000000..fe81cb3 --- /dev/null +++ b/mods/pipeworks/luaentity.lua @@ -0,0 +1,334 @@ +local max_entity_id = 1000000000000 -- If you need more, there's a problem with your code + +luaentity = {} + +luaentity.registered_entities = {} + +local filename = minetest.get_worldpath().."/luaentities" +local function read_file() + local f = io.open(filename, "r") + if f == nil then return {} end + local t = f:read("*all") + f:close() + if t == "" or t == nil then return {} end + return minetest.deserialize(t) +end + +local function write_file(tbl) + local f = io.open(filename, "w") + f:write(minetest.serialize(tbl)) + f:close() +end + +local function read_entities() + local t = read_file() + for _, entity in pairs(t) do + setmetatable(entity, luaentity.registered_entities[entity.name]) + end + return t +end + +local function write_entities() + for _, entity in pairs(luaentity.entities) do + setmetatable(entity, nil) + for _, attached in pairs(entity._attached_entities) do + if attached.entity then + attached.entity:remove() + attached.entity = nil + end + end + entity._attached_entities_master = nil + end + write_file(luaentity.entities) +end + +minetest.register_on_shutdown(write_entities) +luaentity.entities_index = 0 + +local function get_blockpos(pos) + return {x = math.floor(pos.x / 16), + y = math.floor(pos.y / 16), + z = math.floor(pos.z / 16)} +end + +local active_blocks = {} -- These only contain active blocks near players (i.e., not forceloaded ones) +local handle_active_blocks_step = 2 +local handle_active_blocks_timer = 0 +minetest.register_globalstep(function(dtime) + handle_active_blocks_timer = handle_active_blocks_timer + dtime + if handle_active_blocks_timer >= handle_active_blocks_step then + handle_active_blocks_timer = handle_active_blocks_timer - handle_active_blocks_step + local active_block_range = tonumber(minetest.setting_get("active_block_range")) + local new_active_blocks = {} + for _, player in ipairs(minetest.get_connected_players()) do + local blockpos = get_blockpos(player:getpos()) + local minp = vector.subtract(blockpos, active_block_range) + local maxp = vector.add(blockpos, active_block_range) + + for x = minp.x, maxp.x do + for y = minp.y, maxp.y do + for z = minp.z, maxp.z do + local pos = {x = x, y = y, z = z} + new_active_blocks[minetest.hash_node_position(pos)] = pos + end + end + end + end + active_blocks = new_active_blocks + -- todo: callbacks on block load/unload + end +end) + +local function is_active(pos) + return active_blocks[minetest.hash_node_position(get_blockpos(pos))] ~= nil +end + +local entitydef_default = { + _attach = function(self, attached, attach_to) + local attached_def = self._attached_entities[attached] + local attach_to_def = self._attached_entities[attach_to] + attached_def.entity:set_attach( + attach_to_def.entity, "", + vector.subtract(attached_def.offset, attach_to_def.offset), -- todo: Does not work because is object space + vector.new(0, 0, 0) + ) + end, + _set_master = function(self, index) + self._attached_entities_master = index + if not index then + return + end + local def = self._attached_entities[index] + if not def.entity then + return + end + def.entity:setpos(vector.add(self._pos, def.offset)) + def.entity:setvelocity(self._velocity) + def.entity:setacceleration(self._acceleration) + end, + _attach_all = function(self) + local master = self._attached_entities_master + if not master then + return + end + for id, entity in pairs(self._attached_entities) do + if id ~= master and entity.entity then + self:_attach(id, master) + end + end + end, + _detach_all = function(self) + local master = self._attached_entities_master + for id, entity in pairs(self._attached_entities) do + if id ~= master and entity.entity then + entity.entity:set_detach() + end + end + end, + _add_attached = function(self, index) + local entity = self._attached_entities[index] + if entity.entity then + return + end + local entity_pos = vector.add(self._pos, entity.offset) + if not is_active(entity_pos) then + return + end + local ent = minetest.add_entity(entity_pos, entity.name):get_luaentity() + ent:from_data(entity.data) + ent.parent_id = self._id + ent.attached_id = index + entity.entity = ent.object + local master = self._attached_entities_master + if master then + self:_attach(index, master) + else + self:_set_master(index) + end + end, + _remove_attached = function(self, index) + local master = self._attached_entities_master + local entity = self._attached_entities[index] + local ent = entity.entity + entity.entity = nil + if index == master then + self:_detach_all() + local newmaster + for id, attached in pairs(self._attached_entities) do + if id ~= master and attached.entity then + newmaster = id + break + end + end + self:_set_master(newmaster) + self:_attach_all() + elseif master and ent then + ent:set_detach() + end + if ent then + ent:remove() + end + end, + _add_loaded = function(self) + for id, _ in pairs(self._attached_entities) do + self:_add_attached(id) + end + end, + getid = function(self) + return self._id + end, + getpos = function(self) + return vector.new(self._pos) + end, + setpos = function(self, pos) + self._pos = vector.new(pos) + --for _, entity in pairs(self._attached_entities) do + -- if entity.entity then + -- entity.entity:setpos(vector.add(self._pos, entity.offset)) + -- end + --end + local master = self._attached_entities_master + if master then + local master_def = self._attached_entities[master] + master_def.entity:setpos(vector.add(self._pos, master_def.offset)) + end + end, + getvelocity = function(self) + return vector.new(self._velocity) + end, + setvelocity = function(self, velocity) + self._velocity = vector.new(velocity) + local master = self._attached_entities_master + if master then + self._attached_entities[master].entity:setvelocity(self._velocity) + end + end, + getacceleration = function(self) + return vector.new(self._acceleration) + end, + setacceleration = function(self, acceleration) + self._acceleration = vector.new(acceleration) + local master = self._attached_entities_master + if master then + self._attached_entities[master].entity:setacceleration(self._acceleration) + end + end, + remove = function(self) + self:_detach_all() + for _, entity in pairs(self._attached_entities) do + if entity.entity then + entity.entity:remove() + end + end + luaentity.entities[self._id] = nil + end, + add_attached_entity = function(self, name, data, offset) + local index = #self._attached_entities + 1 + self._attached_entities[index] = { + name = name, + data = data, + offset = vector.new(offset), + } + self:_add_attached(index) + return index + end, + remove_attached_entity = function(self, index) + self:_remove_attached(index) + self._attached_entities[index] = nil + end, +} + +function luaentity.register_entity(name, prototype) + -- name = check_modname_prefix(name) + prototype.name = name + setmetatable(prototype, {__index = entitydef_default}) + prototype.__index = prototype -- Make it possible to use it as metatable + luaentity.registered_entities[name] = prototype +end + +-- function luaentity.get_entity_definition(entity) +-- return luaentity.registered_entities[entity.name] +-- end + +function luaentity.add_entity(pos, name) + local index = luaentity.entities_index + while luaentity.entities[index] do + index = index + 1 + if index >= max_entity_id then + index = 0 + end + end + luaentity.entities_index = index + + local entity = { + name = name, + _id = index, + _pos = vector.new(pos), + _velocity = {x = 0, y = 0, z = 0}, + _acceleration = {x = 0, y = 0, z = 0}, + _attached_entities = {}, + } + + local prototype = luaentity.registered_entities[name] + setmetatable(entity, prototype) -- Default to prototype for other methods + luaentity.entities[index] = entity + + if entity.on_activate then + entity:on_activate() + end + return entity +end + +-- todo: check if remove in get_staticdata works +function luaentity.get_staticdata(self) + local parent = luaentity.entities[self.parent_id] + if parent and parent._remove_attached then + parent:_remove_attached(self.attached_id) + end + return "toremove" +end + +function luaentity.on_activate(self, staticdata) + if staticdata == "toremove" then + self.object:remove() + end +end + +function luaentity.get_objects_inside_radius(pos, radius) + local objects = {} + local index = 1 + for id, entity in pairs(luaentity.entities) do + if vector.distance(pos, entity:getpos()) <= radius then + objects[index] = entity + index = index + 1 + end + end +end + +minetest.register_globalstep(function(dtime) + if not luaentity.entities then + luaentity.entities = read_entities() + end + for id, entity in pairs(luaentity.entities) do + local master = entity._attached_entities_master + if master then + local master_def = entity._attached_entities[master] + local master_entity = master_def.entity + entity._pos = vector.subtract(master_entity:getpos(), master_def.offset) + entity._velocity = master_entity:getvelocity() + entity._acceleration = master_entity:getacceleration() + else + entity._pos = vector.add(vector.add( + entity._pos, + vector.multiply(entity._velocity, dtime)), + vector.multiply(entity._acceleration, 0.5 * dtime * dtime)) + entity._velocity = vector.add( + entity._velocity, + vector.multiply(entity._acceleration, dtime)) + end + entity:_add_loaded() + if entity.on_step then + entity:on_step(dtime) + end + end +end) diff --git a/mods/pipeworks/node_breaker.lua b/mods/pipeworks/node_breaker.lua deleted file mode 100644 index 17e0475..0000000 --- a/mods/pipeworks/node_breaker.lua +++ /dev/null @@ -1,281 +0,0 @@ - ---register aliases for when someone had technic installed, but then uninstalled it but not pipeworks -minetest.register_alias("technic:nodebreaker_off", "pipeworks:nodebreaker_off") -minetest.register_alias("technic:nodebreaker_on", "pipeworks:nodebreaker_on") -minetest.register_alias("technic:node_breaker_off", "pipeworks:nodebreaker_off") --old name -minetest.register_alias("technic:node_breaker_on", "pipeworks:nodebreaker_on") --old name - -minetest.register_craft({ - output = 'pipeworks:nodebreaker_off 1', - recipe = { - {'group:wood', 'default:pick_mese','group:wood'}, - {'default:stone', 'mesecons:piston','default:stone'}, - {'default:stone', 'mesecons:mesecon','default:stone'}, - } -}) - -local function swap_node(pos, name) - local node = minetest.get_node(pos) - if node.name == name then - return - end - node.name = name - minetest.swap_node(pos, node) -end - ---define the functions from https://github.com/minetest/minetest/pull/834 while waiting for the devs to notice it -local function dir_to_facedir(dir, is6d) - --account for y if requested - if is6d and math.abs(dir.y) > math.abs(dir.x) and math.abs(dir.y) > math.abs(dir.z) then - - --from above - if dir.y < 0 then - if math.abs(dir.x) > math.abs(dir.z) then - if dir.x < 0 then - return 19 - else - return 13 - end - else - if dir.z < 0 then - return 10 - else - return 4 - end - end - - --from below - else - if math.abs(dir.x) > math.abs(dir.z) then - if dir.x < 0 then - return 15 - else - return 17 - end - else - if dir.z < 0 then - return 6 - else - return 8 - end - end - end - - --otherwise, place horizontally - elseif math.abs(dir.x) > math.abs(dir.z) then - if dir.x < 0 then - return 3 - else - return 1 - end - else - if dir.z < 0 then - return 2 - else - return 0 - end - end -end - -local function delay(x) - return (function() return x end) -end - -local function break_node (pos, facedir) - --locate the outgoing velocity, front, and back of the node via facedir_to_dir - if type(facedir) ~= "number" or facedir < 0 or facedir > 23 then return end - - local vel = minetest.facedir_to_dir(facedir); - local front = {x=pos.x - vel.x, y=pos.y - vel.y, z=pos.z - vel.z} - - local node = minetest.get_node(front) - if node.name == "air" or node.name == "ignore" then - return nil - elseif minetest.registered_nodes[node.name] and minetest.registered_nodes[node.name].liquidtype ~= "none" then - return nil - end - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - inv:set_stack("pick", 1, ItemStack("default:pick_mese")) - local pitch - local yaw - if vel.z < 0 then - yaw = 0 - pitch = 0 - elseif vel.z > 0 then - yaw = math.pi - pitch = 0 - elseif vel.x < 0 then - yaw = 3*math.pi/2 - pitch = 0 - elseif vel.x > 0 then - yaw = math.pi/2 - pitch = 0 - elseif vel.y > 0 then - yaw = 0 - pitch = -math.pi/2 - else - yaw = 0 - pitch = math.pi/2 - end - local digger = { - get_inventory_formspec = delay(""), - get_look_dir = delay({x = -vel.x, y = -vel.y, z = -vel.z}), - get_look_pitch = delay(pitch), - get_look_yaw = delay(yaw), - get_player_control = delay({jump=false, right=false, left=false, LMB=false, RMB=false, sneak=false, aux1=false, down=false, up=false}), - get_player_control_bits = delay(0), - get_player_name = delay("node_breaker"), - is_player = delay(true), - set_inventory_formspec = delay(), - getpos = delay({x = pos.x, y = pos.y - 1.5, z = pos.z}), -- Player height - get_hp = delay(20), - get_inventory = delay(inv), - get_wielded_item = delay(ItemStack("default:pick_mese")), - get_wield_index = delay(1), - get_wield_list = delay("pick"), - moveto = delay(), - punch = delay(), - remove = delay(), - right_click = delay(), - setpos = delay(), - set_hp = delay(), - set_properties = delay(), - set_wielded_item = delay(), - set_animation = delay(), - set_attach = delay(), - set_detach = delay(), - set_bone_position = delay(), - } - - --check node to make sure it is diggable - local def = ItemStack({name=node.name}):get_definition() - if #def ~= 0 and not def.diggable or (def.can_dig and not def.can_dig(front, digger)) then --node is not diggable - return - end - - --handle node drops - local drops = minetest.get_node_drops(node.name, "default:pick_mese") - for _, dropped_item in ipairs(drops) do - local item1 = pipeworks.tube_item({x=pos.x, y=pos.y, z=pos.z}, dropped_item) - item1:get_luaentity().start_pos = {x=pos.x, y=pos.y, z=pos.z} - item1:setvelocity(vel) - item1:setacceleration({x=0, y=0, z=0}) - end - - local oldmetadata = nil - if def.after_dig_node then - oldmetadata = minetest.get_meta(front):to_table() - end - - minetest.remove_node(front) - - --handle post-digging callback - if def.after_dig_node then - -- Copy pos and node because callback can modify them - local pos_copy = {x=front.x, y=front.y, z=front.z} - local node_copy = {name=node.name, param1=node.param1, param2=node.param2} - def.after_dig_node(pos_copy, node_copy, oldmetadata, digger) - end - - --run digging event callbacks - for _, callback in ipairs(minetest.registered_on_dignodes) do - -- Copy pos and node because callback can modify them - local pos_copy = {x=front.x, y=front.y, z=front.z} - local node_copy = {name=node.name, param1=node.param1, param2=node.param2} - callback(pos_copy, node_copy, digger) - end -end - -local node_breaker_on = function(pos, node) - if node.name == "pipeworks:nodebreaker_off" then - swap_node(pos, "pipeworks:nodebreaker_on") - break_node(pos, node.param2) - nodeupdate(pos) - end -end - -local node_breaker_off = function(pos, node) - if node.name == "pipeworks:nodebreaker_on" then - swap_node(pos, "pipeworks:nodebreaker_off") - nodeupdate(pos) - end -end - -minetest.register_node("pipeworks:nodebreaker_off", { - description = "Node Breaker", - tile_images = {"pipeworks_nodebreaker_top_off.png","pipeworks_nodebreaker_bottom_off.png","pipeworks_nodebreaker_side2_off.png","pipeworks_nodebreaker_side1_off.png", - "pipeworks_nodebreaker_back.png","pipeworks_nodebreaker_front_off.png"}, - is_ground_content = true, - paramtype2 = "facedir", - groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2, mesecon = 2,tubedevice=1}, - mesecons= {effector={rules=pipeworks.rules_all,action_on=node_breaker_on, action_off=node_breaker_off}}, - sounds = default.node_sound_stone_defaults(), - tube = {connect_sides={back=1}}, - on_construct = function(pos) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - inv:set_size("pick", 1) - inv:set_stack("pick", 1, ItemStack("default:pick_mese")) - end, - after_place_node = function (pos, placer) - pipeworks.scan_for_tube_objects(pos, placer) - local placer_pos = placer:getpos() - - --correct for the player's height - if placer:is_player() then placer_pos.y = placer_pos.y + 1.5 end - - --correct for 6d facedir - if placer_pos then - local dir = { - x = pos.x - placer_pos.x, - y = pos.y - placer_pos.y, - z = pos.z - placer_pos.z - } - local node = minetest.get_node(pos) - node.param2 = dir_to_facedir(dir, true) - minetest.set_node(pos, node) - minetest.log("action", "real (6d) facedir: " .. node.param2) - end - end, - after_dig_node = pipeworks.scan_for_tube_objects, -}) - -minetest.register_node("pipeworks:nodebreaker_on", { - description = "Node Breaker", - tile_images = {"pipeworks_nodebreaker_top_on.png","pipeworks_nodebreaker_bottom_on.png","pipeworks_nodebreaker_side2_on.png","pipeworks_nodebreaker_side1_on.png", - "pipeworks_nodebreaker_back.png","pipeworks_nodebreaker_front_on.png"}, - mesecons= {effector={rules=pipeworks.rules_all,action_on=node_breaker_on, action_off=node_breaker_off}}, - is_ground_content = true, - paramtype2 = "facedir", - groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2, mesecon = 2,tubedevice=1,not_in_creative_inventory=1}, - sounds = default.node_sound_stone_defaults(), - tube = {connect_sides={back=1}}, - on_construct = function(pos) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - inv:set_size("pick", 1) - inv:set_stack("pick", 1, ItemStack("default:pick_mese")) - end, - after_place_node = function (pos, placer) - pipeworks.scan_for_tube_objects(pos, placer) - local placer_pos = placer:getpos() - - --correct for the player's height - if placer:is_player() then placer_pos.y = placer_pos.y + 1.5 end - - --correct for 6d facedir - if placer_pos then - local dir = { - x = pos.x - placer_pos.x, - y = pos.y - placer_pos.y, - z = pos.z - placer_pos.z - } - local node = minetest.get_node(pos) - node.param2 = dir_to_facedir(dir, true) - minetest.set_node(pos, node) - minetest.log("action", "real (6d) facedir: " .. node.param2) - end - end, - after_dig_node = pipeworks.scan_for_tube_objects, -}) diff --git a/mods/pipeworks/teleport_tube.lua b/mods/pipeworks/teleport_tube.lua index f57f55a..16985e2 100644 --- a/mods/pipeworks/teleport_tube.lua +++ b/mods/pipeworks/teleport_tube.lua @@ -3,10 +3,10 @@ local filename=minetest.get_worldpath() .. "/teleport_tubes" local function read_file() local f = io.open(filename, "r") - if f==nil then return {} end + if f == nil then return {} end local t = f:read("*all") f:close() - if t=="" or t==nil then return {} end + if t == "" or t == nil then return {} end return minetest.deserialize(t) end @@ -18,8 +18,8 @@ end local function update_pos_in_file(pos) local tbl=read_file() - for _,val in ipairs(tbl) do - if val.x==pos.x and val.y==pos.y and val.z==pos.z then + for _, val in ipairs(tbl) do + if val.x == pos.x and val.y == pos.y and val.z == pos.z then local meta = minetest.get_meta(val) val.channel = meta:get_string("channel") val.cr = meta:get_int("can_receive") @@ -40,34 +40,56 @@ local function add_tube_in_file(pos,channel, cr) end local function remove_tube_in_file(pos) - local tbl=read_file() - local newtbl={} - for _,val in ipairs(tbl) do - if val.x~=pos.x or val.y~=pos.y or val.z~=pos.z then - table.insert(newtbl,val) + local tbl = read_file() + local newtbl = {} + for _, val in ipairs(tbl) do + if val.x ~= pos.x or val.y ~= pos.y or val.z ~= pos.z then + table.insert(newtbl, val) end end write_file(newtbl) end +local function read_node_with_vm(pos) + local vm = VoxelManip() + local MinEdge, MaxEdge = vm:read_from_map(pos, pos) + local data = vm:get_data() + local area = VoxelArea:new({MinEdge = MinEdge, MaxEdge = MaxEdge}) + return minetest.get_name_from_content_id(data[area:index(pos.x, pos.y, pos.z)]) +end + local function get_tubes_in_file(pos,channel) - local tbl=read_file() - local newtbl={} - local changed=false - for _,val in ipairs(tbl) do - local node = minetest.get_node(val) + local tbl = read_file() + local newtbl = {} + local changed = false + for _, val in ipairs(tbl) do local meta = minetest.get_meta(val) - -- That shouldn't be needed anymore since the mvps callback, but we leave it nevertheless - if node.name~="ignore" and (val.channel~=meta:get_string("channel") or val.cr~=meta:get_int("can_receive")) then - val.channel=meta:get_string("channel") - val.cr=meta:get_int("can_receive") - changed=true - end - if val.cr==1 and val.channel==channel and (val.x~=pos.x or val.y~=pos.y or val.z~=pos.z) then - table.insert(newtbl,val) + local name = read_node_with_vm(val) + local is_loaded = (minetest.get_node_or_nil(val) ~= nil) + local is_teleport_tube = minetest.registered_nodes[name] and minetest.registered_nodes[name].is_teleport_tube + if is_teleport_tube then + if is_loaded and (val.channel ~= meta:get_string("channel") or val.cr ~= meta:get_int("can_receive")) then + val.channel = meta:get_string("channel") + val.cr = meta:get_int("can_receive") + changed = true + end + if val.cr == 1 and val.channel == channel and (val.x ~= pos.x or val.y ~= pos.y or val.z ~= pos.z) then + table.insert(newtbl, val) + end + else + val.to_remove = true + changed = true end end - if changed then write_file(tbl) end + if changed then + local updated = {} + for _, val in ipairs(tbl) do + if not val.to_remove then + table.insert(updated, val) + end + end + write_file(updated) + end return newtbl end @@ -80,8 +102,17 @@ local teleport_end_textures={"pipeworks_teleport_tube_end.png","pipeworks_telepo local teleport_short_texture="pipeworks_teleport_tube_short.png" local teleport_inv_texture="pipeworks_teleport_tube_inv.png" -pipeworks.register_tube("pipeworks:teleport_tube","Teleporter pneumatic tube segment",teleport_plain_textures, +local function set_teleport_tube_formspec(meta) + local cr = meta:get_int("can_receive") ~= 0 + meta:set_string("formspec","size[10.5,1;]".. + "field[0,0.5;7,1;channel;Channel:;${channel}]".. + "button[8,0;2.5,1;"..(cr and "cr0" or "cr1")..";".. + (cr and "Send and Receive" or "Send only").."]") +end + +pipeworks.register_tube("pipeworks:teleport_tube","Teleporting Pneumatic Tube Segment",teleport_plain_textures, teleport_noctr_textures,teleport_end_textures,teleport_short_texture,teleport_inv_texture, { + is_teleport_tube = true, tube = { can_go = function(pos,node,velocity,stack) velocity.x = 0 @@ -102,10 +133,8 @@ pipeworks.register_tube("pipeworks:teleport_tube","Teleporter pneumatic tube seg local meta = minetest.get_meta(pos) meta:set_string("channel","") meta:set_int("can_receive",1) - meta:set_string("formspec","size[9,1;]".. - "field[0,0.5;7,1;channel;Channel:;${channel}]".. - "button[8,0;1,1;bt;On]") add_tube_in_file(pos,"") + set_teleport_tube_formspec(meta) end, on_receive_fields = function(pos,formname,fields,sender) local meta = minetest.get_meta(pos) @@ -121,7 +150,7 @@ pipeworks.register_tube("pipeworks:teleport_tube","Teleporter pneumatic tube seg return --channels starting with '[name];' can be used by other players, but cannot be received from - elseif mode == ";" and (meta:get_int("can_receive") ~= 0) == (fields["bt"] == nil) then + elseif mode == ";" and (fields.cr1 or (meta:get_int("can_receive") ~= 0 and not fields.cr0)) then minetest.chat_send_player(sender:get_player_name(), "Sorry, receiving from channel '"..fields.channel.."' is reserved for "..name) return end @@ -131,21 +160,11 @@ pipeworks.register_tube("pipeworks:teleport_tube","Teleporter pneumatic tube seg if fields.channel==nil then fields.channel=meta:get_string("channel") end meta:set_string("channel",fields.channel) remove_tube_in_file(pos) + if fields.cr0 then meta:set_int("can_receive", 0) end + if fields.cr1 then meta:set_int("can_receive", 1) end local cr = meta:get_int("can_receive") - if fields["bt"] then - cr=1-cr - meta:set_int("can_receive",cr) - if cr==1 then - meta:set_string("formspec","size[9,1;]".. - "field[0,0.5;7,1;channel;Channel:;${channel}]".. - "button[8,0;1,1;bt;On]") - else - meta:set_string("formspec","size[9,1;]".. - "field[0,0.5;7,1;channel;Channel:;${channel}]".. - "button[8,0;1,1;bt;Off]") - end - end - add_tube_in_file(pos,fields.channel, cr) + add_tube_in_file(pos, fields.channel, meta:get_int("can_receive")) + set_teleport_tube_formspec(meta) end, on_destruct = function(pos) remove_tube_in_file(pos) diff --git a/mods/pipeworks/textures/homedecor_oil_extract.png b/mods/pipeworks/textures/homedecor_oil_extract.png new file mode 100644 index 0000000..ef0f896 Binary files /dev/null and b/mods/pipeworks/textures/homedecor_oil_extract.png differ diff --git a/mods/pipeworks/textures/homedecor_paraffin.png b/mods/pipeworks/textures/homedecor_paraffin.png new file mode 100644 index 0000000..5f98300 Binary files /dev/null and b/mods/pipeworks/textures/homedecor_paraffin.png differ diff --git a/mods/pipeworks/textures/homedecor_plastic_base.png b/mods/pipeworks/textures/homedecor_plastic_base.png deleted file mode 100644 index 0175da3..0000000 Binary files a/mods/pipeworks/textures/homedecor_plastic_base.png and /dev/null differ diff --git a/mods/pipeworks/textures/homedecor_plastic_base_inv.png b/mods/pipeworks/textures/homedecor_plastic_base_inv.png deleted file mode 100644 index 1a01709..0000000 Binary files a/mods/pipeworks/textures/homedecor_plastic_base_inv.png and /dev/null differ diff --git a/mods/pipeworks/textures/homedecor_plastic_sheeting.png b/mods/pipeworks/textures/homedecor_plastic_sheeting.png index 1386b19..fea8773 100644 Binary files a/mods/pipeworks/textures/homedecor_plastic_sheeting.png and b/mods/pipeworks/textures/homedecor_plastic_sheeting.png differ diff --git a/mods/pipeworks/textures/pipeworks_dispenser_back.png b/mods/pipeworks/textures/pipeworks_dispenser_back.png new file mode 100644 index 0000000..f4fade2 Binary files /dev/null and b/mods/pipeworks/textures/pipeworks_dispenser_back.png differ diff --git a/mods/pipeworks/textures/pipeworks_dispenser_bottom.png b/mods/pipeworks/textures/pipeworks_dispenser_bottom.png new file mode 100644 index 0000000..35416de Binary files /dev/null and b/mods/pipeworks/textures/pipeworks_dispenser_bottom.png differ diff --git a/mods/pipeworks/textures/pipeworks_dispenser_front_off.png b/mods/pipeworks/textures/pipeworks_dispenser_front_off.png new file mode 100644 index 0000000..4fc0017 Binary files /dev/null and b/mods/pipeworks/textures/pipeworks_dispenser_front_off.png differ diff --git a/mods/pipeworks/textures/pipeworks_dispenser_front_on.png b/mods/pipeworks/textures/pipeworks_dispenser_front_on.png new file mode 100644 index 0000000..36f7f0b Binary files /dev/null and b/mods/pipeworks/textures/pipeworks_dispenser_front_on.png differ diff --git a/mods/pipeworks/textures/pipeworks_dispenser_side1.png b/mods/pipeworks/textures/pipeworks_dispenser_side1.png new file mode 100644 index 0000000..56e8973 Binary files /dev/null and b/mods/pipeworks/textures/pipeworks_dispenser_side1.png differ diff --git a/mods/pipeworks/textures/pipeworks_dispenser_side2.png b/mods/pipeworks/textures/pipeworks_dispenser_side2.png new file mode 100644 index 0000000..8f306b2 Binary files /dev/null and b/mods/pipeworks/textures/pipeworks_dispenser_side2.png differ diff --git a/mods/pipeworks/textures/pipeworks_dispenser_top.png b/mods/pipeworks/textures/pipeworks_dispenser_top.png new file mode 100644 index 0000000..8d6f9d0 Binary files /dev/null and b/mods/pipeworks/textures/pipeworks_dispenser_top.png differ diff --git a/mods/pipeworks/textures/pipeworks_trashcan_bottom.png b/mods/pipeworks/textures/pipeworks_trashcan_bottom.png new file mode 100644 index 0000000..a50c789 Binary files /dev/null and b/mods/pipeworks/textures/pipeworks_trashcan_bottom.png differ diff --git a/mods/pipeworks/textures/pipeworks_trashcan_side.png b/mods/pipeworks/textures/pipeworks_trashcan_side.png new file mode 100644 index 0000000..7b081bf Binary files /dev/null and b/mods/pipeworks/textures/pipeworks_trashcan_side.png differ diff --git a/mods/pipeworks/trashcan.lua b/mods/pipeworks/trashcan.lua new file mode 100644 index 0000000..fdec79f --- /dev/null +++ b/mods/pipeworks/trashcan.lua @@ -0,0 +1,49 @@ +minetest.register_node("pipeworks:trashcan", { + description = "Trash Can", + drawtype = "normal", + tiles = { + "pipeworks_trashcan_bottom.png", + "pipeworks_trashcan_bottom.png", + "pipeworks_trashcan_side.png", + "pipeworks_trashcan_side.png", + "pipeworks_trashcan_side.png", + "pipeworks_trashcan_side.png", + }, + groups = {snappy = 3, tubedevice = 1, tubedevice_receiver = 1}, + tube = { + insert_object = function(pos, node, stack, direction) + return ItemStack("") + end, + connect_sides = {left = 1, right = 1, front = 1, back = 1, top = 1, bottom = 1}, + priority = 1, -- Lower than anything else + }, + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("formspec", + "size[8,7]".. + "item_image[0,0;1,1;pipeworks:trashcan]".. + "label[1,0;Trash Can]".. + "list[current_name;trash;3.5,1;1,1;]".. + "list[current_player;main;0,3;8,4;]") + meta:set_string("infotext", "Trash Can") + meta:get_inventory():set_size("trash", 1) + end, + after_place_node = function(pos) + pipeworks.scan_for_tube_objects(pos) + end, + after_dig_node = function(pos) + pipeworks.scan_for_tube_objects(pos) + end, + on_metadata_inventory_put = function(pos, listname, index, stack, player) + minetest.get_meta(pos):get_inventory():set_stack(listname, index, ItemStack("")) + end, +}) + +minetest.register_craft({ + output = "pipeworks:trashcan", + recipe = { + { "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" }, + { "default:steel_ingot", "", "default:steel_ingot" }, + { "default:steel_ingot", "default:steel_ingot", "default:steel_ingot" }, + }, +}) diff --git a/mods/pipeworks/tubes.lua b/mods/pipeworks/tubes.lua index 5e6ca4f..2822a10 100644 --- a/mods/pipeworks/tubes.lua +++ b/mods/pipeworks/tubes.lua @@ -20,7 +20,7 @@ local register_one_tube = function(name, tname, dropname, desc, plain, noctrs, e end for _, v in ipairs(connects) do - pipeworks.add_node_box(outboxes, pipeworks.tube_boxes[v]) + table.extend(outboxes, pipeworks.tube_boxes[v]) table.insert(outsel, pipeworks.tube_selectboxes[v]) outimgs[vti[v]] = noctrs[v] end @@ -31,13 +31,13 @@ local register_one_tube = function(name, tname, dropname, desc, plain, noctrs, e outimgs[vti[v]] = ends[v] end - local tgroups = {snappy = 3, tube = 1, not_in_creative_inventory = 1} + local tgroups = {snappy = 3, tube = 1, tubedevice = 1, not_in_creative_inventory = 1} local tubedesc = desc.." "..dump(connects).."... You hacker, you." local iimg = plain[1] local wscale = {x = 1, y = 1, z = 1} if #connects == 0 then - tgroups = {snappy = 3, tube = 1} + tgroups = {snappy = 3, tube = 1, tubedevice = 1} tubedesc = desc iimg=inv outimgs = { @@ -50,7 +50,8 @@ local register_one_tube = function(name, tname, dropname, desc, plain, noctrs, e wscale = {x = 1, y = 1, z = 0.01} end - table.insert(pipeworks.tubenodes, name.."_"..tname) + local rname = name.."_"..tname + table.insert(pipeworks.tubenodes, rname) local nodedef = { description = tubedesc, @@ -62,7 +63,7 @@ local register_one_tube = function(name, tname, dropname, desc, plain, noctrs, e wield_scale = wscale, paramtype = "light", selection_box = { - type = "fixed", + type = "fixed", fixed = outsel }, node_box = { @@ -77,26 +78,22 @@ local register_one_tube = function(name, tname, dropname, desc, plain, noctrs, e style = style, drop = name.."_"..dropname, tubelike = 1, - tube = {connect_sides = {front = 1, back = 1, left = 1, right = 1, top = 1, bottom = 1}}, - on_construct = function(pos) - local meta = minetest.get_meta(pos) - meta:set_int("tubelike", 1) - if minetest.registered_nodes[name.."_"..tname].on_construct_ then - minetest.registered_nodes[name.."_"..tname].on_construct_(pos) - end - end, - after_place_node = function(pos) + tube = { + connect_sides = {front = 1, back = 1, left = 1, right = 1, top = 1, bottom = 1}, + priority = 50 + }, + --[[after_place_node = function(pos) pipeworks.scan_for_tube_objects(pos) - if minetest.registered_nodes[name.."_"..tname].after_place_node_ then - minetest.registered_nodes[name.."_"..tname].after_place_node_(pos) + if minetest.registered_nodes[rname].after_place_node_ then + minetest.registered_nodes[rname].after_place_node_(pos) end end, after_dig_node = function(pos) pipeworks.scan_for_tube_objects(pos) - if minetest.registered_nodes[name.."_"..tname].after_dig_node_ then - minetest.registered_nodes[name.."_"..tname].after_dig_node_(pos) + if minetest.registered_nodes[rname].after_dig_node_ then + minetest.registered_nodes[rname].after_dig_node_(pos) end - end + end]] } if style == "6d" then nodedef.paramtype2 = "facedir" @@ -105,9 +102,9 @@ local register_one_tube = function(name, tname, dropname, desc, plain, noctrs, e if special == nil then special = {} end for key, value in pairs(special) do - if key == "on_construct" or key == "after_dig_node" or key == "after_place_node" then - nodedef[key.."_"] = value - elseif key == "groups" then + --if key == "after_dig_node" or key == "after_place_node" then + -- nodedef[key.."_"] = value + if key == "groups" then for group, val in pairs(value) do nodedef.groups[group] = val end @@ -115,19 +112,12 @@ local register_one_tube = function(name, tname, dropname, desc, plain, noctrs, e for key, val in pairs(value) do nodedef.tube[key] = val end - elseif type(value) == "table" then - nodedef[key] = pipeworks.replace_name(value, "#id", tname) - elseif type(value) == "string" then - nodedef[key] = string.gsub(value, "#id", tname) else - nodedef[key] = value + nodedef[key] = table.recursive_replace(value, "#id", tname) end end - local prefix = ":" - if string.find(name, "pipeworks:") then prefix = "" end - - minetest.register_node(prefix..name.."_"..tname, nodedef) + minetest.register_node(rname, nodedef) end pipeworks.register_tube = function(name, desc, plain, noctrs, ends, short, inv, special, old_registration) @@ -182,21 +172,17 @@ pipeworks.register_tube = function(name, desc, plain, noctrs, ends, short, inv, paramtype = "light", sunlight_propagates = true, description = "Pneumatic tube segment (legacy)", - on_construct = function(pos) - local meta = minetest.get_meta(pos) - meta:set_int("tubelike", 1) - end, - after_place_node = function(pos) + --[[after_place_node = function(pos) pipeworks.scan_for_tube_objects(pos) if minetest.registered_nodes[name.."_1"].after_place_node_ then minetest.registered_nodes[name.."_1"].after_place_node_(pos) end - end, - groups = {not_in_creative_inventory = 1, tube_to_update = 1}, + end,]] + groups = {not_in_creative_inventory = 1, tube_to_update = 1, tube = 1}, tube = {connect_sides = {front = 1, back = 1, left = 1, right = 1, top = 1, bottom = 1}}, drop = name.."_1", }) - table.insert(pipeworks.tubenodes,cname) + table.insert(pipeworks.tubenodes, cname) for xm = 0, 1 do for xp = 0, 1 do for ym = 0, 1 do @@ -221,8 +207,8 @@ if REGISTER_COMPATIBILITY then interval = 1, chance = 1, action = function(pos, node, active_object_count, active_object_count_wider) - local minp = {x = pos.x-1, y = pos.y-1, z = pos.z-1} - local maxp = {x = pos.x+1, y = pos.y+1, z = pos.z+1} + local minp = vector.subtract(pos, 1) + local maxp = vector.add(pos, 1) if table.getn(minetest.find_nodes_in_area(minp, maxp, "ignore")) == 0 then pipeworks.scan_for_tube_objects(pos) end @@ -252,7 +238,40 @@ if pipeworks.enable_mese_tube then "pipeworks_mese_tube_end.png", "pipeworks_mese_tube_end.png", "pipeworks_mese_tube_end.png"} local mese_short_texture = "pipeworks_mese_tube_short.png" local mese_inv_texture = "pipeworks_mese_tube_inv.png" - pipeworks.register_tube("pipeworks:mese_tube", "Mese pneumatic tube segment", mese_plain_textures, mese_noctr_textures, + local function update_formspec(pos) + local meta = minetest.get_meta(pos) + local old_formspec = meta:get_string("formspec") + if string.find(old_formspec, "button1") then -- Old version + local inv = meta:get_inventory() + for i = 1, 6 do + for _, stack in ipairs(inv:get_list("line"..i)) do + minetest.item_drop(stack, "", pos) + end + end + end + meta:set_string("formspec", + "size[8,11]".. + "list[current_name;line1;1,0;6,1;]".. + "list[current_name;line2;1,1;6,1;]".. + "list[current_name;line3;1,2;6,1;]".. + "list[current_name;line4;1,3;6,1;]".. + "list[current_name;line5;1,4;6,1;]".. + "list[current_name;line6;1,5;6,1;]".. + "image[0,0;1,1;pipeworks_white.png]".. + "image[0,1;1,1;pipeworks_black.png]".. + "image[0,2;1,1;pipeworks_green.png]".. + "image[0,3;1,1;pipeworks_yellow.png]".. + "image[0,4;1,1;pipeworks_blue.png]".. + "image[0,5;1,1;pipeworks_red.png]".. + fs_helpers.cycling_button(meta, "button[7,0;1,1", "l1s", {"Off", "On"}).. + fs_helpers.cycling_button(meta, "button[7,1;1,1", "l2s", {"Off", "On"}).. + fs_helpers.cycling_button(meta, "button[7,2;1,1", "l3s", {"Off", "On"}).. + fs_helpers.cycling_button(meta, "button[7,3;1,1", "l4s", {"Off", "On"}).. + fs_helpers.cycling_button(meta, "button[7,4;1,1", "l5s", {"Off", "On"}).. + fs_helpers.cycling_button(meta, "button[7,5;1,1", "l6s", {"Off", "On"}).. + "list[current_player;main;0,7;8,4;]") + end + pipeworks.register_tube("pipeworks:mese_tube", "Sorting Pneumatic Tube Segment", mese_plain_textures, mese_noctr_textures, mese_end_textures, mese_short_texture, mese_inv_texture, {tube = {can_go = function(pos, node, velocity, stack) local tbl = {} @@ -266,6 +285,7 @@ if pipeworks.enable_mese_tube then if st:get_name() == name then found = true table.insert(tbl, vect) + break end end end @@ -288,68 +308,40 @@ if pipeworks.enable_mese_tube then meta:set_int("l"..tostring(i).."s", 1) inv:set_size("line"..tostring(i), 6*1) end - meta:set_string("formspec", - "size[8,11]".. - "list[current_name;line1;1,0;6,1;]".. - "list[current_name;line2;1,1;6,1;]".. - "list[current_name;line3;1,2;6,1;]".. - "list[current_name;line4;1,3;6,1;]".. - "list[current_name;line5;1,4;6,1;]".. - "list[current_name;line6;1,5;6,1;]".. - "image[0,0;1,1;pipeworks_white.png]".. - "image[0,1;1,1;pipeworks_black.png]".. - "image[0,2;1,1;pipeworks_green.png]".. - "image[0,3;1,1;pipeworks_yellow.png]".. - "image[0,4;1,1;pipeworks_blue.png]".. - "image[0,5;1,1;pipeworks_red.png]".. - "button[7,0;1,1;button1;On]".. - "button[7,1;1,1;button2;On]".. - "button[7,2;1,1;button3;On]".. - "button[7,3;1,1;button4;On]".. - "button[7,4;1,1;button5;On]".. - "button[7,5;1,1;button6;On]".. - "list[current_player;main;0,7;8,4;]") + update_formspec(pos) meta:set_string("infotext", "Mese pneumatic tube") end, + on_punch = update_formspec, on_receive_fields = function(pos, formname, fields, sender) - local meta = minetest.get_meta(pos) - local i - if fields.quit then return end - for key, _ in pairs(fields) do i = key end - if i == nil then return end - i = string.sub(i,-1) - newstate = 1 - meta:get_int("l"..i.."s") - meta:set_int("l"..i.."s",newstate) - local frm = "size[8,11]".. - "list[current_name;line1;1,0;6,1;]".. - "list[current_name;line2;1,1;6,1;]".. - "list[current_name;line3;1,2;6,1;]".. - "list[current_name;line4;1,3;6,1;]".. - "list[current_name;line5;1,4;6,1;]".. - "list[current_name;line6;1,5;6,1;]".. - "image[0,0;1,1;pipeworks_white.png]".. - "image[0,1;1,1;pipeworks_black.png]".. - "image[0,2;1,1;pipeworks_green.png]".. - "image[0,3;1,1;pipeworks_yellow.png]".. - "image[0,4;1,1;pipeworks_blue.png]".. - "image[0,5;1,1;pipeworks_red.png]" - for i = 1, 6 do - local st = meta:get_int("l"..tostring(i).."s") - if st == 0 then - frm = frm.."button[7,"..tostring(i-1)..";1,1;button"..tostring(i)..";Off]" - else - frm = frm.."button[7,"..tostring(i-1)..";1,1;button"..tostring(i)..";On]" - end - end - frm = frm.."list[current_player;main;0,7;8,4;]" - meta:set_string("formspec", frm) + fs_helpers.on_receive_fields(pos, fields) + update_formspec(pos) end, can_dig = function(pos, player) local meta = minetest.get_meta(pos) local inv = meta:get_inventory() return (inv:is_empty("line1") and inv:is_empty("line2") and inv:is_empty("line3") and inv:is_empty("line4") and inv:is_empty("line5") and inv:is_empty("line6")) - end + end, + allow_metadata_inventory_put = function(pos, listname, index, stack, player) + update_formspec(pos) -- For old tubes + local inv = minetest.get_meta(pos):get_inventory() + local stack_copy = ItemStack(stack) + stack_copy:set_count(1) + inv:set_stack(listname, index, stack_copy) + return 0 + end, + allow_metadata_inventory_take = function(pos, listname, index, stack, player) + update_formspec(pos) -- For old tubes + local inv = minetest.get_meta(pos):get_inventory() + inv:set_stack(listname, index, ItemStack("")) + return 0 + end, + allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) + update_formspec(pos) -- For old tubes + local inv = minetest.get_meta(pos):get_inventory() + inv:set_stack(from_list, from_index, ItemStack("")) + return 0 + end, }, true) -- Must use old tubes, since the textures are rotated with 6d ones end @@ -357,14 +349,16 @@ if pipeworks.enable_detector_tube then local detector_plain_textures = {"pipeworks_detector_tube_plain.png", "pipeworks_detector_tube_plain.png", "pipeworks_detector_tube_plain.png", "pipeworks_detector_tube_plain.png", "pipeworks_detector_tube_plain.png", "pipeworks_detector_tube_plain.png"} local detector_inv_texture = "pipeworks_detector_tube_inv.png" - pipeworks.register_tube("pipeworks:detector_tube_on", "Detector tube segment on (you hacker you)", detector_plain_textures, noctr_textures, + local detector_tube_step = 2 * tonumber(minetest.setting_get("dedicated_server_step")) + pipeworks.register_tube("pipeworks:detector_tube_on", "Detecting Pneumatic Tube Segment on (you hacker you)", detector_plain_textures, noctr_textures, end_textures, short_texture, detector_inv_texture, {tube = {can_go = function(pos, node, velocity, stack) local meta = minetest.get_meta(pos) local name = minetest.get_node(pos).name local nitems = meta:get_int("nitems")+1 meta:set_int("nitems", nitems) - minetest.after(0.1, minetest.registered_nodes[name].item_exit, pos) + local saved_pos = vector.new(pos) + minetest.after(detector_tube_step, minetest.registered_nodes[name].item_exit, saved_pos) return pipeworks.notvel(pipeworks.meseadjlist,velocity) end}, groups = {mesecon = 2, not_in_creative_inventory = 1}, @@ -388,9 +382,12 @@ if pipeworks.enable_detector_tube then local meta = minetest.get_meta(pos) meta:set_int("nitems", 1) local name = minetest.get_node(pos).name - minetest.after(0.1, minetest.registered_nodes[name].item_exit,pos) - end}) - pipeworks.register_tube("pipeworks:detector_tube_off", "Detector tube segment", detector_plain_textures, noctr_textures, + local saved_pos = vector.new(pos) + minetest.after(detector_tube_step, minetest.registered_nodes[name].item_exit, saved_pos) + + end + }) + pipeworks.register_tube("pipeworks:detector_tube_off", "Detecting Pneumatic Tube Segment", detector_plain_textures, noctr_textures, end_textures, short_texture, detector_inv_texture, {tube = {can_go = function(pos, node, velocity, stack) local node = minetest.get_node(pos) @@ -423,7 +420,7 @@ if pipeworks.enable_conductor_tube then local conductor_on_end_textures = {"pipeworks_conductor_tube_on_end.png", "pipeworks_conductor_tube_on_end.png", "pipeworks_conductor_tube_on_end.png", "pipeworks_conductor_tube_on_end.png", "pipeworks_conductor_tube_on_end.png", "pipeworks_conductor_tube_on_end.png"} - pipeworks.register_tube("pipeworks:conductor_tube_off", "Conductor tube segment", conductor_plain_textures, conductor_noctr_textures, + pipeworks.register_tube("pipeworks:conductor_tube_off", "Conducting Pneumatic Tube Segment", conductor_plain_textures, conductor_noctr_textures, conductor_end_textures, conductor_short_texture, conductor_inv_texture, {groups = {mesecon = 2}, mesecons = {conductor = {state = "off", @@ -431,7 +428,7 @@ if pipeworks.enable_conductor_tube then onstate = "pipeworks:conductor_tube_on_#id"}} }) - pipeworks.register_tube("pipeworks:conductor_tube_on", "Conductor tube segment on (you hacker you)", conductor_on_plain_textures, conductor_on_noctr_textures, + pipeworks.register_tube("pipeworks:conductor_tube_on", "Conducting Pneumatic Tube Segment on (you hacker you)", conductor_on_plain_textures, conductor_on_noctr_textures, conductor_on_end_textures, conductor_short_texture, conductor_inv_texture, {groups = {mesecon = 2, not_in_creative_inventory = 1}, drop = "pipeworks:conductor_tube_off_1", @@ -451,7 +448,7 @@ if pipeworks.enable_accelerator_tube then local accelerator_short_texture = "pipeworks_accelerator_tube_short.png" local accelerator_inv_texture = "pipeworks_accelerator_tube_inv.png" - pipeworks.register_tube("pipeworks:accelerator_tube", "Accelerator pneumatic tube segment", accelerator_plain_textures, + pipeworks.register_tube("pipeworks:accelerator_tube", "Accelerating Pneumatic Tube Segment", accelerator_plain_textures, accelerator_noctr_textures, accelerator_end_textures, accelerator_short_texture, accelerator_inv_texture, {tube = {can_go = function(pos, node, velocity, stack) velocity.speed = velocity.speed+1 @@ -461,7 +458,6 @@ if pipeworks.enable_accelerator_tube then end if pipeworks.enable_crossing_tube then - -- FIXME: The textures are not the correct ones local crossing_noctr_textures = {"pipeworks_crossing_tube_noctr.png", "pipeworks_crossing_tube_noctr.png", "pipeworks_crossing_tube_noctr.png", "pipeworks_crossing_tube_noctr.png", "pipeworks_crossing_tube_noctr.png", "pipeworks_crossing_tube_noctr.png"} local crossing_plain_textures = {"pipeworks_crossing_tube_plain.png" ,"pipeworks_crossing_tube_plain.png", "pipeworks_crossing_tube_plain.png", @@ -471,7 +467,7 @@ if pipeworks.enable_crossing_tube then local crossing_short_texture = "pipeworks_crossing_tube_short.png" local crossing_inv_texture = "pipeworks_crossing_tube_inv.png" - pipeworks.register_tube("pipeworks:crossing_tube", "Crossing tube segment", crossing_plain_textures, + pipeworks.register_tube("pipeworks:crossing_tube", "Crossing Pneumatic Tube Segment", crossing_plain_textures, crossing_noctr_textures, crossing_end_textures, crossing_short_texture, crossing_inv_texture, {tube = {can_go = function(pos, node, velocity, stack) return {velocity} @@ -489,7 +485,7 @@ if pipeworks.enable_sand_tube then local sand_short_texture = "pipeworks_sand_tube_short.png" local sand_inv_texture = "pipeworks_sand_tube_inv.png" - pipeworks.register_tube("pipeworks:sand_tube", "Sand pneumatic tube segment", sand_plain_textures, sand_noctr_textures, sand_end_textures, + pipeworks.register_tube("pipeworks:sand_tube", "Vacuuming Pneumatic Tube Segment", sand_plain_textures, sand_noctr_textures, sand_end_textures, sand_short_texture, sand_inv_texture, {groups = {sand_tube = 1}}) @@ -500,10 +496,7 @@ if pipeworks.enable_sand_tube then for _, object in ipairs(minetest.get_objects_inside_radius(pos, 2)) do if not object:is_player() and object:get_luaentity() and object:get_luaentity().name == "__builtin:item" then if object:get_luaentity().itemstring ~= "" then - local titem = pipeworks.tube_item(pos,object:get_luaentity().itemstring) - titem:get_luaentity().start_pos = {x = pos.x, y = pos.y-1, z = pos.z} - titem:setvelocity({x = 0.01, y = 1, z = -0.01}) - titem:setacceleration({x = 0, y = 0, z = 0}) + pipeworks.tube_inject_item(pos, pos, vector.new(0, 0, 0), object:get_luaentity().itemstring) end object:get_luaentity().itemstring = "" object:remove() @@ -523,7 +516,7 @@ if pipeworks.enable_mese_sand_tube then local mese_sand_short_texture = "pipeworks_mese_sand_tube_short.png" local mese_sand_inv_texture = "pipeworks_mese_sand_tube_inv.png" - pipeworks.register_tube("pipeworks:mese_sand_tube", "Mese sand pneumatic tube segment", mese_sand_plain_textures, mese_sand_noctr_textures, + pipeworks.register_tube("pipeworks:mese_sand_tube", "Adjustable Vacuuming Pneumatic Tube Segment", mese_sand_plain_textures, mese_sand_noctr_textures, mese_sand_end_textures, mese_sand_short_texture,mese_sand_inv_texture, {groups = {mese_sand_tube = 1}, on_construct = function(pos) @@ -532,7 +525,7 @@ if pipeworks.enable_mese_sand_tube then meta:set_string("formspec", "size[2,1]".. "field[.5,.5;1.5,1;dist;distance;${dist}]") - meta:set_string("infotext", "Mese sand pneumatic tube") + meta:set_string("infotext", "Adjustable Vacuuming Pneumatic Tube Segment") end, on_receive_fields = function(pos,formname,fields,sender) local meta = minetest.env:get_meta(pos) @@ -563,10 +556,7 @@ if pipeworks.enable_mese_sand_tube then for _,object in ipairs(get_objects_with_square_radius(pos, minetest.env:get_meta(pos):get_int("dist"))) do if not object:is_player() and object:get_luaentity() and object:get_luaentity().name == "__builtin:item" then if object:get_luaentity().itemstring ~= "" then - local titem = pipeworks.tube_item(pos, object:get_luaentity().itemstring) - titem:get_luaentity().start_pos = {x = pos.x, y = pos.y-1, z = pos.z} - titem:setvelocity({x = 0.01, y = 1, z = -0.01}) - titem:setacceleration({x = 0, y = 0, z = 0}) + pipeworks.tube_inject_item(pos, pos, vector.new(0, 0, 0), object:get_luaentity().itemstring) end object:get_luaentity().itemstring = "" object:remove() @@ -576,59 +566,29 @@ if pipeworks.enable_mese_sand_tube then }) end -local function facedir_to_right_dir(facedir) - - --find the other directions - local backdir = minetest.facedir_to_dir(facedir) - local topdir = ({[0] = {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(facedir/4)] - - --return a cross product - return {x = topdir.y*backdir.z - backdir.y*topdir.z, - y = topdir.z*backdir.x - backdir.z*topdir.x, - z = topdir.x*backdir.y - backdir.x*topdir.y} -end - if pipeworks.enable_one_way_tube then minetest.register_node("pipeworks:one_way_tube", { - description = "One way tube", - tiles = {"pipeworks_one_way_tube_top.png", "pipeworks_one_way_tube_top.png", "pipeworks_one_way_tube_output.png", - "pipeworks_one_way_tube_input.png", "pipeworks_one_way_tube_side.png", "pipeworks_one_way_tube_top.png"}, - paramtype2 = "facedir", - drawtype = "nodebox", - paramtype = "light", - node_box = {type = "fixed", - fixed = {{-1/2, -9/64, -9/64, 1/2, 9/64, 9/64}}}, - groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, tubedevice = 1, tubedevice_receiver = 1}, - legacy_facedir_simple = true, - sounds = default.node_sound_wood_defaults(), - after_place_node = function(pos) - pipeworks.scan_for_tube_objects(pos) - end, - after_dig_node = function(pos) - pipeworks.scan_for_tube_objects(pos) - end, - tube = {connect_sides = {left = 1, right = 1}, - can_go = function(pos, node, velocity, stack) - return velocity - end, - insert_object = function(pos, node, stack, direction) - item1 = pipeworks.tube_item(pos, stack) - item1:get_luaentity().start_pos = pos - item1:setvelocity({x = direction.x*direction.speed, y = direction.y*direction.speed, z = direction.z*direction.speed}) - item1:setacceleration({x = 0, y = 0, z = 0}) - return ItemStack("") - end, - can_insert = function(pos, node, stack, direction) - local dir = facedir_to_right_dir(node.param2) - if dir.x == direction.x and dir.y == direction.y and dir.z == direction.z then - return true - end - return false - end}, + description = "One way tube", + tiles = {"pipeworks_one_way_tube_top.png", "pipeworks_one_way_tube_top.png", "pipeworks_one_way_tube_output.png", + "pipeworks_one_way_tube_input.png", "pipeworks_one_way_tube_side.png", "pipeworks_one_way_tube_top.png"}, + paramtype2 = "facedir", + drawtype = "nodebox", + paramtype = "light", + node_box = {type = "fixed", + fixed = {{-1/2, -9/64, -9/64, 1/2, 9/64, 9/64}}}, + groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, tubedevice = 1}, + legacy_facedir_simple = true, + sounds = default.node_sound_wood_defaults(), + tube = { + connect_sides = {left = 1, right = 1}, + can_go = function(pos, node, velocity, stack) + return {velocity} + end, + can_insert = function(pos, node, stack, direction) + local dir = minetest.facedir_to_right_dir(node.param2) + return vector.equals(dir, direction) + end, + priority = 75 -- Higher than normal tubes, but lower than receivers + }, }) end diff --git a/mods/pipeworks/wielder.lua b/mods/pipeworks/wielder.lua new file mode 100644 index 0000000..3ce73f6 --- /dev/null +++ b/mods/pipeworks/wielder.lua @@ -0,0 +1,423 @@ +local assumed_eye_pos = vector.new(0, 1.5, 0) + +local function vector_copy(v) + return { x = v.x, y = v.y, z = v.z } +end + +local function delay(x) + return (function() return x end) +end + +local function set_wielder_formspec(data, meta) + meta:set_string("formspec", + "invsize[8,"..(6+data.wield_inv_height)..";]".. + "item_image[0,0;1,1;"..data.name_base.."_off]".. + "label[1,0;"..minetest.formspec_escape(data.description).."]".. + "list[current_name;"..minetest.formspec_escape(data.wield_inv_name)..";"..((8-data.wield_inv_width)*0.5)..",1;"..data.wield_inv_width..","..data.wield_inv_height..";]".. + "list[current_player;main;0,"..(2+data.wield_inv_height)..";8,4;]") + meta:set_string("infotext", data.description) +end + +local function wielder_on(data, wielder_pos, wielder_node) + data.fixup_node(wielder_pos, wielder_node) + if wielder_node.name ~= data.name_base.."_off" then return end + wielder_node.name = data.name_base.."_on" + minetest.swap_node(wielder_pos, wielder_node) + nodeupdate(wielder_pos) + local wielder_meta = minetest.get_meta(wielder_pos) + local inv = wielder_meta:get_inventory() + local wield_inv_name = data.wield_inv_name + local wieldindex, wieldstack + for i, stack in ipairs(inv:get_list(wield_inv_name)) do + if not stack:is_empty() then + wieldindex = i + wieldstack = stack + break + end + end + if not wieldindex then + if not data.ghost_inv_name then return end + wield_inv_name = data.ghost_inv_name + inv:set_stack(wield_inv_name, 1, ItemStack(data.ghost_tool)) + wieldindex = 1 + wieldstack = inv:get_stack(wield_inv_name, 1) + end + local dir = minetest.facedir_to_dir(wielder_node.param2) + local under_pos = vector.subtract(wielder_pos, dir) + local above_pos = vector.subtract(under_pos, dir) + local pitch + local yaw + if dir.z < 0 then + yaw = 0 + pitch = 0 + elseif dir.z > 0 then + yaw = math.pi + pitch = 0 + elseif dir.x < 0 then + yaw = 3*math.pi/2 + pitch = 0 + elseif dir.x > 0 then + yaw = math.pi/2 + pitch = 0 + elseif dir.y > 0 then + yaw = 0 + pitch = -math.pi/2 + else + yaw = 0 + pitch = math.pi/2 + end + local virtplayer = { + get_inventory_formspec = delay(wielder_meta:get_string("formspec")), + get_look_dir = delay(vector.multiply(dir, -1)), + get_look_pitch = delay(pitch), + get_look_yaw = delay(yaw), + get_player_control = delay({ jump=false, right=false, left=false, LMB=false, RMB=false, sneak=data.sneak, aux1=false, down=false, up=false }), + get_player_control_bits = delay(data.sneak and 64 or 0), + get_player_name = delay(data.masquerade_as_owner and wielder_meta:get_string("owner") or ":pipeworks:"..minetest.pos_to_string(wielder_pos)), + is_player = delay(true), + is_fake_player = true, + set_inventory_formspec = delay(), + getpos = delay(vector.subtract(wielder_pos, assumed_eye_pos)), + get_hp = delay(20), + get_inventory = delay(inv), + get_wielded_item = delay(wieldstack), + get_wield_index = delay(wieldindex), + get_wield_list = delay(wield_inv_name), + moveto = delay(), + punch = delay(), + remove = delay(), + right_click = delay(), + setpos = delay(), + set_hp = delay(), + set_properties = delay(), + set_wielded_item = function(self, item) inv:set_stack(wield_inv_name, wieldindex, item) end, + set_animation = delay(), + set_attach = delay(), + set_detach = delay(), + set_bone_position = delay(), + } + local pointed_thing = { type="node", under=under_pos, above=above_pos } + data.act(virtplayer, pointed_thing) + if data.eject_drops then + for i, stack in ipairs(inv:get_list("main")) do + if not stack:is_empty() then + pipeworks.tube_inject_item(wielder_pos, wielder_pos, dir, stack) + inv:set_stack("main", i, ItemStack("")) + end + end + end +end + +local function wielder_off(data, pos, node) + if node.name == data.name_base.."_on" then + node.name = data.name_base.."_off" + minetest.swap_node(pos, node) + nodeupdate(pos) + end +end + +local function register_wielder(data) + data.fixup_node = data.fixup_node or function (pos, node) end + data.fixup_oldmetadata = data.fixup_oldmetadata or function (m) return m end + for _, state in ipairs({ "off", "on" }) do + local groups = { snappy=2, choppy=2, oddly_breakable_by_hand=2, mesecon=2, tubedevice=1, tubedevice_receiver=1 } + if state == "on" then groups.not_in_creative_inventory = 1 end + local tile_images = {} + for _, face in ipairs({ "top", "bottom", "side2", "side1", "back", "front" }) do + table.insert(tile_images, data.texture_base.."_"..face..(data.texture_stateful[face] and "_"..state or "")..".png") + end + minetest.register_node(data.name_base.."_"..state, { + description = data.description, + tile_images = tile_images, + mesecons = { + effector = { + rules = pipeworks.rules_all, + action_on = function (pos, node) + wielder_on(data, pos, node) + end, + action_off = function (pos, node) + wielder_off(data, pos, node) + end, + }, + }, + tube = { + can_insert = function(pos, node, stack, tubedir) + if not data.tube_permit_anteroposterior_insert then + local nodedir = minetest.facedir_to_dir(node.param2) + if vector.equals(tubedir, nodedir) or vector.equals(tubedir, vector.multiply(nodedir, -1)) then + return false + end + end + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + return inv:room_for_item(data.wield_inv_name, stack) + end, + insert_object = function(pos, node, stack, tubedir) + if not data.tube_permit_anteroposterior_insert then + local nodedir = minetest.facedir_to_dir(node.param2) + if vector.equals(tubedir, nodedir) or vector.equals(tubedir, vector.multiply(nodedir, -1)) then + return stack + end + end + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + return inv:add_item(data.wield_inv_name, stack) + end, + input_inventory = data.wield_inv_name, + connect_sides = data.tube_connect_sides, + can_remove = function(pos, node, stack, tubedir) + return stack:get_count() + end, + }, + is_ground_content = true, + paramtype2 = "facedir", + tubelike = 1, + groups = groups, + sounds = default.node_sound_stone_defaults(), + drop = data.name_base.."_off", + on_construct = function(pos) + local meta = minetest.get_meta(pos) + set_wielder_formspec(data, meta) + local inv = meta:get_inventory() + inv:set_size(data.wield_inv_name, data.wield_inv_width*data.wield_inv_height) + if data.ghost_inv_name then + inv:set_size(data.ghost_inv_name, 1) + end + if data.eject_drops then + inv:set_size("main", 100) + end + end, + after_place_node = function (pos, placer) + pipeworks.scan_for_tube_objects(pos) + local placer_pos = placer:getpos() + if placer_pos and placer:is_player() then placer_pos = vector.add(placer_pos, assumed_eye_pos) end + if placer_pos then + local dir = vector.subtract(pos, placer_pos) + local node = minetest.get_node(pos) + node.param2 = minetest.dir_to_facedir(dir, true) + minetest.set_node(pos, node) + minetest.log("action", "real (6d) facedir: " .. node.param2) + end + minetest.get_meta(pos):set_string("owner", placer:get_player_name()) + end, + can_dig = (data.can_dig_nonempty_wield_inv and delay(true) or function(pos, player) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + return inv:is_empty(data.wield_inv_name) + end), + after_dig_node = function(pos, oldnode, oldmetadata, digger) + -- The legacy-node fixup is done here in a + -- different form from the standard fixup, + -- rather than relying on a standard fixup + -- in an on_dig callback, because some + -- non-standard diggers (such as technic's + -- mining drill) don't respect on_dig. + oldmetadata = data.fixup_oldmetadata(oldmetadata) + for _, stack in ipairs(oldmetadata.inventory[data.wield_inv_name] or {}) do + if not stack:is_empty() then + minetest.add_item(pos, stack) + end + end + pipeworks.scan_for_tube_objects(pos) + end, + on_punch = data.fixup_node, + allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) + local meta = minetest.get_meta(pos) + if player:get_player_name() ~= meta:get_string("owner") and meta:get_string("owner") ~= "" then + return 0 + end + return count + end, + allow_metadata_inventory_put = function(pos, listname, index, stack, player) + local meta = minetest.get_meta(pos) + if player:get_player_name() ~= meta:get_string("owner") and meta:get_string("owner") ~= "" then + return 0 + end + return stack:get_count() + end, + allow_metadata_inventory_take = function(pos, listname, index, stack, player) + local meta = minetest.get_meta(pos) + if player:get_player_name() ~= meta:get_string("owner") and meta:get_string("owner") ~= "" then + return 0 + end + return stack:get_count() + end, + }) + end +end + +if pipeworks.enable_node_breaker then + local data + data = { + name_base = "pipeworks:nodebreaker", + description = "Node Breaker", + texture_base = "pipeworks_nodebreaker", + texture_stateful = { top = true, bottom = true, side2 = true, side1 = true, front = true }, + tube_connect_sides = { top=1, bottom=1, left=1, right=1, back=1 }, + tube_permit_anteroposterior_insert = false, + wield_inv_name = "pick", + wield_inv_width = 1, + wield_inv_height = 1, + can_dig_nonempty_wield_inv = true, + ghost_inv_name = "ghost_pick", + ghost_tool = "default:pick_mese", + fixup_node = function (pos, node) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + -- Node breakers predating the visible pick slot + -- may have been partially updated. This code + -- fully updates them. Some have been observed + -- to have no pick slot at all; first add one. + if inv:get_size("pick") ~= 1 then + inv:set_size("pick", 1) + end + -- Originally, they had a ghost pick in a "pick" + -- inventory, no other inventory, and no form. + -- The partial update of early with-form node + -- breaker code gives them "ghost_pick" and "main" + -- inventories, but leaves the old ghost pick in + -- the "pick" inventory, and doesn't add a form. + -- First perform that partial update. + if inv:get_size("ghost_pick") ~= 1 then + inv:set_size("ghost_pick", 1) + inv:set_size("main", 100) + end + -- If the node breaker predates the visible pick + -- slot, which we can detect by it not having a + -- form, then the pick slot needs to be cleared + -- of the old ghost pick. + if (meta:get_string("formspec") or "") == "" then + inv:set_stack("pick", 1, ItemStack("")) + end + -- Finally, unconditionally set the formspec + -- and infotext. This not only makes the + -- pick slot visible for node breakers where + -- it wasn't before; it also updates the form + -- for node breakers that had an older version + -- of the form, and sets infotext where it was + -- missing for early with-form node breakers. + set_wielder_formspec(data, meta) + end, + fixup_oldmetadata = function (oldmetadata) + -- Node breakers predating the visible pick slot, + -- with node form, kept their ghost pick in an + -- inventory named "pick", the same name as the + -- later visible pick slot. The pick must be + -- removed to avoid spilling it. + if not oldmetadata.fields.formspec then + return { inventory = { pick = {} }, fields = oldmetadata.fields } + else + return oldmetadata + end + end, + masquerade_as_owner = true, + sneak = false, + act = function(virtplayer, pointed_thing) + local wieldstack = virtplayer:get_wielded_item() + local oldwieldstack = ItemStack(wieldstack) + local on_use = (minetest.registered_items[wieldstack:get_name()] or {}).on_use + if on_use then + virtplayer:set_wielded_item(on_use(wieldstack, virtplayer, pointed_thing) or wieldstack) + else + local under_node = minetest.get_node(pointed_thing.under) + local on_dig = (minetest.registered_nodes[under_node.name] or {on_dig=minetest.node_dig}).on_dig + on_dig(pointed_thing.under, under_node, virtplayer) + end + wieldstack = virtplayer:get_wielded_item() + local wieldname = wieldstack:get_name() + if wieldname == oldwieldstack:get_name() then + -- don't mechanically wear out tool + if wieldstack:get_count() == oldwieldstack:get_count() and + wieldstack:get_metadata() == oldwieldstack:get_metadata() and + ((minetest.registered_items[wieldstack:get_name()] or {}).wear_represents or "mechanical_wear") == "mechanical_wear" then + virtplayer:set_wielded_item(oldwieldstack) + end + elseif wieldname ~= "" then + -- tool got replaced by something else: + -- treat it as a drop + virtplayer:get_inventory():add_item("main", wieldstack) + virtplayer:set_wielded_item(ItemStack("")) + end + end, + eject_drops = true, + } + register_wielder(data) + minetest.register_craft({ + output = "pipeworks:nodebreaker_off", + recipe = { + { "group:wood", "default:pick_mese", "group:wood" }, + { "default:stone", "mesecons:piston", "default:stone" }, + { "default:stone", "mesecons:mesecon", "default:stone" }, + } + }) + -- aliases for when someone had technic installed, but then uninstalled it but not pipeworks + minetest.register_alias("technic:nodebreaker_off", "pipeworks:nodebreaker_off") + minetest.register_alias("technic:nodebreaker_on", "pipeworks:nodebreaker_on") + minetest.register_alias("technic:node_breaker_off", "pipeworks:nodebreaker_off") + minetest.register_alias("technic:node_breaker_on", "pipeworks:nodebreaker_on") + -- turn legacy auto-tree-taps into node breakers + dofile(pipeworks.modpath.."/legacy.lua") +end + +if pipeworks.enable_deployer then + register_wielder({ + name_base = "pipeworks:deployer", + description = "Deployer", + texture_base = "pipeworks_deployer", + texture_stateful = { front = true }, + tube_connect_sides = { back=1 }, + tube_permit_anteroposterior_insert = true, + wield_inv_name = "main", + wield_inv_width = 3, + wield_inv_height = 3, + can_dig_nonempty_wield_inv = false, + masquerade_as_owner = true, + sneak = false, + act = function(virtplayer, pointed_thing) + local wieldstack = virtplayer:get_wielded_item() + virtplayer:set_wielded_item((minetest.registered_items[wieldstack:get_name()] or {on_place=minetest.item_place}).on_place(wieldstack, virtplayer, pointed_thing) or wieldstack) + end, + eject_drops = false, + }) + minetest.register_craft({ + output = "pipeworks:deployer_off", + recipe = { + { "group:wood", "default:chest", "group:wood" }, + { "default:stone", "mesecons:piston", "default:stone" }, + { "default:stone", "mesecons:mesecon", "default:stone" }, + } + }) + -- aliases for when someone had technic installed, but then uninstalled it but not pipeworks + minetest.register_alias("technic:deployer_off", "pipeworks:deployer_off") + minetest.register_alias("technic:deployer_on", "pipeworks:deployer_on") +end + +if pipeworks.enable_dispenser then + register_wielder({ + name_base = "pipeworks:dispenser", + description = "Dispenser", + texture_base = "pipeworks_dispenser", + texture_stateful = { front = true }, + tube_connect_sides = { back=1 }, + tube_permit_anteroposterior_insert = true, + wield_inv_name = "main", + wield_inv_width = 3, + wield_inv_height = 3, + can_dig_nonempty_wield_inv = false, + masquerade_as_owner = false, + sneak = true, + act = function(virtplayer, pointed_thing) + local wieldstack = virtplayer:get_wielded_item() + virtplayer:set_wielded_item((minetest.registered_items[wieldstack:get_name()] or {on_drop=minetest.item_drop}).on_drop(wieldstack, virtplayer, virtplayer:getpos()) or wieldstack) + end, + eject_drops = false, + }) + minetest.register_craft({ + output = "pipeworks:dispenser_off", + recipe = { + { "default:desert_sand", "default:chest", "default:desert_sand" }, + { "default:stone", "mesecons:piston", "default:stone" }, + { "default:stone", "mesecons:mesecon", "default:stone" }, + } + }) +end diff --git a/mods/plants_lib/depends.txt b/mods/plants_lib/depends.txt index ceb8b91..4ad96d5 100644 --- a/mods/plants_lib/depends.txt +++ b/mods/plants_lib/depends.txt @@ -1,2 +1 @@ default -skylands \ No newline at end of file diff --git a/mods/plants_lib/init.lua b/mods/plants_lib/init.lua index 232f633..a32e42f 100644 --- a/mods/plants_lib/init.lua +++ b/mods/plants_lib/init.lua @@ -1,5 +1,4 @@ -- Plantlife library mod by Vanessa Ezekowitz --- last revision, 2014-05-15 -- -- License: WTFPL -- @@ -14,6 +13,8 @@ plantslib = {} plantslib.modpath = minetest.get_modpath("plants_lib") plantslib.intllib_modpath = minetest.get_modpath("intllib") +plantslib.total_legacy_calls = 0 + local S if plantslib.intllib_modpath then dofile(plantslib.intllib_modpath.."/intllib.lua") @@ -69,15 +70,6 @@ function plantslib:is_node_loaded(node_pos) return true end -function plantslib:clone_node(name) - node2={} - node=minetest.registered_nodes[name] - for k,v in pairs(node) do - node2[k]=v - end - return node2 -end - function plantslib:set_defaults(biome) biome.seed_diff = biome.seed_diff or 0 biome.min_elevation = biome.min_elevation or -31000 @@ -108,96 +100,180 @@ end -- Spawn plants using the map generator -function plantslib:register_generate_plant(biomedef, node_or_function_or_model) - minetest.register_on_generated(plantslib:search_for_surfaces(minp, maxp, biomedef, node_or_function_or_model)) +plantslib.surfaces_list = {} +plantslib.actions_list = {} +plantslib.surface_nodes = {} + +local function search_table(t, s) + for i = 1, #t do + if t[i] == s then return true end + end + return false end -function plantslib:search_for_surfaces(minp, maxp, biomedef, node_or_function_or_model) - return function(minp, maxp, blockseed) - local biome = biomedef - plantslib:set_defaults(biome) +-- register the list of surfaces to spawn stuff on, filtering out all duplicates. - local searchnodes = minetest.find_nodes_in_area(minp, maxp, biome.surface) - local in_biome_nodes = {} - for _ , pos in ipairs(searchnodes) do - local p_top = { x = pos.x, y = pos.y + 1, z = pos.z } - local perlin1 = minetest.get_perlin(biome.seed_diff, perlin_octaves, perlin_persistence, perlin_scale) - local noise1 = perlin1:get2d({x=p_top.x, y=p_top.z}) - local noise2 = plantslib.perlin_temperature:get2d({x=p_top.x, y=p_top.z}) - local noise3 = plantslib.perlin_humidity:get2d({x=p_top.x+150, y=p_top.z+50}) - if (not biome.depth or minetest.get_node({ x = pos.x, y = pos.y-biome.depth-1, z = pos.z }).name ~= biome.surface) - and (not biome.check_air or (biome.check_air and minetest.get_node(p_top).name == "air")) - and pos.y >= biome.min_elevation - and pos.y <= biome.max_elevation - and noise1 > biome.plantlife_limit - and noise2 <= biome.temp_min - and noise2 >= biome.temp_max - and noise3 <= biome.humidity_min - and noise3 >= biome.humidity_max - and (not biome.ncount or #(minetest.find_nodes_in_area({x=pos.x-1, y=pos.y, z=pos.z-1}, {x=pos.x+1, y=pos.y, z=pos.z+1}, biome.neighbors)) > biome.ncount) - and (not biome.near_nodes or #(minetest.find_nodes_in_area({x=pos.x-biome.near_nodes_size, y=pos.y-biome.near_nodes_vertical, z=pos.z-biome.near_nodes_size}, {x=pos.x+biome.near_nodes_size, y=pos.y+biome.near_nodes_vertical, z=pos.z+biome.near_nodes_size}, biome.near_nodes)) >= biome.near_nodes_count) - and math.random(1,100) > biome.rarity - and (not biome.below_nodes or string.find(dump(biome.below_nodes), minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name) ) - then - table.insert(in_biome_nodes, pos) +function plantslib:register_generate_plant(biomedef, node_or_function_or_model) + + -- if calling code passes an undefined node, don't register an action for it. + if type(node_or_function_or_model) == "string" + and string.find(node_or_function_or_model, ":") + and not minetest.registered_nodes[node_or_function_or_model] then + plantslib:dbg("Warning: Ignored registration for undefined spawn node: "..dump(node_or_function_or_model)) + return + end + + if type(node_or_function_or_model) == "string" + and not string.find(node_or_function_or_model, ":") then + plantslib:dbg("Warning: Registered function call using deprecated string method: "..dump(node_or_function_or_model)) + end + + if biomedef.check_air == false then + plantslib:dbg("Warning: Registered legacy mapgen hook: "..dump(node_or_function_or_model)) + minetest.register_on_generated(plantslib:generate_block_legacy(minp, maxp, biomedef, node_or_function_or_model)) + plantslib.total_legacy_calls = plantslib.total_legacy_calls + 1 + else + plantslib.actions_list[#plantslib.actions_list + 1] = { biomedef, node_or_function_or_model } + local s = biomedef.surface + if type(s) == "string" then + if s and minetest.registered_nodes[s] then + if not search_table(plantslib.surfaces_list, s) then + plantslib.surfaces_list[#plantslib.surfaces_list + 1] = s + end + else + plantslib:dbg("Warning: Ignored registration for undefined surface node: "..dump(s)) + end + else + for i = 1, #biomedef.surface do + local s = biomedef.surface[i] + if s and minetest.registered_nodes[s] then + if not search_table(plantslib.surfaces_list, s) then + plantslib.surfaces_list[#plantslib.surfaces_list + 1] = s + end + else + plantslib:dbg("Warning: Ignored registration for undefined surface node: "..dump(s)) + end + end + end + end +end + +function plantslib:generate_block(minp, maxp, blockseed) + return function(minp, maxp, blockseed) + + -- use the block hash as a unique key into the surface_nodes + -- table, so that we can write the table thread-safely. + + local blockhash = minetest.hash_node_position(minp) + local search_area = minetest.find_nodes_in_area(minp, maxp, plantslib.surfaces_list) + + -- search the generated block for surfaces + + local surface_nodes = {} + surface_nodes.blockhash = {} + + for i = 1, #search_area do + local pos = search_area[i] + local p_top = { x=pos.x, y=pos.y+1, z=pos.z } + if minetest.get_node(p_top).name == "air" then + surface_nodes.blockhash[#surface_nodes.blockhash + 1] = pos end end - local num_in_biome_nodes = #in_biome_nodes + for action = 1, #plantslib.actions_list do + local biome = plantslib.actions_list[action][1] + local node_or_function_or_model = plantslib.actions_list[action][2] - if num_in_biome_nodes > 0 then - for i = 1, math.min(biome.max_count, num_in_biome_nodes) do - local tries = 0 - local spawned = false - while tries < 2 and not spawned do - local pos = in_biome_nodes[math.random(1, num_in_biome_nodes)] - if biome.spawn_replace_node then - pos.y = pos.y-1 - end - local p_top = { x = pos.x, y = pos.y + 1, z = pos.z } + plantslib:set_defaults(biome) - if not (biome.avoid_nodes and biome.avoid_radius and minetest.find_node_near(p_top, biome.avoid_radius + math.random(-1.5,2), biome.avoid_nodes)) then - if biome.delete_above then - minetest.remove_node(p_top) - minetest.remove_node({x=p_top.x, y=p_top.y+1, z=p_top.z}) - end + -- filter stage 1 - find nodes from the supplied surfaces that are within the current biome. - if biome.delete_above_surround then - minetest.remove_node({x=p_top.x-1, y=p_top.y, z=p_top.z}) - minetest.remove_node({x=p_top.x+1, y=p_top.y, z=p_top.z}) - minetest.remove_node({x=p_top.x, y=p_top.y, z=p_top.z-1}) - minetest.remove_node({x=p_top.x, y=p_top.y, z=p_top.z+1}) + local in_biome_nodes = {} + local perlin_fertile_area = minetest.get_perlin(biome.seed_diff, perlin_octaves, perlin_persistence, perlin_scale) - minetest.remove_node({x=p_top.x-1, y=p_top.y+1, z=p_top.z}) - minetest.remove_node({x=p_top.x+1, y=p_top.y+1, z=p_top.z}) - minetest.remove_node({x=p_top.x, y=p_top.y+1, z=p_top.z-1}) - minetest.remove_node({x=p_top.x, y=p_top.y+1, z=p_top.z+1}) - end + for i = 1, #surface_nodes.blockhash do + local pos = surface_nodes.blockhash[i] + local p_top = { x = pos.x, y = pos.y + 1, z = pos.z } + local noise1 = perlin_fertile_area:get2d({x=pos.x, y=pos.z}) + local noise2 = plantslib.perlin_temperature:get2d({x=pos.x, y=pos.z}) + local noise3 = plantslib.perlin_humidity:get2d({x=pos.x+150, y=pos.z+50}) + local biome_surfaces_string = dump(biome.surface) + if ((not biome.depth and string.find(biome_surfaces_string, minetest.get_node(pos).name)) or (biome.depth and not string.find(biome_surfaces_string, minetest.get_node({ x = pos.x, y = pos.y-biome.depth-1, z = pos.z }).name))) + and (not biome.check_air or (biome.check_air and minetest.get_node(p_top).name == "air")) + and pos.y >= biome.min_elevation + and pos.y <= biome.max_elevation + and noise1 > biome.plantlife_limit + and noise2 <= biome.temp_min + and noise2 >= biome.temp_max + and noise3 <= biome.humidity_min + and noise3 >= biome.humidity_max + and (not biome.ncount or #(minetest.find_nodes_in_area({x=pos.x-1, y=pos.y, z=pos.z-1}, {x=pos.x+1, y=pos.y, z=pos.z+1}, biome.neighbors)) > biome.ncount) + and (not biome.near_nodes or #(minetest.find_nodes_in_area({x=pos.x-biome.near_nodes_size, y=pos.y-biome.near_nodes_vertical, z=pos.z-biome.near_nodes_size}, {x=pos.x+biome.near_nodes_size, y=pos.y+biome.near_nodes_vertical, z=pos.z+biome.near_nodes_size}, biome.near_nodes)) >= biome.near_nodes_count) + and math.random(1,100) > biome.rarity + and (not biome.below_nodes or string.find(dump(biome.below_nodes), minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name) ) + then + in_biome_nodes[#in_biome_nodes + 1] = pos + end + end + -- filter stage 2 - find places within that biome area to place the plants. + + local num_in_biome_nodes = #in_biome_nodes + + if num_in_biome_nodes > 0 then + for i = 1, math.min(biome.max_count, num_in_biome_nodes) do + local tries = 0 + local spawned = false + while tries < 2 and not spawned do + local pos = in_biome_nodes[math.random(1, num_in_biome_nodes)] if biome.spawn_replace_node then - minetest.remove_node(pos) + pos.y = pos.y-1 end + local p_top = { x = pos.x, y = pos.y + 1, z = pos.z } - local objtype = type(node_or_function_or_model) + if not (biome.avoid_nodes and biome.avoid_radius and minetest.find_node_near(p_top, biome.avoid_radius + math.random(-1.5,2), biome.avoid_nodes)) then + if biome.delete_above then + minetest.remove_node(p_top) + minetest.remove_node({x=p_top.x, y=p_top.y+1, z=p_top.z}) + end - if objtype == "table" then - plantslib:generate_tree(pos, node_or_function_or_model) - spawned = true - elseif objtype == "string" and - minetest.registered_nodes[node_or_function_or_model] then - minetest.add_node(p_top, { name = node_or_function_or_model }) - spawned = true - elseif objtype == "function" then - node_or_function_or_model(pos) - spawned = trueload - elseif objtype == "string" and pcall(loadstring(("return %s(...)"): - format(node_or_function_or_model)),pos) then - spawned = true + if biome.delete_above_surround then + minetest.remove_node({x=p_top.x-1, y=p_top.y, z=p_top.z}) + minetest.remove_node({x=p_top.x+1, y=p_top.y, z=p_top.z}) + minetest.remove_node({x=p_top.x, y=p_top.y, z=p_top.z-1}) + minetest.remove_node({x=p_top.x, y=p_top.y, z=p_top.z+1}) + + minetest.remove_node({x=p_top.x-1, y=p_top.y+1, z=p_top.z}) + minetest.remove_node({x=p_top.x+1, y=p_top.y+1, z=p_top.z}) + minetest.remove_node({x=p_top.x, y=p_top.y+1, z=p_top.z-1}) + minetest.remove_node({x=p_top.x, y=p_top.y+1, z=p_top.z+1}) + end + + if biome.spawn_replace_node then + minetest.remove_node(pos) + end + + local objtype = type(node_or_function_or_model) + + if objtype == "table" then + plantslib:generate_tree(pos, node_or_function_or_model) + spawned = true + elseif objtype == "string" and + minetest.registered_nodes[node_or_function_or_model] then + minetest.set_node(p_top, { name = node_or_function_or_model }) + spawned = true + elseif objtype == "function" then + node_or_function_or_model(pos) + spawned = true + elseif objtype == "string" and pcall(loadstring(("return %s(...)"): + format(node_or_function_or_model)),pos) then + spawned = true + else + plantslib:dbg("Warning: Ignored invalid definition for object "..dump(node_or_function_or_model).." that was pointed at {"..dump(pos).."}") + end else - print("Ignored invalid definition for object "..dump(node_or_function_or_model).." that was pointed at {"..dump(pos).."}") + tries = tries + 1 end - else - tries = tries + 1 end end end @@ -205,6 +281,8 @@ function plantslib:search_for_surfaces(minp, maxp, biomedef, node_or_function_or end end +minetest.register_on_generated(plantslib:generate_block(minp, maxp, blockseed)) + -- The spawning ABM function plantslib:spawn_on_surfaces(sd,sp,sr,sc,ss,sa) @@ -239,8 +317,8 @@ function plantslib:spawn_on_surfaces(sd,sp,sr,sc,ss,sa) action = function(pos, node, active_object_count, active_object_count_wider) local p_top = { x = pos.x, y = pos.y + 1, z = pos.z } local n_top = minetest.get_node(p_top) - local perlin1 = minetest.get_perlin(biome.seed_diff, perlin_octaves, perlin_persistence, perlin_scale) - local noise1 = perlin1:get2d({x=p_top.x, y=p_top.z}) + local perlin_fertile_area = minetest.get_perlin(biome.seed_diff, perlin_octaves, perlin_persistence, perlin_scale) + local noise1 = perlin_fertile_area:get2d({x=p_top.x, y=p_top.z}) local noise2 = plantslib.perlin_temperature:get2d({x=p_top.x, y=p_top.z}) local noise3 = plantslib.perlin_humidity:get2d({x=p_top.x+150, y=p_top.z+50}) if noise1 > biome.plantlife_limit @@ -262,7 +340,7 @@ function plantslib:spawn_on_surfaces(sd,sp,sr,sc,ss,sa) local walldir = plantslib:find_adjacent_wall(p_top, biome.verticals_list) if biome.alt_wallnode and walldir then if n_top.name == "air" then - minetest.add_node(p_top, { name = biome.alt_wallnode, param2 = walldir }) + minetest.set_node(p_top, { name = biome.alt_wallnode, param2 = walldir }) end else local currentsurface = minetest.get_node(pos).name @@ -279,19 +357,19 @@ function plantslib:spawn_on_surfaces(sd,sp,sr,sc,ss,sa) assert(loadstring(spawn_plants.."(...)"))(pos) elseif not biome.spawn_on_side and not biome.spawn_on_bottom and not biome.spawn_replace_node then if n_top.name == "air" then - minetest.add_node(p_top, { name = plant_to_spawn, param2 = fdir }) + minetest.set_node(p_top, { name = plant_to_spawn, param2 = fdir }) end elseif biome.spawn_replace_node then - minetest.add_node(pos, { name = plant_to_spawn, param2 = fdir }) + minetest.set_node(pos, { name = plant_to_spawn, param2 = fdir }) elseif biome.spawn_on_side then local onside = plantslib:find_open_side(pos) if onside then - minetest.add_node(onside.newpos, { name = plant_to_spawn, param2 = onside.facedir }) + minetest.set_node(onside.newpos, { name = plant_to_spawn, param2 = onside.facedir }) end elseif biome.spawn_on_bottom then if minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name == "air" then - minetest.add_node({x=pos.x, y=pos.y-1, z=pos.z}, { name = plant_to_spawn, param2 = fdir} ) + minetest.set_node({x=pos.x, y=pos.y-1, z=pos.z}, { name = plant_to_spawn, param2 = fdir} ) end end end @@ -338,11 +416,11 @@ function plantslib:grow_plants(opts) -- corner case for changing short junglegrass -- to dry shrub in desert if n_bot.name == options.dry_early_node and options.grow_plant == "junglegrass:short" then - minetest.add_node(pos, { name = "default:dry_shrub" }) + minetest.set_node(pos, { name = "default:dry_shrub" }) elseif options.grow_vertically and walldir then if plantslib:search_downward(pos, options.height_limit, options.ground_nodes) then - minetest.add_node(p_top, { name = options.grow_plant, param2 = walldir}) + minetest.set_node(p_top, { name = options.grow_plant, param2 = walldir}) end elseif not options.grow_result and not options.grow_function then @@ -366,19 +444,19 @@ function plantslib:replace_object(pos, replacement, grow_function, walldir, seed plantslib:grow_tree(pos, grow_function) return elseif growtype == "function" then - local perlin1 = minetest.get_perlin(seeddiff, perlin_octaves, perlin_persistence, perlin_scale) - local noise1 = perlin1:get2d({x=pos.x, y=pos.z}) + local perlin_fertile_area = minetest.get_perlin(seeddiff, perlin_octaves, perlin_persistence, perlin_scale) + local noise1 = perlin_fertile_area:get2d({x=pos.x, y=pos.z}) local noise2 = plantslib.perlin_temperature:get2d({x=pos.x, y=pos.z}) grow_function(pos,noise1,noise2,walldir) return elseif growtype == "string" then - local perlin1 = minetest.get_perlin(seeddiff, perlin_octaves, perlin_persistence, perlin_scale) - local noise1 = perlin1:get2d({x=pos.x, y=pos.z}) + local perlin_fertile_area = minetest.get_perlin(seeddiff, perlin_octaves, perlin_persistence, perlin_scale) + local noise1 = perlin_fertile_area:get2d({x=pos.x, y=pos.z}) local noise2 = plantslib.perlin_temperature:get2d({x=pos.x, y=pos.z}) assert(loadstring(grow_function.."(...)"))(pos,noise1,noise2,walldir) return elseif growtype == "nil" then - minetest.add_node(pos, { name = replacement, param2 = walldir}) + minetest.set_node(pos, { name = replacement, param2 = walldir}) return elseif growtype ~= "nil" and growtype ~= "string" and growtype ~= "table" then error("Invalid grow function "..dump(grow_function).." used on object at ("..dump(pos)..")") @@ -456,5 +534,107 @@ function plantslib:get_nodedef_field(nodename, fieldname) return minetest.registered_nodes[nodename][fieldname] end +-- The old version of the mapgen spawner, for mods that require disabling of +-- checking for air during the initial map read stage. + +function plantslib:generate_block_legacy(minp, maxp, biomedef, node_or_function_or_model) + return function(minp, maxp, blockseed) + local biome = biomedef + plantslib:set_defaults(biome) + + local searchnodes = minetest.find_nodes_in_area(minp, maxp, biome.surface) + local in_biome_nodes = {} + local perlin_fertile_area = minetest.get_perlin(biome.seed_diff, perlin_octaves, perlin_persistence, perlin_scale) + + for i = 1, #searchnodes do + local pos = searchnodes[i] + local p_top = { x = pos.x, y = pos.y + 1, z = pos.z } + local noise1 = perlin_fertile_area:get2d({x=p_top.x, y=p_top.z}) + local noise2 = plantslib.perlin_temperature:get2d({x=p_top.x, y=p_top.z}) + local noise3 = plantslib.perlin_humidity:get2d({x=p_top.x+150, y=p_top.z+50}) + if (not biome.depth or minetest.get_node({ x = pos.x, y = pos.y-biome.depth-1, z = pos.z }).name ~= biome.surface) + and pos.y >= biome.min_elevation + and pos.y <= biome.max_elevation + and noise1 > biome.plantlife_limit + and noise2 <= biome.temp_min + and noise2 >= biome.temp_max + and noise3 <= biome.humidity_min + and noise3 >= biome.humidity_max + and (not biome.ncount or #(minetest.find_nodes_in_area({x=pos.x-1, y=pos.y, z=pos.z-1}, {x=pos.x+1, y=pos.y, z=pos.z+1}, biome.neighbors)) > biome.ncount) + and (not biome.near_nodes or #(minetest.find_nodes_in_area({x=pos.x-biome.near_nodes_size, y=pos.y-biome.near_nodes_vertical, z=pos.z-biome.near_nodes_size}, {x=pos.x+biome.near_nodes_size, y=pos.y+biome.near_nodes_vertical, z=pos.z+biome.near_nodes_size}, biome.near_nodes)) >= biome.near_nodes_count) + and math.random(1,100) > biome.rarity + and (not biome.below_nodes or string.find(dump(biome.below_nodes), minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name) ) + then + in_biome_nodes[#in_biome_nodes + 1] = pos + end + end + + local num_in_biome_nodes = #in_biome_nodes + + if num_in_biome_nodes > 0 then + for i = 1, math.min(biome.max_count, num_in_biome_nodes) do + local tries = 0 + local spawned = false + while tries < 2 and not spawned do + local pos = in_biome_nodes[math.random(1, num_in_biome_nodes)] + if biome.spawn_replace_node then + pos.y = pos.y-1 + end + local p_top = { x = pos.x, y = pos.y + 1, z = pos.z } + + if not (biome.avoid_nodes and biome.avoid_radius and minetest.find_node_near(p_top, biome.avoid_radius + math.random(-1.5,2), biome.avoid_nodes)) then + if biome.delete_above then + minetest.remove_node(p_top) + minetest.remove_node({x=p_top.x, y=p_top.y+1, z=p_top.z}) + end + + if biome.delete_above_surround then + minetest.remove_node({x=p_top.x-1, y=p_top.y, z=p_top.z}) + minetest.remove_node({x=p_top.x+1, y=p_top.y, z=p_top.z}) + minetest.remove_node({x=p_top.x, y=p_top.y, z=p_top.z-1}) + minetest.remove_node({x=p_top.x, y=p_top.y, z=p_top.z+1}) + + minetest.remove_node({x=p_top.x-1, y=p_top.y+1, z=p_top.z}) + minetest.remove_node({x=p_top.x+1, y=p_top.y+1, z=p_top.z}) + minetest.remove_node({x=p_top.x, y=p_top.y+1, z=p_top.z-1}) + minetest.remove_node({x=p_top.x, y=p_top.y+1, z=p_top.z+1}) + end + + if biome.spawn_replace_node then + minetest.remove_node(pos) + end + + local objtype = type(node_or_function_or_model) + + if objtype == "table" then + plantslib:generate_tree(pos, node_or_function_or_model) + spawned = true + elseif objtype == "string" and + minetest.registered_nodes[node_or_function_or_model] then + minetest.set_node(p_top, { name = node_or_function_or_model }) + spawned = true + elseif objtype == "function" then + node_or_function_or_model(pos) + spawned = trueload + elseif objtype == "string" and pcall(loadstring(("return %s(...)"): + format(node_or_function_or_model)),pos) then + spawned = true + else + plantslib:dbg("Warning: Ignored invalid definition for object "..dump(node_or_function_or_model).." that was pointed at {"..dump(pos).."}") + end + else + tries = tries + 1 + end + end + end + end + end +end + +print("[Plants Lib] Loaded") + +minetest.after(0, function() + print("[Plants Lib] Registered a total of "..#plantslib.surfaces_list.." surface types to be evaluated,") + print("[Plants Lib] a total of "..#plantslib.actions_list.." actions, and "..plantslib.total_legacy_calls.." legacy mapgen hooks.") +end) -print(S("[Plantlife Library] Loaded")) diff --git a/mods/skylands/abms.lua b/mods/skylands/abms.lua index 7da8f4a..c18d9cb 100644 --- a/mods/skylands/abms.lua +++ b/mods/skylands/abms.lua @@ -276,4 +276,5 @@ minetest.register_abm({ vm:write_to_map() vm:update_map() end, -}) \ No newline at end of file +}) + diff --git a/mods/skylands/init.lua b/mods/skylands/init.lua index be737e4..75fc046 100644 --- a/mods/skylands/init.lua +++ b/mods/skylands/init.lua @@ -1,11 +1,11 @@ --- skylands 4.0 by HeroOfTheWinds, based on floatindev 0.2.0 by paramat +-- skylands 4.2 by HeroOfTheWinds, based on floatindev 0.2.0 by paramat -- For latest stable Minetest and back to 0.4.8 --- Depends default, fire, stairs, moreblocks?, moreores?, mesecons? +-- Depends default, fire, stairs, moreblocks?, moreores?, mesecons?, technic? -- License: code WTFPL -- Parameters -local YMIN = 700 -- Approximate realm limits. +local YMIN = -33000 -- Approximate realm limits. local YMAX = 33000 local XMIN = -33000 local XMAX = 33000 @@ -158,6 +158,7 @@ dofile(minetest.get_modpath("skylands").."/wheat.lua") dofile(minetest.get_modpath("skylands").."/abms.lua") dofile(minetest.get_modpath("skylands").."/functions.lua") dofile(minetest.get_modpath("skylands").."/pools.lua") +dofile(minetest.get_modpath("skylands").."/tools.lua") dofile(minetest.get_modpath("skylands").."/farming.lua") diff --git a/mods/skylands/pools.lua b/mods/skylands/pools.lua index 8cf0f64..c0b3a0e 100644 --- a/mods/skylands/pools.lua +++ b/mods/skylands/pools.lua @@ -23,6 +23,8 @@ function skylands:gen_pool(lakepoints, area, data, x0, z0, x1, z1) local c_hvngrass = minetest.get_content_id("skylands:heaven_grass") local c_rich = minetest.get_content_id("skylands:rich_dirt") + local c_cloud = minetest.get_content_id("skylands:cloud") + local sidelen = x1 - x0 -- actually sidelen - 1 @@ -251,6 +253,7 @@ function skylands:gen_pool(lakepoints, area, data, x0, z0, x1, z1) break elseif data[viu] == c_hvngrass then data[viu] = c_rich + break else break end diff --git a/mods/skylands/textures/skylands_cavorite_handle.png b/mods/skylands/textures/skylands_cavorite_handle.png new file mode 100644 index 0000000..cd5b46d Binary files /dev/null and b/mods/skylands/textures/skylands_cavorite_handle.png differ diff --git a/mods/skylands/textures/skylands_cavorite_tool_bronzeaxe.png b/mods/skylands/textures/skylands_cavorite_tool_bronzeaxe.png new file mode 100644 index 0000000..15d5cfa Binary files /dev/null and b/mods/skylands/textures/skylands_cavorite_tool_bronzeaxe.png differ diff --git a/mods/skylands/textures/skylands_cavorite_tool_bronzepick.png b/mods/skylands/textures/skylands_cavorite_tool_bronzepick.png new file mode 100644 index 0000000..15118a4 Binary files /dev/null and b/mods/skylands/textures/skylands_cavorite_tool_bronzepick.png differ diff --git a/mods/skylands/textures/skylands_cavorite_tool_bronzeshovel.png b/mods/skylands/textures/skylands_cavorite_tool_bronzeshovel.png new file mode 100644 index 0000000..208a649 Binary files /dev/null and b/mods/skylands/textures/skylands_cavorite_tool_bronzeshovel.png differ diff --git a/mods/skylands/textures/skylands_cavorite_tool_bronzesword.png b/mods/skylands/textures/skylands_cavorite_tool_bronzesword.png new file mode 100644 index 0000000..775ba77 Binary files /dev/null and b/mods/skylands/textures/skylands_cavorite_tool_bronzesword.png differ diff --git a/mods/skylands/textures/skylands_cavorite_tool_diamondaxe.png b/mods/skylands/textures/skylands_cavorite_tool_diamondaxe.png new file mode 100644 index 0000000..1025008 Binary files /dev/null and b/mods/skylands/textures/skylands_cavorite_tool_diamondaxe.png differ diff --git a/mods/skylands/textures/skylands_cavorite_tool_diamondpick.png b/mods/skylands/textures/skylands_cavorite_tool_diamondpick.png new file mode 100644 index 0000000..2bbe07e Binary files /dev/null and b/mods/skylands/textures/skylands_cavorite_tool_diamondpick.png differ diff --git a/mods/skylands/textures/skylands_cavorite_tool_diamondshovel.png b/mods/skylands/textures/skylands_cavorite_tool_diamondshovel.png new file mode 100644 index 0000000..f122eb2 Binary files /dev/null and b/mods/skylands/textures/skylands_cavorite_tool_diamondshovel.png differ diff --git a/mods/skylands/textures/skylands_cavorite_tool_diamondsword.png b/mods/skylands/textures/skylands_cavorite_tool_diamondsword.png new file mode 100644 index 0000000..fac6f91 Binary files /dev/null and b/mods/skylands/textures/skylands_cavorite_tool_diamondsword.png differ diff --git a/mods/skylands/textures/skylands_cavorite_tool_meseaxe.png b/mods/skylands/textures/skylands_cavorite_tool_meseaxe.png new file mode 100644 index 0000000..11840ba Binary files /dev/null and b/mods/skylands/textures/skylands_cavorite_tool_meseaxe.png differ diff --git a/mods/skylands/textures/skylands_cavorite_tool_mesepick.png b/mods/skylands/textures/skylands_cavorite_tool_mesepick.png new file mode 100644 index 0000000..9837cee Binary files /dev/null and b/mods/skylands/textures/skylands_cavorite_tool_mesepick.png differ diff --git a/mods/skylands/textures/skylands_cavorite_tool_meseshovel.png b/mods/skylands/textures/skylands_cavorite_tool_meseshovel.png new file mode 100644 index 0000000..ccad336 Binary files /dev/null and b/mods/skylands/textures/skylands_cavorite_tool_meseshovel.png differ diff --git a/mods/skylands/textures/skylands_cavorite_tool_mesesword.png b/mods/skylands/textures/skylands_cavorite_tool_mesesword.png new file mode 100644 index 0000000..84f3a2c Binary files /dev/null and b/mods/skylands/textures/skylands_cavorite_tool_mesesword.png differ diff --git a/mods/skylands/textures/skylands_cavorite_tool_steelaxe.png b/mods/skylands/textures/skylands_cavorite_tool_steelaxe.png new file mode 100644 index 0000000..ecc7628 Binary files /dev/null and b/mods/skylands/textures/skylands_cavorite_tool_steelaxe.png differ diff --git a/mods/skylands/textures/skylands_cavorite_tool_steelpick.png b/mods/skylands/textures/skylands_cavorite_tool_steelpick.png new file mode 100644 index 0000000..dc7a679 Binary files /dev/null and b/mods/skylands/textures/skylands_cavorite_tool_steelpick.png differ diff --git a/mods/skylands/textures/skylands_cavorite_tool_steelshovel.png b/mods/skylands/textures/skylands_cavorite_tool_steelshovel.png new file mode 100644 index 0000000..7427c18 Binary files /dev/null and b/mods/skylands/textures/skylands_cavorite_tool_steelshovel.png differ diff --git a/mods/skylands/textures/skylands_cavorite_tool_steelsword.png b/mods/skylands/textures/skylands_cavorite_tool_steelsword.png new file mode 100644 index 0000000..5cd37ef Binary files /dev/null and b/mods/skylands/textures/skylands_cavorite_tool_steelsword.png differ diff --git a/mods/skylands/textures/skylands_cavorite_tool_stoneaxe.png b/mods/skylands/textures/skylands_cavorite_tool_stoneaxe.png new file mode 100644 index 0000000..f51f478 Binary files /dev/null and b/mods/skylands/textures/skylands_cavorite_tool_stoneaxe.png differ diff --git a/mods/skylands/textures/skylands_cavorite_tool_stonepick.png b/mods/skylands/textures/skylands_cavorite_tool_stonepick.png new file mode 100644 index 0000000..173cc68 Binary files /dev/null and b/mods/skylands/textures/skylands_cavorite_tool_stonepick.png differ diff --git a/mods/skylands/textures/skylands_cavorite_tool_stoneshovel.png b/mods/skylands/textures/skylands_cavorite_tool_stoneshovel.png new file mode 100644 index 0000000..881f00f Binary files /dev/null and b/mods/skylands/textures/skylands_cavorite_tool_stoneshovel.png differ diff --git a/mods/skylands/textures/skylands_cavorite_tool_stonesword.png b/mods/skylands/textures/skylands_cavorite_tool_stonesword.png new file mode 100644 index 0000000..a5f01cb Binary files /dev/null and b/mods/skylands/textures/skylands_cavorite_tool_stonesword.png differ diff --git a/mods/skylands/textures/skylands_cavorite_tool_woodaxe.png b/mods/skylands/textures/skylands_cavorite_tool_woodaxe.png new file mode 100644 index 0000000..9757875 Binary files /dev/null and b/mods/skylands/textures/skylands_cavorite_tool_woodaxe.png differ diff --git a/mods/skylands/textures/skylands_cavorite_tool_woodpick.png b/mods/skylands/textures/skylands_cavorite_tool_woodpick.png new file mode 100644 index 0000000..7a52990 Binary files /dev/null and b/mods/skylands/textures/skylands_cavorite_tool_woodpick.png differ diff --git a/mods/skylands/textures/skylands_cavorite_tool_woodshovel.png b/mods/skylands/textures/skylands_cavorite_tool_woodshovel.png new file mode 100644 index 0000000..141f802 Binary files /dev/null and b/mods/skylands/textures/skylands_cavorite_tool_woodshovel.png differ diff --git a/mods/skylands/textures/skylands_cavorite_tool_woodsword.png b/mods/skylands/textures/skylands_cavorite_tool_woodsword.png new file mode 100644 index 0000000..3aa3dde Binary files /dev/null and b/mods/skylands/textures/skylands_cavorite_tool_woodsword.png differ diff --git a/mods/skylands/tools.lua b/mods/skylands/tools.lua new file mode 100644 index 0000000..7b10928 --- /dev/null +++ b/mods/skylands/tools.lua @@ -0,0 +1,570 @@ +minetest.register_craftitem("skylands:cavorite_handle", { + description = "Cavorite Tool Handle", + inventory_image = "skylands_cavorite_handle.png", +}) + +-- +-- Picks +-- + +minetest.register_tool("skylands:cavorite_pick_wood", { + description = "Cavorite-Enhanced Wooden Pickaxe", + inventory_image = "skylands_cavorite_tool_woodpick.png", + tool_capabilities = { + full_punch_interval = 0.8, + max_drop_level=0, + groupcaps={ + cracky = {times={[3]=1.10}, uses=8, maxlevel=1}, + }, + damage_groups = {fleshy=2}, + }, +}) +minetest.register_tool("skylands:cavorite_pick_stone", { + description = "Cavorite-Enhanced Stone Pickaxe", + inventory_image = "skylands_cavorite_tool_stonepick.png", + tool_capabilities = { + full_punch_interval = 0.87, + max_drop_level=0, + groupcaps={ + cracky = {times={[2]=1.33, [3]=0.8}, uses=15, maxlevel=1}, + }, + damage_groups = {fleshy=3}, + }, +}) +minetest.register_tool("skylands:cavorite_pick_steel", { + description = "Cavorite-Enhanced Steel Pickaxe", + inventory_image = "skylands_cavorite_tool_steelpick.png", + tool_capabilities = { + full_punch_interval = 0.67, + max_drop_level=1, + groupcaps={ + cracky = {times={[1]=2.67, [2]=1.07, [3]=0.53}, uses=15, maxlevel=2}, + }, + damage_groups = {fleshy=4}, + }, +}) +minetest.register_tool("skylands:cavorite_pick_bronze", { + description = "Cavorite-Enhanced Bronze Pickaxe", + inventory_image = "skylands_cavorite_tool_bronzepick.png", + tool_capabilities = { + full_punch_interval = 0.67, + max_drop_level=1, + groupcaps={ + cracky = {times={[1]=2.67, [2]=1.07, [3]=0.53}, uses=23, maxlevel=2}, + }, + damage_groups = {fleshy=4}, + }, +}) +minetest.register_tool("skylands:cavorite_pick_mese", { + description = "Cavorite-Enhanced Mese Pickaxe", + inventory_image = "skylands_cavorite_tool_mesepick.png", + tool_capabilities = { + full_punch_interval = 0.6, + max_drop_level=3, + groupcaps={ + cracky = {times={[1]=1.6, [2]=0.8, [3]=0.40}, uses=15, maxlevel=3}, + }, + damage_groups = {fleshy=5}, + }, +}) +minetest.register_tool("skylands:cavorite_pick_diamond", { + description = "Cavorite-Enhanced Diamond Pickaxe", + inventory_image = "skylands_cavorite_tool_diamondpick.png", + tool_capabilities = { + full_punch_interval = 0.6, + max_drop_level=3, + groupcaps={ + cracky = {times={[1]=1.33, [2]=0.67, [3]=0.33}, uses=23, maxlevel=3}, + }, + damage_groups = {fleshy=5}, + }, +}) + +-- +-- Shovels +-- + +minetest.register_tool("skylands:cavorite_shovel_wood", { + description = "Cavorite-Enhanced Wooden Shovel", + inventory_image = "skylands_cavorite_tool_woodshovel.png", + wield_image = "skylands_cavorite_tool_woodshovel.png^[transformR90", + tool_capabilities = { + full_punch_interval = 0.8, + max_drop_level=0, + groupcaps={ + crumbly = {times={[1]=2.00, [2]=1.07, [3]=0.40}, uses=7, maxlevel=1}, + }, + damage_groups = {fleshy=2}, + }, +}) +minetest.register_tool("skylands:cavorite_shovel_stone", { + description = "Cavorite-Enhanced Stone Shovel", + inventory_image = "skylands_cavorite_tool_stoneshovel.png", + wield_image = "skylands_cavorite_tool_stoneshovel.png^[transformR90", + tool_capabilities = { + full_punch_interval = 0.93, + max_drop_level=0, + groupcaps={ + crumbly = {times={[1]=1.20, [2]=0.80, [3]=0.33}, uses=15, maxlevel=1}, + }, + damage_groups = {fleshy=2}, + }, +}) +minetest.register_tool("skylands:cavorite_shovel_steel", { + description = "Cavorite-Enhanced Steel Shovel", + inventory_image = "skylands_cavorite_tool_steelshovel.png", + wield_image = "skylands_cavorite_tool_steelshovel.png^[transformR90", + tool_capabilities = { + full_punch_interval = 0.73, + max_drop_level=1, + groupcaps={ + crumbly = {times={[1]=1.00, [2]=0.60, [3]=0.27}, uses=22, maxlevel=2}, + }, + damage_groups = {fleshy=3}, + }, +}) +minetest.register_tool("skylands:cavorite_shovel_bronze", { + description = "Cavorite-Enhanced Bronze Shovel", + inventory_image = "skylands_cavorite_tool_bronzeshovel.png", + wield_image = "skylands_cavorite_tool_bronzeshovel.png^[transformR90", + tool_capabilities = { + full_punch_interval = 0.73, + max_drop_level=1, + groupcaps={ + crumbly = {times={[1]=1.00, [2]=0.60, [3]=0.27}, uses=30, maxlevel=2}, + }, + damage_groups = {fleshy=3}, + }, +}) +minetest.register_tool("skylands:cavorite_shovel_mese", { + description = "Cavorite-Enhanced Mese Shovel", + inventory_image = "skylands_cavorite_tool_meseshovel.png", + wield_image = "skylands_cavorite_tool_meseshovel.png^[transformR90", + tool_capabilities = { + full_punch_interval = 0.67, + max_drop_level=3, + groupcaps={ + crumbly = {times={[1]=0.80, [2]=0.40, [3]=0.20}, uses=15, maxlevel=3}, + }, + damage_groups = {fleshy=4}, + }, +}) +minetest.register_tool("skylands:cavorite_shovel_diamond", { + description = "Cavorite-Enhanced Diamond Shovel", + inventory_image = "skylands_cavorite_tool_diamondshovel.png", + wield_image = "skylands_cavorite_tool_diamondshovel.png^[transformR90", + tool_capabilities = { + full_punch_interval = 0.67, + max_drop_level=1, + groupcaps={ + crumbly = {times={[1]=0.73, [2]=0.33, [3]=0.20}, uses=23, maxlevel=3}, + }, + damage_groups = {fleshy=4}, + }, +}) + +-- +-- Axes +-- + +minetest.register_tool("skylands:cavorite_axe_wood", { + description = "Cavorite-Enhanced Wooden Axe", + inventory_image = "skylands_cavorite_tool_woodaxe.png", + tool_capabilities = { + full_punch_interval = 0.67, + max_drop_level=0, + groupcaps={ + choppy = {times={[2]=2.00, [3]=1.33}, uses=7, maxlevel=1}, + }, + damage_groups = {fleshy=2}, + }, +}) +minetest.register_tool("skylands:cavorite_axe_stone", { + description = "Cavorite-Enhanced Stone Axe", + inventory_image = "skylands_cavorite_tool_stoneaxe.png", + tool_capabilities = { + full_punch_interval = 0.8, + max_drop_level=0, + groupcaps={ + choppy={times={[1]=2.00, [2]=1.33, [3]=1.00}, uses=15, maxlevel=1}, + }, + damage_groups = {fleshy=3}, + }, +}) +minetest.register_tool("skylands:cavorite_axe_steel", { + description = "Cavorite-Enhanced Steel Axe", + inventory_image = "skylands_cavorite_tool_steelaxe.png", + tool_capabilities = { + full_punch_interval = 0.67, + max_drop_level=1, + groupcaps={ + choppy={times={[1]=1.67, [2]=0.93, [3]=0.67}, uses=15, maxlevel=2}, + }, + damage_groups = {fleshy=4}, + }, +}) +minetest.register_tool("skylands:cavorite_axe_bronze", { + description = "Cavorite-Enhanced Bronze Axe", + inventory_image = "skylands_cavorite_tool_bronzeaxe.png", + tool_capabilities = { + full_punch_interval = 0.67, + max_drop_level=1, + groupcaps={ + choppy={times={[1]=1.67, [2]=0.93, [3]=0.67}, uses=15, maxlevel=2}, + }, + damage_groups = {fleshy=4}, + }, +}) +minetest.register_tool("skylands:cavorite_axe_mese", { + description = "Cavorite-Enhanced Mese Axe", + inventory_image = "skylands_cavorite_tool_meseaxe.png", + tool_capabilities = { + full_punch_interval = 0.6, + max_drop_level=1, + groupcaps={ + choppy={times={[1]=1.47, [2]=0.67, [3]=0.40}, uses=15, maxlevel=3}, + }, + damage_groups = {fleshy=6}, + }, +}) +minetest.register_tool("skylands:cavorite_axe_diamond", { + description = "Cavorite-Enhanced Diamond Axe", + inventory_image = "skylands_cavorite_tool_diamondaxe.png", + tool_capabilities = { + full_punch_interval = 0.6, + max_drop_level=1, + groupcaps={ + choppy={times={[1]=1.40, [2]=0.60, [3]=0.33}, uses=20, maxlevel=2}, + }, + damage_groups = {fleshy=7}, + }, +}) + +-- +-- Swords +-- + +minetest.register_tool("skylands:cavorite_sword_wood", { + description = "Cavorite-Enhanced Wooden Sword", + inventory_image = "skylands_cavorite_tool_woodsword.png", + tool_capabilities = { + full_punch_interval = 0.67, + max_drop_level=0, + groupcaps={ + snappy={times={[2]=1.07, [3]=0.27}, uses=7, maxlevel=1}, + }, + damage_groups = {fleshy=2}, + } +}) +minetest.register_tool("skylands:cavorite_sword_stone", { + description = "Cavorite-Enhanced Stone Sword", + inventory_image = "skylands_cavorite_tool_stonesword.png", + tool_capabilities = { + full_punch_interval = 0.8, + max_drop_level=0, + groupcaps={ + snappy={times={[2]=0.93, [3]=0.27}, uses=15, maxlevel=1}, + }, + damage_groups = {fleshy=4}, + } +}) +minetest.register_tool("skylands:cavorite_sword_steel", { + description = "Cavorite-Enhanced Steel Sword", + inventory_image = "skylands_cavorite_tool_steelsword.png", + tool_capabilities = { + full_punch_interval = 0.53, + max_drop_level=1, + groupcaps={ + snappy={times={[1]=1.67, [2]=0.8, [3]=0.23}, uses=15, maxlevel=2}, + }, + damage_groups = {fleshy=6}, + } +}) +minetest.register_tool("skylands:cavorite_sword_bronze", { + description = "Cavorite-Enhanced Bronze Sword", + inventory_image = "skylands_cavorite_tool_bronzesword.png", + tool_capabilities = { + full_punch_interval = 0.53, + max_drop_level=1, + groupcaps={ + snappy={times={[1]=1.67, [2]=0.8, [3]=0.23}, uses=30, maxlevel=2}, + }, + damage_groups = {fleshy=6}, + } +}) +minetest.register_tool("skylands:cavorite_sword_mese", { + description = "Cavorite-Enhanced Mese Sword", + inventory_image = "skylands_cavorite_tool_mesesword.png", + tool_capabilities = { + full_punch_interval = 0.47, + max_drop_level=1, + groupcaps={ + snappy={times={[1]=1.33, [2]=0.67, [3]=0.23}, uses=20, maxlevel=3}, + }, + damage_groups = {fleshy=7}, + } +}) +minetest.register_tool("skylands:cavorite_sword_diamond", { + description = "Cavorite-Enhanced Diamond Sword", + inventory_image = "skylands_cavorite_tool_diamondsword.png", + tool_capabilities = { + full_punch_interval = 0.47, + max_drop_level=1, + groupcaps={ + snappy={times={[1]=1.27, [2]=0.60, [3]=0.20}, uses=30, maxlevel=3}, + }, + damage_groups = {fleshy=8}, + } +}) + +--- +--- Crafting +--- + +--cavorite handle, base of all tool upgrades +minetest.register_craft({ + output = "skylands:cavorite_handle", + recipe = { + {"skylands:cavorite"}, + {"skylands:cavorite"}, + } +}) + +--tool upgrade recipes +minetest.register_craft({ + output = "skylands:cavorite_pick_wood", + recipe = { + {"default:pick_wood"}, + {"skylands:cavorite_handle"}, + {"skylands:cavorite_handle"}, + } +}) + +minetest.register_craft({ + output = "skylands:cavorite_pick_stone", + recipe = { + {"default:pick_stone"}, + {"skylands:cavorite_handle"}, + {"skylands:cavorite_handle"}, + } +}) + +minetest.register_craft({ + output = "skylands:cavorite_pick_steel", + recipe = { + {"default:pick_steel"}, + {"skylands:cavorite_handle"}, + {"skylands:cavorite_handle"}, + } +}) + +minetest.register_craft({ + output = "skylands:cavorite_pick_bronze", + recipe = { + {"default:pick_bronze"}, + {"skylands:cavorite_handle"}, + {"skylands:cavorite_handle"}, + } +}) + +minetest.register_craft({ + output = "skylands:cavorite_pick_mese", + recipe = { + {"default:pick_mese"}, + {"skylands:cavorite_handle"}, + {"skylands:cavorite_handle"}, + } +}) + +minetest.register_craft({ + output = "skylands:cavorite_pick_diamond", + recipe = { + {"default:pick_diamond"}, + {"skylands:cavorite_handle"}, + {"skylands:cavorite_handle"}, + } +}) + +minetest.register_craft({ + output = "skylands:cavorite_shovel_wood", + recipe = { + {"default:shovel_wood"}, + {"skylands:cavorite_handle"}, + {"skylands:cavorite_handle"}, + } +}) + +minetest.register_craft({ + output = "skylands:cavorite_shovel_stone", + recipe = { + {"default:shovel_stone"}, + {"skylands:cavorite_handle"}, + {"skylands:cavorite_handle"}, + } +}) + +minetest.register_craft({ + output = "skylands:cavorite_shovel_steel", + recipe = { + {"default:shovel_steel"}, + {"skylands:cavorite_handle"}, + {"skylands:cavorite_handle"}, + } +}) + +minetest.register_craft({ + output = "skylands:cavorite_shovel_bronze", + recipe = { + {"default:shovel_bronze"}, + {"skylands:cavorite_handle"}, + {"skylands:cavorite_handle"}, + } +}) + +minetest.register_craft({ + output = "skylands:cavorite_shovel_mese", + recipe = { + {"default:shovel_mese"}, + {"skylands:cavorite_handle"}, + {"skylands:cavorite_handle"}, + } +}) + +minetest.register_craft({ + output = "skylands:cavorite_shovel_diamond", + recipe = { + {"default:shovel_diamond"}, + {"skylands:cavorite_handle"}, + {"skylands:cavorite_handle"}, + } +}) + +minetest.register_craft({ + output = "skylands:cavorite_axe_wood", + recipe = { + {"default:axe_wood"}, + {"skylands:cavorite_handle"}, + {"skylands:cavorite_handle"}, + } +}) + +minetest.register_craft({ + output = "skylands:cavorite_axe_stone", + recipe = { + {"default:axe_stone"}, + {"skylands:cavorite_handle"}, + {"skylands:cavorite_handle"}, + } +}) + +minetest.register_craft({ + output = "skylands:cavorite_axe_steel", + recipe = { + {"default:axe_steel"}, + {"skylands:cavorite_handle"}, + {"skylands:cavorite_handle"}, + } +}) + +minetest.register_craft({ + output = "skylands:cavorite_axe_bronze", + recipe = { + {"default:axe_bronze"}, + {"skylands:cavorite_handle"}, + {"skylands:cavorite_handle"}, + } +}) + +minetest.register_craft({ + output = "skylands:cavorite_axe_mese", + recipe = { + {"default:axe_mese"}, + {"skylands:cavorite_handle"}, + {"skylands:cavorite_handle"}, + } +}) + +minetest.register_craft({ + output = "skylands:cavorite_axe_diamond", + recipe = { + {"default:axe_diamond"}, + {"skylands:cavorite_handle"}, + {"skylands:cavorite_handle"}, + } +}) + +minetest.register_craft({ + output = "skylands:cavorite_sword_wood", + recipe = { + {"default:sword_wood"}, + {"skylands:cavorite_handle"}, + {"skylands:cavorite_handle"}, + } +}) + +minetest.register_craft({ + output = "skylands:cavorite_sword_stone", + recipe = { + {"default:sword_stone"}, + {"skylands:cavorite_handle"}, + {"skylands:cavorite_handle"}, + } +}) + +minetest.register_craft({ + output = "skylands:cavorite_sword_steel", + recipe = { + {"default:sword_steel"}, + {"skylands:cavorite_handle"}, + {"skylands:cavorite_handle"}, + } +}) + +minetest.register_craft({ + output = "skylands:cavorite_sword_bronze", + recipe = { + {"default:sword_bronze"}, + {"skylands:cavorite_handle"}, + {"skylands:cavorite_handle"}, + } +}) + +minetest.register_craft({ + output = "skylands:cavorite_sword_mese", + recipe = { + {"default:sword_mese"}, + {"skylands:cavorite_handle"}, + {"skylands:cavorite_handle"}, + } +}) + +minetest.register_craft({ + output = "skylands:cavorite_sword_diamond", + recipe = { + {"default:sword_diamond"}, + {"skylands:cavorite_handle"}, + {"skylands:cavorite_handle"}, + } +}) + +--check to add wear to crafts when previous tool was worn +minetest.register_on_craft(function(itemstack, player, old_craft_grid, craft_inv) + if string.find(itemstack:get_name(), "cavorite") then --either cavorite_handle or a cavorite tool + local wear = 0 --store wear + local old_tool = false --store old tool used + --loop through old crafting grid to find old tool + for i = 1, 9 do + slot = old_craft_grid[i] + if string.find(slot:get_name(), "default") then + old_tool = slot --this is the tool, since it's name contains "default" + end + end + if old_tool:get_wear() == 0 then --tool has no wear, so give one with no wear + return + else + --tool has wear, so apply it to the new one. + wear = old_tool:get_wear() + return {name=itemstack:get_name(), count=1, wear=wear, metadata=""} + end + end +end) \ No newline at end of file diff --git a/mods/technic-master/.gitattributes b/mods/technic-master/.gitattributes new file mode 100644 index 0000000..412eeda --- /dev/null +++ b/mods/technic-master/.gitattributes @@ -0,0 +1,22 @@ +# Auto detect text files and perform LF normalization +* text=auto + +# Custom for Visual Studio +*.cs diff=csharp +*.sln merge=union +*.csproj merge=union +*.vbproj merge=union +*.fsproj merge=union +*.dbproj merge=union + +# Standard to msysgit +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain diff --git a/mods/technic-master/.gitignore b/mods/technic-master/.gitignore new file mode 100644 index 0000000..716917d --- /dev/null +++ b/mods/technic-master/.gitignore @@ -0,0 +1,167 @@ +################# +## Eclipse +################# + +*.pydevproject +.project +.metadata +bin/ +tmp/ +*.tmp +*.bak +*.swp +*~.nib +local.properties +.classpath +.settings/ +.loadpath + +# External tool builders +.externalToolBuilders/ + +# Locally stored "Eclipse launch configurations" +*.launch + +# CDT-specific +.cproject + +# PDT-specific +.buildpath + + +################# +## Visual Studio +################# + +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.sln.docstates + +# Build results +[Dd]ebug/ +[Rr]elease/ +*_i.c +*_p.c +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.vspscc +.builds +*.dotCover + +## TODO: If you have NuGet Package Restore enabled, uncomment this +#packages/ + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf + +# Visual Studio profiler +*.psess +*.vsp + +# ReSharper is a .NET coding add-in +_ReSharper* + +# Installshield output folder +[Ee]xpress + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish + +# Others +[Bb]in +[Oo]bj +sql +TestResults +*.Cache +ClientBin +stylecop.* +~$* +*.dbmdl +Generated_Code #added for RIA/Silverlight projects + +# Backup & report files from converting an old project file to a newer +# Visual Studio version. Backup files are not needed, because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML + + + +############ +## Windows +############ + +# Windows image file caches +Thumbs.db + +# Folder config file +Desktop.ini + + +############# +## Python +############# + +*.py[co] + +# Packages +*.egg +*.egg-info +dist +build +eggs +parts +bin +var +sdist +develop-eggs +.installed.cfg + +# Installer logs +pip-log.txt + +# Unit test / coverage reports +.coverage +.tox + +#Translations +*.mo + +#Mr Developer +.mr.developer.cfg + +# Mac crap +.DS_Store + +#gedit backup files +*~ + diff --git a/mods/technic-master/README.md b/mods/technic-master/README.md new file mode 100644 index 0000000..f2b64c2 --- /dev/null +++ b/mods/technic-master/README.md @@ -0,0 +1,22 @@ +Technic +======= + +Credits for contributing to the project (in alphabetical order): + * kpoppel + * Nekogloop + * Nore/Novatux + * ShadowNinja + * VanessaE + * And many others... + +FAQ +--- + +1. My technic circuit doesn't work. No power is distrubuted. + * A: Make sure you have a switching station connected. + +License +------- + +See mod folders for their licences + diff --git a/mods/technic-master/concrete/depends.txt b/mods/technic-master/concrete/depends.txt new file mode 100644 index 0000000..c48fe0d --- /dev/null +++ b/mods/technic-master/concrete/depends.txt @@ -0,0 +1,3 @@ +default +intllib? + diff --git a/mods/technic-master/concrete/init.lua b/mods/technic-master/concrete/init.lua new file mode 100644 index 0000000..03a865a --- /dev/null +++ b/mods/technic-master/concrete/init.lua @@ -0,0 +1,262 @@ +--Minetest 0.4.7 mod: concrete +--(c) 2013 by RealBadAngel + +local technic = technic or {} +technic.concrete_posts = {} + +-- Boilerplate to support localized strings if intllib mod is installed. +local S +if intllib then + S = intllib.Getter() +else + S = function(s) return s end +end + +minetest.register_alias("technic:concrete_post", "technic:concrete_post0") +minetest.register_alias("technic:concrete_post32", "technic:concrete_post12") +minetest.register_alias("technic:concrete_post33", "technic:concrete_post3") +minetest.register_alias("technic:concrete_post34", "technic:concrete_post28") +minetest.register_alias("technic:concrete_post35", "technic:concrete_post19") + +local steel_ingot +if minetest.get_modpath("technic_worldgen") then + steel_ingot = "technic:carbon_steel_ingot" +else + steel_ingot = "default:steel_ingot" +end + +minetest.register_craft({ + output = 'technic:rebar 6', + recipe = { + {'','', 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'}, + } +}) + +minetest.register_craft({ + output = 'technic:concrete_post_platform 6', + recipe = { + {'technic:concrete','technic:concrete_post0','technic:concrete'}, + } +}) + +minetest.register_craft({ + output = 'technic:concrete_post0 12', + recipe = { + {'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'}, + } +}) + +local box_platform = {-0.5, 0.3, -0.5, 0.5, 0.5, 0.5} +local box_center = {-0.15, -0.5, -0.15, 0.15, 0.5, 0.15} +local box_x1 = {0, -0.3, -0.1, 0.5, 0.3, 0.1} +local box_z1 = {-0.1, -0.3, 0, 0.1, 0.3, 0.5} +local box_x2 = {0, -0.3, -0.1, -0.5, 0.3, 0.1} +local box_z2 = {-0.1, -0.3, 0, 0.1, 0.3, -0.5} + +minetest.register_craftitem(":technic:rebar", { + description = S("Rebar"), + inventory_image = "technic_rebar.png", +}) + +minetest.register_node(":technic:concrete", { + description = S("Concrete Block"), + tile_images = {"technic_concrete_block.png",}, + groups = {cracky=1, level=2, concrete=1}, + sounds = default.node_sound_stone_defaults(), + after_place_node = function(pos, placer, itemstack) + technic.update_posts(pos, false) + end, + after_dig_node = function (pos, oldnode, oldmetadata, digger) + technic.update_posts(pos, false) + end, +}) + +minetest.register_node(":technic:blast_resistant_concrete", { + description = S("Blast-resistant Concrete Block"), + tile_images = {"technic_blast_resistant_concrete_block.png",}, + groups={cracky=1, level=3, concrete=1}, + sounds = default.node_sound_stone_defaults(), + after_place_node = function(pos, player, itemstack) + technic.update_posts(pos, false) + end, + after_dig_node = function (pos, oldnode, oldmetadata, digger) + technic.update_posts(pos, false) + end, +}) + +minetest.register_node(":technic:concrete_post_platform", { + description = S("Concrete Post Platform"), + tile_images = {"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} + }, + on_place = function (itemstack, placer, pointed_thing) + local node = minetest.get_node(pointed_thing.under) + if not technic.concrete_posts[node.name] then + return minetest.item_place_node(itemstack, placer, pointed_thing) + end + local links = technic.concrete_posts[node.name] + if links[5] ~= 0 then -- The post already has a platform + return minetest.item_place_node(itemstack, placer, pointed_thing) + end + local id = technic.get_post_id({links[1], links[2], links[3], links[4], 1}) + minetest.set_node(pointed_thing.under, {name="technic:concrete_post"..id}) + itemstack:take_item() + placer:set_wielded_item(itemstack) + return itemstack + end, +}) + +local function gen_post_nodebox(x1, x2, z1, z2, platform) + local box = {box_center} + if x1 ~= 0 then + table.insert(box, box_x1) + end + if x2 ~= 0 then + table.insert(box, box_x2) + end + if z1 ~= 0 then + table.insert(box, box_z1) + end + if z2 ~= 0 then + table.insert(box, box_z2) + end + if platform ~= 0 then + table.insert(box, box_platform) + end + return box +end + +local function dig_post_with_platform(pos, oldnode, oldmetadata) + oldnode.name = "technic:concrete_post0" + minetest.set_node(pos, oldnode) + technic.update_posts(pos, true) +end + +function technic.posts_should_connect(pos) + local node = minetest.get_node(pos) + if technic.concrete_posts[node.name] then + return "post" + elseif minetest.get_item_group(node.name, "concrete") ~= 0 then + return "block" + end +end + +function technic.get_post_id(links) + return (links[4] * 1) + (links[3] * 2) + + (links[2] * 4) + (links[1] * 8) + + (links[5] * 16) +end + +function technic.update_posts(pos, set, secondrun) + local node = minetest.get_node(pos) + local link_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}, + } + + local links = {0, 0, 0, 0, 0} + + for i, link_pos in pairs(link_positions) do + local connecttype = technic.posts_should_connect(link_pos) + if connecttype then + links[i] = 1 + -- Have posts next to us update theirselves, + -- but only once. (We don't want to start an + -- infinite loop of updates) + if not secondrun and connecttype == "post" then + technic.update_posts(link_pos, true, true) + end + end + end + -- We don't want to set ourselves if we have been removed or we are + -- updating a concrete node + if set then + -- Preserve platform + local oldlinks = technic.concrete_posts[node.name] + if oldlinks then + links[5] = oldlinks[5] + end + minetest.set_node(pos, {name="technic:concrete_post" + ..technic.get_post_id(links)}) + end +end + +for x1 = 0, 1 do +for x2 = 0, 1 do +for z1 = 0, 1 do +for z2 = 0, 1 do +for platform = 0, 1 do + local links = {x1, x2, z1, z2, platform} + local id = technic.get_post_id(links) + technic.concrete_posts["technic:concrete_post"..id] = links + + local groups = {cracky=1, level=2, concrete_post=1} + if id ~= 0 then + groups.not_in_creative_inventory = 1 + end + + local drop = "technic:concrete_post0" + local after_dig_node = function(pos, oldnode, oldmetadata, digger) + technic.update_posts(pos, false) + end + if platform ~= 0 then + drop = "technic:concrete_post_platform" + after_dig_node = function(pos, oldnode, oldmetadata, digger) + dig_post_with_platform(pos, oldnode, oldmetadata) + end + end + + minetest.register_node(":technic:concrete_post"..id, { + description = S("Concrete Post"), + tiles = {"technic_concrete_block.png"}, + groups = groups, + sounds = default.node_sound_stone_defaults(), + drop = drop, + paramtype = "light", + sunlight_propagates = true, + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = gen_post_nodebox(x1, x2, z1, z2, platform), + }, + after_place_node = function(pos, placer, itemstack) + technic.update_posts(pos, true) + end, + after_dig_node = after_dig_node, + }) +end +end +end +end +end + diff --git a/mods/technic-master/concrete/locale/de.txt b/mods/technic-master/concrete/locale/de.txt new file mode 100644 index 0000000..83fdc19 --- /dev/null +++ b/mods/technic-master/concrete/locale/de.txt @@ -0,0 +1,10 @@ +# German Translation for technic_concrete +# Deutsche Übersetzung von technic_concrete +# by Xanthin + +Rebar = Bewehrungsstab +Concrete Block = Betonblock +Blast-resistant Concrete Block = Explosionsbestaendiger Betonblock +Concrete Post Platform = Betonpfostenplattform +Concrete Post = Betonpfosten + diff --git a/mods/technic-master/concrete/locale/template.txt b/mods/technic-master/concrete/locale/template.txt new file mode 100644 index 0000000..451adaf --- /dev/null +++ b/mods/technic-master/concrete/locale/template.txt @@ -0,0 +1,8 @@ +# technic_concrete translation template + +Rebar = +Concrete Block = +Blast-resistant Concrete Block = +Concrete Post Platform = +Concrete Post = + diff --git a/mods/technic-master/concrete/textures/technic_blast_resistant_concrete_block.png b/mods/technic-master/concrete/textures/technic_blast_resistant_concrete_block.png new file mode 100644 index 0000000..b7d8588 Binary files /dev/null and b/mods/technic-master/concrete/textures/technic_blast_resistant_concrete_block.png differ diff --git a/mods/technic-master/concrete/textures/technic_concrete_block.png b/mods/technic-master/concrete/textures/technic_concrete_block.png new file mode 100644 index 0000000..cd94594 Binary files /dev/null and b/mods/technic-master/concrete/textures/technic_concrete_block.png differ diff --git a/mods/technic-master/concrete/textures/technic_rebar.png b/mods/technic-master/concrete/textures/technic_rebar.png new file mode 100644 index 0000000..16d1fc5 Binary files /dev/null and b/mods/technic-master/concrete/textures/technic_rebar.png differ diff --git a/mods/technic-master/concrete/textures/x32/technic_concrete_block.png b/mods/technic-master/concrete/textures/x32/technic_concrete_block.png new file mode 100644 index 0000000..91364f3 Binary files /dev/null and b/mods/technic-master/concrete/textures/x32/technic_concrete_block.png differ diff --git a/mods/technic-master/concrete/textures/x32/technic_rebar.png b/mods/technic-master/concrete/textures/x32/technic_rebar.png new file mode 100644 index 0000000..16d1fc5 Binary files /dev/null and b/mods/technic-master/concrete/textures/x32/technic_rebar.png differ diff --git a/mods/technic-master/extranodes/depends.txt b/mods/technic-master/extranodes/depends.txt new file mode 100644 index 0000000..6271875 --- /dev/null +++ b/mods/technic-master/extranodes/depends.txt @@ -0,0 +1,6 @@ +default +moreblocks +technic_worldgen +concrete +intllib? + diff --git a/mods/technic-master/extranodes/init.lua b/mods/technic-master/extranodes/init.lua new file mode 100644 index 0000000..934193f --- /dev/null +++ b/mods/technic-master/extranodes/init.lua @@ -0,0 +1,86 @@ +-- Minetest 0.4.6 mod: extranodes +-- namespace: technic +-- Boilerplate to support localized strings if intllib mod is installed. +local S +if intllib then + S = intllib.Getter() +else + S = function(s) return s end +end +--register stairslike nodes +register_stair_slab_panel_micro("technic", "marble", "technic:marble", + {cracky=2, not_in_creative_inventory=1}, + {"technic_marble.png"}, + S("Marble"), + "marble", + "facedir", + 0) + +register_stair_slab_panel_micro("technic", "marble_bricks", "technic:marble_bricks", + {cracky=2, not_in_creative_inventory=1}, + {"technic_marble_bricks.png"}, + S("Marble Bricks"), + "marble_bricks", + "facedir", + 0) + +register_stair_slab_panel_micro("technic", "granite", "technic:granite", + {cracky=1, not_in_creative_inventory=1}, + {"technic_granite.png"}, + S("Granite"), + "granite", + "facedir", + 0) + +register_stair_slab_panel_micro("technic", "concrete", "technic:concrete", + {cracky=3, not_in_creative_inventory=1}, + {"technic_concrete_block.png"}, + S("Concrete"), + "concrete", + "facedir", + 0) + +--register nodes in circular saw if aviable +if circular_saw then + for i,v in ipairs({"concrete", "marble", "marble_bricks", "granite", "default:obsidian"}) do + table.insert(circular_saw.known_stairs, "technic:" ..v); + end +end + + +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") +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") diff --git a/mods/technic-master/extranodes/locale/de.txt b/mods/technic-master/extranodes/locale/de.txt new file mode 100644 index 0000000..f3c017e --- /dev/null +++ b/mods/technic-master/extranodes/locale/de.txt @@ -0,0 +1,9 @@ +# German Translation for technic_extranodes +# Deutsche Übersetzung von technic_extranodes +# by Xanthin + +Marble = Marmor +Marble Bricks = Marmorziegel +Granite = Granit +Concrete = Beton + diff --git a/mods/technic-master/extranodes/locale/template.txt b/mods/technic-master/extranodes/locale/template.txt new file mode 100644 index 0000000..2ffe498 --- /dev/null +++ b/mods/technic-master/extranodes/locale/template.txt @@ -0,0 +1,7 @@ +# technic_extranodes translation template + +Marble = +Marble Bricks = +Granite = +Concrete = + diff --git a/mods/technic-master/manual.md b/mods/technic-master/manual.md new file mode 100644 index 0000000..fb21f45 --- /dev/null +++ b/mods/technic-master/manual.md @@ -0,0 +1,821 @@ +Minetest technic modpack user manual +==================================== + +The technic modpack extends the Minetest game with many new elements, +mainly constructable machines and tools. It is a large modpack, and +tends to dominate gameplay when it is used. This manual describes how +to use the technic modpack, mainly from a player's perspective. + +The technic modpack depends on some other modpacks: + +* the basic Minetest game +* mesecons, which supports the construction of logic systems based on + signalling elements +* pipeworks, which supports the automation of item transport +* moreores, which provides some additional ore types + +This manual doesn't explain how to use these other modpacks, which ought +to (but actually don't) have their own manuals. + +Recipes for constructable items in technic are generally not guessable, +and are also not specifically documented here. You should use a +craft guide mod to look up the recipes in-game. For the best possible +guidance, use the unified\_inventory mod, with which technic registers +its specialised recipe types. + +substances +---------- + +### ore ### + +The technic mod makes extensive use of not just the default ores but also +some that are added by mods. You will need to mine for all the ore types +in the course of the game. Each ore type is found at a specific range of +elevations, and while the ranges mostly overlap, some have non-overlapping +ranges, so you will ultimately need to mine at more than one elevation +to find all the ores. Also, because one of the best elevations to mine +at is very deep, you will be unable to mine there early in the game. + +Elevation is measured in meters, relative to a reference plane that +is not quite sea level. (The standard sea level is at an elevation +of about +1.4.) Positive elevations are above the reference plane and +negative elevations below. Because elevations are always described this +way round, greater numbers when higher, we avoid the word "depth". + +The ores that matter in technic are coal, iron, copper, tin, zinc, +chromium, uranium, silver, gold, mithril, mese, and diamond. + +Coal is part of the basic Minetest game. It is found from elevation ++64 downwards, so is available right on the surface at the start of +the game, but it is far less abundant above elevation 0 than below. +It is initially used as a fuel, driving important machines in the early +part of the game. It becomes less important as a fuel once most of your +machines are electrically powered, but burning fuel remains a way to +generate electrical power. Coal is also used, usually in dust form, as +an ingredient in alloying recipes, wherever elemental carbon is required. + +Iron is part of the basic Minetest game. It is found from elevation ++2 downwards, and its abundance increases in stages as one descends, +reaching its maximum from elevation -64 downwards. It is a common metal, +used frequently as a structural component. In technic, unlike the basic +game, iron is used in multiple forms, mainly alloys based on iron and +including carbon (coal). + +Copper is part of the basic Minetest game (having migrated there from +moreores). It is found from elevation -16 downwards, but is more abundant +from elevation -64 downwards. It is a common metal, used either on its +own for its electrical conductivity, or as the base component of alloys. +Although common, it is very heavily used, and most of the time it will +be the material that most limits your activity. + +Tin is supplied by the moreores mod. It is found from elevation +8 +downwards, with no elevation-dependent variations in abundance beyond +that point. It is a common metal. Its main use in pure form is as a +component of electrical batteries. Apart from that its main purpose is +as the secondary ingredient in bronze (the base being copper), but bronze +is itself little used. Its abundance is well in excess of its usage, +so you will usually have a surplus of it. + +Zinc is supplied by technic. It is found from elevation +2 downwards, +with no elevation-dependent variations in abundance beyond that point. +It is a common metal. Its main use is as the secondary ingredient +in brass (the base being copper), but brass is itself little used. +Its abundance is well in excess of its usage, so you will usually have +a surplus of it. + +Chromium is supplied by technic. It is found from elevation -100 +downwards, with no elevation-dependent variations in abundance beyond +that point. It is a moderately common metal. Its main use is as the +secondary ingredient in stainless steel (the base being iron). + +Uranium is supplied by technic. It is found only from elevation -80 down +to -300; using it therefore requires one to mine above elevation -300 even +though deeper mining is otherwise more productive. It is a moderately +common metal, useful only for reasons related to radioactivity: it forms +the fuel for nuclear reactors, and is also one of the best radiation +shielding materials available. It is not difficult to find enough uranium +ore to satisfy these uses. Beware that the ore is slightly radioactive: +it will slightly harm you if you stand as close as possible to it. +It is safe when more than a meter away or when mined. + +Silver is supplied by the moreores mod. It is found from elevation -2 +downwards, with no elevation-dependent variations in abundance beyond +that point. It is a semi-precious metal. It is little used, being most +notably used in electrical items due to its conductivity, being the best +conductor of all the pure elements. + +Gold is part of the basic Minetest game (having migrated there from +moreores). It is found from elevation -64 downwards, but is more +abundant from elevation -256 downwards. It is a precious metal. It is +little used, being most notably used in electrical items due to its +combination of good conductivity (third best of all the pure elements) +and corrosion resistance. + +Mithril is supplied by the moreores mod. It is found from elevation +-512 downwards, the deepest ceiling of any minable substance, with +no elevation-dependent variations in abundance beyond that point. +It is a rare precious metal, and unlike all the other metals described +here it is entirely fictional, being derived from J. R. R. Tolkien's +Middle-Earth setting. It is little used. + +Mese is part of the basic Minetest game. It is found from elevation +-64 downwards. The ore is more abundant from elevation -256 downwards, +and from elevation -1024 downwards there are also occasional blocks of +solid mese (each yielding as much mese as nine blocks of ore). It is a +precious gemstone, and unlike diamond it is entirely fictional. It is +used in many recipes, though mainly not in large quantities, wherever +some magical quality needs to be imparted. + +Diamond is part of the basic Minetest game (having migrated there from +technic). It is found from elevation -128 downwards, but is more abundant +from elevation -256 downwards. It is a precious gemstone. It is used +moderately, mainly for reasons connected to its extreme hardness. + +### rock ### + +In addition to the ores, there are multiple kinds of rock that need to be +mined in their own right, rather than for minerals. The rock types that +matter in technic are standard stone, desert stone, marble, and granite. + +Standard stone is part of the basic Minetest game. It is extremely +common. As in the basic game, when dug it yields cobblestone, which can +be cooked to turn it back into standard stone. Cobblestone is used in +recipes only for some relatively primitive machines. Standard stone is +used in a couple of machine recipes. These rock types gain additional +significance with technic because the grinder can be used to turn them +into dirt and sand. This, especially when combined with an automated +cobblestone generator, can be an easier way to acquire sand than +collecting it where it occurs naturally. + +Desert stone is part of the basic Minetest game. It is found specifically +in desert biomes, and only from elevation +2 upwards. Although it is +easily accessible, therefore, its quantity is ultimately quite limited. +It is used in a few recipes. + +Marble is supplied by technic. It is found in dense clusters from +elevation -50 downwards. It has mainly decorative use, but also appears +in one machine recipe. + +Granite is supplied by technic. It is found in dense clusters from +elevation -150 downwards. It is much harder to dig than standard stone, +so impedes mining when it is encountered. It has mainly decorative use, +but also appears in a couple of machine recipes. + +### rubber ### + +Rubber is a biologically-derived material that has industrial uses due +to its electrical resistivity and its impermeability. In technic, it +is used in a few recipes, and it must be acquired by tapping rubber trees. + +If you have the moretrees mod installed, the rubber trees you need +are those defined by that mod. If not, technic supplies a copy of the +moretrees rubber tree. + +Extracting rubber requires a specific tool, a tree tap. Using the tree +tap (by left-clicking) on a rubber tree trunk block extracts a lump of +raw latex from the trunk. Each trunk block can be repeatedly tapped for +latex, at intervals of several minutes; its appearance changes to show +whether it is currently ripe for tapping. Each tree has several trunk +blocks, so several latex lumps can be extracted from a tree in one visit. + +Raw latex isn't used directly. It must be vulcanized to produce finished +rubber. This can be performed by simply cooking the latex, with each +latex lump producing one lump of rubber. If you have an extractor, +however, the latex is better processed there: each latex lump will +produce three lumps of rubber. + +### metal ### + +Many of the substances important in technic are metals, and there is +a common pattern in how metals are handled. Generally, each metal can +exist in five forms: ore, lump, dust, ingot, and block. With a couple of +tricky exceptions in mods outside technic, metals are only *used* in dust, +ingot, and block forms. Metals can be readily converted between these +three forms, but can't be converted from them back to ore or lump forms. + +As in the basic Minetest game, a "lump" of metal is acquired directly by +digging ore, and will then be processed into some other form for use. +A lump is thus more akin to ore than to refined metal. (In real life, +metal ore rarely yields lumps ("nuggets") of pure metal directly. +More often the desired metal is chemically bound into the rock as an +oxide or some other compound, and the ore must be chemically processed +to yield pure metal.) + +Not all metals occur directly as ore. Generally, elemental metals (those +consisting of a single chemical element) occur as ore, and alloys (those +consisting of a mixture of multiple elements) do not. In fact, if the +fictional mithril is taken to be elemental, this pattern is currently +followed perfectly. (It is not clear in the Middle-Earth setting whether +mithril is elemental or an alloy.) This might change in the future: +in real life some alloys do occur as ore, and some elemental metals +rarely occur naturally outside such alloys. Metals that do not occur +as ore also lack the "lump" form. + +The basic Minetest game offers a single way to refine metals: cook a lump +in a furnace to produce an ingot. With technic this refinement method +still exists, but is rarely used outside the early part of the game, +because technic offers a more efficient method once some machines have +been built. The grinder, available only in electrically-powered forms, +can grind a metal lump into two piles of metal dust. Each dust pile +can then be cooked into an ingot, yielding two ingots from one lump. +This doubling of material value means that you should only cook a lump +directly when you have no choice, mainly early in the game when you +haven't yet built a grinder. + +An ingot can also be ground back to (one pile of) dust. Thus it is always +possible to convert metal between ingot and dust forms, at the expense +of some energy consumption. Nine ingots of a metal can be crafted into +a block, which can be used for building. The block can also be crafted +back to nine ingots. Thus it is possible to freely convert metal between +ingot and block forms, which is convenient to store the metal compactly. +Every metal has dust, ingot, and block forms. + +Alloying recipes in which a metal is the base ingredient, to produce a +metal alloy, always come in two forms, using the metal either as dust +or as an ingot. If the secondary ingredient is also a metal, it must +be supplied in the same form as the base ingredient. The output alloy +is also returned in the same form. For example, brass can be produced +by alloying two copper ingots with one zinc ingot to make three brass +ingots, or by alloying two piles of copper dust with one pile of zinc +dust to make three piles of brass dust. The two ways of alloying produce +equivalent results. + +### iron and its alloys ### + +Iron forms several important alloys. In real-life history, iron was the +second metal to be used as the base component of deliberately-constructed +alloys (the first was copper), and it was the first metal whose working +required processes of any metallurgical sophistication. The game +mechanics around iron broadly imitate the historical progression of +processes around it, rather than the less-varied modern processes. + +The two-component alloying system of iron with carbon is of huge +importance, both in the game and in real life. The basic Minetest game +doesn't distinguish between these pure iron and these alloys at all, +but technic introduces a distinction based on the carbon content, and +renames some items of the basic game accordingly. + +The iron/carbon spectrum is represented in the game by three metal +substances: wrought iron, carbon steel, and cast iron. Wrought iron +has low carbon content (less than 0.25%), resists shattering, and +is easily welded, but is relatively soft and susceptible to rusting. +In real-life history it was used for rails, gates, chains, wire, pipes, +fasteners, and other purposes. Cast iron has high carbon content +(2.1% to 4%), is especially hard, and resists corrosion, but is +relatively brittle, and difficult to work. Historically it was used +to build large structures such as bridges, and for cannons, cookware, +and engine cylinders. Carbon steel has medium carbon content (0.25% +to 2.1%), and intermediate properties: moderately hard and also tough, +somewhat resistant to corrosion. In real life it is now used for most +of the purposes previously satisfied by wrought iron and many of those +of cast iron, but has historically been especially important for its +use in swords, armor, skyscrapers, large bridges, and machines. + +In real-life history, the first form of iron to be refined was +wrought iron, which is nearly pure iron, having low carbon content. +It was produced from ore by a low-temperature furnace process (the +"bloomery") in which the ore/iron remains solid and impurities (slag) +are progressively removed by hammering ("working", hence "wrought"). +This began in the middle East, around 1800 BCE. + +Historically, the next forms of iron to be refined were those of high +carbon content. This was the result of the development of a more +sophisticated kind of furnace, the blast furnace, capable of reaching +higher temperatures. The real advantage of the blast furnace is that it +melts the metal, allowing it to be cast straight into a shape supplied by +a mould, rather than having to be gradually beaten into the desired shape. +A side effect of the blast furnace is that carbon from the furnace's fuel +is unavoidably incorporated into the metal. Normally iron is processed +twice through the blast furnace: once producing "pig iron", which has +very high carbon content and lots of impurities but lower melting point, +casting it into rough ingots, then remelting the pig iron and casting it +into the final moulds. The result is called "cast iron". Pig iron was +first produced in China around 1200 BCE, and cast iron later in the 5th +century BCE. Incidentally, the Chinese did not have the bloomery process, +so this was their first iron refining process, and, unlike the rest of +the world, their first wrought iron was made from pig iron rather than +directly from ore. + +Carbon steel, with intermediate carbon content, was developed much later, +in Europe in the 17th century CE. It required a more sophisticated +process, because the blast furnace made it extremely difficult to achieve +a controlled carbon content. Tweaks of the blast furnace would sometimes +produce an intermediate carbon content by luck, but the first processes to +reliably produce steel were based on removing almost all the carbon from +pig iron and then explicitly mixing a controlled amount of carbon back in. + +In the game, the bloomery process is represented by ordinary cooking +or grinding of an iron lump. The lump represents unprocessed ore, +and is identified only as "iron", not specifically as wrought iron. +This standard refining process produces dust or an ingot which is +specifically identified as wrought iron. Thus the standard refining +process produces the (nearly) pure metal. + +Cast iron is trickier. You might expect from the real-life notes above +that cooking an iron lump (representing ore) would produce pig iron that +can then be cooked again to produce cast iron. This is kind of the case, +but not exactly, because as already noted cooking an iron lump produces +wrought iron. The game doesn't distinguish between low-temperature +and high-temperature cooking processes: the same furnace is used not +just to cast all kinds of metal but also to cook food. So there is no +distinction between cooking processes to produce distinct wrought iron +and pig iron. But repeated cooking *is* available as a game mechanic, +and is indeed used to produce cast iron: re-cooking a wrought iron ingot +produces a cast iron ingot. So pig iron isn't represented in the game as +a distinct item; instead wrought iron stands in for pig iron in addition +to its realistic uses as wrought iron. + +Carbon steel is produced by a more regular in-game process: alloying +wrought iron with coal dust (which is essentially carbon). This bears +a fair resemblance to the historical development of carbon steel. +This alloying recipe is relatively time-consuming for the amount of +material processed, when compared against other alloying recipes, and +carbon steel is heavily used, so it is wise to alloy it in advance, +when you're not waiting for it. + +There are additional recipes that permit all three of these types of iron +to be converted into each other. Alloying carbon steel again with coal +dust produces cast iron, with its higher carbon content. Cooking carbon +steel or cast iron produces wrought iron, in an abbreviated form of the +bloomery process. + +There's one more iron alloy in the game: stainless steel. It is managed +in a completely regular manner, created by alloying carbon steel with +chromium. + +### uranium enrichment ### + +When uranium is to be used to fuel a nuclear reactor, it is not +sufficient to merely isolate and refine uranium metal. It is necessary +to control its isotopic composition, because the different isotopes +behave differently in nuclear processes. + +The main isotopes of interest are U-235 and U-238. U-235 is good at +sustaining a nuclear chain reaction, because when a U-235 nucleus is +bombarded with a neutron it will usually fission (split) into fragments. +It is therefore described as "fissile". U-238, on the other hand, +is not fissile: if bombarded with a neutron it will usually capture it, +becoming U-239, which is very unstable and quickly decays into semi-stable +(and fissile) plutonium-239. + +Inconveniently, the fissile U-235 makes up only about 0.7% of natural +uranium, almost all of the other 99.3% being U-238. Natural uranium +therefore doesn't make a great nuclear fuel. (In real life there are +a small number of reactor types that can use it, but technic doesn't +have such a reactor.) Better nuclear fuel needs to contain a higher +proportion of U-235. + +Achieving a higher U-235 content isn't as simple as separating the U-235 +from the U-238 and just using the required amount of U-235. Because +U-235 and U-238 are both uranium, and therefore chemically identical, +they cannot be chemically separated, in the way that different elements +are separated from each other when refining metal. They do differ +in atomic mass, so they can be separated by centrifuging, but because +their atomic masses are very close, centrifuging doesn't separate them +very well. They cannot be separated completely, but it is possible to +produce uranium that has the isotopes mixed in different proportions. +Uranium with a significantly larger fissile U-235 fraction than natural +uranium is called "enriched", and that with a significantly lower fissile +fraction is called "depleted". + +A single pass through a centrifuge produces two output streams, one with +a fractionally higher fissile proportion than the input, and one with a +fractionally lower fissile proportion. To alter the fissile proportion +by a significant amount, these output streams must be centrifuged again, +repeatedly. The usual arrangement is a "cascade", a linear arrangement +of many centrifuges. Each centrifuge takes as input uranium with some +specific fissile proportion, and passes its two output streams to the +two adjacent centrifuges. Natural uranium is input somewhere in the +middle of the cascade, and the two ends of the cascade produce properly +enriched and depleted uranium. + +Fuel for technic's nuclear reactor consists of enriched uranium of which +3.5% is fissile. (This is a typical value for a real-life light water +reactor, a common type for power generation.) To enrich uranium in the +game, it must first be in dust form: the centrifuge will not operate +on ingots. (In real life uranium enrichment is done with the uranium +in the form of a gas.) It is best to grind uranium lumps directly to +dust, rather than cook them to ingots first, because this yields twice +as much metal dust. When uranium is in refined form (dust, ingot, or +block), the name of the inventory item indicates its fissile proportion. +Uranium of any available fissile proportion can be put through all the +usual processes for metal. + +A single centrifuge operation takes two uranium dust piles, and produces +as output one dust pile with a fissile proportion 0.1% higher and one with +a fissile proportion 0.1% lower. Uranium can be enriched up to the 3.5% +required for nuclear fuel, and depleted down to 0.0%. Thus a cascade +covering the full range of fissile fractions requires 34 cascade stages. +(In real life, enriching to 3.5% uses thousands of cascade stages. +Also, centrifuging is less effective when the input isotope ratio +is more skewed, so the steps in fissile proportion are smaller for +relatively depleted uranium. Zero fissile content is only asymptotically +approachable, and natural uranium relatively cheap, so uranium is normally +only depleted to around 0.3%. On the other hand, much higher enrichment +than 3.5% isn't much more difficult than enriching that far.) + +Although centrifuges can be used manually, it is not feasible to perform +uranium enrichment by hand. It is a practical necessity to set up +an automated cascade, using pneumatic tubes to transfer uranium dust +piles between centrifuges. Because both outputs from a centrifuge are +ejected into the same tube, sorting tubes are needed to send the outputs +in different directions along the cascade. It is possible to send items +into the centrifuges through the same tubes that take the outputs, so the +simplest version of the cascade structure has a line of 34 centrifuges +linked by a line of 34 sorting tube segments. + +Assuming that the cascade depletes uranium all the way to 0.0%, +producing one unit of 3.5%-fissile uranium requires the input of five +units of 0.7%-fissile (natural) uranium, takes 490 centrifuge operations, +and produces four units of 0.0%-fissile (fully depleted) uranium as a +byproduct. It is possible to reduce the number of required centrifuge +operations by using more natural uranium input and outputting only +partially depleted uranium, but (unlike in real life) this isn't usually +an economical approach. The 490 operations are not spread equally over +the cascade stages: the busiest stage is the one taking 0.7%-fissile +uranium, which performs 28 of the 490 operations. The least busy is the +one taking 3.4%-fissile uranium, which performs 1 of the 490 operations. + +A centrifuge cascade will consume quite a lot of energy. It is +worth putting a battery upgrade in each centrifuge. (Only one can be +accommodated, because a control logic unit upgrade is also required for +tube operation.) An MV centrifuge, the only type presently available, +draws 7 kEU/s in this state, and takes 5 s for each uranium centrifuging +operation. It thus takes 35 kEU per operation, and the cascade requires +17.15 MEU to produce each unit of enriched uranium. It takes five units +of enriched uranium to make each fuel rod, and six rods to fuel a reactor, +so the enrichment cascade requires 514.5 MEU to process a full set of +reactor fuel. This is about 0.85% of the 6.048 GEU that the reactor +will generate from that fuel. + +If there is enough power available, and enough natural uranium input, +to keep the cascade running continuously, and exactly one centrifuge +at each stage, then the overall speed of the cascade is determined by +the busiest stage, the 0.7% stage. It can perform its 28 operations +towards the enrichment of a single uranium unit in 140 s, so that is +the overall cycle time of the cascade. It thus takes 70 min to enrich +a full set of reactor fuel. While the cascade is running at this full +speed, its average power consumption is 122.5 kEU/s. The instantaneous +power consumption varies from second to second over the 140 s cycle, +and the maximum possible instantaneous power consumption (with all 34 +centrifuges active simultaneously) is 238 kEU/s. It is recommended to +have some battery boxes to smooth out these variations. + +If the power supplied to the centrifuge cascade averages less than +122.5 kEU/s, then the cascade can't run continuously. (Also, if the +power supply is intermittent, such as solar, then continuous operation +requires more battery boxes to smooth out the supply variations, even if +the average power is high enough.) Because it's automated and doesn't +require continuous player attention, having the cascade run at less +than full speed shouldn't be a major problem. The enrichment work will +consume the same energy overall regardless of how quickly it's performed, +and the speed will vary in direct proportion to the average power supply +(minus any supply lost because battery boxes filled completely). + +If there is insufficient power to run both the centrifuge cascade at +full speed and whatever other machines require power, all machines on +the same power network as the centrifuge will be forced to run at the +same fractional speed. This can be inconvenient, especially if use +of the other machines is less automated than the centrifuge cascade. +It can be avoided by putting the centrifuge cascade on a separate power +network from other machines, and limiting the proportion of the generated +power that goes to it. + +If there is sufficient power and it is desired to enrich uranium faster +than a single cascade can, the process can be speeded up more economically +than by building an entire second cascade. Because the stages of the +cascade do different proportions of the work, it is possible to add a +second and subsequent centrifuges to only the busiest stages, and have +the less busy stages still keep up with only a single centrifuge each. + +Another possible approach to uranium enrichment is to have no fixed +assignment of fissile proportions to centrifuges, dynamically putting +whatever uranium is available into whichever centrifuges are available. +Theoretically all of the centrifuges can be kept almost totally busy all +the time, making more efficient use of capital resources, and the number +of centrifuges used can be as little (down to one) or as large as desired. +The difficult part is that it is not sufficient to put each uranium dust +pile individually into whatever centrifuge is available: they must be +input in matched pairs. Any odd dust pile in a centrifuge will not be +processed and will prevent that centrifuge from accepting any other input. + +industrial processes +-------------------- + +### alloying ### + +In technic, alloying is a way of combining items to create other items, +distinct from standard crafting. Alloying always uses inputs of exactly +two distinct types, and produces a single output. Like cooking, which +takes a single input, it is performed using a powered machine, known +generically as an "alloy furnace". An alloy furnace always has two +input slots, and it doesn't matter which way round the two ingredients +are placed in the slots. Many alloying recipes require one or both +slots to contain a stack of more than one of the ingredient item: the +quantity required of each ingredient is part of the recipe. + +As with the furnaces used for cooking, there are multiple kinds of alloy +furnace, powered in different ways. The most-used alloy furnaces are +electrically powered. There is also an alloy furnace that is powered +by directly burning fuel, just like the basic cooking furnace. Building +almost any electrical machine, including the electrically-powered alloy +furnaces, requires a machine casing component, one ingredient of which +is brass, an alloy. It is therefore necessary to use the fuel-fired +alloy furnace in the early part of the game, on the way to building +electrical machinery. + +Alloying recipes are mainly concerned with metals. These recipes +combine a base metal with some other element, most often another metal, +to produce a new metal. This is discussed in the section on metal. +There are also a few alloying recipes in which the base ingredient is +non-metallic, such as the recipe for the silicon wafer. + +### grinding, extracting, and compressing ### + +Grinding, extracting, and compressing are three distinct, but very +similar, ways of converting one item into another. They are all quite +similar to the cooking found in the basic Minetest game. Each uses +an input consisting of a single item type, and produces a single +output. They are all performed using powered machines, respectively +known generically as a "grinder", "extractor", and "compressor". +Some compressing recipes require the input to be a stack of more than +one of the input item: the quantity required is part of the recipe. +Grinding and extracting recipes never require such a stacked input. + +There are multiple kinds of grinder, extractor, and compressor. Unlike +cooking furnaces and alloy furnaces, there are none that directly burn +fuel; they are all electrically powered. + +Grinding recipes always produce some kind of dust, loosely speaking, +as output. The most important grinding recipes are concerned with metals: +every metal lump or ingot can be ground into metal dust. Coal can also +be ground into dust, and burning the dust as fuel produces much more +energy than burning the original coal lump. There are a few other +grinding recipes that make block types from the basic Minetest game +more interconvertible: standard stone can be ground to standard sand, +desert stone to desert sand, cobblestone to gravel, and gravel to dirt. + +Extracting is a miscellaneous category, used for a small group +of processes that just don't fit nicely anywhere else. (Its name is +notably vaguer than those of the other kinds of processing.) It is used +for recipes that produce dye, mainly from flowers. (However, for those +recipes using flowers, the basic Minetest game provides parallel crafting +recipes that are easier to use and produce more dye, and those recipes +are not suppressed by technic.) Its main use is to generate rubber from +raw latex, which it does three times as efficiently as merely cooking +the latex. Extracting was also formerly used for uranium enrichment for +use as nuclear fuel, but this use has been superseded by a new enrichment +system using the centrifuge. + +Compressing recipes are mainly used to produce a few relatively advanced +artificial item types, such as the copper and carbon plates used in +advanced machine recipes. There are also a couple of compressing recipes +making natural block types more interconvertible. + +### centrifuging ### + +Centrifuging is another way of using a machine to convert items. +Centrifuging takes an input of a single item type, and produces outputs +of two distinct types. The input may be required to be a stack of +more than one of the input item: the quantity required is part of +the recipe. Centrifuging is only performed by a single machine type, +the MV (electrically-powered) centrifuge. + +Currently, centrifuging recipes don't appear in the unified\_inventory +craft guide, because unified\_inventory can't yet handle recipes with +multiple outputs. + +Generally, centrifuging separates the input item into constituent +substances, but it can only work when the input is reasonably fluid, +and in marginal cases it is quite destructive to item structure. +(In real life, centrifuges require their input to be mainly fluid, that +is either liquid or gas. Few items in the game are described as liquid +or gas, so the concept of the centrifuge is stretched a bit to apply to +finely-divided solids.) + +The main use of centrifuging is in uranium enrichment, where it +separates the isotopes of uranium dust that otherwise appears uniform. +Enrichment is a necessary process before uranium can be used as nuclear +fuel, and the radioactivity of uranium blocks is also affected by its +isotopic composition. + +A secondary use of centrifuging is to separate the components of +metal alloys. This can only be done using the dust form of the alloy. +It recovers both components of binary metal/metal alloys. It can't +recover the carbon from steel or cast iron. + +chests +------ + +The technic mod replaces the basic Minetest game's single type of +chest with a range of chests that have different sizes and features. +The chest types are identified by the materials from which they are made; +the better chests are made from more exotic materials. The chest types +form a linear sequence, each being (with one exception noted below) +strictly more powerful than the preceding one. The sequence begins with +the wooden chest from the basic game, and each later chest type is built +by upgrading a chest of the preceding type. The chest types are: + +1. wooden chest: 8×4 (32) slots +2. iron chest: 9×5 (45) slots +3. copper chest: 12×5 (60) slots +4. silver chest: 12×6 (72) slots +5. gold chest: 15×6 (90) slots +6. mithril chest: 15×6 (90) slots + +The iron and later chests have the ability to sort their contents, +when commanded by a button in their interaction forms. Item types are +sorted in the same order used in the unified\_inventory craft guide. +The copper and later chests also have an auto-sorting facility that can +be enabled from the interaction form. An auto-sorting chest automatically +sorts its contents whenever a player closes the chest. The contents will +then usually be in a sorted state when the chest is opened, but may not +be if pneumatic tubes have operated on the chest while it was closed, +or if two players have the chest open simultaneously. + +The silver and gold chests, but not the mithril chest, have a built-in +sign-like capability. They can be given a textual label, which will +be visible when hovering over the chest. The gold chest, but again not +the mithril chest, can be further labelled with a colored patch that is +visible from a moderate distance. + +The mithril chest is currently an exception to the upgrading system. +It has only as many inventory slots as the preceding (gold) type, and has +fewer of the features. It has no feature that other chests don't have: +it is strictly weaker than the gold chest. It is planned that in the +future it will acquire some unique features, but for now the only reason +to use it is aesthetic. + +The size of the largest chests is dictated by the maximum size +of interaction form that the game engine can successfully display. +If in the future the engine becomes capable of handling larger forms, +by scaling them to fit the screen, the sequence of chest sizes will +likely be revised. + +As with the chest of the basic Minetest game, each chest type comes +in both locked and unlocked flavors. All of the chests work with the +pneumatic tubes of the pipeworks mod. + +electrical power +---------------- + +Most machines in technic are electrically powered. To operate them it is +necessary to construct an electrical power network. The network links +together power generators and power-consuming machines, connecting them +using power cables. + +There are three tiers of electrical networking: low voltage (LV), +medium voltage (MV), and high voltage (HV). Each network must operate +at a single voltage, and most electrical items are specific to a single +voltage. Generally, the machines of higher tiers are more powerful, +but consume more energy and are more expensive to build, than machines +of lower tiers. It is normal to build networks of all three tiers, +in ascending order as one progresses through the game, but it is not +strictly necessary to do this. Building HV equipment requires some parts +that can only be manufactured using electrical machines, either LV or MV, +so it is not possible to build an HV network first, but it is possible +to skip either LV or MV on the way to HV. + +Each voltage has its own cable type, with distinctive insulation. Cable +segments connect to each other and to compatible machines automatically. +Incompatible electrical items don't connect. All non-cable electrical +items must be connected via cable: they don't connect directly to each +other. Most electrical items can connect to cables in any direction, +but there are a couple of important exceptions noted below. + +To be useful, an electrical network must connect at least one power +generator to at least one power-consuming machine. In addition to these +items, the network must have a "switching station" in order to operate: +no energy will flow without one. Unlike most electrical items, the +switching station is not voltage-specific: the same item will manage +a network of any tier. However, also unlike most electrical items, +it is picky about the direction in which it is connected to the cable: +the cable must be directly below the switching station. Due to a bug, +the switching station will visually appear to connect to cables on other +sides, but those connections don't do anything. + +Hovering over a network's switching station will show the aggregate energy +supply and demand, which is useful for troubleshooting. Electrical energy +is measured in "EU", and power (energy flow) in EU per second (EU/s). +Energy is shifted around a network instantaneously once per second. + +In a simple network with only generators and consumers, if total +demand exceeds total supply then no energy will flow, the machines +will do nothing, and the generators' output will be lost. To handle +this situation, it is recommended to add a battery box to the network. +A battery box will store generated energy, and when enough has been +stored to run the consumers for one second it will deliver it to the +consumers, letting them run part-time. It also stores spare energy +when supply exceeds demand, to let consumers run full-time when their +demand occasionally peaks above the supply. More battery boxes can +be added to cope with larger periods of mismatched supply and demand, +such as those resulting from using solar generators (which only produce +energy in the daytime). + +When there are electrical networks of multiple tiers, it can be appealing +to generate energy on one tier and transfer it to another. The most +direct way to do this is with the "supply converter", which can be +directly wired into two networks. It is another tier-independent item, +and also particular about the direction of cable connections: it must +have the cable of one network directly above, and the cable of another +network directly below. The supply converter demands 10000 EU/s from +the network above, and when this network gives it power it supplies 9000 +EU/s to the network below. Thus it is only 90% efficient, unlike most of +the electrical system which is 100% efficient in moving energy around. +To transfer more than 10000 EU/s between networks, connect multiple +supply converters in parallel. + +administrative world anchor +--------------------------- + +A world anchor is an object in the Minetest world that causes the server +to keep surrounding parts of the world running even when no players +are nearby. It is mainly used to allow machines to run unattended: +normally machines are suspended when not near a player. The technic +mod supplies a form of world anchor, as a placable block, but it is not +straightforwardly available to players. There is no recipe for it, so it +is only available if explicitly spawned into existence by someone with +administrative privileges. In a single-player world, the single player +normally has administrative privileges, and can obtain a world anchor +by entering the chat command "/give singleplayer technic:admin\_anchor". + +The world anchor tries to force a cubical area, centred upon the anchor, +to stay loaded. The distance from the anchor to the most distant map +nodes that it will keep loaded is referred to as the "radius", and can be +set in the world anchor's interaction form. The radius can be set as low +as 0, meaning that the anchor only tries to keep itself loaded, or as high +as 255, meaning that it will operate on a 511×511×511 cube. +Larger radii are forbidden, to avoid typos causing the server excessive +work; to keep a larger area loaded, use multiple anchors. Also use +multiple anchors if the area to be kept loaded is not well approximated +by a cube. + +The world is always kept loaded in units of 16×16×16 cubes, +confusingly known as "map blocks". The anchor's configured radius takes +no account of map block boundaries, but the anchor's effect is actually to +keep loaded each map block that contains any part of the configured cube. +The anchor's interaction form includes a status note showing how many map +blocks this is, and how many of those it is successfully keeping loaded. +When the anchor is disabled, as it is upon placement, it will always +show that it is keeping no map blocks loaded; this does not indicate +any kind of failure. + +The world anchor can optionally be locked. When it is locked, only +the anchor's owner, the player who placed it, can reconfigure it or +remove it. Only the owner can lock it. Locking an anchor is useful +if the use of anchors is being tightly controlled by administrators: +an administrator can set up a locked anchor and be sure that it will +not be set by ordinary players to an unapproved configuration. + +The server limits the ability of world anchors to keep parts of the world +loaded, to avoid overloading the server. The total number of map blocks +that can be kept loaded in this way is set by the server configuration +item "max\_forceloaded\_blocks" (in minetest.conf), which defaults to +only 16. For comparison, each player normally keeps 125 map blocks loaded +(a radius of 32). If an enabled world anchor shows that it is failing to +keep all the map blocks loaded that it would like to, this can be fixed +by increasing max\_forceloaded\_blocks by the amount of the shortfall. + +The tight limit on force-loading is the reason why the world anchor is +not directly available to players. With the limit so low both by default +and in common practice, the only feasible way to determine where world +anchors should be used is for administrators to decide it directly. + +subjects missing from this manual +--------------------------------- + +This manual needs to be extended with sections on: + +* substances + * concrete +* powered machines + * machine upgrades + * how machines interact with tubes + * battery box + * processing machines + * CNC machine + * music player + * tool workshop + * forcefield emitter + * quarry +* power generators + * hydro + * geothermal + * fuel-fired + * wind + * solar + * nuclear +* tools + * tool charging + * battery and energy crystals + * chainsaw + * flashlight + * mining lasers + * liquid cans + * mining drills + * prospector + * sonic screwdriver + * wrench +* radioactivity +* frames +* templates diff --git a/mods/technic-master/modpack.txt b/mods/technic-master/modpack.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/mods/technic-master/modpack.txt @@ -0,0 +1 @@ + diff --git a/mods/technic-master/technic/README.md b/mods/technic-master/technic/README.md new file mode 100644 index 0000000..89e838b --- /dev/null +++ b/mods/technic-master/technic/README.md @@ -0,0 +1,24 @@ +Technic +======= + +License +------- + +Copyright (C) 2012-2014 Maciej Kasatkin (RealBadAngel) + +Technic chests code is licensed under the GNU LGPLv2+. + +Texture licenses: + +BlockMen modified by Zefram (CC BY-SA 3.0): + * technic_chernobylite_block.png + * technic_corium_flowing_animated.png + * technic_corium_source_animated.png + +celeron55 (Perttu Ahola) modified by Zefram (CC BY-SA 3.0): + * technic_bucket_corium.png + +RealBadAngel: (WTFPL) + * Everything else. + +CC BY-SA 3.0: diff --git a/mods/technic-master/technic/config.lua b/mods/technic-master/technic/config.lua new file mode 100644 index 0000000..e512bee --- /dev/null +++ b/mods/technic-master/technic/config.lua @@ -0,0 +1,17 @@ +technic.config = technic.config or Settings(minetest.get_worldpath().."/technic.conf") + +local conf_table = technic.config:to_table() + +local defaults = { + enable_mining_drill = "true", + enable_mining_laser = "true", + enable_flashlight = "false", + enable_wind_mill = "false", + enable_corium_griefing = "true", +} + +for k, v in pairs(defaults) do + if conf_table[k] == nil then + technic.config:set(k, v) + end +end diff --git a/mods/technic-master/technic/crafts.lua b/mods/technic-master/technic/crafts.lua new file mode 100644 index 0000000..29ff0d0 --- /dev/null +++ b/mods/technic-master/technic/crafts.lua @@ -0,0 +1,202 @@ +-- tubes crafting recipes + +minetest.register_craft({ + output = 'pipeworks:accelerator_tube_1', + recipe = { + {'technic:copper_coil', 'pipeworks:tube_1', 'technic:copper_coil'}, + } +}) + +minetest.register_craft({ + 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'}, + } +}) + +minetest.register_craft({ + 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'}, + } +}) + +minetest.register_craft({ + 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'}, + } +}) + +minetest.register_craft({ + 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'}, + } +}) + +minetest.register_craft({ + 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'}, + } +}) + +minetest.register_craft({ + output = 'technic:fine_copper_wire 2', + recipe = { + {'', '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', ''}, + } +}) + +minetest.register_craft({ + output = 'technic:fine_silver_wire 2', + recipe = { + {'', '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'}, + } +}) + +minetest.register_craft({ + 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'}, + } +}) + +minetest.register_craft({ + output = 'technic:lv_transformer', + recipe = { + {'mesecons_materials:fiber', 'technic:wrought_iron_ingot', 'mesecons_materials:fiber'}, + {'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', + recipe = { + {'mesecons_materials:fiber', 'technic:carbon_steel_ingot', 'mesecons_materials:fiber'}, + {'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', + recipe = { + {'mesecons_materials:fiber', 'technic:stainless_steel_ingot', 'mesecons_materials:fiber'}, + {'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', + recipe = { + {'', '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'}, + } +}) + +minetest.register_craft({ + output = 'technic:carbon_cloth', + recipe = { + {'technic:graphite', 'technic:graphite', 'technic:graphite'} + } +}) + +minetest.register_craft({ + output = "technic:machine_casing", + recipe = { + { "technic:cast_iron_ingot", "technic:cast_iron_ingot", "technic:cast_iron_ingot" }, + { "technic:cast_iron_ingot", "technic:brass_ingot", "technic:cast_iron_ingot" }, + { "technic:cast_iron_ingot", "technic:cast_iron_ingot", "technic:cast_iron_ingot" }, + }, +}) + +-- Remove some recipes +minetest.register_craftitem("technic:nothing", { + description = "", + inventory_image = "blank.png", + groups = { not_in_creative_inventory = 1 }, +}) + +if minetest.register_craft_predict then + minetest.register_craft_predict(function(itemstack, player, old_craft_grid, craft_inv) + if itemstack:get_name() == "technic:nothing" then + return ItemStack("") + end + end) +end + +-- Bronze +minetest.register_craft({ + type = "shapeless", + output = "technic:nothing", + recipe = {"default:copper_ingot", "default:steel_ingot"} +}) + +-- Accelerator tube +minetest.register_craft({ + output = "technic:nothing", + recipe = { + { "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" }, + { "default:mese_crystal_fragment", "default:steel_ingot", "default:mese_crystal_fragment" }, + { "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" } + }, +}) + +-- Teleport tube +minetest.register_craft({ + output = "technic:nothing", + recipe = { + { "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" }, + { "default:desert_stone", "default:mese_block", "default:desert_stone" }, + { "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" } + }, +}) + diff --git a/mods/technic-master/technic/depends.txt b/mods/technic-master/technic/depends.txt new file mode 100644 index 0000000..c2671c5 --- /dev/null +++ b/mods/technic-master/technic/depends.txt @@ -0,0 +1,7 @@ +default +pipeworks +technic_worldgen +bucket? +mesecons_mvps? +intllib? +unified_inventory? diff --git a/mods/technic-master/technic/helpers.lua b/mods/technic-master/technic/helpers.lua new file mode 100644 index 0000000..c07937a --- /dev/null +++ b/mods/technic-master/technic/helpers.lua @@ -0,0 +1,38 @@ +-- Only changes name, keeps other params +function technic.swap_node(pos, name) + local node = minetest.get_node(pos) + if node.name ~= name then + node.name = name + minetest.swap_node(pos, node) + end + return node.name +end + +-- Fully charge RE chargeable item. +-- Must be defined early to reference in item definitions. +function technic.refill_RE_charge(stack) + local max_charge = technic.power_tools[stack:get_name()] + if not max_charge then return stack end + technic.set_RE_wear(stack, max_charge, max_charge) + local meta = minetest.deserialize(stack:get_metadata()) or {} + meta.charge = max_charge + stack:set_metadata(minetest.serialize(meta)) + return stack +end + +local function resolve_name(function_name) + local a = _G + for key in string.gmatch(function_name, "([^%.]+)(%.?)") do + if a[key] then + a = a[key] + else + return nil + end + end + return a +end + +function technic.function_exists(function_name) + return type(resolve_name(function_name)) == 'function' +end + diff --git a/mods/technic-master/technic/init.lua b/mods/technic-master/technic/init.lua new file mode 100644 index 0000000..28427da --- /dev/null +++ b/mods/technic-master/technic/init.lua @@ -0,0 +1,53 @@ +-- Minetest 0.4.7 mod: technic +-- namespace: technic +-- (c) 2012-2013 by RealBadAngel + +technic = technic or {} + +technic.tube_inject_item = pipeworks.tube_inject_item or function (pos, start_pos, velocity, item) + local tubed = pipeworks.tube_item(vector.new(pos), item) + tubed:get_luaentity().start_pos = vector.new(start_pos) + tubed:setvelocity(velocity) + tubed:setacceleration(vector.new(0, 0, 0)) +end + +local load_start = os.clock() +local modpath = minetest.get_modpath("technic") +technic.modpath = modpath + +-- Boilerplate to support intllib +if intllib then + technic.getter = intllib.Getter() +else + technic.getter = function(s) return s end +end +local S = technic.getter + +-- Read configuration file +dofile(modpath.."/config.lua") + +-- Helper functions +dofile(modpath.."/helpers.lua") + +-- Items +dofile(modpath.."/items.lua") + +-- Craft recipes for items +dofile(modpath.."/crafts.lua") + +-- Register functions +dofile(modpath.."/register.lua") + +-- Machines +dofile(modpath.."/machines/init.lua") + +-- Tools +dofile(modpath.."/tools/init.lua") + +-- Aliases for legacy node/item names +dofile(modpath.."/legacy.lua") + +if minetest.setting_getbool("log_mods") then + print(S("[Technic] Loaded in %f seconds"):format(os.clock() - load_start)) +end + diff --git a/mods/technic-master/technic/items.lua b/mods/technic-master/technic/items.lua new file mode 100644 index 0000000..3c00dd9 --- /dev/null +++ b/mods/technic-master/technic/items.lua @@ -0,0 +1,225 @@ + +local S = technic.getter + +minetest.register_craftitem("technic:silicon_wafer", { + description = S("Silicon Wafer"), + inventory_image = "technic_silicon_wafer.png", +}) + +minetest.register_craftitem( "technic:doped_silicon_wafer", { + description = S("Doped Silicon Wafer"), + inventory_image = "technic_doped_silicon_wafer.png", +}) + +minetest.register_craftitem("technic:uranium_fuel", { + description = S("Uranium Fuel"), + inventory_image = "technic_uranium_fuel.png", +}) + +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", + "technic_diamond_block_blue.png", + "technic_diamond_block_blue.png"), + wear_represents = "technic_RE_charge", + on_refill = technic.refill_RE_charge, + tool_capabilities = { + max_drop_level = 0, + groupcaps = { + 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", + "technic_diamond_block_green.png", + "technic_diamond_block_green.png"), + wear_represents = "technic_RE_charge", + on_refill = technic.refill_RE_charge, + tool_capabilities = { + max_drop_level = 0, + groupcaps = { + 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", + "technic_diamond_block_red.png", + "technic_diamond_block_red.png"), + wear_represents = "technic_RE_charge", + on_refill = technic.refill_RE_charge, + tool_capabilities = { + max_drop_level = 0, + groupcaps = { + fleshy = {times={}, uses=10000, maxlevel=0} + } + } +}) + + +minetest.register_craftitem("technic:fine_copper_wire", { + description = S("Fine Copper Wire"), + inventory_image = "technic_fine_copper_wire.png", +}) + +minetest.register_craftitem("technic:fine_gold_wire", { + description = S("Fine Gold Wire"), + inventory_image = "technic_fine_gold_wire.png", +}) + +minetest.register_craftitem("technic:fine_silver_wire", { + description = S("Fine Silver Wire"), + inventory_image = "technic_fine_silver_wire.png", +}) + +minetest.register_craftitem("technic:copper_coil", { + description = S("Copper Coil"), + inventory_image = "technic_copper_coil.png", +}) + +minetest.register_craftitem("technic:motor", { + description = S("Electric Motor"), + inventory_image = "technic_motor.png", +}) + +minetest.register_craftitem("technic:lv_transformer", { + description = S("Low Voltage Transformer"), + inventory_image = "technic_lv_transformer.png", +}) + +minetest.register_craftitem("technic:lv_transformer", { + description = S("Low Voltage Transformer"), + inventory_image = "technic_lv_transformer.png", +}) +minetest.register_craftitem("technic:mv_transformer", { + description = S("Medium Voltage Transformer"), + inventory_image = "technic_mv_transformer.png", +}) + +minetest.register_craftitem( "technic:hv_transformer", { + description = S("High Voltage Transformer"), + inventory_image = "technic_hv_transformer.png", +}) + +minetest.register_craftitem( "technic:control_logic_unit", { + description = S("Control Logic Unit"), + inventory_image = "technic_control_logic_unit.png", +}) + +minetest.register_craftitem("technic:mixed_metal_ingot", { + description = S("Mixed Metal Ingot"), + inventory_image = "technic_mixed_metal_ingot.png", +}) + +minetest.register_craftitem("technic:composite_plate", { + description = S("Composite Plate"), + inventory_image = "technic_composite_plate.png", +}) + +minetest.register_craftitem("technic:copper_plate", { + description = S("Copper Plate"), + inventory_image = "technic_copper_plate.png", +}) + +minetest.register_craftitem("technic:carbon_plate", { + description = S("Carbon Plate"), + inventory_image = "technic_carbon_plate.png", +}) + +minetest.register_craftitem("technic:graphite", { + description = S("Graphite"), + inventory_image = "technic_graphite.png", +}) + +minetest.register_craftitem("technic:carbon_cloth", { + description = S("Carbon Cloth"), + inventory_image = "technic_carbon_cloth.png", +}) + +minetest.register_node("technic:machine_casing", { + description = S("Machine Casing"), + groups = {cracky=2}, + sunlight_propagates = true, + paramtype = "light", + drawtype = "allfaces", + tiles = {"technic_machine_casing.png"}, + sounds = default.node_sound_stone_defaults(), +}) + +for p = 0, 35 do + local nici = (p ~= 0 and p ~= 7 and p ~= 35) and 1 or nil + local psuffix = p == 7 and "" or p + local ingot = "technic:uranium"..psuffix.."_ingot" + 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), + inventory_image = "technic_uranium_ingot.png", + groups = {uranium_ingot=1, not_in_creative_inventory=nici}, + }); + -- Note on radioactivity of blocks: + -- Source: + -- The baseline radioactivity of an isotope is not especially + -- correlated with whether it's fissile (i.e., suitable as + -- reactor fuel). Natural uranium consists mainly of fissile + -- U-235 and non-fissile U-238, and both U-235 and U-238 are + -- significantly radioactive. U-235's massic activity is + -- about 80.0 MBq/kg, and U-238's is about 12.4 MBq/kg, which + -- superficially suggests that 3.5%-fissile uranium should have + -- only 1.19 times the activity of fully-depleted uranium. + -- But a third isotope affects the result hugely: U-234 has + -- massic activity of 231 GBq/kg. Natural uranium has massic + -- composition of 99.2837% U-238, 0.711% U-235, and 0.0053% U-234, + -- so its activity comes roughly 49% each from U-234 and U-238 + -- and only 2% from U-235. During enrichment via centrifuge, + -- the U-234 fraction is concentrated along with the U-235, with + -- the U-234:U-235 ratio remaining close to its original value. + -- (Actually the U-234 gets separated from U-238 slightly more + -- than the U-235 is, so the U-234:U-235 ratio is slightly + -- higher in enriched uranium.) A typical massic composition + -- for 3.5%-fissile uranium is 96.47116% U-238, 3.5% U-235, and + -- 0.02884% U-234. This gives 3.5%-fissile uranium about 6.55 + -- times the activity of fully-depleted uranium. The values we + -- compute here for the "radioactive" group value are based on + -- linear interpolation of activity along that scale, rooted at + -- a natural (0.7%-fissile) uranium block having the activity of + -- 9 uranium ore blocks (due to 9 ingots per block). The group + -- value is proportional to the square root of the activity, + -- and uranium ore has radioactive=1. This yields radioactive=2 + -- for a fully-depleted uranium block and radioactive=5 for a + -- 3.5%-fissile uranium block. + (ov or minetest.register_node)(block, { + 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=math.floor(math.sqrt((1+5.55*p/35) * 9 / (1+5.55*7/35)) + 0.5)}, + 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}, + }, + }) + minetest.register_craft({ + output = ingot.." 9", + recipe = {{block}}, + }) + end +end diff --git a/mods/technic-master/technic/legacy.lua b/mods/technic-master/technic/legacy.lua new file mode 100644 index 0000000..8360a71 --- /dev/null +++ b/mods/technic-master/technic/legacy.lua @@ -0,0 +1,38 @@ + +-- Aliases to convert from legacy node/item names + +technic.legacy_nodenames = { + ["technic:alloy_furnace"] = "technic:lv_alloy_furnace", + ["technic:alloy_furnace_active"] = "technic:lv_alloy_furnace_active", + ["technic:battery_box"] = "technic:lv_battery_box0", + ["technic:battery_box1"] = "technic:lv_battery_box1", + ["technic:battery_box2"] = "technic:lv_battery_box2", + ["technic:battery_box3"] = "technic:lv_battery_box3", + ["technic:battery_box4"] = "technic:lv_battery_box4", + ["technic:battery_box5"] = "technic:lv_battery_box5", + ["technic:battery_box6"] = "technic:lv_battery_box6", + ["technic:battery_box7"] = "technic:lv_battery_box7", + ["technic:battery_box8"] = "technic:lv_battery_box8", + ["technic:electric_furnace"] = "technic:lv_electric_furnace", + ["technic:electric_furnace_active"] = "technic:lv_electric_furnace_active", + ["technic:grinder"] = "technic:lv_grinder", + ["technic:grinder_active"] = "technic:lv_grinder_active", + ["technic:extractor"] = "technic:lv_extractor", + ["technic:extractor_active"] = "technic:lv_extractor_active", + ["technic:compressor"] = "technic:lv_compressor", + ["technic:compressor_active"] = "technic:lv_compressor_active", + ["technic:hv_battery_box"] = "technic:hv_battery_box0", + ["technic:hv_cable"] = "technic:hv_cable0", + ["technic:lv_cable"] = "technic:lv_cable0", + ["technic:mv_cable"] = "technic:mv_cable0", + ["technic:mv_battery_box"] = "technic:mv_battery_box0", + ["technic:generator"] = "technic:lv_generator", + ["technic:generator_active"] = "technic:lv_generator_active", + ["technic:iron_dust"] = "technic:wrought_iron_dust", + ["technic:enriched_uranium"] = "technic:uranium35_ingot", +} + +for old, new in pairs(technic.legacy_nodenames) do + minetest.register_alias(old, new) +end + diff --git a/mods/technic-master/technic/locale/de.txt b/mods/technic-master/technic/locale/de.txt new file mode 100644 index 0000000..31ea107 --- /dev/null +++ b/mods/technic-master/technic/locale/de.txt @@ -0,0 +1,199 @@ +# German Translation for Technic Mod +# Deutsche Uebersetzung des Technic Mods +# by Xanthin + +## Misc +[Technic] Loaded in %f seconds = [Technic] ist in %f Sekunden geladen + +## Items +Silicon Wafer = Siliziumscheibe +Doped Silicon Wafer = Dotierte Siliziumscheibe +Enriched Uranium = Angereichertes Uran +Uranium Fuel = Uranbrennstoff +Diamond Drill Head = Diamantbohrkopf +Blue Energy Crystal = Blauer Energiekristall +Green Energy Crystal = Gruener Energiekristall +Red Energy Crystal = Roter Energiekristall +Fine Copper Wire = Feinkupferdraht +Copper Coil = Kupferspule +Electric Motor = Elektromotor +Low Voltage Transformer = Niederspannungstransformator +Medium Voltage Transformer = Mittelspannungstransformator +High Voltage Transformer = Hochspannungstransformator +Control Logic Unit = Steuer- und Regelungseinheit +Mixed Metal Ingot = Mischmetallbarren +Composite Plate = Verbundplatte +Copper Plate = Kupferplatte +Carbon Plate = Kohlefaserplatte +Graphite = Graphit +Carbon Cloth = Kohlefasergewebe +Raw Latex = Rohlatex +Rubber Fiber = Gummifaser +%.1f%%-Fissile Uranium Ingot = +%.1f%%-Fissile Uranium Block = + +## Machine misc +Machine cannot be removed because it is not empty = Die Maschine kann nicht entfernt werden, weil sie noch nicht leer ist. +Inventory move disallowed due to protection = Das Inventar ist geschuetzt, Zugriff verweigert. +# $1: Machine name (Includes tier) +%s Active = %s ist eingeschaltet +%s Disabled = %s ist ausgeschaltet +%s Enabled = +%s Idle = %s ist bereit +%s Improperly Placed = %s ist falsch plaziert +%s Unpowered = %s hat keine Stromversorgung +%s Out Of Fuel = %s hat keinen Brennstoff +%s Has Bad Cabling = %s ist falsch verkabelt +%s Has No Network = %s hat kein Netzwerk +%s Finished = %s ist fertig +Enable/Disable = Einschalten/Ausschalten +Range = Reichweite +Upgrade Slots = Verbesserungsfaecher +In: = Rein: +Out: = Raus: +Slot %d = Fach %d +Itemwise = Einzelstuecke +Stackwise = Ganzer Stapel +Owner: = +Unlocked = +Locked = +Radius: = +Enabled = +Disabled = + +## Machine names +# $1: Tier +%s Alloy Furnace = %s Legierungsofen +%s Battery Box = %s Batteriebox +%s Cable = %s Kabel +%s CNC Machine = %s CNC-Maschine +%s Compressor = %s Kompressor +%s Extractor = %s Extraktor +%s Forcefield Emitter = %s Kraftfeld-Emitter +%s Furnace = %s Ofen +%s Grinder = %s Schleifmaschine +%s Music Player = %s Musikspieler +%s Quarry = %s Steinbruch +%s Tool Workshop = %s Werkzeugwerkstatt +Arrayed Solar %s Generator = %s Solaranlage +Fuel-Fired %s Generator = %s Kohle-Generator +Geothermal %s Generator = %s Geothermie-Generator +Hydro %s Generator = %s Wassermuehle +Nuclear %s Generator Core = %s Reaktorkern +Small Solar %s Generator = %s Solarmodul +Wind %s Generator = %s Windmuehle +Self-Contained Injector = Selbstversorger-Injektor +Constructor Mk%d = Konstruktor Modell %d +Frame = Rahmen +Frame Motor = Rahmenmotor +Template = Schablone +Template (replacing) = Schablone (ersetzend) +Template motor = Schablonenmotor +Template tool = Schablonenwerkzeug +Battery Box = Batteriebox +Supply Converter = Stromumwandler +Switching Station = Schaltanlage +Fuel-Fired Alloy Furnace = Kohle-Legierungsofen +Fuel-Fired Furnace = Kohle-Ofen +Wind Mill Frame = Windmuehlengeruest +Forcefield = Kraftfeld +Nuclear Reactor Rod Compartment = Brennstabfaecher +Administrative World Anchor = + +## Machine-specific +# $1: Pruduced EU +Charge = Aufladen +Discharge = Entladen +Power level = Energiestufe +# $1: Tier $2: current_charge $3: max_charge +%s Battery Box: %d/%d = %s Batteriebox: %d/%d +# $1: Machine name $2: Supply $3: Demand +%s. Supply: %d Demand: %d = %s. Versorgung: %d Bedarf: %d +Production at %d%% = Produktion bei %d%% +Choose Milling Program: = Waehle ein Fraesprogramm: +Slim Elements half / normal height: = Schmale Elemente von halber / normaler Hoehe: +Current track %s = Aktueller Titel %s +Stopped = +Keeping %d/%d map blocks loaded = + +## CNC +Cylinder = Zylinder +Element Cross = Halbes Kreuzelement +Element Cross Double = Kreuzelement +Element Edge = Halbes Eckelement +Element Edge Double = Eckelement +Element End = Halbes Endelement +Element End Double = Endelement +Element Straight = Halbes aufrechtes Element +Element Straight Double = Aufrechtes Element +Element T = Halbes T-Element +Element T Double = T-Element +Horizontal Cylinder = Liegender Zylinder +One Curved Edge Block = Block mit einer abgerundeten Kante +Pyramid = Pyramide +Slope = Schraege +Slope Edge = Schraege mit Ecke +Slope Inner Edge = Schraege mit Innenecke +Slope Lying = Liegende Schraege +Slope Upside Down = Umgedrehte Schraege +Slope Upside Down Edge = Umgedrehte Schraege mit Ecke +Slope Upside Down Inner Edge = Umgedrehte Schraege mit Innenecke +Sphere = Kugel +Spike = Spitze +Stick = Stange +Two Curved Edge Block = Block mit zwei abgerundeten Kanten +Brick = Ziegel: +Cobble = Pflasterstein: +Dirt = Erde: +Leaves = Laub: +Sandstone = Sandstein: +Stone = Stein: +Tree = Baumstamm: +Wooden = Holz: + +## Grinder Recipes +# $1: Name +%s Dust = %sstaub +Akalin = Akalin +Alatro = Alatro +Arol = Arol +Brass = Messing +Bronze = Bronze +Carbon Steel = Kohlenstoffstahl +Cast Iron = Gusseisen +Chromium = Chrom +Coal = Kohle +Copper = Kupfer +Gold = Gold +Mithril = Mithril +Silver = Silber +Stainless Steel = Edelstahl +Talinite = Talinite +Tin = Zinn +Wrought Iron = Schmiedeeisen +Zinc = Zink +%.1f%%-Fissile Uranium = + +## Tools +RE Battery = Akkubatterie +Water Can = Wasserkanister +Lava Can = Lavakanister +Chainsaw = Kettensaege +Flashlight = Taschenlampe +3 nodes deep. = 3 Bloecke tief. +3 nodes tall. = 3 Bloecke hoch. +3 nodes wide. = 3 Bloecke breit. +3x3 nodes. = 3x3 Bloecke. +Use while sneaking to change Mining Drill Mk%d modes. = Halte die Shift-Taste beim Benutzen gedrueckt, um die Funktion des Bergbaubohrers Modell %d zu aendern. +Mining Drill Mk%d Mode %d = Bergbaubohrer Modell %d Funktion %d +Mining Drill Mk%d = Bergbaubohrer Modell %d +Mining Laser Mk%d = Bergbaulaser Modell %d +Single node. = Einzelblock +Sonic Screwdriver = Schallschraubendreher +Tree Tap = Baumzapfhahn + +## Craft descriptions +Alloy cooking = +Grinding = +Compressing = +Extracting = diff --git a/mods/technic-master/technic/locale/es.txt b/mods/technic-master/technic/locale/es.txt new file mode 100644 index 0000000..80a5736 --- /dev/null +++ b/mods/technic-master/technic/locale/es.txt @@ -0,0 +1,192 @@ +# Spanish Translation for Technic Mod +# Traduccion al Español del Mod Technic +# Autor: Diego Martínez + +## Misc +[Technic] Loaded in %f seconds = [Technic] Cargado en %f segundos + +## Items +Silicon Wafer = Oblea de Silicio +Doped Silicon Wafer = Oblea de Silicio Dopada +Enriched Uranium = Uranio Enriquecido +Uranium Fuel = Combustible de Uranio +Diamond Drill Head = Mecha de Taladro de Diamante +Blue Energy Crystal = Cristal de Energia Azul +Green Energy Crystal = Cristal de Energia Verde +Red Energy Crystal = Cristal de Energia Rojo +Fine Copper Wire = Cable Fino de Cobre +Copper Coil = Resorte de Cobre +Electric Motor = Motor Electrico +Low Voltage Transformer = Transformador de Bajo Voltaje +Medium Voltage Transformer = Transformador de Voltaje Medio +High Voltage Transformer = Transformador de Alto Voltaje +Control Logic Unit = Unidad Logica de Control +Mixed Metal Ingot = Lingote de Metal Mezclado +Composite Plate = Placa de Compuestos +Copper Plate = Placa de Cobre +Carbon Plate = Placa de Carbon +Graphite = Grafito +Carbon Cloth = Tela de Carbon +Raw Latex = Latex Crudo +Rubber Fiber = Fibra de Hule +%.1f%%-Fissile Uranium Ingot = +%.1f%%-Fissile Uranium Block = + +## Machine misc +Machine cannot be removed because it is not empty = La maquina no puede removerse porque no esta vacia +Inventory move disallowed due to protection = +# $1: Machine name (Includes tier) +%s Active = %s Activo +%s Enabled = +%s Idle = %s Quieto +%s Unpowered = %s Sin Energia +%s Out Of Fuel = %s Sin Combustible +%s Has Bad Cabling = %s Tiene Mal Cableado +%s Has No Network = %s No Tiene Una Red +%s Finished = %s Terminado +%s Disabled = %s Deshabilitado +%s Improperly Placed = %s No Colocado Apropiadamente +Range = Alcance +Enable/Disable = Habilitar/Deshabilitar +Itemwise = +Stackwise = +Owner: = +Unlocked = +Locked = +Radius: = +Enabled = +Disabled = + +## Machine names +# $1: Tier +%s Alloy Furnace = Horno de Aleacion %s +%s Battery Box = Caja de Bateria %s +%s Cable = Cable %s +%s CNC Machine = Maquina CNC %s +%s Compressor = Compresor %s +%s Extractor = Extractor %s +%s Forcefield Emitter = Emisor de Campo de Fuerza %s +%s Furnace = Horno %s +%s Grinder = Amoladora %s +%s Music Player = Reproductor de Musica %s +%s Quarry = Cantera %s +%s Tool Workshop = Taller de Herramientas %s +Arrayed Solar %s Generator = Panel Solar %s +Fuel-Fired %s Generator = Generador a Carbon %s +Geothermal %s Generator = Generador Geotermico %s +Hydro %s Generator = Molino de Agua %s +Nuclear %s Generator Core = Nucleo de Reactor Nuclear %s +Small Solar %s Generator = Panel Solar %s +Wind %s Generator = Molino de Viento %s +Self-Contained Injector = +Constructor Mk%d = +Frame = +Frame Motor = +Template = +Template (replacing) = +Template Motor = +Template Tool = +Supply Converter = Convertidor de Alimentacion +Switching Station = Estacion de Conmutacion +Battery Box = Caja de Baterias +Fuel-Fired Alloy Furnace = Horno de Aleacion a Carbon +Fuel-Fired Furnace = Horno a Carbon +Forcefield = Campo de Fuerza +Nuclear Reactor Rod Compartment = Compartimiento para Vara de Reactor Nuclear +Wind Mill Frame = Armazon de Molino de Viento +Administrative World Anchor = + +## Machine-specific +# $1: Pruduced EU +Charge = Cargar +Discharge = Descargar +Power level = Nivel de Poder +# $1: Tier $2: current_charge $3: max_charge +%s Battery Box: %d/%d = Caja de Bateria %s: %d/%d +# $1: Machine name $2: Supply $3: Demand +%s. Supply: %d Demand: %d = %s. Alimentacion: %d Demanda: %d +# $1: Production percent +Production at %d%% = Produccion en %d%% +Stopped = +Keeping %d/%d map blocks loaded = + +## CNC Machine +Element Edge = Elemento Borde +Tree = Arbol +Element Cross Double = Elemento Cruz Doble +Spike = Pica +Element Edge Double = Elemento Borde Doble +Two Curved Edge Block = Dos Bloques de Borde Curvados +Pyramid = Piramide +Slope Upside Down Inner Edge = Borde Interno de Rampa Al Reves +Slope Upside Down Edge = Borde de Rampa Al Reves +Element Straight Double = Elemento Doble Recto +Sphere = Esfera +Element End Double = Doble Fin de Elemento +Element Straight = Recta de Elemento +Horizontal Cylinder = Cilindro Horizontal +Slope Inner Edge = Borde Interno de Rampa +One Curved Edge Block = Un Bloque de Borde Curvado +Element Cross = Cruce de Elementos +Stick = Varita +Element End = Fin de Elemento +Slope Lying = Rampa en Reposo +Slope Upside Down = Rampa Al Reves +Slope Edge = Borde de Rampa +Slope = Rampa +Element T = Elemento T +Cylinder = Cilindro +Cobble = Adoquines +Stone = Piedra +Brick = Ladrillo +Dirt = Tierra +Sandstone = Arenisca +Wooden = Madera +Leaves = Hojas + +## Grinder Recipes +# $1: Name +%s Dust = Polvo de %s +Akalin = Akalina +Alatro = Alatro +Arol = Arol +Brass = Laton +Bronze = Bronce +Carbon Steel = Acero al Carbono +Cast Iron = Hierro Fundido +Chromium = Cromo +Coal = Carbon +Copper = Cobre +Gold = Oro +Mithril = Mitrilo +Silver = Plata +Stainless Steel = Acero Inoxidable +Talinite = Talinita +Tin = Estanio +Wrought Iron = Hierro Forjado +Zinc = Zinc +%.1f%%-Fissile Uranium = + +## Tools +RE Battery = +Water Can = Bidon de Agua +Lava Can = Bidon de Lava +Chainsaw = Motosierra +Flashlight = Linterna +3 nodes deep. = 3 nodos de profundo. +3 nodes tall. = 3 nodos de alto. +3 nodes wide. = 3 nodos de ancho. +3x3 nodes. = 3x3 nodos. +Use while sneaking to change Mining Drill Mk%d modes. = Manten pulsado Mayus y Usar para cambiar el modo del Taladro de Mineria Mk%d. +Mining Drill Mk%d Mode %d = Taladro de Mineria Mk%d Modo %d +Mining Drill Mk%d = Taladro de Mineria Mk%d +Mining Laser Mk%d = Laser de Mineria Mk%d +Single node. = Nodo simple. +Sonic Screwdriver = Destonillador Sonico +Tree Tap = Grifo de Arbol + +## Craft descriptions +Alloy cooking = +Grinding = +Compressing = +Extracting = diff --git a/mods/technic-master/technic/locale/it.txt b/mods/technic-master/technic/locale/it.txt new file mode 100644 index 0000000..4ad5a97 --- /dev/null +++ b/mods/technic-master/technic/locale/it.txt @@ -0,0 +1,196 @@ + +## Misc +[Technic] Loaded in %f seconds = [Technic] caricato in %f secondi + +## Items +Silicon Wafer = Wafer di silicone +Doped Silicon Wafer = Wafer di silicone dopato +Enriched Uranium = Uranio arricchito +Uranium Fuel = Uranio Combustibile +Diamond Drill Head = Trivella diamantata +Blue Energy Crystal = Cristallo energetico blu +Green Energy Crystal = Cristallo energetico verde +Red Energy Crystal = Cristallo energetico rosso +Fine Copper Wire = Filo di rame fine +Copper Coil = Bobina di rame +Electric Motor = Motore elettrico +Low Voltage Transformer = Trasformatore in bassa tensione +Medium Voltage Transformer = Trasformatore in media tensione +High Voltage Transformer = Trasformatore in alta tensione +Control Logic Unit = Unità di controllo logica +Mixed Metal Ingot = Lingotto in lega ibrida +Composite Plate = Lastra composita +Copper Plate = Lastra di rame +Carbon Plate = Lastra in carbonio +Graphite = Lastra in graffite +Carbon Cloth = Fibra di carbonio +Raw Latex = Latex grezzo +Rubber Fiber = Fibra di gomma +%.1f%%-Fissile Uranium Ingot = +%.1f%%-Fissile Uranium Block = + +## Machine misc +Machine cannot be removed because it is not empty = La macchina non può essere rimossa perchè non è vuota +Inventory move disallowed due to protection = Impossibile muovere l'inventario a causa della protezione +# $1: Machine name (Includes tier) +%s Active = %s Attivo +%s Disabled = %s Disabilitato +%s Enabled = +%s Idle = %s Inattivo +%s Improperly Placed = %s Piazzato impropiamente +%s Unpowered = %s Non alimentato +%s Out Of Fuel = %s senza carburante +%s Has Bad Cabling = %s ha un cablaggio scorretto +%s Has No Network = %s non è collegata +%s Finished = %s Finito +Enable/Disable = Abilita/Disabilita +Range = Raggio +Upgrade Slots = +In: = Ingresso: +Out: = Uscita: +Slot %d = +Itemwise = Singolo elemento +Stackwise = pila completa +Owner: = +Unlocked = +Locked = +Radius: = +Enabled = +Disabled = + +## Machine names +# $1: Tier +%s Alloy Furnace = %s Fornace per leghe +%s Battery Box = %s Box batterie +%s Cable = Cavo %s +%s CNC Machine = Tornio CNC %s +%s Compressor = Compressore %s +%s Extractor = Estrattore %s +%s Forcefield Emitter = Emettitore di campo di forza %s +%s Furnace = %s Fornace +%s Grinder = %s Tritatutto +%s Music Player = Music Player %s +%s Quarry = Cava %s +%s Tool Workshop = Officina per attrezzi %s +Arrayed Solar %s Generator = %s Pannello Solare +Fuel-Fired %s Generator = %s Generatore a carbone +Geothermal %s Generator = %s Generatore Geotermico +Hydro %s Generator = Turbina Elettrica %s +Nuclear %s Generator Core = Reattore nucleare %s +Small Solar %s Generator = %s Pannello solare +Wind %s Generator = %s Generatore eolico +Self-Contained Injector = Ignettore +Constructor Mk%d = Costruttore Mk%d +Frame = Cornice +Frame Motor = Cornice del motore +Template = +Template (replacing) = Template (rimpiazzato) +Template Motor = +Template Tool = +Battery Box = Box batterie +Supply Converter = Trasformatore +Switching Station = Stazione di controllo +Fuel-Fired Alloy Furnace = Fornace per leghe a carbone +Fuel-Fired Furnace = Fornace a carbone +Wind Mill Frame = Pala eolica +Forcefield = Campo di forza +Nuclear Reactor Rod Compartment = Compartimento combustibile nucleare +Administrative World Anchor = + +## Machine-specific +# $1: Pruduced EU +Charge = Carica +Discharge = Scarica +Power level = Livello di potenza +# $1: Tier $2: current_charge $3: max_charge +%s Battery Box: %d/%d = %s Box Batterie: %d/%d +# $1: Machine name $2: Supply $3: Demand +%s. Supply: %d Demand: %d = %s. Prodotto: %d Consumato: %d +Production at %d%% = Produzione a %d%% +Choose Milling Program: = Scegliere un programma di Fresatura +Slim Elements half / normal height: = Metà elementi sottili / altezza normale: +Current track %s = Traccia corrente %s +Stopped = +Keeping %d/%d map blocks loaded = + +## CNC +Cylinder = Cilindro +Element Cross = Elemento a croce +Element Cross Double = Elemento a croce doppio +Element Edge = Elemento bordo +Element Edge Double = Elemento bordo doppio +Element End = Elemento finale +Element End Double = Elemento finale doppio +Element Straight = Elemento dritto +Element Straight Double = Elemento dritto doppio +Element T = Elemento a T +Element T Double = Elemento a T doppio +Horizontal Cylinder = Cilindro orizzontale +One Curved Edge Block = Blocco con bordo curvo +Pyramid = Piramide +Slope = Inclinato +Slope Edge = Bordo inclinato +Slope Inner Edge = Bordo interno inclinato +Slope Lying = Pendenza bugiarda +Slope Upside Down = Pendenza capovolta +Slope Upside Down Edge = Bordo inclinato capovolto +Slope Upside Down Inner Edge = Bordo interno inclinato capovolto +Sphere = Sfera +Spike = Spuntone +Stick = Bastone +Two Curved Edge Block = Blocco con bordo a doppia curva +Brick = Mattone +Cobble = Ciottolato +Dirt = Terra +Leaves = Foglie +Sandstone = Arenaria +Stone = Pietra +Tree = Albero +Wooden = Legno + +## Grinder Recipes +# $1: Name +%s Dust = Polvere di %s +Akalin = Alcalino +Alatro = Alatro +Arol = Arol +Brass = Ottone +Bronze = Bronzo +Carbon Steel = Acciaio al Carbonio +Cast Iron = Ghisa +Chromium = Cromo +Coal = Carbone +Copper = Rame +Gold = Oro +Mithril = Mithril +Silver = Argento +Stainless Steel = Acciaio Inossidabile +Talinite = Talinite +Tin = Stagno +Wrought Iron = Ferro Battuto +Zinc = Zinco +%.1f%%-Fissile Uranium = + +## Tools +RE Battery = +Water Can = Serbatoio d'acqua +Lava Can = Serbatoio di lava +Chainsaw = Motosega +Flashlight = Torcia +3 nodes deep. = 3 nodi in profondità. +3 nodes tall. = 3 nodi in altezza. +3 nodes wide. = 3 nodi in larghezza. +3x3 nodes. = 3x3 nodi. +Use while sneaking to change Mining Drill Mk%d modes. = Premi shift (freccia grossa) e usa per cambiare modalità nella trivella da miniera Mk%d. +Mining Drill Mk%d Mode %d = Trivella mk%d in modalità %d +Mining Drill Mk%d = Trivella da miniera mk%d +Mining Laser Mk%d = Laser da miniera mk%d +Single node. = Nodo singolo. +Sonic Screwdriver = Cacciavite sonico +Tree Tap = Batti albero + +## Craft descriptions +Alloy cooking = Cottura lege +Grinding = Macinazione +Compressing = Compressione +Extracting = Estrazione diff --git a/mods/technic-master/technic/locale/template.txt b/mods/technic-master/technic/locale/template.txt new file mode 100644 index 0000000..4df3586 --- /dev/null +++ b/mods/technic-master/technic/locale/template.txt @@ -0,0 +1,205 @@ +# template.txt +# Template for translations of Technic + + +## Misc +[Technic] Loaded in %f seconds = + +## Items +Silicon Wafer = +Doped Silicon Wafer = +Enriched Uranium = +Uranium Fuel = +Diamond Drill Head = +Blue Energy Crystal = +Green Energy Crystal = +Red Energy Crystal = +Fine Copper Wire = +Copper Coil = +Electric Motor = +Low Voltage Transformer = +Medium Voltage Transformer = +High Voltage Transformer = +Control Logic Unit = +Mixed Metal Ingot = +Composite Plate = +Copper Plate = +Carbon Plate = +Graphite = +Carbon Cloth = +Raw Latex = +Rubber Fiber = +%.1f%%-Fissile Uranium Ingot = +%.1f%%-Fissile Uranium Block = + +## Machine misc +Machine cannot be removed because it is not empty = +Inventory move disallowed due to protection = +# $1: Machine name (Includes tier) +%s Active = +%s Disabled = +%s Enabled = +%s Idle = +%s Improperly Placed = +%s is empty = +%s Unpowered = +%s Out Of Fuel = +%s Has Bad Cabling = +%s (Slave) = +%s Has No Network = +%s Finished = +Enable/Disable = +Range = +Upgrade Slots = +In: = +Out: = +Slot %d = +Itemwise = +Stackwise = +Ignoring Mesecon Signal = +Controlled by Mesecon Signal = +Owner: = +Unlocked = +Locked = +Radius: = +Enabled = +Disabled = + +## Machine names +# $1: Tier +%s Alloy Furnace = +%s Battery Box = +%s Cable = +%s CNC Machine = +%s Centrifuge = +%s Compressor = +%s Extractor = +%s Forcefield Emitter = +%s Furnace = +%s Grinder = +%s Music Player = +%s Quarry = +%s Tool Workshop = +Arrayed Solar %s Generator = +Fuel-Fired %s Generator = +Geothermal %s Generator = +Hydro %s Generator = +Nuclear %s Generator Core = +Small Solar %s Generator = +Wind %s Generator = +Self-Contained Injector = +Constructor Mk%d = +Frame = +Frame Motor = +Template = +Template (replacing) = +Template Motor = +Template Tool = +Battery Box = +Supply Converter = +Switching Station = +Fuel-Fired Alloy Furnace = +Fuel-Fired Furnace = +Wind Mill Frame = +Forcefield = +Nuclear Reactor Rod Compartment = +Administrative World Anchor = + +## Machine-specific +# $1: Pruduced EU +Charge = +Discharge = +Power level = +# $1: Tier $2: current_charge $3: max_charge +%s Battery Box: %d/%d = +# $1: Machine name $2: Supply $3: Demand +%s. Supply: %d Demand: %d = +Production at %d%% = +Choose Milling Program: = +Slim Elements half / normal height: = +Current track %s = +Stopped = +Keeping %d/%d map blocks loaded = + +## CNC +Cylinder = +Element Cross = +Element Cross Double = +Element Edge = +Element Edge Double = +Element End = +Element End Double = +Element Straight = +Element Straight Double = +Element T = +Element T Double = +Horizontal Cylinder = +One Curved Edge Block = +Pyramid = +Slope = +Slope Edge = +Slope Inner Edge = +Slope Lying = +Slope Upside Down = +Slope Upside Down Edge = +Slope Upside Down Inner Edge = +Sphere = +Spike = +Stick = +Two Curved Edge Block = +Brick = +Cobble = +Dirt = +Leaves = +Sandstone = +Stone = +Tree = +Wooden = + +## Grinder Recipes +# $1: Name +%s Dust = +Akalin = +Alatro = +Arol = +Brass = +Bronze = +Carbon Steel = +Cast Iron = +Chromium = +Coal = +Copper = +Gold = +Mithril = +Silver = +Stainless Steel = +Talinite = +Tin = +Wrought Iron = +Zinc = +%.1f%%-Fissile Uranium = + +## Tools +RE Battery = +Water Can = +Lava Can = +Chainsaw = +Flashlight = +3 nodes deep. = +3 nodes tall. = +3 nodes wide. = +3x3 nodes. = +Use while sneaking to change Mining Drill Mk%d modes. = +Mining Drill Mk%d Mode %d = +Mining Drill Mk%d = +Mining Laser Mk%d = +Single node. = +Sonic Screwdriver = +Tree Tap = + +## Craft descriptions +Alloy cooking = +Grinding = +Compressing = +Extracting = +Separating = diff --git a/mods/technic-master/technic/machines/HV/battery_box.lua b/mods/technic-master/technic/machines/HV/battery_box.lua new file mode 100644 index 0000000..1e054ec --- /dev/null +++ b/mods/technic-master/technic/machines/HV/battery_box.lua @@ -0,0 +1,21 @@ +-- HV battery box +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_cable0', ''}, + } +}) + +technic.register_battery_box({ + tier = "HV", + max_charge = 1000000, + charge_rate = 100000, + discharge_rate = 400000, + charge_step = 10000, + discharge_step = 40000, + upgrade = 1, + tube = 1, +}) + diff --git a/mods/technic-master/technic/machines/HV/cables.lua b/mods/technic-master/technic/machines/HV/cables.lua new file mode 100644 index 0000000..25297c8 --- /dev/null +++ b/mods/technic-master/technic/machines/HV/cables.lua @@ -0,0 +1,12 @@ + +minetest.register_craft({ + output = 'technic:hv_cable0 3', + recipe = { + {'homedecor:plastic_sheeting', 'homedecor:plastic_sheeting', 'homedecor:plastic_sheeting'}, + {'technic:mv_cable0', 'technic:mv_cable0', 'technic:mv_cable0'}, + {'homedecor:plastic_sheeting', 'homedecor:plastic_sheeting', 'homedecor:plastic_sheeting'}, + } +}) + +technic.register_cable("HV", 3/16) + diff --git a/mods/technic-master/technic/machines/HV/forcefield.lua b/mods/technic-master/technic/machines/HV/forcefield.lua new file mode 100644 index 0000000..fadc9cb --- /dev/null +++ b/mods/technic-master/technic/machines/HV/forcefield.lua @@ -0,0 +1,243 @@ +-- Forcefield mod by ShadowNinja +-- Modified by kpoppel +-- +-- Forcefields are powerful barriers but they consume huge amounts of power. +-- Forcefield Generator is a HV machine. + +-- How expensive is the generator? +-- Leaves room for upgrades lowering the power drain? +local forcefield_power_drain = 10 +local forcefield_step_interval = 1 + +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_cable0', 'default:mese' }, + } +}) + + +-- Idea: Let forcefields have different colors by upgrade slot. +-- Idea: Let forcefields add up by detecting if one hits another. +-- ___ __ +-- / \/ \ +-- | | +-- \___/\___/ + +local function update_forcefield(pos, meta, active) + local shape = meta:get_int("shape") + local range = meta:get_int("range") + local vm = VoxelManip() + local p1 = {x = pos.x-range, y = pos.y-range, z = pos.z-range} + local p2 = {x = pos.x+range, y = pos.y+range, z = pos.z+range} + local MinEdge, MaxEdge = vm:read_from_map(p1, p2) + local area = VoxelArea:new({MinEdge = MinEdge, MaxEdge = MaxEdge}) + local data = vm:get_data() + + local c_air = minetest.get_content_id("air") + local c_field = minetest.get_content_id("technic:forcefield") + + for z=-range, range do + for y=-range, range do + local vi = area:index(pos.x+(-range), pos.y+y, pos.z+z) + for x=-range, range do + local relevant + if shape == 0 then + relevant = + x*x+y*y+z*z <= range * range + range and + x*x+y*y+z*z >= (range-1) * (range-1) + (range-1) + else + relevant = + x == -range or x == range or + y == -range or y == range or + z == -range or z == range + end + if relevant then + if active and data[vi] == c_air then + data[vi] = c_field + elseif not active and data[vi] == c_field then + data[vi] = c_air + end + end + vi = vi + 1 + end + end + end + + vm:set_data(data) + vm:update_liquids() + vm:write_to_map() + vm:update_map() +end + +local function set_forcefield_formspec(meta) + local formspec = "size[5,2.25]".. + "field[0.3,0.5;2,1;range;"..S("Range")..";"..meta:get_int("range").."]" + -- The names for these toggle buttons are explicit about which + -- state they'll switch to, so that multiple presses (arising + -- from the ambiguity between lag and a missed press) only make + -- the single change that the user expects. + if meta:get_int("shape") == 0 then + formspec = formspec.."button[3,0.2;2,1;shape1;"..S("Sphere").."]" + else + formspec = formspec.."button[3,0.2;2,1;shape0;"..S("Cube").."]" + end + if meta:get_int("mesecon_mode") == 0 then + formspec = formspec.."button[0,1;5,1;mesecon_mode_1;"..S("Ignoring Mesecon Signal").."]" + else + formspec = formspec.."button[0,1;5,1;mesecon_mode_0;"..S("Controlled by Mesecon Signal").."]" + end + if meta:get_int("enabled") == 0 then + formspec = formspec.."button[0,1.75;5,1;enable;"..S("%s Disabled"):format(S("%s Forcefield Emitter"):format("HV")).."]" + else + formspec = formspec.."button[0,1.75;5,1;disable;"..S("%s Enabled"):format(S("%s Forcefield Emitter"):format("HV")).."]" + end + meta:set_string("formspec", formspec) +end + +local forcefield_receive_fields = function(pos, formname, fields, sender) + local meta = minetest.get_meta(pos) + local range = nil + if fields.range then + range = tonumber(fields.range) or 0 + -- Smallest field is 5. Anything less is asking for trouble. + -- Largest is 20. It is a matter of pratical node handling. + -- At the maximim range updating the forcefield takes about 0.2s + range = math.max(range, 5) + range = math.min(range, 20) + if range == meta:get_int("range") then range = nil end + end + if fields.shape0 or fields.shape1 or range then + update_forcefield(pos, meta, false) + end + if range then meta:set_int("range", range) end + if fields.shape0 then meta:set_int("shape", 0) end + if fields.shape1 then meta:set_int("shape", 1) end + if fields.enable then meta:set_int("enabled", 1) end + if fields.disable then meta:set_int("enabled", 0) end + if fields.mesecon_mode_0 then meta:set_int("mesecon_mode", 0) end + if fields.mesecon_mode_1 then meta:set_int("mesecon_mode", 1) end + set_forcefield_formspec(meta) +end + +local mesecons = { + effector = { + action_on = function(pos, node) + minetest.get_meta(pos):set_int("mesecon_effect", 1) + end, + action_off = function(pos, node) + minetest.get_meta(pos):set_int("mesecon_effect", 0) + end + } +} + +local run = function(pos, node, active_object_count, active_object_count_wider) + local meta = minetest.get_meta(pos) + local eu_input = meta:get_int("HV_EU_input") + local enabled = meta:get_int("enabled") ~= 0 and (meta:get_int("mesecon_mode") == 0 or meta:get_int("mesecon_effect") ~= 0) + local machine_name = S("%s Forcefield Emitter"):format("HV") + + local range = meta:get_int("range") + local power_requirement + if meta:get_int("shape") == 0 then + power_requirement = math.floor(4 * math.pi * range * range) + else + power_requirement = 24 * range * range + end + power_requirement = power_requirement * forcefield_power_drain + + if not enabled then + if node.name == "technic:forcefield_emitter_on" then + update_forcefield(pos, meta, false) + technic.swap_node(pos, "technic:forcefield_emitter_off") + meta:set_string("infotext", S("%s Disabled"):format(machine_name)) + end + meta:set_int("HV_EU_demand", 0) + return + end + meta:set_int("HV_EU_demand", power_requirement) + if eu_input < power_requirement then + meta:set_string("infotext", S("%s Unpowered"):format(machine_name)) + if node.name == "technic:forcefield_emitter_on" then + update_forcefield(pos, meta, false) + technic.swap_node(pos, "technic:forcefield_emitter_off") + end + elseif eu_input >= power_requirement then + if node.name == "technic:forcefield_emitter_off" then + technic.swap_node(pos, "technic:forcefield_emitter_on") + meta:set_string("infotext", S("%s Active"):format(machine_name)) + end + update_forcefield(pos, meta, true) + end +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}, + on_receive_fields = forcefield_receive_fields, + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_int("HV_EU_input", 0) + meta:set_int("HV_EU_demand", 0) + meta:set_int("range", 10) + meta:set_int("enabled", 0) + meta:set_int("mesecon_mode", 0) + meta:set_int("mesecon_effect", 0) + meta:set_string("infotext", S("%s Forcefield Emitter"):format("HV")) + set_forcefield_formspec(meta) + end, + mesecons = mesecons, + technic_run = run, +}) + +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, not_in_creative_inventory=1}, + drop = "technic:forcefield_emitter_off", + on_receive_fields = forcefield_receive_fields, + on_destruct = function(pos) + local meta = minetest.get_meta(pos) + update_forcefield(pos, meta, false) + end, + mesecons = mesecons, + technic_run = run, + 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") + end, +}) + +minetest.register_node("technic:forcefield", { + description = S("%s Forcefield"):format("HV"), + sunlight_propagates = true, + drawtype = "glasslike", + groups = {not_in_creative_inventory=1, unbreakable=1}, + paramtype = "light", + light_source = 15, + drop = '', + tiles = {{ + name = "technic_forcefield_animated.png", + animation = { + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = 1.0, + }, + }}, +}) + + +if minetest.get_modpath("mesecons_mvps") then + mesecon:register_mvps_stopper("technic:forcefield") +end + +technic.register_machine("HV", "technic:forcefield_emitter_on", technic.receiver) +technic.register_machine("HV", "technic:forcefield_emitter_off", technic.receiver) + diff --git a/mods/technic-master/technic/machines/HV/generator.lua b/mods/technic-master/technic/machines/HV/generator.lua new file mode 100644 index 0000000..aa83590 --- /dev/null +++ b/mods/technic-master/technic/machines/HV/generator.lua @@ -0,0 +1,13 @@ +minetest.register_alias("hv_generator", "technic:hv_generator") + +minetest.register_craft({ + 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_cable0', 'technic:stainless_steel_ingot'}, + } +}) + +technic.register_generator({tier="HV", tube=1, supply=1200}) + diff --git a/mods/technic-master/technic/machines/HV/init.lua b/mods/technic-master/technic/machines/HV/init.lua new file mode 100644 index 0000000..d7136b4 --- /dev/null +++ b/mods/technic-master/technic/machines/HV/init.lua @@ -0,0 +1,18 @@ + +technic.register_tier("HV", "High Voltage") + +local path = technic.modpath.."/machines/HV" + +-- Wiring stuff +dofile(path.."/cables.lua") +dofile(path.."/battery_box.lua") + +-- Generators +dofile(path.."/solar_array.lua") +dofile(path.."/nuclear_reactor.lua") +dofile(path.."/generator.lua") + +-- Machines +dofile(path.."/quarry.lua") +dofile(path.."/forcefield.lua") + diff --git a/mods/technic-master/technic/machines/HV/nuclear_reactor.lua b/mods/technic-master/technic/machines/HV/nuclear_reactor.lua new file mode 100644 index 0000000..b57faa7 --- /dev/null +++ b/mods/technic-master/technic/machines/HV/nuclear_reactor.lua @@ -0,0 +1,715 @@ +-- The enriched uranium rod driven EU generator. +-- A very large and advanced machine providing vast amounts of power. +-- Very efficient but also expensive to run as it needs uranium. (10000EU 86400 ticks (one week)) +-- Provides HV EUs that can be down converted as needed. +-- +-- The nuclear reactor core needs water and a protective shield to work. +-- This is checked now and then and if the machine is tampered with... BOOM! + +local burn_ticks = 7 * 24 * 60 * 60 -- (seconds). +local power_supply = 100000 -- EUs +local fuel_type = "technic:uranium_fuel" -- The reactor burns this stuff + +local S = technic.getter + +if not vector.length_square then + vector.length_square = function (v) + return v.x*v.x + v.y*v.y + v.z*v.z + end +end + +-- FIXME: recipe must make more sense like a rod recepticle, steam chamber, HV generator? +minetest.register_craft({ + 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_cable0', 'technic:stainless_steel_ingot'}, + } +}) + +local generator_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;]" + +-- "Boxy sphere" +local nodebox = { + { -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 reactor_siren = {} +local function siren_set_state(pos, newstate) + local hpos = minetest.hash_node_position(pos) + local siren = reactor_siren[hpos] + if not siren then + if newstate == "off" then return end + siren = {state="off"} + reactor_siren[hpos] = siren + end + if newstate == "danger" and siren.state ~= "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}) + siren.state = "danger" + elseif newstate == "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}) + siren.handle = clear_handle + siren.state = "clear" + minetest.after(10, function () + if siren.handle == clear_handle then + minetest.sound_stop(clear_handle) + if reactor_siren[hpos] == siren then + reactor_siren[hpos] = nil + end + end + end) + elseif newstate == "off" and siren.state ~= "off" then + if siren.handle then minetest.sound_stop(siren.handle) end + siren.handle = nil + reactor_siren[hpos] = nil + end +end +local function siren_danger(pos, meta) + meta:set_int("siren", 1) + siren_set_state(pos, "danger") +end +local function siren_clear(pos, meta) + if meta:get_int("siren") ~= 0 then + siren_set_state(pos, "clear") + meta:set_int("siren", 0) + end +end + +-- The standard reactor structure consists of a 9x9x9 cube. A cross +-- section through the middle: +-- +-- CCCC CCCC +-- CBBB BBBC +-- CBSS SSBC +-- CBSWWWSBC +-- CBSW#WSBC +-- CBSW|WSBC +-- CBSS|SSBC +-- CBBB|BBBC +-- CCCC|CCCC +-- C = Concrete, B = Blast-resistant concrete, S = Stainless Steel, +-- W = water node, # = reactor core, | = HV cable +-- +-- The man-hole and the HV cable are only in the middle, and the man-hole +-- is optional. +-- +-- For the reactor to operate and not melt down, it insists on the inner +-- 7x7x7 portion (from the core out to the blast-resistant concrete) +-- being intact. Intactness only depends on the number of nodes of the +-- right type in each layer. The water layer must have water in all but +-- at most one node; the steel and blast-resistant concrete layers must +-- have the right material in all but at most two nodes. The permitted +-- gaps are meant for the cable and man-hole, but can actually be anywhere +-- and contain anything. For the reactor to be useful, a cable must +-- connect to the core, but it can go in any direction. +-- +-- The outer concrete layer of the standard structure is not required +-- for the reactor to operate. It is noted here because it used to +-- be mandatory, and for historical reasons (that it predates the +-- implementation of radiation) it needs to continue being adequate +-- shielding of legacy reactors. If it ever ceases to be adequate +-- shielding for new reactors, legacy ones should be grandfathered. +local reactor_structure_badness = function(pos) + local vm = VoxelManip() + local pos1 = vector.subtract(pos, 3) + 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 c_blast_concrete = minetest.get_content_id("technic:blast_resistant_concrete") + local c_stainless_steel = minetest.get_content_id("technic:stainless_steel_block") + local c_water_source = minetest.get_content_id("default:water_source") + local c_water_flowing = minetest.get_content_id("default:water_flowing") + + local blastlayer, steellayer, waterlayer = 0, 0, 0 + + for z = pos1.z, pos2.z do + for y = pos1.y, pos2.y do + for x = pos1.x, pos2.x do + local cid = data[area:index(x, y, z)] + if x == pos1.x or x == pos2.x or + y == pos1.y or y == pos2.y or + z == pos1.z or z == pos2.z then + if cid == c_blast_concrete then + blastlayer = blastlayer + 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 + if cid == c_stainless_steel then + steellayer = steellayer + 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 + if cid == c_water_source or cid == c_water_flowing then + waterlayer = waterlayer + 1 + end + end + end + end + end + if waterlayer > 25 then waterlayer = 25 end + if steellayer > 96 then steellayer = 96 end + if blastlayer > 216 then blastlayer = 216 end + return (25 - waterlayer) + (96 - steellayer) + (216 - blastlayer) +end + +local function meltdown_reactor(pos) + print("A reactor melted down at "..minetest.pos_to_string(pos)) + minetest.set_node(pos, {name="technic:corium_source"}) +end + +minetest.register_abm({ + nodenames = {"technic:hv_nuclear_reactor_core_active"}, + interval = 1, + chance = 1, + 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") + if badness == 0 then + if accum_badness ~= 0 then + meta:set_int("structure_accumulated_badness", accum_badness - 1) + siren_clear(pos, meta) + end + else + siren_danger(pos, meta) + accum_badness = accum_badness + badness + if accum_badness >= 100 then + meltdown_reactor(pos) + else + meta:set_int("structure_accumulated_badness", accum_badness) + end + end + end, +}) + +local run = function(pos, node) + local meta = minetest.get_meta(pos) + local machine_name = S("Nuclear %s Generator Core"):format("HV") + local burn_time = meta:get_int("burn_time") or 0 + + if burn_time >= burn_ticks or burn_time == 0 then + local inv = meta:get_inventory() + if not inv:is_empty("src") then + local srclist = inv:get_list("src") + local correct_fuel_count = 0 + for _, srcstack in pairs(srclist) do + if srcstack then + if srcstack:get_name() == fuel_type then + correct_fuel_count = correct_fuel_count + 1 + end + end + end + -- Check that the reactor is complete as well + -- as the correct number of correct fuel + if correct_fuel_count == 6 and + reactor_structure_badness(pos) == 0 then + meta:set_int("burn_time", 1) + technic.swap_node(pos, "technic:hv_nuclear_reactor_core_active") + meta:set_int("HV_EU_supply", power_supply) + for idx, srcstack in pairs(srclist) do + srcstack:take_item() + inv:set_stack("src", idx, srcstack) + end + return + end + end + meta:set_int("HV_EU_supply", 0) + meta:set_int("burn_time", 0) + meta:set_string("infotext", S("%s Idle"):format(machine_name)) + technic.swap_node(pos, "technic:hv_nuclear_reactor_core") + meta:set_int("structure_accumulated_badness", 0) + siren_clear(pos, meta) + elseif burn_time > 0 then + burn_time = burn_time + 1 + meta:set_int("burn_time", burn_time) + local percent = math.floor(burn_time / burn_ticks * 100) + meta:set_string("infotext", machine_name.." ("..percent.."%)") + meta:set_int("HV_EU_supply", power_supply) + end +end + +minetest.register_node("technic:hv_nuclear_reactor_core", { + description = S("Nuclear %s Generator Core"):format("HV"), + tiles = {"technic_hv_nuclear_reactor_core.png", "technic_hv_nuclear_reactor_core.png", + "technic_hv_nuclear_reactor_core.png", "technic_hv_nuclear_reactor_core.png", + "technic_hv_nuclear_reactor_core.png", "technic_hv_nuclear_reactor_core.png"}, + groups = {cracky=1, technic_machine=1}, + legacy_facedir_simple = true, + sounds = default.node_sound_wood_defaults(), + drawtype="nodebox", + paramtype = "light", + stack_max = 1, + node_box = { + type = "fixed", + fixed = nodebox + }, + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("infotext", S("Nuclear %s Generator Core"):format("HV")) + meta:set_int("HV_EU_supply", 0) + -- Signal to the switching station that this device burns some + -- sort of fuel and needs special handling + meta:set_int("HV_EU_from_fuel", 1) + meta:set_int("burn_time", 0) + meta:set_string("formspec", generator_formspec) + local inv = meta:get_inventory() + inv:set_size("src", 6) + end, + can_dig = technic.machine_can_dig, + on_destruct = function(pos) siren_set_state(pos, "off") end, + allow_metadata_inventory_put = technic.machine_inventory_put, + allow_metadata_inventory_take = technic.machine_inventory_take, + allow_metadata_inventory_move = technic.machine_inventory_move, + technic_run = run, +}) + +minetest.register_node("technic:hv_nuclear_reactor_core_active", { + tiles = {"technic_hv_nuclear_reactor_core.png", "technic_hv_nuclear_reactor_core.png", + "technic_hv_nuclear_reactor_core.png", "technic_hv_nuclear_reactor_core.png", + "technic_hv_nuclear_reactor_core.png", "technic_hv_nuclear_reactor_core.png"}, + groups = {cracky=1, technic_machine=1, radioactive=7, 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 = 15, + paramtype = "light", + node_box = { + type = "fixed", + fixed = nodebox + }, + can_dig = technic.machine_can_dig, + after_dig_node = meltdown_reactor, + on_destruct = function(pos) siren_set_state(pos, "off") end, + allow_metadata_inventory_put = technic.machine_inventory_put, + allow_metadata_inventory_take = technic.machine_inventory_take, + allow_metadata_inventory_move = technic.machine_inventory_move, + technic_run = run, + technic_on_disable = function(pos, node) + local timer = minetest.get_node_timer(pos) + timer:start(1) + end, + on_timer = function(pos, node) + local meta = minetest.get_meta(pos) + + -- Connected back? + if meta:get_int("HV_EU_timeout") > 0 then return end + + local burn_time = meta:get_int("burn_time") or 0 + + if burn_time >= burn_ticks or burn_time == 0 then + meta:set_int("HV_EU_supply", 0) + meta:set_int("burn_time", 0) + technic.swap_node(pos, "technic:hv_nuclear_reactor_core") + meta:set_int("structure_accumulated_badness", 0) + siren_clear(pos, meta) + return + end + + meta:set_int("burn_time", burn_time + 1) + local timer = minetest.get_node_timer(pos) + timer:start(1) + end, +}) + +technic.register_machine("HV", "technic:hv_nuclear_reactor_core", technic.producer) +technic.register_machine("HV", "technic:hv_nuclear_reactor_core_active", technic.producer) + +-- radioactivity + +-- Radiation resistance represents the extent to which a material +-- attenuates radiation passing through it; i.e., how good a radiation +-- shield it is. This is identified per node type. For materials that +-- exist in real life, the radiation resistance value that this system +-- uses for a node type consisting of a solid cube of that material is the +-- (approximate) number of halvings of ionising radiation that is achieved +-- by a metre of the material in real life. This is approximately +-- proportional to density, which provides a good way to estimate it. +-- Homogeneous mixtures of materials have radiation resistance computed +-- by a simple weighted mean. Note that the amount of attenuation that +-- a material achieves in-game is not required to be (and is not) the +-- same as the attenuation achieved in real life. +-- +-- Radiation resistance for a node type may be specified in the node +-- definition, under the key "radiation_resistance". As an interim +-- measure, until node definitions widely include this, this code +-- knows a bunch of values for particular node types in several mods, +-- and values for groups of node types. The node definition takes +-- precedence if it specifies a value. Nodes for which no value at +-- all is known are taken to provide no radiation resistance at all; +-- this is appropriate for the majority of node types. Only node types +-- consisting of a fairly homogeneous mass of material should report +-- non-zero radiation resistance; anything with non-uniform geometry +-- or complex internal structure should show no radiation resistance. +-- Fractional resistance values are permitted; two significant figures +-- is the recommended precision. +local default_radiation_resistance_per_node = { + ["default:brick"] = 13, + ["default:bronzeblock"] = 45, + ["default:clay"] = 15, + ["default:coalblock"] = 9.6, + ["default:cobble"] = 15, + ["default:copperblock"] = 46, + ["default:desert_cobble"] = 15, + ["default:desert_sand"] = 10, + ["default:desert_stone"] = 17, + ["default:desert_stonebrick"] = 17, + ["default:diamondblock"] = 24, + ["default:dirt"] = 8.2, + ["default:dirt_with_grass"] = 8.2, + ["default:dirt_with_grass_footsteps"] = 8.2, + ["default:dirt_with_snow"] = 8.2, + ["default:glass"] = 17, + ["default:goldblock"] = 170, + ["default:gravel"] = 10, + ["default:ice"] = 5.6, + ["default:lava_flowing"] = 8.5, + ["default:lava_source"] = 17, + ["default:mese"] = 21, + ["default:mossycobble"] = 15, + ["default:nyancat"] = 1000, + ["default:nyancat_rainbow"] = 1000, + ["default:obsidian"] = 18, + ["default:obsidian_glass"] = 18, + ["default:sand"] = 10, + ["default:sandstone"] = 15, + ["default:sandstonebrick"] = 15, + ["default:snowblock"] = 1.7, + ["default:steelblock"] = 40, + ["default:stone"] = 17, + ["default:stone_with_coal"] = 16, + ["default:stone_with_copper"] = 20, + ["default:stone_with_diamond"] = 18, + ["default:stone_with_gold"] = 34, + ["default:stone_with_iron"] = 20, + ["default:stone_with_mese"] = 17, + ["default:stonebrick"] = 17, + ["default:water_flowing"] = 2.8, + ["default:water_source"] = 5.6, + ["farming:desert_sand_soil"] = 10, + ["farming:desert_sand_soil_wet"] = 10, + ["farming:soil"] = 8.2, + ["farming:soil_wet"] = 8.2, + ["glooptest:akalin_crystal_glass"] = 21, + ["glooptest:akalinblock"] = 40, + ["glooptest:alatro_crystal_glass"] = 21, + ["glooptest:alatroblock"] = 40, + ["glooptest:amethystblock"] = 18, + ["glooptest:arol_crystal_glass"] = 21, + ["glooptest:crystal_glass"] = 21, + ["glooptest:emeraldblock"] = 19, + ["glooptest:heavy_crystal_glass"] = 21, + ["glooptest:mineral_akalin"] = 20, + ["glooptest:mineral_alatro"] = 20, + ["glooptest:mineral_amethyst"] = 17, + ["glooptest:mineral_arol"] = 20, + ["glooptest:mineral_desert_coal"] = 16, + ["glooptest:mineral_desert_iron"] = 20, + ["glooptest:mineral_emerald"] = 17, + ["glooptest:mineral_kalite"] = 20, + ["glooptest:mineral_ruby"] = 18, + ["glooptest:mineral_sapphire"] = 18, + ["glooptest:mineral_talinite"] = 20, + ["glooptest:mineral_topaz"] = 18, + ["glooptest:reinforced_crystal_glass"] = 21, + ["glooptest:rubyblock"] = 27, + ["glooptest:sapphireblock"] = 27, + ["glooptest:talinite_crystal_glass"] = 21, + ["glooptest:taliniteblock"] = 40, + ["glooptest:topazblock"] = 24, + ["mesecons_extrawires:mese_powered"] = 21, + ["moreblocks:cactus_brick"] = 13, + ["moreblocks:cactus_checker"] = 8.5, + ["moreblocks:circle_stone_bricks"] = 17, + ["moreblocks:clean_glass"] = 17, + ["moreblocks:coal_checker"] = 9.0, + ["moreblocks:coal_glass"] = 17, + ["moreblocks:coal_stone"] = 17, + ["moreblocks:coal_stone_bricks"] = 17, + ["moreblocks:glow_glass"] = 17, + ["moreblocks:grey_bricks"] = 15, + ["moreblocks:iron_checker"] = 11, + ["moreblocks:iron_glass"] = 17, + ["moreblocks:iron_stone"] = 17, + ["moreblocks:iron_stone_bricks"] = 17, + ["moreblocks:plankstone"] = 9.3, + ["moreblocks:split_stone_tile"] = 15, + ["moreblocks:split_stone_tile_alt"] = 15, + ["moreblocks:stone_tile"] = 15, + ["moreblocks:super_glow_glass"] = 17, + ["moreblocks:tar"] = 7.0, + ["moreblocks:wood_tile"] = 1.7, + ["moreblocks:wood_tile_center"] = 1.7, + ["moreblocks:wood_tile_down"] = 1.7, + ["moreblocks:wood_tile_flipped"] = 1.7, + ["moreblocks:wood_tile_full"] = 1.7, + ["moreblocks:wood_tile_left"] = 1.7, + ["moreblocks:wood_tile_right"] = 1.7, + ["moreblocks:wood_tile_up"] = 1.7, + ["moreores:mineral_mithril"] = 18, + ["moreores:mineral_silver"] = 21, + ["moreores:mineral_tin"] = 19, + ["moreores:mithril_block"] = 26, + ["moreores:silver_block"] = 53, + ["moreores:tin_block"] = 37, + ["snow:snow_brick"] = 2.8, + ["technic:brass_block"] = 43, + ["technic:carbon_steel_block"] = 40, + ["technic:cast_iron_block"] = 40, + ["technic:chernobylite_block"] = 40, + ["technic:chromium_block"] = 37, + ["technic:corium_flowing"] = 40, + ["technic:corium_source"] = 80, + ["technic:granite"] = 18, + ["technic:marble"] = 18, + ["technic:marble_bricks"] = 18, + ["technic:mineral_chromium"] = 19, + ["technic:mineral_uranium"] = 71, + ["technic:mineral_zinc"] = 19, + ["technic:stainless_steel_block"] = 40, + ["technic:zinc_block"] = 36, + ["tnt:tnt"] = 11, + ["tnt:tnt_burning"] = 11, +} +local default_radiation_resistance_per_group = { + concrete = 16, + tree = 3.4, + uranium_block = 500, + wood = 1.7, +} +local cache_radiation_resistance = {} +local function node_radiation_resistance(nodename) + local eff = cache_radiation_resistance[nodename] + if eff then return eff end + local def = minetest.registered_nodes[nodename] or {groups={}} + eff = def.radiation_resistance or default_radiation_resistance_per_node[nodename] + if not eff then + for g, v in pairs(def.groups) do + if v > 0 and default_radiation_resistance_per_group[g] then + eff = default_radiation_resistance_per_group[g] + break + end + end + end + if not eff then eff = 0 end + cache_radiation_resistance[nodename] = eff + return eff +end + +-- Radioactive nodes cause damage to nearby players. The damage +-- effect depends on the intrinsic strength of the radiation source, +-- the distance between the source and the player, and the shielding +-- effect of the intervening material. These determine a rate of damage; +-- total damage caused is the integral of this over time. +-- +-- In the absence of effective shielding, for a specific source the +-- damage rate varies realistically in inverse proportion to the square +-- of the distance. (Distance is measured to the player's abdomen, +-- not to the nominal player position which corresponds to the foot.) +-- However, if the player is inside a non-walkable (liquid or gaseous) +-- radioactive node, the nominal distance could go to zero, yielding +-- infinite damage. In that case, the player's body is displacing the +-- radioactive material, so the effective distance should remain non-zero. +-- We therefore apply a lower distance bound of sqrt(0.75) m, which is +-- the maximum distance one can get from the node centre within the node. +-- +-- A radioactive node is identified by being in the "radioactive" group, +-- and the group value signifies the strength of the radiation source. +-- The group value is the distance in metres from a node at which an +-- unshielded player will be damaged by 0.25 HP/s. Or, equivalently, it +-- is half the square root of the damage rate in HP/s that an unshielded +-- player 1 m away will take. +-- +-- Shielding is assessed by sampling every 0.25 m along the path +-- from the source to the player, ignoring the source node itself. +-- The summed radiation resistance values from the sampled nodes yield +-- a measure of the total amount of radiation resistance on the path. +-- As in reality, shielding causes exponential attenuation of radiation. +-- However, the effect is scaled down relative to real life: each +-- metre-point of shielding, corresponding to a real-life halving of +-- radiation, reduces radiation by 0.01 nepers (a factor of about 1.01). +-- This scales down the difference between shielded and unshielded safe +-- distances, avoiding the latter becoming impractically large. +-- +-- Damage is processed at rates down to 0.25 HP/s, which in the absence of +-- shielding is attained at the distance specified by the "radioactive" +-- group value. Computed damage rates below 0.25 HP/s result in no +-- damage at all to the player. This gives the player an opportunity +-- to be safe, and limits the range at which source/player interactions +-- need to be considered. +local assumed_abdomen_offset = vector.new(0, 1, 0) +local assumed_abdomen_offset_length = vector.length(assumed_abdomen_offset) +minetest.register_abm({ + nodenames = {"group:radioactive"}, + interval = 1, + chance = 1, + action = function (pos, node) + local strength = minetest.registered_nodes[node.name].groups.radioactive + for _, o in ipairs(minetest.get_objects_inside_radius(pos, strength + assumed_abdomen_offset_length)) do + if o:is_player() then + local rel = vector.subtract(vector.add(o:getpos(), assumed_abdomen_offset), pos) + local dist_sq = vector.length_square(rel) + local dist = math.sqrt(dist_sq) + local dirstep = dist == 0 and vector.new(0,0,0) or vector.divide(rel, dist*4) + local intpos = pos + local resistance = 0 + for intdist = 0.25, dist, 0.25 do + intpos = vector.add(intpos, dirstep) + local intnodepos = vector.round(intpos) + if not vector.equals(intnodepos, pos) then + resistance = resistance + node_radiation_resistance(minetest.get_node(intnodepos).name) + end + end + local dmg_rate = 0.25 * strength*strength * math.exp(-0.0025*resistance) / math.max(0.75, dist_sq) + if dmg_rate >= 0.25 then + local dmg_int = math.floor(dmg_rate) + if math.random() < dmg_rate-dmg_int then + dmg_int = dmg_int + 1 + end + if dmg_int > 0 then + o:set_hp(math.max(o:get_hp() - dmg_int, 0)) + end + end + end + end + end, +}) + +-- radioactive materials that can result from destroying a reactor + +for _, state in ipairs({ "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"] = {{ + name = "technic_corium_"..state.."_animated.png", + animation = { + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = 3.0, + }, + }}, + paramtype = "light", + paramtype2 = (state == "flowing" and "flowingliquid" or nil), + light_source = (state == "source" and 8 or 5), + walkable = false, + pointable = false, + diggable = false, + buildable_to = true, + drop = "", + drowning = 1, + liquidtype = state, + liquid_alternative_flowing = "technic:corium_flowing", + liquid_alternative_source = "technic:corium_source", + liquid_viscosity = LAVA_VISC, + liquid_renewable = false, + damage_per_second = 6, + post_effect_color = { a=192, r=80, g=160, b=80 }, + groups = { + liquid = 2, + hot = 3, + igniter = 1, + radioactive = (state == "source" and 32 or 16), + not_in_creative_inventory = (state == "flowing" and 1 or nil), + }, + }) +end + +if bucket and bucket.register_liquid then + bucket.register_liquid( + "technic:corium_source", + "technic:corium_flowing", + "technic:bucket_corium", + "technic_bucket_corium.png", + "Corium Bucket" + ) +end + +minetest.register_node("technic:chernobylite_block", { + description = S("Chernobylite Block"), + tiles = { "technic_chernobylite_block.png" }, + is_ground_content = true, + groups = { cracky=1, radioactive=5, level=2 }, + sounds = default.node_sound_stone_defaults(), + light_source = 2, + +}) + +minetest.register_abm({ + nodenames = {"group:water"}, + neighbors = {"technic:corium_source"}, + interval = 1, + chance = 1, + action = function (pos, node) + minetest.remove_node(pos) + end, +}) + +minetest.register_abm({ + nodenames = {"technic:corium_flowing"}, + neighbors = {"group:water"}, + interval = 1, + chance = 1, + action = function (pos, node) + minetest.set_node(pos, {name="technic:chernobylite_block"}) + end, +}) + +local griefing = technic.config:get_bool("enable_corium_griefing") + +minetest.register_abm({ + nodenames = {"technic:corium_flowing"}, + interval = 5, + chance = (griefing and 10 or 1), + action = function (pos, node) + minetest.set_node(pos, {name="technic:chernobylite_block"}) + end, +}) + +if griefing then + minetest.register_abm({ + 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), + }) do + if math.random(8) == 1 then + minetest.dig_node(vector.add(pos, offset)) + end + end + end, + }) +end diff --git a/mods/technic-master/technic/machines/HV/quarry.lua b/mods/technic-master/technic/machines/HV/quarry.lua new file mode 100644 index 0000000..10c0ee0 --- /dev/null +++ b/mods/technic-master/technic/machines/HV/quarry.lua @@ -0,0 +1,184 @@ + +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_cable0", "technic:carbon_steel_block"}}, + output = "technic:quarry", +}) + +local quarry_dig_above_nodes = 3 -- How far above the quarry we will dig nodes +local quarry_max_depth = 100 + +local function set_quarry_formspec(meta) + local formspec = "size[3,1.5]".. + "field[1,0.5;2,1;size;Radius;"..meta:get_int("size").."]" + if meta:get_int("enabled") == 0 then + formspec = formspec.."button[0,1;3,1;enable;"..S("%s Disabled"):format(S("%s Quarry"):format("HV")).."]" + else + formspec = formspec.."button[0,1;3,1;disable;"..S("%s Enabled"):format(S("%s Quarry"):format("HV")).."]" + end + meta:set_string("formspec", formspec) +end + +local function quarry_receive_fields(pos, formname, fields, sender) + local meta = minetest.get_meta(pos) + if fields.size then + local size = tonumber(fields.size) or 0 + size = math.max(size, 2) + size = math.min(size, 8) + meta:set_int("size", size) + end + if fields.enable then meta:set_int("enabled", 1) end + if fields.disable then meta:set_int("enabled", 0) end + set_quarry_formspec(meta) +end + +local function get_quarry_center(pos, size) + local node = minetest.get_node(pos) + local back_dir = minetest.facedir_to_dir(node.param2) + local relative_center = vector.multiply(back_dir, size + 1) + local center = vector.add(pos, relative_center) + return center +end + +local function gen_next_digpos(center, digpos, size) + digpos.x = digpos.x + 1 + if digpos.x > center.x + size then + digpos.x = center.x - size + digpos.z = digpos.z + 1 + end + if digpos.z > center.z + size then + digpos.x = center.x - size + digpos.z = center.z - size + digpos.y = digpos.y - 1 + end +end + +local function find_next_digpos(data, area, center, dig_y, size) + local c_air = minetest.get_content_id("air") + + for y = center.y + quarry_dig_above_nodes, dig_y - 1, -1 do + for z = center.z - size, center.z + size do + for x = center.x - size, center.x + size do + if data[area:index(x, y, z)] ~= c_air then + return vector.new(x, y, z) + end + end + end + end +end + +local function quarry_dig(pos, center, size) + local meta = minetest.get_meta(pos) + local drops = {} + local dig_y = meta:get_int("dig_y") + local owner = meta:get_string("owner") + + local vm = VoxelManip() + local p1 = vector.new( + center.x - size, + center.y + quarry_dig_above_nodes, + center.z - size) + local p2 = vector.new( + center.x + size, + dig_y - 1, -- One node lower in case we have finished the current layer + center.z + size) + local e1, e2 = vm:read_from_map(p1, p2) + local area = VoxelArea:new({MinEdge=e1, MaxEdge=e2}) + local data = vm:get_data() + + local digpos = find_next_digpos(data, area, center, dig_y, size) + + if digpos then + if digpos.y < pos.y - quarry_max_depth then + meta:set_int("dig_y", digpos.y) + return drops + end + if minetest.is_protected and minetest.is_protected(digpos, owner) then + meta:set_int("enabled", 0) + set_quarry_formspec(meta) + return {} + end + dig_y = digpos.y + local node = minetest.get_node(digpos) + local node_def = minetest.registered_nodes[node.name] or { diggable = false } + if node_def.diggable and ((not node_def.can_dig) or node_def.can_dig(digpos, nil)) then + minetest.remove_node(digpos) + drops = minetest.get_node_drops(node.name, "") + end + elseif not (dig_y < pos.y - quarry_max_depth) then + dig_y = dig_y - 16 + end + + meta:set_int("dig_y", dig_y) + return drops +end + +local function send_items(items, pos, node) + for _, item in pairs(items) do + technic.tube_inject_item(pos, pos, vector.new(0, 1, 0), item) + end +end + +local run = function(pos, node) + local meta = minetest.get_meta(pos) + local size = meta:get_int("size") + local eu_input = meta:get_int("HV_EU_input") + local demand = 10000 + local center = get_quarry_center(pos, size) + local dig_y = meta:get_int("dig_y") + local machine_name = S("%s Quarry"):format("HV") + + if meta:get_int("enabled") == 0 then + meta:set_string("infotext", S("%s Disabled"):format(machine_name)) + meta:set_int("HV_EU_demand", 0) + return + end + + if eu_input < demand then + meta:set_string("infotext", S("%s Unpowered"):format(machine_name)) + elseif eu_input >= demand then + meta:set_string("infotext", S("%s Active"):format(machine_name)) + + local items = quarry_dig(pos, center, size) + send_items(items, pos, node) + + if dig_y < pos.y - quarry_max_depth then + meta:set_string("infotext", S("%s Finished"):format(machine_name)) + end + end + meta:set_int("HV_EU_demand", demand) +end + +minetest.register_node("technic:quarry", { + description = S("%s Quarry"):format("HV"), + tiles = {"technic_carbon_steel_block.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"}, + paramtype2 = "facedir", + groups = {cracky=2, tubedevice=1, technic_machine = 1}, + tube = { + connect_sides = {top = 1}, + }, + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("infotext", S("%s Quarry"):format("HV")) + meta:set_int("size", 4) + set_quarry_formspec(meta) + meta:set_int("dig_y", pos.y) + end, + after_place_node = function(pos, placer, itemstack) + local meta = minetest.get_meta(pos) + meta:set_string("owner", placer:get_player_name()) + pipeworks.scan_for_tube_objects(pos) + end, + after_dig_node = pipeworks.scan_for_tube_objects, + on_receive_fields = quarry_receive_fields, + technic_run = run, +}) + +technic.register_machine("HV", "technic:quarry", technic.receiver) + diff --git a/mods/technic-master/technic/machines/HV/solar_array.lua b/mods/technic-master/technic/machines/HV/solar_array.lua new file mode 100644 index 0000000..414291a --- /dev/null +++ b/mods/technic-master/technic/machines/HV/solar_array.lua @@ -0,0 +1,14 @@ +-- The high voltage solar array is an assembly of medium voltage arrays. +-- Solar arrays are not able to store large amounts of energy. + +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_cable0', ''}, + } +}) + +technic.register_solar_array({tier="HV", power=100}) + diff --git a/mods/technic-master/technic/machines/LV/alloy_furnace.lua b/mods/technic-master/technic/machines/LV/alloy_furnace.lua new file mode 100644 index 0000000..bdf2f31 --- /dev/null +++ b/mods/technic-master/technic/machines/LV/alloy_furnace.lua @@ -0,0 +1,14 @@ +-- LV Alloy furnace + +-- FIXME: kpoppel: I'd like to introduce an induction heating element here... +minetest.register_craft({ + output = 'technic:lv_alloy_furnace', + recipe = { + {'default:brick', 'default:brick', 'default:brick'}, + {'default:brick', 'technic:machine_casing', 'default:brick'}, + {'default:brick', 'technic:lv_cable0', 'default:brick'}, + } +}) + +technic.register_alloy_furnace({tier = "LV", speed = 1, demand = {300}}) + diff --git a/mods/technic-master/technic/machines/LV/battery_box.lua b/mods/technic-master/technic/machines/LV/battery_box.lua new file mode 100644 index 0000000..429bcd6 --- /dev/null +++ b/mods/technic-master/technic/machines/LV/battery_box.lua @@ -0,0 +1,19 @@ + +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_cable0', 'technic:battery'}, + } +}) + +technic.register_battery_box({ + tier = "LV", + max_charge = 40000, + charge_rate = 1000, + discharge_rate = 4000, + charge_step = 500, + discharge_step = 800, +}) + diff --git a/mods/technic-master/technic/machines/LV/cables.lua b/mods/technic-master/technic/machines/LV/cables.lua new file mode 100644 index 0000000..e18eae1 --- /dev/null +++ b/mods/technic-master/technic/machines/LV/cables.lua @@ -0,0 +1,14 @@ + +minetest.register_alias("lv_cable", "technic:lv_cable0") + +minetest.register_craft({ + output = 'technic:lv_cable0 6', + recipe = { + {'default:paper', 'default:paper', 'default:paper'}, + {'default:copper_ingot', 'default:copper_ingot', 'default:copper_ingot'}, + {'default:paper', 'default:paper', 'default:paper'}, + } +}) + +technic.register_cable("LV", 2/16) + diff --git a/mods/technic-master/technic/machines/LV/cnc.lua b/mods/technic-master/technic/machines/LV/cnc.lua new file mode 100644 index 0000000..2a89a7a --- /dev/null +++ b/mods/technic-master/technic/machines/LV/cnc.lua @@ -0,0 +1,231 @@ +-- Technic CNC v1.0 by kpoppel +-- Based on the NonCubic Blocks MOD v1.4 by yves_de_beck + +-- Idea: +-- Somehow have a tabbed/paged panel if the number of shapes should expand +-- beyond what is available in the panel today. +-- I could imagine some form of API allowing modders to come with their own node +-- box definitions and easily stuff it in the this machine for production. + +local S = technic.getter + +local shape = {} +local onesize_products = { + slope = 2, + slope_edge = 1, + slope_inner_edge = 1, + pyramid = 2, + spike = 1, + cylinder = 2, + sphere = 1, + stick = 8, + slope_upsdown = 2, + slope_edge_upsdown = 1, + slope_inner_edge_upsdown = 1, + cylinder_horizontal = 2, + slope_lying = 2, + onecurvededge = 1, + twocurvededge = 1, +} +local twosize_products = { + element_straight = 4, + element_end = 2, + element_cross = 1, + element_t = 1, + element_edge = 2, +} + +local cnc_formspec = + "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; ]".. + "image_button[3,0.5;1,1;technic_cnc_slope_inner_edge.png;slope_inner_edge; ]".. + "image_button[4,0.5;1,1;technic_cnc_pyramid.png;pyramid; ]".. + "image_button[5,0.5;1,1;technic_cnc_spike.png;spike; ]".. + "image_button[6,0.5;1,1;technic_cnc_cylinder.png;cylinder; ]".. + "image_button[7,0.5;1,1;technic_cnc_sphere.png;sphere; ]".. + "image_button[8,0.5;1,1;technic_cnc_stick.png;stick; ]".. + + "image_button[1,1.5;1,1;technic_cnc_slope_upsdwn.png;slope_upsdown; ]".. + "image_button[2,1.5;1,1;technic_cnc_slope_edge_upsdwn.png;slope_edge_upsdown; ]".. + "image_button[3,1.5;1,1;technic_cnc_slope_inner_edge_upsdwn.png;slope_inner_edge_upsdown; ]".. + "image_button[4,1.5;1,1;technic_cnc_cylinder_horizontal.png;cylinder_horizontal; ]".. + + "image_button[1,2.5;1,1;technic_cnc_slope_lying.png;slope_lying; ]".. + "image_button[2,2.5;1,1;technic_cnc_onecurvededge.png;onecurvededge; ]".. + "image_button[3,2.5;1,1;technic_cnc_twocurvededge.png;twocurvededge; ]".. + + "label[1,3.5;"..S("Slim Elements half / normal height:").."]".. + + "image_button[1,4;1,0.5;technic_cnc_full.png;full; ]".. + "image_button[1,4.5;1,0.5;technic_cnc_half.png;half; ]".. + "image_button[2,4;1,1;technic_cnc_element_straight.png;element_straight; ]".. + "image_button[3,4;1,1;technic_cnc_element_end.png;element_end; ]".. + "image_button[4,4;1,1;technic_cnc_element_cross.png;element_cross; ]".. + "image_button[5,4;1,1;technic_cnc_element_t.png;element_t; ]".. + "image_button[6,4;1,1;technic_cnc_element_edge.png;element_edge; ]".. + + "label[0, 5.5;"..S("In:").."]".. + "list[current_name;src;0.5,5.5;1,1;]".. + "label[4, 5.5;"..S("Out:").."]".. + "list[current_name;dst;5,5.5;4,1;]".. + + "list[current_player;main;0,7;8,4;]" + +local size = 1; + +-- The form handler is declared here because we need it in both the inactive and active modes +-- in order to be able to change programs wile it is running. +local function form_handler(pos, formname, fields, sender) + -- REGISTER MILLING PROGRAMS AND OUTPUTS: + ------------------------------------------ + -- Program for half/full size + if fields["full"] then + size = 1 + return + end + + if fields["half"] then + size = 2 + return + end + + -- Resolve the node name and the number of items to make + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + local inputstack = inv:get_stack("src", 1) + local inputname = inputstack:get_name() + local multiplier = 0 + for k, _ in pairs(fields) do + -- Set a multipier for the half/full size capable blocks + if twosize_products[k] ~= nil then + multiplier = size * twosize_products[k] + else + multiplier = onesize_products[k] + end + + if onesize_products[k] ~= nil or twosize_products[k] ~= nil then + 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) + 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") + break + end + end + return +end + +-- Action code performing the transformation +local run = function(pos, node) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + local eu_input = meta:get_int("LV_EU_input") + local machine_name = S("%s CNC Machine"):format("LV") + local machine_node = "technic:cnc" + local demand = 450 + + local result = meta:get_string("cnc_product") + if inv:is_empty("src") or + (not minetest.registered_nodes[result]) or + (not inv:room_for_item("dst", result)) then + technic.swap_node(pos, machine_node) + meta:set_string("infotext", S("%s Idle"):format(machine_name)) + meta:set_string("cnc_product", "") + meta:set_int("LV_EU_demand", 0) + return + end + + if eu_input < demand then + technic.swap_node(pos, machine_node) + meta:set_string("infotext", S("%s Unpowered"):format(machine_name)) + elseif eu_input >= demand then + technic.swap_node(pos, machine_node.."_active") + meta:set_string("infotext", S("%s Active"):format(machine_name)) + meta:set_int("src_time", meta:get_int("src_time") + 1) + if meta:get_int("src_time") >= 3 then -- 3 ticks per output + meta:set_int("src_time", 0) + srcstack = inv:get_stack("src", 1) + srcstack:take_item() + inv:set_stack("src", 1, srcstack) + inv:add_item("dst", result.." "..meta:get_int("cnc_multiplier")) + end + end + meta:set_int("LV_EU_demand", demand) +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"}, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, + }, + }, + groups = {cracky=2, technic_machine=1}, + legacy_facedir_simple = true, + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("infotext", S("%s CNC Machine"):format("LV")) + meta:set_float("technic_power_machine", 1) + meta:set_string("formspec", cnc_formspec) + local inv = meta:get_inventory() + inv:set_size("src", 1) + inv:set_size("dst", 4) + end, + can_dig = technic.machine_can_dig, + allow_metadata_inventory_put = technic.machine_inventory_put, + allow_metadata_inventory_take = technic.machine_inventory_take, + allow_metadata_inventory_move = technic.machine_inventory_move, + on_receive_fields = form_handler, + technic_run = run, +}) + +-- 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"}, + paramtype2 = "facedir", + drop = "technic:cnc", + groups = {cracky=2, technic_machine=1, not_in_creative_inventory=1}, + legacy_facedir_simple = true, + can_dig = technic.machine_can_dig, + allow_metadata_inventory_put = technic.machine_inventory_put, + allow_metadata_inventory_take = technic.machine_inventory_take, + allow_metadata_inventory_move = technic.machine_inventory_move, + on_receive_fields = form_handler, + technic_run = run, + technic_disabled_machine_name = "technic:cnc", +}) + +technic.register_machine("LV", "technic:cnc", technic.receiver) +technic.register_machine("LV", "technic:cnc_active", technic.receiver) + +------------------------- +-- CNC Machine Recipe +------------------------- +minetest.register_craft({ + 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_cable0', 'technic:carbon_steel_ingot'}, + }, +}) + diff --git a/mods/technic-master/technic/machines/LV/cnc_api.lua b/mods/technic-master/technic/machines/LV/cnc_api.lua new file mode 100644 index 0000000..58708c9 --- /dev/null +++ b/mods/technic-master/technic/machines/LV/cnc_api.lua @@ -0,0 +1,356 @@ +-- API for the technic CNC machine +-- Again code is adapted from the NonCubic Blocks MOD v1.4 by yves_de_beck + +local S = technic.getter + +technic.cnc = {} + +technic.cnc.detail_level = 16 + +-- REGISTER NONCUBIC FORMS, CREATE MODELS AND RECIPES: +------------------------------------------------------ +local function cnc_sphere() + local nodebox = {} + local detail = technic.cnc.detail_level + local sehne + for i = 1, detail - 1 do + sehne = math.sqrt(0.25 - (((i / detail) - 0.5) ^ 2)) + nodebox[i]={-sehne, (i/detail) - 0.5, -sehne, sehne, (i/detail)+(1/detail)-0.5, sehne} + end + return nodebox +end + +local function cnc_cylinder_horizontal() + local nodebox = {} + local detail = technic.cnc.detail_level + local sehne + for i = 1, detail - 1 do + sehne = math.sqrt(0.25 - (((i / detail) - 0.5) ^ 2)) + nodebox[i]={-0.5, (i/detail)-0.5, -sehne, 0.5, (i/detail)+(1/detail)-0.5, sehne} + end + return nodebox +end + +local function cnc_cylinder() + local nodebox = {} + local detail = technic.cnc.detail_level + local sehne + for i = 1, detail - 1 do + sehne = math.sqrt(0.25 - (((i / detail) - 0.5) ^ 2)) + nodebox[i]={(i/detail) - 0.5, -0.5, -sehne, (i/detail)+(1/detail)-0.5, 0.5, sehne} + end + return nodebox +end + +local function cnc_twocurvededge() + local nodebox = {} + local detail = technic.cnc.detail_level * 2 + local sehne + for i = (detail / 2) - 1, detail - 1 do + sehne = math.sqrt(0.25 - (((i / detail) - 0.5) ^ 2)) + nodebox[i]={-sehne, -0.5, -sehne, 0.5, (i/detail)+(1/detail)-0.5, 0.5} + end + return nodebox +end + +local function cnc_onecurvededge() + local nodebox = {} + local detail = technic.cnc.detail_level * 2 + local sehne + for i = (detail / 2) - 1, detail - 1 do + sehne = math.sqrt(0.25 - (((i / detail) - 0.5) ^ 2)) + nodebox[i]={-0.5, -0.5, -sehne, 0.5, (i/detail)+(1/detail)-0.5, 0.5} + end + return nodebox +end + +local function cnc_spike() + local nodebox = {} + local detail = technic.cnc.detail_level + for i = 0, detail - 1 do + nodebox[i+1] = {(i/detail/2)-0.5, (i/detail/2)-0.5, (i/detail/2)-0.5, + 0.5-(i/detail/2), (i/detail)-0.5+(1/detail), 0.5-(i/detail/2)} + end + return nodebox +end + +local function cnc_pyramid() + local nodebox = {} + local detail = technic.cnc.detail_level / 2 + for i = 0, detail - 1 do + nodebox[i+1] = {(i/detail/2)-0.5, (i/detail/2)-0.5, (i/detail/2)-0.5, 0.5-(i/detail/2), (i/detail/2)-0.5+(1/detail), 0.5-(i/detail/2)} + end + return nodebox +end + +local function cnc_slope_inner_edge_upsdown() + local nodebox = {} + local detail = technic.cnc.detail_level + for i = 0, detail-1 do + nodebox[i+1] = {0.5-(i/detail)-(1/detail), (i/detail)-0.5, -0.5, 0.5, (i/detail)-0.5+(1/detail), 0.5} + nodebox[i+detail+1] = {-0.5, (i/detail)-0.5, 0.5-(i/detail)-(1/detail), 0.5, (i/detail)-0.5+(1/detail), 0.5} + end + return nodebox +end + +local function cnc_slope_edge_upsdown() + local nodebox = {} + local detail = technic.cnc.detail_level + for i = 0, detail-1 do + nodebox[i+1] = {(-1*(i/detail))+0.5-(1/detail), (i/detail)-0.5, (-1*(i/detail))+0.5-(1/detail), 0.5, (i/detail)-0.5+(1/detail), 0.5} + end + return nodebox +end + +local function cnc_slope_inner_edge() + local nodebox = {} + local detail = technic.cnc.detail_level + for i = 0, detail-1 do + nodebox[i+1] = {(i/detail)-0.5, -0.5, -0.5, 0.5, (i/detail)-0.5+(1/detail), 0.5} + nodebox[i+detail+1] = {-0.5, -0.5, (i/detail)-0.5, 0.5, (i/detail)-0.5+(1/detail), 0.5} + end + return nodebox +end + +local function cnc_slope_edge() + local nodebox = {} + local detail = technic.cnc.detail_level + for i = 0, detail-1 do + nodebox[i+1] = {(i/detail)-0.5, -0.5, (i/detail)-0.5, 0.5, (i/detail)-0.5+(1/detail), 0.5} + end + return nodebox +end + +local function cnc_slope_upsdown() + local nodebox = {} + local detail = technic.cnc.detail_level + for i = 0, detail-1 do + nodebox[i+1] = {-0.5, (i/detail)-0.5, (-1*(i/detail))+0.5-(1/detail), 0.5, (i/detail)-0.5+(1/detail), 0.5} + end + return nodebox +end + +local function cnc_slope_lying() + local nodebox = {} + local detail = technic.cnc.detail_level + for i = 0, detail-1 do + nodebox[i+1] = {(i/detail)-0.5, -0.5, (i/detail)-0.5, (i/detail)-0.5+(1/detail), 0.5 , 0.5} + end + return nodebox +end + +local function cnc_slope() + local nodebox = {} + local detail = technic.cnc.detail_level + for i = 0, detail-1 do + nodebox[i+1] = {-0.5, (i/detail)-0.5, (i/detail)-0.5, 0.5, (i/detail)-0.5+(1/detail), 0.5} + end + return nodebox +end + +-- Define slope boxes for the various nodes +------------------------------------------- +technic.cnc.programs = { + {suffix = "technic_cnc_stick", + nodebox = {-0.15, -0.5, -0.15, 0.15, 0.5, 0.15}, + desc = S("Stick")}, + + {suffix = "technic_cnc_element_end_double", + nodebox = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.5}, + desc = S("Element End Double")}, + + {suffix = "technic_cnc_element_cross_double", + nodebox = { + {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", + nodebox = { + {-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", + nodebox = { + {-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", + nodebox = {-0.3, -0.5, -0.5, 0.3, 0.5, 0.5}, + desc = S("Element Straight Double")}, + + {suffix = "technic_cnc_element_end", + nodebox = {-0.3, -0.5, -0.3, 0.3, 0, 0.5}, + desc = S("Element End")}, + + {suffix = "technic_cnc_element_cross", + nodebox = { + {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", + nodebox = { + {-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", + nodebox = { + {-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", + nodebox = {-0.3, -0.5, -0.5, 0.3, 0, 0.5}, + desc = S("Element Straight")}, + + {suffix = "technic_cnc_sphere", + nodebox = cnc_sphere(), + desc = S("Sphere")}, + + {suffix = "technic_cnc_cylinder_horizontal", + nodebox = cnc_cylinder_horizontal(), + desc = S("Horizontal Cylinder")}, + + {suffix = "technic_cnc_cylinder", + nodebox = cnc_cylinder(), + desc = S("Cylinder")}, + + {suffix = "technic_cnc_twocurvededge", + nodebox = cnc_twocurvededge(), + desc = S("Two Curved Edge Block")}, + + {suffix = "technic_cnc_onecurvededge", + nodebox = cnc_onecurvededge(), + desc = S("One Curved Edge Block")}, + + {suffix = "technic_cnc_spike", + nodebox = cnc_spike(), + desc = S("Spike")}, + + {suffix = "technic_cnc_pyramid", + nodebox = cnc_pyramid(), + desc = S("Pyramid")}, + + {suffix = "technic_cnc_slope_inner_edge_upsdown", + nodebox = cnc_slope_inner_edge_upsdown(), + desc = S("Slope Upside Down Inner Edge")}, + + {suffix = "technic_cnc_slope_edge_upsdown", + nodebox = cnc_slope_edge_upsdown(), + desc = S("Slope Upside Down Edge")}, + + {suffix = "technic_cnc_slope_inner_edge", + nodebox = cnc_slope_inner_edge(), + desc = S("Slope Inner Edge")}, + + {suffix = "technic_cnc_slope_edge", + nodebox = cnc_slope_edge(), + desc = S("Slope Edge")}, + + {suffix = "technic_cnc_slope_upsdown", + nodebox = cnc_slope_upsdown(), + desc = S("Slope Upside Down")}, + + {suffix = "technic_cnc_slope_lying", + nodebox = cnc_slope_lying(), + desc = S("Slope Lying")}, + + {suffix = "technic_cnc_slope", + nodebox = cnc_slope(), + desc = S("Slope")}, +} + +-- 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_sphere", "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"} +} + +-- Generic function for registering all the different node types +function technic.cnc.register_program(recipeitem, suffix, nodebox, groups, images, description) + minetest.register_node(":"..recipeitem.."_"..suffix, { + description = description, + drawtype = "nodebox", + tiles = images, + paramtype = "light", + paramtype2 = "facedir", + walkable = true, + node_box = { + type = "fixed", + fixed = nodebox + }, + groups = groups, + }) +end + +-- function to iterate over all the programs the CNC machine knows +function technic.cnc.register_all(recipeitem, groups, images, description) + for _, data in ipairs(technic.cnc.programs) do + -- Disable node creation for disabled node types for some material + local do_register = true + if technic.cnc.programs_disable[recipeitem] ~= nil then + for __, disable in ipairs(technic.cnc.programs_disable[recipeitem]) do + if disable == data.suffix then + do_register = false + end + end + end + -- Create the node if it passes the test + if do_register then + technic.cnc.register_program(recipeitem, data.suffix, data.nodebox, groups, images, description.." "..data.desc) + end + end +end + + +-- REGISTER NEW TECHNIC_CNC_API's PART 2: technic.cnc..register_element_end(subname, recipeitem, groups, images, desc_element_xyz) +----------------------------------------------------------------------------------------------------------------------- +function technic.cnc.register_slope_edge_etc(recipeitem, groups, images, desc_slope, desc_slope_lying, desc_slope_upsdown, desc_slope_edge, desc_slope_inner_edge, desc_slope_upsdwn_edge, desc_slope_upsdwn_inner_edge, desc_pyramid, desc_spike, desc_onecurvededge, desc_twocurvededge, desc_cylinder, desc_cylinder_horizontal, desc_sphere, desc_element_straight, desc_element_edge, desc_element_t, desc_element_cross, desc_element_end) + + technic.cnc.register_slope(recipeitem, groups, images, desc_slope) + technic.cnc.register_slope_lying(recipeitem, groups, images, desc_slope_lying) + technic.cnc.register_slope_upsdown(recipeitem, groups, images, desc_slope_upsdown) + technic.cnc.register_slope_edge(recipeitem, groups, images, desc_slope_edge) + technic.cnc.register_slope_inner_edge(recipeitem, groups, images, desc_slope_inner_edge) + technic.cnc.register_slope_edge_upsdown(recipeitem, groups, images, desc_slope_upsdwn_edge) + technic.cnc.register_slope_inner_edge_upsdown(recipeitem, groups, images, desc_slope_upsdwn_inner_edge) + technic.cnc.register_pyramid(recipeitem, groups, images, desc_pyramid) + technic.cnc.register_spike(recipeitem, groups, images, desc_spike) + technic.cnc.register_onecurvededge(recipeitem, groups, images, desc_onecurvededge) + technic.cnc.register_twocurvededge(recipeitem, groups, images, desc_twocurvededge) + technic.cnc.register_cylinder(recipeitem, groups, images, desc_cylinder) + technic.cnc.register_cylinder_horizontal(recipeitem, groups, images, desc_cylinder_horizontal) + technic.cnc.register_sphere(recipeitem, groups, images, desc_sphere) + technic.cnc.register_element_straight(recipeitem, groups, images, desc_element_straight) + technic.cnc.register_element_edge(recipeitem, groups, images, desc_element_edge) + technic.cnc.register_element_t(recipeitem, groups, images, desc_element_t) + technic.cnc.register_element_cross(recipeitem, groups, images, desc_element_cross) + technic.cnc.register_element_end(recipeitem, groups, images, desc_element_end) +end + +-- REGISTER STICKS: noncubic.register_xyz(recipeitem, groups, images, desc_element_xyz) +------------------------------------------------------------------------------------------------------------ +function technic.cnc.register_stick_etc(recipeitem, groups, images, desc_stick) + technic.cnc.register_stick(recipeitem, groups, images, desc_stick) +end + +function technic.cnc.register_elements(recipeitem, groups, images, desc_element_straight_double, desc_element_edge_double, desc_element_t_double, desc_element_cross_double, desc_element_end_double) + technic.cnc.register_element_straight_double(recipeitem, groups, images, desc_element_straight_double) + technic.cnc.register_element_edge_double(recipeitem, groups, images, desc_element_edge_double) + technic.cnc.register_element_t_double(recipeitem, groups, images, desc_element_t_double) + technic.cnc.register_element_cross_double(recipeitem, groups, images, desc_element_cross_double) + technic.cnc.register_element_end_double(recipeitem, groups, images, desc_element_end_double) +end + diff --git a/mods/technic-master/technic/machines/LV/cnc_nodes.lua b/mods/technic-master/technic/machines/LV/cnc_nodes.lua new file mode 100644 index 0000000..b250bc8 --- /dev/null +++ b/mods/technic-master/technic/machines/LV/cnc_nodes.lua @@ -0,0 +1,96 @@ +-- REGISTER MATERIALS AND PROPERTIES FOR NONCUBIC ELEMENTS: +----------------------------------------------------------- + +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"}, + S("Dirt")) +technic.cnc.programs_disable["default:dirt"] = {"technic_cnc_sphere", "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"} + +-- WOOD +------- +technic.cnc.register_all("default:wood", + {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"}, + S("Stone")) +-- COBBLE +--------- +technic.cnc.register_all("default:cobble", + {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"}, + S("Brick")) + +-- SANDSTONE +------------ +technic.cnc.register_all("default:sandstone", + {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"}, + 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"}, + S("Tree")) + +-- WROUGHT IRON +--------------- +technic.cnc.register_all("default:steelblock", + {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"}, + 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"}, + S("Stainless Steel")) + +-- Marble +------------ +technic.cnc.register_all("technic:marble", + {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"}, + S("Granite")) + diff --git a/mods/technic-master/technic/machines/LV/coal_alloy_furnace.lua b/mods/technic-master/technic/machines/LV/coal_alloy_furnace.lua new file mode 100644 index 0000000..a149921 --- /dev/null +++ b/mods/technic-master/technic/machines/LV/coal_alloy_furnace.lua @@ -0,0 +1,165 @@ + +-- Fuel driven alloy furnace. This uses no EUs: + +local S = technic.getter + +minetest.register_craft({ + output = 'technic:coal_alloy_furnace', + recipe = { + {'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]".. + "label[0,0;"..machine_name.."]".. + "image[2,2;1,1;default_furnace_fire_bg.png]".. + "list[current_name;fuel;2,3;1,1;]".. + "list[current_name;src;2,1;2,1;]".. + "list[current_name;dst;5,1;2,2;]".. + "list[current_player;main;0,5;8,4;]" + +minetest.register_node("technic:coal_alloy_furnace", { + description = machine_name, + 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"}, + paramtype2 = "facedir", + groups = {cracky=2}, + legacy_facedir_simple = true, + sounds = default.node_sound_stone_defaults(), + on_construct = function(pos) + local meta = minetest.env:get_meta(pos) + meta:set_string("formspec", formspec) + meta:set_string("infotext", machine_name) + local inv = meta:get_inventory() + inv:set_size("fuel", 1) + inv:set_size("src", 2) + inv:set_size("dst", 4) + end, + can_dig = technic.machine_can_dig, + allow_metadata_inventory_put = technic.machine_inventory_put, + allow_metadata_inventory_take = technic.machine_inventory_take, + allow_metadata_inventory_move = technic.machine_inventory_move, +}) + +minetest.register_node("technic:coal_alloy_furnace_active", { + description = machine_name, + 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"}, + paramtype2 = "facedir", + light_source = 8, + drop = "technic:coal_alloy_furnace", + groups = {cracky=2, not_in_creative_inventory=1}, + legacy_facedir_simple = true, + sounds = default.node_sound_stone_defaults(), + can_dig = technic.machine_can_dig, + allow_metadata_inventory_put = technic.machine_inventory_put, + allow_metadata_inventory_take = technic.machine_inventory_take, + allow_metadata_inventory_move = technic.machine_inventory_move, +}) + +minetest.register_abm({ + 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) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + + if inv:get_size("src") == 1 then -- Old furnace -> convert it + inv:set_size("src", 2) + inv:set_stack("src", 2, inv:get_stack("src2", 1)) + inv:set_size("src2", 0) + end + + local recipe = nil + + for i, name in pairs({ + "fuel_totaltime", + "fuel_time", + "src_totaltime", + "src_time"}) do + if not meta:get_float(name) then + meta:set_float(name, 0.0) + end + end + + -- Get what to cook if anything + local result = technic.get_recipe("alloy", inv:get_list("src")) + + local was_active = false + + if meta:get_float("fuel_time") < meta:get_float("fuel_totaltime") then + was_active = true + meta:set_int("fuel_time", meta:get_int("fuel_time") + 1) + if result then + meta:set_int("src_time", meta:get_int("src_time") + 1) + if meta:get_int("src_time") >= result.time then + meta:set_int("src_time", 0) + local result_stack = ItemStack(result.output) + if inv:room_for_item("dst", result_stack) then + inv:set_list("src", result.new_input) + inv:add_item("dst", result_stack) + end + end + else + meta:set_int("src_time", 0) + end + end + + if meta:get_float("fuel_time") < meta:get_float("fuel_totaltime") then + local percent = math.floor(meta:get_float("fuel_time") / + meta:get_float("fuel_totaltime") * 100) + meta:set_string("infotext", S("%s Active"):format(machine_name).." ("..percent.."%)") + technic.swap_node(pos, "technic:coal_alloy_furnace_active") + meta:set_string("formspec", + "size[8,9]".. + "label[0,0;"..machine_name.."]".. + "image[2,2;1,1;default_furnace_fire_bg.png^[lowpart:".. + (100 - percent)..":default_furnace_fire_fg.png]".. + "list[current_name;fuel;2,3;1,1;]".. + "list[current_name;src;2,1;2,1;]".. + "list[current_name;dst;5,1;2,2;]".. + "list[current_player;main;0,5;8,4;]") + return + end + + local recipe = technic.get_recipe("alloy", inv:get_list("src")) + + if not recipe then + if was_active then + meta:set_string("infotext", S("%s is empty"):format(machine_name)) + technic.swap_node(pos, "technic:coal_alloy_furnace") + meta:set_string("formspec", formspec) + end + return + end + + -- Next take a hard look at the fuel situation + local fuel = nil + local afterfuel + local fuellist = inv:get_list("fuel") + + if fuellist then + fuel, afterfuel = minetest.get_craft_result({method = "fuel", width = 1, items = fuellist}) + end + + if fuel.time <= 0 then + meta:set_string("infotext", S("%s Out Of Fuel"):format(machine_name)) + technic.swap_node(pos, "technic:coal_alloy_furnace") + meta:set_string("formspec", formspec) + return + end + + meta:set_string("fuel_totaltime", fuel.time) + meta:set_string("fuel_time", 0) + + inv:set_stack("fuel", 1, afterfuel.items[1]) + end, +}) + diff --git a/mods/technic-master/technic/machines/LV/coal_furnace.lua b/mods/technic-master/technic/machines/LV/coal_furnace.lua new file mode 100644 index 0000000..53a0f8b --- /dev/null +++ b/mods/technic-master/technic/machines/LV/coal_furnace.lua @@ -0,0 +1,5 @@ +local S = technic.getter + +if minetest.registered_nodes["default:furnace"].description == "Furnace" then + minetest.override_item("default:furnace", { description = S("Fuel-Fired Furnace") }) +end diff --git a/mods/technic-master/technic/machines/LV/compressor.lua b/mods/technic-master/technic/machines/LV/compressor.lua new file mode 100644 index 0000000..e2bde40 --- /dev/null +++ b/mods/technic-master/technic/machines/LV/compressor.lua @@ -0,0 +1,13 @@ + +minetest.register_alias("compressor", "technic:lv_compressor") + +minetest.register_craft({ + output = 'technic:lv_compressor', + recipe = { + {'default:stone', 'technic:motor', 'default:stone'}, + {'mesecons:piston', 'technic:machine_casing', 'mesecons:piston'}, + {'technic:fine_silver_wire', 'technic:lv_cable0', 'technic:fine_silver_wire'}, + } +}) + +technic.register_compressor({tier = "LV", demand = {300}, speed = 1}) diff --git a/mods/technic-master/technic/machines/LV/electric_furnace.lua b/mods/technic-master/technic/machines/LV/electric_furnace.lua new file mode 100644 index 0000000..cc4daff --- /dev/null +++ b/mods/technic-master/technic/machines/LV/electric_furnace.lua @@ -0,0 +1,16 @@ +-- LV Electric Furnace +-- This is a faster version of the stone furnace which runs on EUs + +-- FIXME: kpoppel I'd like to introduce an induction heating element here also +minetest.register_craft({ + output = 'technic:electric_furnace', + recipe = { + {'default:cobble', 'default:cobble', 'default:cobble'}, + {'default:cobble', 'technic:machine_casing', 'default:cobble'}, + {'default:cobble', 'technic:lv_cable0', 'default:cobble'}, + } +}) + +technic.register_electric_furnace({tier="LV", demand={300}, speed = 2}) + + diff --git a/mods/technic-master/technic/machines/LV/extractor.lua b/mods/technic-master/technic/machines/LV/extractor.lua new file mode 100644 index 0000000..363d2e3 --- /dev/null +++ b/mods/technic-master/technic/machines/LV/extractor.lua @@ -0,0 +1,13 @@ + +minetest.register_alias("extractor", "technic:lv_extractor") + +minetest.register_craft({ + output = 'technic:lv_extractor', + recipe = { + {'technic:treetap', 'technic:motor', 'technic:treetap'}, + {'technic:treetap', 'technic:machine_casing', 'technic:treetap'}, + {'', 'technic:lv_cable0', ''}, + } +}) + +technic.register_extractor({tier = "LV", demand = {300}, speed = 1}) diff --git a/mods/technic-master/technic/machines/LV/generator.lua b/mods/technic-master/technic/machines/LV/generator.lua new file mode 100644 index 0000000..999dbc5 --- /dev/null +++ b/mods/technic-master/technic/machines/LV/generator.lua @@ -0,0 +1,18 @@ +-- The electric generator. +-- A simple device to get started on the electric machines. +-- Inefficient and expensive in fuel (200EU per tick) +-- Also only allows for LV machinery to run. + +minetest.register_alias("lv_generator", "technic:lv_generator") + +minetest.register_craft({ + output = 'technic:lv_generator', + recipe = { + {'default:stone', 'default:furnace', 'default:stone'}, + {'default:stone', 'technic:machine_casing', 'default:stone'}, + {'default:stone', 'technic:lv_cable0', 'default:stone'}, + } +}) + +technic.register_generator({tier="LV", supply=200}) + diff --git a/mods/technic-master/technic/machines/LV/geothermal.lua b/mods/technic-master/technic/machines/LV/geothermal.lua new file mode 100644 index 0000000..e88d3c9 --- /dev/null +++ b/mods/technic-master/technic/machines/LV/geothermal.lua @@ -0,0 +1,111 @@ +-- A geothermal EU generator +-- Using hot lava and water this device can create energy from steam +-- The machine is only producing LV EUs and can thus not drive more advanced equipment +-- The output is a little more than the coal burning generator (max 300EUs) + +minetest.register_alias("geothermal", "technic:geothermal") + +local S = technic.getter + +minetest.register_craft({ + 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_cable0', 'technic:granite'}, + } +}) + +minetest.register_craftitem("technic:geothermal", { + description = S("Geothermal %s Generator"):format("LV"), +}) + +local check_node_around = function(pos) + local node = minetest.get_node(pos) + if node.name == "default:water_source" or node.name == "default:water_flowing" then return 1 end + if node.name == "default:lava_source" or node.name == "default:lava_flowing" then return 2 end + return 0 +end + +local run = function(pos, node) + local meta = minetest.get_meta(pos) + local water_nodes = 0 + local lava_nodes = 0 + local production_level = 0 + local eu_supply = 0 + + -- Correct positioning is water on one side and lava on the other. + -- The two cannot be adjacent because the lava the turns into obsidian or rock. + -- To get to 100% production stack the water and lava one extra block down as well: + -- WGL (W=Water, L=Lava, G=the generator, |=an LV cable) + -- 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}, + } + for _, p in pairs(positions) do + local check = check_node_around(p) + if check == 1 then water_nodes = water_nodes + 1 end + if check == 2 then lava_nodes = lava_nodes + 1 end + end + + if water_nodes == 1 and lava_nodes == 1 then production_level = 25; eu_supply = 50 end + if water_nodes == 2 and lava_nodes == 1 then production_level = 50; eu_supply = 100 end + if water_nodes == 1 and lava_nodes == 2 then production_level = 75; eu_supply = 200 end + if water_nodes == 2 and lava_nodes == 2 then production_level = 100; eu_supply = 300 end + + if production_level > 0 then + meta:set_int("LV_EU_supply", eu_supply) + end + + meta:set_string("infotext", + 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") + return + end + if production_level == 0 then + technic.swap_node(pos, "technic:geothermal") + meta:set_int("LV_EU_supply", 0) + end +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"}, + paramtype2 = "facedir", + groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1}, + legacy_facedir_simple = true, + sounds = default.node_sound_wood_defaults(), + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("infotext", S("Geothermal %s Generator"):format("LV")) + meta:set_int("LV_EU_supply", 0) + end, + technic_run = run, +}) + +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"}, + paramtype2 = "facedir", + groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1}, + legacy_facedir_simple = true, + sounds = default.node_sound_wood_defaults(), + drop = "technic:geothermal", + technic_run = run, +}) + +technic.register_machine("LV", "technic:geothermal", technic.producer) +technic.register_machine("LV", "technic:geothermal_active", technic.producer) + diff --git a/mods/technic-master/technic/machines/LV/grinder.lua b/mods/technic-master/technic/machines/LV/grinder.lua new file mode 100644 index 0000000..0ea8aeb --- /dev/null +++ b/mods/technic-master/technic/machines/LV/grinder.lua @@ -0,0 +1,13 @@ + +minetest.register_alias("grinder", "technic:grinder") +minetest.register_craft({ + output = 'technic:grinder', + recipe = { + {'default:desert_stone', 'default:diamond', 'default:desert_stone'}, + {'default:desert_stone', 'technic:machine_casing', 'default:desert_stone'}, + {'technic:granite', 'technic:lv_cable0', 'technic:granite'}, + } +}) + +technic.register_grinder({tier="LV", demand={200}, speed=1}) + diff --git a/mods/technic-master/technic/machines/LV/init.lua b/mods/technic-master/technic/machines/LV/init.lua new file mode 100644 index 0000000..f8778cd --- /dev/null +++ b/mods/technic-master/technic/machines/LV/init.lua @@ -0,0 +1,33 @@ + +technic.register_tier("LV", "Low Voltage") + +local path = technic.modpath.."/machines/LV" + +-- Wiring stuff +dofile(path.."/cables.lua") +dofile(path.."/battery_box.lua") + +-- Generators +dofile(path.."/solar_panel.lua") +dofile(path.."/solar_array.lua") +dofile(path.."/geothermal.lua") +dofile(path.."/water_mill.lua") +dofile(path.."/generator.lua") + +-- Coal-powered machines (TODO -> move to somewhere else?) +dofile(path.."/coal_alloy_furnace.lua") +dofile(path.."/coal_furnace.lua") + +-- Machines +dofile(path.."/alloy_furnace.lua") +dofile(path.."/electric_furnace.lua") +dofile(path.."/grinder.lua") +dofile(path.."/extractor.lua") +dofile(path.."/compressor.lua") + +dofile(path.."/music_player.lua") + +dofile(path.."/cnc.lua") +dofile(path.."/cnc_api.lua") +dofile(path.."/cnc_nodes.lua") + diff --git a/mods/technic-master/technic/machines/LV/music_player.lua b/mods/technic-master/technic/machines/LV/music_player.lua new file mode 100644 index 0000000..dc7e2d0 --- /dev/null +++ b/mods/technic-master/technic/machines/LV/music_player.lua @@ -0,0 +1,130 @@ +-- LV Music player. +-- The player can play music. But it is high ampage! + +local S = technic.getter + +minetest.register_alias("music_player", "technic:music_player") +minetest.register_craft({ + output = 'technic:music_player', + recipe = { + {'technic:chromium_ingot', 'default:diamond', 'technic:chromium_ingot'}, + {'default:diamond', 'technic:machine_casing', 'default:diamond'}, + {'default:mossycobble', 'technic:lv_cable0', 'default:mossycobble'}, + } +}) + +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,}) +end + +local run = function(pos, node) + local meta = minetest.get_meta(pos) + local eu_input = meta:get_int("LV_EU_input") + local machine_name = S("%s Music Player"):format("LV") + local machine_node = "technic:music_player" + local demand = 150 + + local current_track = meta:get_int("current_track") + local pos_hash = minetest.hash_node_position(pos) + local music_handle = music_handles[pos_hash] + + -- Setup meta data if it does not exist. + if not eu_input then + meta:set_int("LV_EU_demand", demand) + meta:set_int("LV_EU_input", 0) + return + end + + if meta:get_int("active") == 0 then + meta:set_string("infotext", S("%s Idle"):format(machine_name)) + meta:set_int("LV_EU_demand", 0) + return + end + + if eu_input < demand then + meta:set_string("infotext", S("%s Unpowered"):format(machine_name)) + if music_handle then + minetest.sound_stop(music_handle) + music_handle = nil + end + elseif eu_input >= demand then + meta:set_string("infotext", S("%s Active"):format(machine_name)) + if not music_handle then + music_handle = play_track(pos, current_track) + end + end + music_handles[pos_hash] = music_handle + meta:set_int("LV_EU_demand", demand) +end + +local function stop_player(pos, node) + local pos_hash = minetest.hash_node_position(pos) + local music_handle = music_handles[pos_hash] + if music_handle then + minetest.sound_stop(music_handle) + music_handles[pos_hash] = nil + end +end + +local function set_display(meta) + meta:set_string("formspec", + "size[4,4.5]".. + "item_image[0,0;1,1;technic:music_player]".. + "label[1,0;"..S("%s Music Player"):format("LV").."]".. + "button[0,1;1,1;track1;1]".. + "button[1,1;1,1;track2;2]".. + "button[2,1;1,1;track3;3]".. + "button[0,2;1,1;track4;4]".. + "button[1,2;1,1;track5;5]".. + "button[2,2;1,1;track6;6]".. + "button[0,3;1,1;track7;7]".. + "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 + 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}, + sounds = default.node_sound_wood_defaults(), + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("infotext", S("%s Music Player"):format("LV")) + set_display(meta) + end, + on_receive_fields = function(pos, formanme, fields, sender) + local new_track = nil + if fields.stop then new_track = 0 end + if fields.track1 then new_track = 1 end + if fields.track2 then new_track = 2 end + if fields.track3 then new_track = 3 end + if fields.track4 then new_track = 4 end + if fields.track5 then new_track = 5 end + if fields.track6 then new_track = 6 end + if fields.track7 then new_track = 7 end + if fields.track8 then new_track = 8 end + if fields.track9 then new_track = 9 end + if new_track then + stop_player(pos) + local meta = minetest.get_meta(pos) + meta:set_int("active", new_track == 0 and 0 or 1) + meta:set_int("current_track", new_track) + set_display(meta) + end + end, + on_destruct = stop_player, + technic_run = run, + technic_on_disable = stop_player, +}) + +technic.register_machine("LV", "technic:music_player", technic.receiver) + diff --git a/mods/technic-master/technic/machines/LV/solar_array.lua b/mods/technic-master/technic/machines/LV/solar_array.lua new file mode 100644 index 0000000..4d2c3b3 --- /dev/null +++ b/mods/technic-master/technic/machines/LV/solar_array.lua @@ -0,0 +1,18 @@ +-- The solar array is an assembly of panels into a powerful array +-- The assembly can deliver more energy than the individual panel because +-- of the transformer unit which converts the panel output variations into +-- a stable supply. +-- Solar arrays are not able to store large amounts of energy. +-- The LV arrays are used to make medium voltage arrays. + +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_cable0', ''}, + } +}) + +technic.register_solar_array({tier="LV", power=10}) + diff --git a/mods/technic-master/technic/machines/LV/solar_panel.lua b/mods/technic-master/technic/machines/LV/solar_panel.lua new file mode 100644 index 0000000..959de52 --- /dev/null +++ b/mods/technic-master/technic/machines/LV/solar_panel.lua @@ -0,0 +1,67 @@ +-- Solar panels are the building blocks of LV solar arrays +-- They can however also be used separately but with reduced efficiency due to the missing transformer. +-- Individual panels are less efficient than when the panels are combined into full arrays. + +local S = technic.getter + +local run = function(pos, node) + -- The action here is to make the solar panel prodice power + -- Power is dependent on the light level and the height above ground + -- There are many ways to cheat by using other light sources like lamps. + -- 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 machine_name = S("Small Solar %s Generator"):format("LV") + + local light = minetest.get_node_light(pos1, nil) + local time_of_day = minetest.get_timeofday() + local meta = minetest.get_meta(pos) + if light == nil then light = 0 end + -- turn on panel only during day time and if sufficient light + -- I know this is counter intuitive when cheating by using other light sources underground. + if light >= 12 and time_of_day >= 0.24 and time_of_day <= 0.76 and pos.y > -10 then + local charge_to_give = math.floor((light + pos1.y) * 3) + charge_to_give = math.max(charge_to_give, 0) + charge_to_give = math.min(charge_to_give, 200) + meta:set_string("infotext", S("%s Active"):format(machine_name).." ("..charge_to_give.."EU)") + meta:set_int("LV_EU_supply", charge_to_give) + else + meta:set_string("infotext", S("%s Idle"):format(machine_name)) + meta:set_int("LV_EU_supply", 0) + end +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}, + sounds = default.node_sound_wood_defaults(), + description = S("Small Solar %s Generator"):format("LV"), + active = false, + drawtype = "nodebox", + paramtype = "light", + is_ground_content = true, + node_box = { + type = "fixed", + fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5}, + }, + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_int("LV_EU_supply", 0) + meta:set_string("infotext", S("Small Solar %s Generator"):format("LV")) + end, + technic_run = run, +}) + +minetest.register_craft({ + output = 'technic:solar_panel', + recipe = { + {'technic:doped_silicon_wafer', 'technic:doped_silicon_wafer', 'technic:doped_silicon_wafer'}, + {'technic:fine_silver_wire', 'technic:lv_cable0', 'mesecons_materials:glue'}, + + } +}) + +technic.register_machine("LV", "technic:solar_panel", technic.producer) + diff --git a/mods/technic-master/technic/machines/LV/water_mill.lua b/mods/technic-master/technic/machines/LV/water_mill.lua new file mode 100644 index 0000000..9088d1d --- /dev/null +++ b/mods/technic-master/technic/machines/LV/water_mill.lua @@ -0,0 +1,102 @@ +-- A water mill produces LV EUs by exploiting flowing water across it +-- It is a LV EU supplyer and fairly low yield (max 120EUs) +-- It is a little under half as good as the thermal generator. + +local S = technic.getter + +minetest.register_alias("water_mill", "technic:water_mill") + +minetest.register_craft({ + output = 'technic:water_mill', + recipe = { + {'technic:marble', 'default:diamond', 'technic:marble'}, + {'group:wood', 'technic:machine_casing', 'group:wood'}, + {'technic:marble', 'technic:lv_cable0', 'technic:marble'}, + } +}) + +local function check_node_around_mill(pos) + local node = minetest.get_node(pos) + if node.name == "default:water_flowing" or + node.name == "default:water_source" then + return true + end + return false +end + +local run = function(pos, node) + local meta = minetest.get_meta(pos) + local water_nodes = 0 + local lava_nodes = 0 + local production_level = 0 + local eu_supply = 0 + + 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}, + } + + for _, p in pairs(positions) do + local check = check_node_around_mill(p) + if check then + water_nodes = water_nodes + 1 + end + end + + production_level = 25 * water_nodes + eu_supply = 30 * water_nodes + + if production_level > 0 then + meta:set_int("LV_EU_supply", eu_supply) + end + + meta:set_string("infotext", + S("Hydro %s Generator"):format("LV").." ("..production_level.."%)") + + if production_level > 0 and + minetest.get_node(pos).name == "technic:water_mill" then + technic.swap_node (pos, "technic:water_mill_active") + meta:set_int("LV_EU_supply", 0) + return + end + if production_level == 0 then + technic.swap_node(pos, "technic:water_mill") + end +end + +minetest.register_node("technic:water_mill", { + description = S("Hydro %s Generator"):format("LV"), + 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"}, + paramtype2 = "facedir", + groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1}, + legacy_facedir_simple = true, + sounds = default.node_sound_wood_defaults(), + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("infotext", S("Hydro %s Generator"):format("LV")) + meta:set_int("LV_EU_supply", 0) + end, + technic_run = run, +}) + +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", + "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, not_in_creative_inventory=1}, + legacy_facedir_simple = true, + sounds = default.node_sound_wood_defaults(), + drop = "technic:water_mill", + technic_run = run, + technic_disabled_machine_name = "technic:water_mill", +}) + +technic.register_machine("LV", "technic:water_mill", technic.producer) +technic.register_machine("LV", "technic:water_mill_active", technic.producer) + diff --git a/mods/technic-master/technic/machines/MV/alloy_furnace.lua b/mods/technic-master/technic/machines/MV/alloy_furnace.lua new file mode 100644 index 0000000..a1918fd --- /dev/null +++ b/mods/technic-master/technic/machines/MV/alloy_furnace.lua @@ -0,0 +1,14 @@ +-- MV alloy furnace + +minetest.register_craft({ + 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_cable0', 'technic:stainless_steel_ingot'}, + } +}) + + +technic.register_alloy_furnace({tier = "MV", speed = 1.5, upgrade = 1, tube = 1, demand = {3000, 2000, 1000}}) + diff --git a/mods/technic-master/technic/machines/MV/battery_box.lua b/mods/technic-master/technic/machines/MV/battery_box.lua new file mode 100644 index 0000000..45437c1 --- /dev/null +++ b/mods/technic-master/technic/machines/MV/battery_box.lua @@ -0,0 +1,22 @@ +-- MV Battery box + +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_cable0', ''}, + } +}) + +technic.register_battery_box({ + tier = "MV", + max_charge = 200000, + charge_rate = 20000, + discharge_rate = 80000, + charge_step = 2000, + discharge_step = 8000, + upgrade = 1, + tube = 1, +}) + diff --git a/mods/technic-master/technic/machines/MV/cables.lua b/mods/technic-master/technic/machines/MV/cables.lua new file mode 100644 index 0000000..b1a34c8 --- /dev/null +++ b/mods/technic-master/technic/machines/MV/cables.lua @@ -0,0 +1,14 @@ + +minetest.register_alias("mv_cable", "technic:mv_cable0") + +minetest.register_craft({ + output = 'technic:mv_cable0 3', + recipe ={ + {'technic:rubber', 'technic:rubber', 'technic:rubber'}, + {'technic:lv_cable0', 'technic:lv_cable0', 'technic:lv_cable0'}, + {'technic:rubber', 'technic:rubber', 'technic:rubber'}, + } +}) + +technic.register_cable("MV", 2.5/16) + diff --git a/mods/technic-master/technic/machines/MV/centrifuge.lua b/mods/technic-master/technic/machines/MV/centrifuge.lua new file mode 100644 index 0000000..5bf24bf --- /dev/null +++ b/mods/technic-master/technic/machines/MV/centrifuge.lua @@ -0,0 +1,16 @@ +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_cable0", "pipeworks:mese_filter" }, + } +}) + +technic.register_centrifuge({ + tier = "MV", + demand = { 8000, 7000, 6000 }, + speed = 2, + upgrade = 1, + tube = 1, +}) diff --git a/mods/technic-master/technic/machines/MV/compressor.lua b/mods/technic-master/technic/machines/MV/compressor.lua new file mode 100644 index 0000000..5b36cc5 --- /dev/null +++ b/mods/technic-master/technic/machines/MV/compressor.lua @@ -0,0 +1,12 @@ +-- MV compressor + +minetest.register_craft({ + 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_cable0', 'technic:stainless_steel_ingot'}, + } +}) + +technic.register_compressor({tier = "MV", demand = {800, 600, 400}, speed = 2, upgrade = 1, tube = 1}) diff --git a/mods/technic-master/technic/machines/MV/electric_furnace.lua b/mods/technic-master/technic/machines/MV/electric_furnace.lua new file mode 100644 index 0000000..1f6b1c2 --- /dev/null +++ b/mods/technic-master/technic/machines/MV/electric_furnace.lua @@ -0,0 +1,18 @@ +-- MV Electric Furnace +-- This is a faster version of the stone furnace which runs on EUs +-- In addition to this it can be upgraded with microcontrollers and batteries +-- This new version uses the batteries to lower the power consumption of the machine +-- Also in addition this furnace can be attached to the pipe system from the pipeworks mod. + +-- FIXME: kpoppel I'd like to introduce an induction heating element here also +minetest.register_craft({ + 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_cable0', 'technic:stainless_steel_ingot'}, + } +}) + +technic.register_electric_furnace({tier="MV", upgrade=1, tube=1, demand={2000, 1000, 500}, speed=4}) + diff --git a/mods/technic-master/technic/machines/MV/extractor.lua b/mods/technic-master/technic/machines/MV/extractor.lua new file mode 100644 index 0000000..fdef5b2 --- /dev/null +++ b/mods/technic-master/technic/machines/MV/extractor.lua @@ -0,0 +1,12 @@ +-- MV extractor + +minetest.register_craft({ + 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_cable0', 'technic:stainless_steel_ingot'}, + } +}) + +technic.register_extractor({tier = "MV", demand = {800, 600, 400}, speed = 2, upgrade = 1, tube = 1}) diff --git a/mods/technic-master/technic/machines/MV/generator.lua b/mods/technic-master/technic/machines/MV/generator.lua new file mode 100644 index 0000000..4ae24b8 --- /dev/null +++ b/mods/technic-master/technic/machines/MV/generator.lua @@ -0,0 +1,13 @@ +minetest.register_alias("generator_mv", "technic:generator_mv") + +minetest.register_craft({ + 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_cable0', 'technic:stainless_steel_ingot'}, + } +}) + +technic.register_generator({tier="MV", tube=1, supply=600}) + diff --git a/mods/technic-master/technic/machines/MV/grinder.lua b/mods/technic-master/technic/machines/MV/grinder.lua new file mode 100644 index 0000000..dac536c --- /dev/null +++ b/mods/technic-master/technic/machines/MV/grinder.lua @@ -0,0 +1,13 @@ +-- MV grinder + +minetest.register_craft({ + 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_cable0', 'technic:stainless_steel_ingot'}, + } +}) + +technic.register_grinder({tier="MV", demand={600, 450, 300}, speed=2, upgrade=1, tube=1}) + diff --git a/mods/technic-master/technic/machines/MV/init.lua b/mods/technic-master/technic/machines/MV/init.lua new file mode 100644 index 0000000..72a98b6 --- /dev/null +++ b/mods/technic-master/technic/machines/MV/init.lua @@ -0,0 +1,32 @@ + +technic.register_tier("MV", "Medium Voltage") + +local path = technic.modpath.."/machines/MV" + +-- Wiring stuff +dofile(path.."/cables.lua") +dofile(path.."/battery_box.lua") + +-- Generators +if technic.config:get_bool("enable_wind_mill") then + dofile(path.."/wind_mill.lua") +end +dofile(path.."/generator.lua") +dofile(path.."/solar_array.lua") + +-- Machines +dofile(path.."/alloy_furnace.lua") +dofile(path.."/electric_furnace.lua") +dofile(path.."/grinder.lua") +dofile(path.."/extractor.lua") +dofile(path.."/compressor.lua") +dofile(path.."/centrifuge.lua") + +dofile(path.."/tool_workshop.lua") + +-- The power radiator supplies appliances with inductive coupled power: +-- Lighting and associated textures is taken directly from VanessaE's homedecor and made electric. +-- This is currently useless, slow, and mostly copied +--dofile(path.."/power_radiator.lua") +--dofile(path.."/lighting.lua") + diff --git a/mods/technic-master/technic/machines/MV/lighting.lua b/mods/technic-master/technic/machines/MV/lighting.lua new file mode 100644 index 0000000..76fcb20 --- /dev/null +++ b/mods/technic-master/technic/machines/MV/lighting.lua @@ -0,0 +1,590 @@ +-- NOTE: The code is takes directly from VanessaE's homedecor mod. +-- I just made it the lights into indictive appliances for this mod. + +-- This file supplies electric powered glowlights + +-- Boilerplate to support localized strings if intllib mod is installed. +local S +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 +end + +function technic_homedecor_node_is_owned(pos, placer) + local ownername = false + if type(IsPlayerNodeOwner) == "function" then -- node_ownership mod + if HasOwner(pos, placer) then + if not IsPlayerNodeOwner(pos, placer:get_player_name()) then + if type(getLastOwner) == "function" then -- ...is an old version + ownername = getLastOwner(pos) + elseif type(GetNodeOwnerName) == "function" then -- ...is a recent version + ownername = GetNodeOwnerName(pos) + else + ownername = S("someone") + end + end + end + + elseif type(isprotect) == "function" then -- glomie's protection mod + if not isprotect(5, pos, placer) then + ownername = S("someone") + end + elseif type(protector) == "table" and type(protector.can_dig) == "function" then -- Zeg9's protection mod + if not protector.can_dig(5, pos, placer) then + ownername = S("someone") + end + end + + if ownername ~= false then + 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 technic_homedecor_rotate_and_place = function(itemstack, placer, pointed_thing) + if not technic_homedecor_node_is_owned(pointed_thing.under, placer) + and not technic_homedecor_node_is_owned(pointed_thing.above, placer) then + local node = minetest.get_node(pointed_thing.under) + if not minetest.registered_nodes[node.name] or not minetest.registered_nodes[node.name].on_rightclick then + + local above = pointed_thing.above + local under = pointed_thing.under + local pitch = placer:get_look_pitch() + local pname = minetest.get_node(under).name + local node = minetest.get_node(above) + local fdir = minetest.dir_to_facedir(placer:get_look_dir()) + local wield_name = itemstack:get_name() + + if not minetest.registered_nodes[pname] + or not minetest.registered_nodes[pname].on_rightclick then + + local iswall = (above.x ~= under.x) or (above.z ~= under.z) + local isceiling = (above.x == under.x) and (above.z == under.z) and (pitch > 0) + local pos1 = above + + if minetest.registered_nodes[pname]["buildable_to"] then + pos1 = under + iswall = false + end + + 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 + elseif isceiling then + 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 + end + + if not homedecor_expect_infinite_stacks then + itemstack:take_item() + return itemstack + end + end + else + minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, placer, itemstack) + end + end +end + +-- Yellow -- Half node +minetest.register_node('technic:homedecor_glowlight_half_yellow', { + description = S("Yellow Glowlight (thick)"), + drawtype = "nodebox", + tiles = { + 'technic_homedecor_glowlight_yellow_tb.png', + 'technic_homedecor_glowlight_yellow_tb.png', + 'technic_homedecor_glowlight_thick_yellow_sides.png', + 'technic_homedecor_glowlight_thick_yellow_sides.png', + 'technic_homedecor_glowlight_thick_yellow_sides.png', + 'technic_homedecor_glowlight_thick_yellow_sides.png' + }, + selection_box = { + type = "fixed", + fixed = { -0.5, -0.5, -0.5, 0.5, 0, 0.5 } + }, + node_box = { + 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) + return itemstack + end, + on_construct = function(pos) + technic.inductive_on_construct(pos, 100, "Yellow Glowlight (thick)") + end, + on_punch = function(pos, node, puncher) + technic.inductive_on_punch_off(pos, 100, "technic:homedecor_glowlight_half_yellow_active") + end +}) + +minetest.register_node('technic:homedecor_glowlight_half_yellow_active', { + description = S("Yellow Glowlight (thick)"), + drawtype = "nodebox", + tiles = { + 'technic_homedecor_glowlight_yellow_tb.png', + 'technic_homedecor_glowlight_yellow_tb.png', + 'technic_homedecor_glowlight_thick_yellow_sides.png', + 'technic_homedecor_glowlight_thick_yellow_sides.png', + 'technic_homedecor_glowlight_thick_yellow_sides.png', + 'technic_homedecor_glowlight_thick_yellow_sides.png' + }, + selection_box = { + type = "fixed", + fixed = { -0.5, -0.5, -0.5, 0.5, 0, 0.5 } + }, + node_box = { + 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", + on_place = function(itemstack, placer, pointed_thing) + technic_homedecor_rotate_and_place(itemstack, placer, pointed_thing) + return itemstack + end, + on_construct = function(pos) + technic.inductive_on_construct(pos, 100, "Yellow Glowlight (thick)") + end, + on_punch = function(pos, node, puncher) + technic.inductive_on_punch_on(pos, 0, "technic:homedecor_glowlight_half_yellow") + end +}) + +-- Yellow -- Quarter node +minetest.register_node('technic:homedecor_glowlight_quarter_yellow', { + description = S("Yellow Glowlight (thin)"), + drawtype = "nodebox", + tiles = { + 'technic_homedecor_glowlight_yellow_tb.png', + 'technic_homedecor_glowlight_yellow_tb.png', + 'technic_homedecor_glowlight_thin_yellow_sides.png', + 'technic_homedecor_glowlight_thin_yellow_sides.png', + 'technic_homedecor_glowlight_thin_yellow_sides.png', + 'technic_homedecor_glowlight_thin_yellow_sides.png' + }, + selection_box = { + type = "fixed", + fixed = { -0.5, -0.5, -0.5, 0.5, -0.25, 0.5 } + }, + node_box = { + 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) + return itemstack + end, + on_construct = function(pos) + technic.inductive_on_construct(pos, 100, "Yellow Glowlight (thin)") + end, + on_punch = function(pos, node, puncher) + technic.inductive_on_punch_off(pos, 100, "technic:homedecor_glowlight_quarter_yellow_active") + end +}) + +minetest.register_node('technic:homedecor_glowlight_quarter_yellow_active', { + description = S("Yellow Glowlight (thin)"), + drawtype = "nodebox", + tiles = { + 'technic_homedecor_glowlight_yellow_tb.png', + 'technic_homedecor_glowlight_yellow_tb.png', + 'technic_homedecor_glowlight_thin_yellow_sides.png', + 'technic_homedecor_glowlight_thin_yellow_sides.png', + 'technic_homedecor_glowlight_thin_yellow_sides.png', + 'technic_homedecor_glowlight_thin_yellow_sides.png' + }, + selection_box = { + type = "fixed", + fixed = { -0.5, -0.5, -0.5, 0.5, -0.25, 0.5 } + }, + node_box = { + 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, + sounds = default.node_sound_wood_defaults(), + + 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 + end, + on_construct = function(pos) + technic.inductive_on_construct(pos, 100, "Yellow Glowlight (thin)") + end, + on_punch = function(pos, node, puncher) + technic.inductive_on_punch_on(pos, 0, "technic:homedecor_glowlight_quarter_yellow") + end +}) + + +-- White -- half node +minetest.register_node('technic:homedecor_glowlight_half_white', { + description = S("White Glowlight (thick)"), + drawtype = "nodebox", + tiles = { + 'technic_homedecor_glowlight_white_tb.png', + 'technic_homedecor_glowlight_white_tb.png', + 'technic_homedecor_glowlight_thick_white_sides.png', + 'technic_homedecor_glowlight_thick_white_sides.png', + 'technic_homedecor_glowlight_thick_white_sides.png', + 'technic_homedecor_glowlight_thick_white_sides.png' + }, + selection_box = { + type = "fixed", + fixed = { -0.5, -0.5, -0.5, 0.5, 0, 0.5 } + }, + node_box = { + 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) + return itemstack + end, + on_construct = function(pos) + technic.inductive_on_construct(pos, 100, "White Glowlight (thick)") + end, + on_punch = function(pos, node, puncher) + technic.inductive_on_punch_off(pos, 100, "technic:homedecor_glowlight_half_white_active") + end +}) + +minetest.register_node('technic:homedecor_glowlight_half_white_active', { + description = S("White Glowlight (thick)"), + drawtype = "nodebox", + tiles = { + 'technic_homedecor_glowlight_white_tb.png', + 'technic_homedecor_glowlight_white_tb.png', + 'technic_homedecor_glowlight_thick_white_sides.png', + 'technic_homedecor_glowlight_thick_white_sides.png', + 'technic_homedecor_glowlight_thick_white_sides.png', + 'technic_homedecor_glowlight_thick_white_sides.png' + }, + selection_box = { + type = "fixed", + fixed = { -0.5, -0.5, -0.5, 0.5, 0, 0.5 } + }, + node_box = { + 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", + on_place = function(itemstack, placer, pointed_thing) + technic_homedecor_rotate_and_place(itemstack, placer, pointed_thing) + return itemstack + end, + on_construct = function(pos) + technic.inductive_on_construct(pos, 100, "White Glowlight (thick)") + end, + on_punch = function(pos, node, puncher) + technic.inductive_on_punch_on(pos, 0, "technic:homedecor_glowlight_half_white") + end +}) + +-- White -- Quarter node +minetest.register_node('technic:homedecor_glowlight_quarter_white', { + description = S("White Glowlight (thin)"), + drawtype = "nodebox", + tiles = { + 'technic_homedecor_glowlight_white_tb.png', + 'technic_homedecor_glowlight_white_tb.png', + 'technic_homedecor_glowlight_thin_white_sides.png', + 'technic_homedecor_glowlight_thin_white_sides.png', + 'technic_homedecor_glowlight_thin_white_sides.png', + 'technic_homedecor_glowlight_thin_white_sides.png' + }, + selection_box = { + type = "fixed", + fixed = { -0.5, -0.5, -0.5, 0.5, -0.25, 0.5 } + }, + node_box = { + 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) + return itemstack + end, + on_construct = function(pos) + technic.inductive_on_construct(pos, 100, "White Glowlight (thin)") + end, + on_punch = function(pos, node, puncher) + technic.inductive_on_punch_off(pos, 100, "technic:homedecor_glowlight_quarter_white_active") + end +}) + +minetest.register_node('technic:homedecor_glowlight_quarter_white_active', { + description = S("White Glowlight (thin)"), + drawtype = "nodebox", + tiles = { + 'technic_homedecor_glowlight_white_tb.png', + 'technic_homedecor_glowlight_white_tb.png', + 'technic_homedecor_glowlight_thin_white_sides.png', + 'technic_homedecor_glowlight_thin_white_sides.png', + 'technic_homedecor_glowlight_thin_white_sides.png', + 'technic_homedecor_glowlight_thin_white_sides.png' + }, + selection_box = { + type = "fixed", + fixed = { -0.5, -0.5, -0.5, 0.5, -0.25, 0.5 } + }, + node_box = { + 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, + sounds = default.node_sound_wood_defaults(), + + 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 + end, + on_construct = function(pos) + technic.inductive_on_construct(pos, 100, "White Glowlight (thin)") + end, + on_punch = function(pos, node, puncher) + technic.inductive_on_punch_on(pos, 0, "technic:homedecor_glowlight_quarter_white") + end +}) + +-- Glowlight "cubes" - yellow +minetest.register_node('technic:homedecor_glowlight_small_cube_yellow', { + description = S("Yellow Glowlight (small cube)"), + drawtype = "nodebox", + tiles = { + 'technic_homedecor_glowlight_cube_yellow_tb.png', + 'technic_homedecor_glowlight_cube_yellow_tb.png', + 'technic_homedecor_glowlight_cube_yellow_sides.png', + 'technic_homedecor_glowlight_cube_yellow_sides.png', + 'technic_homedecor_glowlight_cube_yellow_sides.png', + 'technic_homedecor_glowlight_cube_yellow_sides.png' + }, + selection_box = { + type = "fixed", + fixed = { -0.25, -0.5, -0.25, 0.25, 0, 0.25 } + }, + node_box = { + 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) + return itemstack + end, + on_construct = function(pos) + technic.inductive_on_construct(pos, 50, "Yellow Glowlight (small cube)") + end, + on_punch = function(pos, node, puncher) + technic.inductive_on_punch_off(pos, 50, "technic:homedecor_glowlight_small_cube_yellow_active") + end +}) + +minetest.register_node('technic:homedecor_glowlight_small_cube_yellow_active', { + description = S("Yellow Glowlight (small cube)"), + drawtype = "nodebox", + tiles = { + 'technic_homedecor_glowlight_cube_yellow_tb.png', + 'technic_homedecor_glowlight_cube_yellow_tb.png', + 'technic_homedecor_glowlight_cube_yellow_sides.png', + 'technic_homedecor_glowlight_cube_yellow_sides.png', + 'technic_homedecor_glowlight_cube_yellow_sides.png', + 'technic_homedecor_glowlight_cube_yellow_sides.png' + }, + selection_box = { + type = "fixed", + fixed = { -0.25, -0.5, -0.25, 0.25, 0, 0.25 } + }, + node_box = { + 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, + sounds = default.node_sound_wood_defaults(), + + 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 + end, + on_construct = function(pos) + technic.inductive_on_construct(pos, 50, "Yellow Glowlight (small cube)") + end, + on_punch = function(pos, node, puncher) + technic.inductive_on_punch_on(pos, 0, "technic:homedecor_glowlight_small_cube_yellow") + end +}) + +-- Glowlight "cubes" - white +minetest.register_node('technic:homedecor_glowlight_small_cube_white', { + description = S("White Glowlight (small cube)"), + drawtype = "nodebox", + tiles = { + 'technic_homedecor_glowlight_cube_white_tb.png', + 'technic_homedecor_glowlight_cube_white_tb.png', + 'technic_homedecor_glowlight_cube_white_sides.png', + 'technic_homedecor_glowlight_cube_white_sides.png', + 'technic_homedecor_glowlight_cube_white_sides.png', + 'technic_homedecor_glowlight_cube_white_sides.png' + }, + selection_box = { + type = "fixed", + fixed = { -0.25, -0.5, -0.25, 0.25, 0, 0.25 } + }, + node_box = { + 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) + return itemstack + end, + on_construct = function(pos) + technic.inductive_on_construct(pos, 50, "White Glowlight (small cube)") + end, + on_punch = function(pos, node, puncher) + technic.inductive_on_punch_off(pos, 50, "technic:homedecor_glowlight_small_cube_white_active") + end +}) + +minetest.register_node('technic:homedecor_glowlight_small_cube_white_active', { + description = S("White Glowlight (small cube)"), + drawtype = "nodebox", + tiles = { + 'technic_homedecor_glowlight_cube_white_tb.png', + 'technic_homedecor_glowlight_cube_white_tb.png', + 'technic_homedecor_glowlight_cube_white_sides.png', + 'technic_homedecor_glowlight_cube_white_sides.png', + 'technic_homedecor_glowlight_cube_white_sides.png', + 'technic_homedecor_glowlight_cube_white_sides.png' + }, + selection_box = { + type = "fixed", + fixed = { -0.25, -0.5, -0.25, 0.25, 0, 0.25 } + }, + node_box = { + 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, + sounds = default.node_sound_wood_defaults(), + + 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 + end, + on_construct = function(pos) + technic.inductive_on_construct(pos, 50, "White Glowlight (small cube)") + end, + on_punch = function(pos, node, puncher) + technic.inductive_on_punch_on(pos, 0, "technic:homedecor_glowlight_small_cube_white") + end +}) + +technic.register_inductive_machine("technic:homedecor_glowlight_half_yellow") +technic.register_inductive_machine("technic:homedecor_glowlight_half_white") +technic.register_inductive_machine("technic:homedecor_glowlight_quarter_yellow") +technic.register_inductive_machine("technic:homedecor_glowlight_quarter_white") +technic.register_inductive_machine("technic:homedecor_glowlight_small_cube_yellow") +technic.register_inductive_machine("technic:homedecor_glowlight_small_cube_white") diff --git a/mods/technic-master/technic/machines/MV/power_radiator.lua b/mods/technic-master/technic/machines/MV/power_radiator.lua new file mode 100644 index 0000000..4f9a837 --- /dev/null +++ b/mods/technic-master/technic/machines/MV/power_radiator.lua @@ -0,0 +1,220 @@ +-- The power radiator fuctions like an inductive charger +-- only better in the game setting. +-- The purpose is to allow small appliances to receive power +-- without the overhead of the wiring needed for larger machines. +-- +-- The power radiator will consume power corresponding to the +-- sum(power rating of the attached appliances)/0.06 +-- Using inductive power transfer is very inefficient so this is +-- set to the factor 0.06. +-- +-- Punching the radiator will toggle the power state of all attached appliances. + +local power_radius = 12 + +------------------------------------------------------------------ +-- API for inductive powered nodes: +-- Use the functions below to set the corresponding callbacks +-- Also two nodes are needed: The inactive and the active one. The active must be called _active . +------------------------------------------------------------------ +-- Register a new appliance using this function + +technic.inductive_nodes = {} +technic.register_inductive_machine = function(name) + table.insert(technic.inductive_nodes, name) + table.insert(technic.inductive_nodes, name.."_active") +end + +-- Appliances: +-- has_supply: pos of supply node if the appliance has a power radiator near with sufficient power for the demand else "" +-- EU_demand: The power demand of the device. +-- EU_charge: Actual use. set to EU_demand if active==1 +-- active: set to 1 if the device is on +technic.inductive_on_construct = function(pos, eu_demand, infotext) + local meta = minetest.get_meta(pos) + meta:set_string("infotext", infotext) + meta:set_int("technic_inductive_power_machine", 1) + meta:set_int("EU_demand", eu_demand) -- The power demand of this appliance + meta:set_int("EU_charge", 0) -- The actual power draw of this appliance + meta:set_string("has_supply", "") -- Register whether we are powered or not. For use with several radiators. + meta:set_int("active", 0) -- If the appliance can be turned on and off by using it use this. +end + +technic.inductive_on_punch_off = function(pos, eu_charge, swapnode) + local meta = minetest.get_meta(pos) + if meta:get_string("has_supply") ~= "" then + technic.swap_node(pos, swapnode) + meta:set_int("active", 1) + meta:set_int("EU_charge",eu_charge) + --print("-----------") + --print("Turn on:") + --print("EU_charge: "..meta:get_int("EU_charge")) + --print("has_supply: "..meta:get_string("has_supply")) + --print("<----------->") + end +end + +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) + --print("-----------") + --print("Turn off:") + --print("EU_charge: "..meta:get_int("EU_charge")) + --print("has_supply: "..meta:get_string("has_supply")) + --print("<---------->") +end + +local shutdown_inductive_appliances = function(pos) + -- The supply radius + 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}, + technic.inductive_nodes) + for _, pos1 in pairs(positions) do + local meta1 = minetest.get_meta(pos1) + -- If the appliance is belonging to this node + if meta1:get_string("has_supply") == pos.x..pos.y..pos.z then + local nodename = minetest.get_node(pos1).name + -- Swap the node and make sure it is off and unpowered + if string.sub(nodename, -7) == "_active" then + technic.swap_node(pos1, string.sub(nodename, 1, -8)) + meta1:set_int("active", 0) + meta1:set_int("EU_charge", 0) + end + meta1:set_string("has_supply", "") + end + end +end + +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}, + technic.inductive_nodes) + for _, pos1 in pairs(positions) do + local meta1 = minetest.get_meta(pos1) + if meta1:get_string("has_supply") == pos.x..pos.y..pos.z then + minetest.punch_node(pos1) + end + end +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}, + 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}, + }, + 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_string("infotext", "MV Power Radiator") + end, + on_dig = function(pos, node, digger) + shutdown_inductive_appliances(pos) + return minetest.node_dig(pos, node, digger) + end, + on_punch = function(pos, node, puncher) + toggle_on_off_inductive_appliances(pos, node, puncher) + end +}) + +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_cable0', 'technic:rubber'}, + } +}) + +minetest.register_abm({ + nodenames = {"technic:power_radiator"}, + interval = 1, + chance = 1, + action = function(pos, node, active_object_count, active_object_count_wider) + local meta = minetest.env:get_meta(pos) + local eu_input = meta:get_int("MV_EU_input") + local eu_demand = meta:get_int("MV_EU_demand") + + -- Power off automatically if no longer connected to a switching station + technic.switching_station_timeout_count(pos, "MV") + + if eu_input == 0 then + -- No power + meta:set_string("infotext", "MV Power Radiator is unpowered"); + -- 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) + elseif eu_input == eu_demand then + -- Powered and ready + + -- The maximum EU sourcing a single radiator can provide. + local max_charge = 30000 -- == the max EU demand of the radiator + local connected_EU_demand = meta:get_int("connected_EU_demand") + + -- Efficiency factor + local eff_factor = 0.06 + -- The supply radius + local rad = power_radius + + local meta1 = nil + local pos1 = {} + 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}, + technic.inductive_nodes) + for _, pos1 in pairs(positions) do + local meta1 = minetest.get_meta(pos1) + -- If not supplied see if this node can handle it. + if meta1:get_string("has_supply") == "" then + -- if demand surpasses the capacity of this node, don't bother adding it. + local app_eu_demand = math.floor(meta1:get_int("EU_demand") / eff_factor) + if connected_EU_demand + app_eu_demand <= max_charge then + -- We can power the appliance. Register, and spend power if it is on. + connected_EU_demand = connected_EU_demand + app_eu_demand + + meta1:set_string("has_supply", pos.x..pos.y..pos.z) + --Always 0: used_charge = math.floor(used_charge + meta1:get_int("EU_charge") / eff_factor) + end + elseif meta1:get_string("has_supply") == pos.x..pos.y..pos.z then + -- The appliance has power from this node. Spend power if it is on. + 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)"); + if used_charge == 0 then + meta:set_int("MV_EU_demand", 1) -- Still idle + else + meta:set_int("MV_EU_demand", used_charge) + end + end + -- Save state + meta:set_int("connected_EU_demand", connected_EU_demand) + end + end, +}) + +technic.register_machine("MV", "technic:power_radiator", technic.receiver) + diff --git a/mods/technic-master/technic/machines/MV/solar_array.lua b/mods/technic-master/technic/machines/MV/solar_array.lua new file mode 100644 index 0000000..227d8ee --- /dev/null +++ b/mods/technic-master/technic/machines/MV/solar_array.lua @@ -0,0 +1,14 @@ + +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_cable0', ''}, + } +}) + +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") diff --git a/mods/technic-master/technic/machines/MV/tool_workshop.lua b/mods/technic-master/technic/machines/MV/tool_workshop.lua new file mode 100644 index 0000000..1026718 --- /dev/null +++ b/mods/technic-master/technic/machines/MV/tool_workshop.lua @@ -0,0 +1,85 @@ +-- Tool workshop +-- This machine repairs tools. + +minetest.register_alias("tool_workshop", "technic:tool_workshop") + +local S = technic.getter + +minetest.register_craft({ + 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_cable0', 'default:obsidian'}, + } +}) + +local workshop_formspec = + "invsize[8,9;]".. + "list[current_name;src;3,1;1,1;]".. + "label[0,0;"..S("%s Tool Workshop"):format("MV").."]".. + "list[current_player;main;0,5;8,4;]" + +local run = function(pos, node) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + local eu_input = meta:get_int("MV_EU_input") + local machine_name = S("%s Tool Workshop"):format("MV") + local machine_node = "technic:tool_workshop" + local demand = 5000 + + -- Setup meta data if it does not exist. + if not eu_input then + meta:set_int("MV_EU_demand", demand) + meta:set_int("MV_EU_input", 0) + return + end + + local repairable = false + local srcstack = inv:get_stack("src", 1) + if not srcstack:is_empty() then + local itemdef = minetest.registered_items[srcstack:get_name()] + if itemdef and + (not itemdef.wear_represents or + itemdef.wear_represents == "mechanical_wear") and + srcstack:get_wear() ~= 0 then + repairable = true + end + end + if not repairable then + meta:set_string("infotext", S("%s Idle"):format(machine_name)) + meta:set_int("MV_EU_demand", 0) + return + end + + if eu_input < demand then + meta:set_string("infotext", S("%s Unpowered"):format(machine_name)) + elseif eu_input >= demand 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", demand) +end + +minetest.register_node("technic:tool_workshop", { + description = S("%s Tool Workshop"):format("MV"), + 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}, + sounds = default.node_sound_wood_defaults(), + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("infotext", S("%s Tool Workshop"):format("MV")) + meta:set_string("formspec", workshop_formspec) + local inv = meta:get_inventory() + inv:set_size("src", 1) + end, + can_dig = technic.machine_can_dig, + allow_metadata_inventory_put = technic.machine_inventory_put, + allow_metadata_inventory_take = technic.machine_inventory_take, + technic_run = run, +}) + +technic.register_machine("MV", "technic:tool_workshop", technic.receiver) + diff --git a/mods/technic-master/technic/machines/MV/wind_mill.lua b/mods/technic-master/technic/machines/MV/wind_mill.lua new file mode 100644 index 0000000..4d63ddc --- /dev/null +++ b/mods/technic-master/technic/machines/MV/wind_mill.lua @@ -0,0 +1,87 @@ + +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'}, + } +}) + +minetest.register_craft({ + output = 'technic:wind_mill', + recipe = { + {'', 'technic:motor', ''}, + {'technic:carbon_steel_ingot', 'technic:carbon_steel_block', 'technic:carbon_steel_ingot'}, + {'', 'technic:mv_cable0', ''}, + } +}) + +minetest.register_node("technic:wind_mill_frame", { + description = S("Wind Mill Frame"), + drawtype = "glasslike_framed", + tiles = {"technic_carbon_steel_block.png", "default_glass.png"}, + sunlight_propagates = true, + groups = {cracky=3}, + sounds = default.node_sound_stone_defaults(), + paramtype = "light", +}) + +local function check_wind_mill(pos) + if pos.y < 30 then + return false + end + for i = 1, 20 do + local node = minetest.get_node({x=pos.x, y=pos.y-i, z=pos.z}) + if node.name ~= "technic:wind_mill_frame" then + return false + end + end + return true +end + +local run = function(pos, node) + local meta = minetest.get_meta(pos) + local machine_name = S("Wind %s Generator"):format("MV") + local power = math.min(pos.y * 100, 5000) + + if not check_wind_mill(pos) then + meta:set_int("MV_EU_supply", 0) + meta:set_string("infotext", S("%s Improperly Placed"):format(machine_name)) + return + else + meta:set_int("MV_EU_supply", power) + end + + meta:set_string("infotext", machine_name.." ("..power.."EU)") +end + +minetest.register_node("technic:wind_mill", { + description = S("Wind %s Generator"):format("MV"), + tiles = {"technic_carbon_steel_block.png"}, + paramtype2 = "facedir", + groups = {cracky=1, technic_machine=1}, + 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 + } + }, + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("infotext", S("Wind %s Generator"):format("MV")) + meta:set_int("MV_EU_supply", 0) + end, + technic_run = run, +}) + +technic.register_machine("MV", "technic:wind_mill", technic.producer) + diff --git a/mods/technic-master/technic/machines/init.lua b/mods/technic-master/technic/machines/init.lua new file mode 100644 index 0000000..ad79eab --- /dev/null +++ b/mods/technic-master/technic/machines/init.lua @@ -0,0 +1,14 @@ +local path = technic.modpath.."/machines" + +dofile(path.."/register/init.lua") + +-- Tiers +dofile(path.."/LV/init.lua") +dofile(path.."/MV/init.lua") +dofile(path.."/HV/init.lua") + +dofile(path.."/switching_station.lua") +dofile(path.."/supply_converter.lua") + +dofile(path.."/other/init.lua") + diff --git a/mods/technic-master/technic/machines/other/anchor.lua b/mods/technic-master/technic/machines/other/anchor.lua new file mode 100644 index 0000000..1c15bd2 --- /dev/null +++ b/mods/technic-master/technic/machines/other/anchor.lua @@ -0,0 +1,109 @@ +local S = technic.getter + +local desc = S("Administrative World Anchor") + +local function compute_forceload_positions(pos, meta) + local radius = meta:get_int("radius") + local minpos = vector.subtract(pos, vector.new(radius, radius, radius)) + 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 + end + local flposes = {} + for x = minbpos.x, maxbpos.x, 16 do + for y = minbpos.y, maxbpos.y, 16 do + for z = minbpos.z, maxbpos.z, 16 do + table.insert(flposes, vector.new(x, y, z)) + end + end + end + return flposes +end + +local function currently_forceloaded_positions(meta) + local ser = meta:get_string("forceloaded") + return ser == "" and {} or minetest.deserialize(ser) +end + +local function forceload_off(meta) + local flposes = currently_forceloaded_positions(meta) + meta:set_string("forceloaded", "") + for _, p in ipairs(flposes) do + minetest.forceload_free_block(p) + end +end + +local function forceload_on(pos, meta) + local want_flposes = compute_forceload_positions(pos, meta) + local have_flposes = {} + for _, p in ipairs(want_flposes) do + if minetest.forceload_block(p) then + table.insert(have_flposes, p) + end + end + meta:set_string("forceloaded", #have_flposes == 0 and "" or minetest.serialize(have_flposes)) +end + +local function set_display(pos, meta) + meta:set_string("infotext", S(meta:get_int("enabled") ~= 0 and "%s Enabled" or "%s Disabled"):format(desc)) + meta:set_string("formspec", + "size[5,3.5]".. + "item_image[0,0;1,1;technic:admin_anchor]".. + "label[1,0;"..minetest.formspec_escape(desc).."]".. + "label[0,1;"..minetest.formspec_escape(S("Owner:").." "..meta:get_string("owner")).."]".. + (meta:get_int("locked") == 0 and + "button[3,1;2,1;lock;"..minetest.formspec_escape(S("Unlocked")).."]" or + "button[3,1;2,1;unlock;"..minetest.formspec_escape(S("Locked")).."]").. + "field[0.25,2.3;1,1;radius;"..minetest.formspec_escape(S("Radius:"))..";"..meta:get_int("radius").."]".. + (meta:get_int("enabled") == 0 and + "button[3,2;2,1;enable;"..minetest.formspec_escape(S("Disabled")).."]" or + "button[3,2;2,1;disable;"..minetest.formspec_escape(S("Enabled")).."]").. + "label[0,3;"..minetest.formspec_escape(S("Keeping %d/%d map blocks loaded"):format(#currently_forceloaded_positions(meta), #compute_forceload_positions(pos, meta))).."]") +end + +minetest.register_node("technic:admin_anchor", { + description = desc, + drawtype = "normal", + tiles = {"technic_admin_anchor.png"}, + is_ground_content = true, + groups = {cracky=3, not_in_creative_inventory=1}, + sounds = default.node_sound_stone_defaults(), + 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) + 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) + local meta = minetest.get_meta(pos) + forceload_off(meta) + end, + 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 + sender:get_player_name() == meta:get_string("owner")) then + return + end + if fields.unlock then meta:set_int("locked", 0) end + if fields.lock then meta:set_int("locked", 1) end + if fields.disable or fields.enable or fields.radius then + forceload_off(meta) + if fields.disable then meta:set_int("enabled", 0) end + if fields.enable then meta:set_int("enabled", 1) end + if fields.radius and string.find(fields.radius, "^[0-9]+$") and tonumber(fields.radius) < 256 then meta:set_int("radius", fields.radius) end + if meta:get_int("enabled") ~= 0 then + forceload_on(pos, meta) + end + end + set_display(pos, meta) + end, +}) diff --git a/mods/technic-master/technic/machines/other/constructor.lua b/mods/technic-master/technic/machines/other/constructor.lua new file mode 100644 index 0000000..3396ac7 --- /dev/null +++ b/mods/technic-master/technic/machines/other/constructor.lua @@ -0,0 +1,189 @@ + +local S = technic.getter + +local function deploy_node(inv, slot_name, pos, node, machine_node) + if node.name ~= "air" then + if node.name == "ignore" or + node.name == "default:lava_source" or + node.name == "default:lava_flowing" or + node.name == "default:water_source" or + node.name == "default:water_flowing" then + return + end + local drops = minetest.get_node_drops(node.name, "") + local remove_to = false + for i, item in ipairs(drops) do + if not inv:room_for_item(slot_name, item) then + remove_to = i - 1 + break + end + inv:add_item(slot_name, item) + end + if remove_to then + for i = 1, remove_to do + inv:remove_item(drops[i]) + end + else + minetest.remove_node(pos) + end + return + end + if not inv:is_empty(slot_name) then + local stack = inv:get_list(slot_name)[1] + local def = stack:get_definition() + if def.type == "node" then + minetest.set_node(pos, { + name = stack:get_name(), + param2 = machine_node.param2 + }) + stack:take_item() + inv:set_stack(slot_name, 1, stack) + elseif def.type == "craft" then + if def.on_place then + -- Use pcall to avoid nil placer errors. + -- TODO: Do without pcall. + local ok, stk = pcall(def.on_place, stack, nil, { + -- Fake pointed_thing + type = "node", + above = pos, + under = {x=pos.x, y=pos.y-1, z=pos.z}, + }) + if ok then + inv:set_stack(slot_name, 1, stk or stack) + return + end + end + minetest.item_place_object(stack, nil, { + -- Fake pointed_thing + type = "node", + above = pos, + under = pos, + }) + inv:set_stack(slot_name, 1, nil) + end + end +end + +minetest.register_craft({ + type = "shapeless", + output = 'technic:constructor_mk1_off 1', + 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'}, + +}) + +minetest.register_craft({ + type = "shapeless", + output = 'technic:constructor_mk3_off 1', + recipe = {'technic:constructor_mk2_off', 'technic:constructor_mk2_off'}, + +}) + +local function make_on(mark, length) + return function(pos, node) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + local dir = vector.new() + if node.param2 == 3 then dir.x = 1 end + if node.param2 == 2 then dir.z = 1 end + if node.param2 == 1 then dir.x = -1 end + if node.param2 == 0 then dir.z = -1 end + + local place_pos = vector.new(pos) + + if node.name == "technic:constructor_mk"..mark.."_off" then + technic.swap_node(pos, "technic:constructor_mk"..mark.."_on") + nodeupdate(pos) + for i = 1, length do + place_pos = vector.add(place_pos, dir) + local place_node = minetest.get_node(place_pos) + deploy_node(inv, "slot"..i, place_pos, place_node, node) + end + end + end +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") + nodeupdate(pos) + end + end +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", + "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"}, + paramtype2 = "facedir", + 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) + local formspec = "size[8,9;]".. + "label[0,0;"..S("Constructor Mk%d"):format(mark).."]".. + "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;]" + end + meta:set_string("formspec", formspec) + meta:set_string("infotext", S("Constructor Mk%d"):format(mark)) + local inv = meta:get_inventory() + for i = 1, length do + inv:set_size("slot"..i, 1) + end + end, + can_dig = function(pos, player) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + for i = 1, length do + if not inv:is_empty("slot"..i) then + return false + end + end + return true + end, + allow_metadata_inventory_put = technic.machine_inventory_put, + allow_metadata_inventory_take = technic.machine_inventory_take, + allow_metadata_inventory_move = technic.machine_inventory_move, + }) + + minetest.register_node("technic:constructor_mk"..mark.."_on", { + 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"}, + 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)}}, + sounds = default.node_sound_stone_defaults(), + allow_metadata_inventory_put = technic.machine_inventory_put, + allow_metadata_inventory_take = technic.machine_inventory_take, + allow_metadata_inventory_move = technic.machine_inventory_move, + }) +end + +make_constructor(1, 1) +make_constructor(2, 2) +make_constructor(3, 4) + diff --git a/mods/technic-master/technic/machines/other/frames.lua b/mods/technic-master/technic/machines/other/frames.lua new file mode 100644 index 0000000..427e60b --- /dev/null +++ b/mods/technic-master/technic/machines/other/frames.lua @@ -0,0 +1,928 @@ + +local S = technic.getter + +frames = {} + +local infinite_stacks = minetest.setting_getbool("creative_mode") and minetest.get_modpath("unified_inventory") == nil + +local frames_pos = {} + +-- Helpers + +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 + 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 + 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 + +local function pos_to_string(pos) + if pos.x == 0 then pos.x = 0 end -- Fix for signed 0 + if pos.y == 0 then pos.y = 0 end -- Fix for signed 0 + if pos.z == 0 then pos.z = 0 end -- Fix for signed 0 + return tostring(pos.x).."\n"..tostring(pos.y).."\n"..tostring(pos.z) +end + +local function pos_from_string(str) + local l = lines(str) + 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 + end + return false +end + +local function table_empty(table) + for _, __ in pairs(table) do + return false + end + return true +end + +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 + end + table[i] = toadd +end + +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) + 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) + 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 + return + end + --[[if pos.x==must_not_move.x and pos.y==must_not_move.y and pos.z==must_not_move.z then + return + end]] + end + local nodelist = {} + 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} + end + local objects = {} + for _, pos in ipairs(poslist) 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) + end + end + end + for _, obj in ipairs(objects) do + obj:setpos(vector.add(obj:getpos(), vect)) + end + 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 + if npos.x == pos.x and npos.y == pos.y and npos.z == pos.z then + table.remove(poslist, __) + break + end + end + end + for __, pos in ipairs(poslist) do + minetest.remove_node(pos) + end + for _, callback in ipairs(mesecon.on_mvps_move) do + callback(nodelist) + end +end + +local function is_supported_node(name) + return ((string.find(name, "tube") ~= nil) and (string.find(name, "pipeworks") ~= nil)) +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 + +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 }, + { b, -a, -a, a, a, -b }, + + { -b, b, -a, b, a, -b }, + { -b, -a, -a, b, -b, -b }, + + { -b, b, b, b, a, a }, + { -b, -a, b, b, -b, a }, + + { b, b, -b, a, a, b }, + { b, -a, -b, a, -b, b }, + + { -a, b, -b, -b, a, b }, + { -a, -a, -b, -b, -b, 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}) + end + 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}) + end + 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}) + 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,{ + description = S("Frame"), + tiles = {"technic_frame.png"}, + groups=groups, + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed=nodeboxes, + }, + selection_box = { + type="fixed", + fixed={-0.5,-0.5,-0.5,0.5,0.5,0.5} + }, + paramtype = "light", + 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 + 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) + else + nodename=string.sub(nodename,1,-2)..newstate + end + 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() + .. " at protected position " + .. minetest.pos_to_string(pos)) + minetest.record_protection_violation(pos, placer:get_player_name()) + return itemstack + end + if pos == nil then return end + local node = minetest.get_node(pos) + 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()}) + end + else + minetest.set_node(pos, {name = itemstack:get_name()}) + end + if not infinite_stacks then + itemstack:take_item() + end + return itemstack + end, + on_rightclick = function(pos, node, placer, itemstack, pointed_thing) + 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() + .. " 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()}) + + 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} + if def.after_place_node(pos_copy, placer, itemstack) then + take_item = false + end + end + + -- Run script hook + 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} + if callback(pos_copy, newnode_copy, placer, oldnode_copy, itemstack) then + take_item = false + end + end + + if take_item then + itemstack:take_item() + end + + obj = minetest.add_entity(pos, "technic:frame_entity") + obj:get_luaentity():set_node({name=node.name}) + + return itemstack + else + --local pointed_thing = {type = "node", under = pos} + if pointed_thing then + minetest.item_place_node(itemstack, placer, pointed_thing) + 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}, + visual = "wielditem", + textures = {}, + 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)} + frames_pos[pos_to_string(pos)] = node.name + local stack = ItemStack(node.name) + local itemtable = stack:to_table() + local itemname = nil + if itemtable then + itemname = stack:to_table().name + end + local item_texture = nil + local item_type = "" + if minetest.registered_items[itemname] then + item_texture = minetest.registered_items[itemname].inventory_image + item_type = minetest.registered_items[itemname].type + end + prop = { + is_visible = true, + 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}) + end, + + dig = function(self) + 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)} + 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 + self.damage_object = minetest.add_entity(pos, "technic:damage_entity") + self.damage_object:get_luaentity().remaining_time = 0.25 + self.damage_object:get_luaentity().frame_object = self + self.damage_object:get_luaentity().texture_index = 0 + self.damage_object:get_luaentity().texture_change_time = 0.15 + else + self.damage_object:get_luaentity().remaining_time = 0.25 + end + self.last_puncher = 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 = self.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 + 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 itemstack = clicker:get_wielded_item() + local itemdef = minetest.registered_items[itemstack:get_name()] + if itemdef ~= nil then + itemdef.on_place(itemstack, clicker, pointed_thing) + end + end, +}) + +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}, + physical = false, + }, + on_step = function(self, dtime) + if self.remaining_time == nil then + self.object:remove() + self.frame_object.damage_object = nil + end + self.remaining_time = self.remaining_time - dtime + if self.remaining_time < 0 then + self.object:remove() + self.frame_object.damage_object = nil + end + self.texture_change_time = self.texture_change_time - dtime + if self.texture_change_time < 0 then + self.texture_change_time = self.texture_change_time + 0.15 + self.texture_index = self.texture_index + 1 + if self.texture_index == 5 then + self.object:remove() + self.frame_object.damage_object = nil + 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}}) + end + end, +}) + +mesecon:register_mvps_unmov("technic:frame_entity") +mesecon:register_mvps_unmov("technic:damage_entity") +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)]} + frames_pos[pos_to_string(n.oldpos)] = nil + end + end + if #to_move > 0 then + for _, t in ipairs(to_move) do + frames_pos[pos_to_string(t.pos)] = t.name + local objects = minetest.get_objects_inside_radius(t.oldpos, 0.1) + for _, obj in ipairs(objects) do + local entity = obj:get_luaentity() + if entity and (entity.name == "technic:frame_entity" or entity.name == "technic:damage_entity") then + obj:setpos(t.pos) + end + end + end + end +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)]}) + frames_pos[pos_to_string(pos)] = nil + local objects = minetest.get_objects_inside_radius(pos, 0.1) + for _, obj in ipairs(objects) do + local entity = obj:get_luaentity() + if entity and (entity.name == "technic:frame_entity" or entity.name == "technic:damage_entity") then + obj:remove() + end + end + end +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 + 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) + end + end + end +end + +local function get_connected_nodes(pos) + 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)) + 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 dir = minetest.facedir_to_dir(node.param2) + local nnode=minetest.get_node(nnodepos) + if frames_pos[pos_to_string(nnodepos)] then + nnode.name = frames_pos[pos_to_string(nnodepos)] + end + 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 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",{ + 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}, + paramtype2 = "facedir", + 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) + 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 + 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 meta = minetest.get_meta(pos1) + if meta:get_string("connected") == "" then + c[#(c)+1]=pos1 + template_connected(pos1,c,connectors) + if nodename == "technic:template_connector" then + connectors[#connectors+1] = pos1 + end + end + end + end +end + +local function get_templates(pos) + local c = {pos} + local connectors + if minetest.get_node(pos).name == "technic:template_connector" then + connectors = {pos} + else + connectors = {} + end + template_connected(pos,c,connectors) + return c, connectors +end + +local function swap_template(pos, new) + local meta = minetest.get_meta(pos) + local saved_node = meta:get_string("saved_node") + meta:set_string("saved_node", "") + technic.swap_node(pos, new) + local meta = minetest.get_meta(pos) + meta:set_string("saved_node", saved_node) +end + +local function save_node(pos) + local node = minetest.get_node(pos) + if node.name == "air" then + minetest.set_node(pos, {name="technic:template"}) + return + end + if node.name == "technic:template" then + swap_template(pos, "technic:template_connector") + local meta = minetest.get_meta(pos) + meta:set_string("connected", "") + return + end + local meta = minetest.get_meta(pos) + local meta0 = meta:to_table() + for _, list in pairs(meta0.inventory) do + for key, stack in pairs(list) do + list[key] = stack:to_string() + end + end + node.meta = meta0 + minetest.set_node(pos, {name="technic:template"}) + return node +end + +local function restore_node(pos, node) + minetest.set_node(pos, node) + local meta = minetest.get_meta(pos) + for _, list in pairs(node.meta.inventory) do + for key, stack in pairs(list) do + list[key] = ItemStack(stack) + end + end + meta:from_table(node.meta) +end + +local function expand_template(pos) + local meta = minetest.get_meta(pos) + local c = meta:get_string("connected") + if c == "" then return end + c = minetest.deserialize(c) + for _, vect in ipairs(c) do + local pos1 = vector.add(pos, vect) + local saved_node = save_node(pos1) + local meta1 = minetest.get_meta(pos1) + if saved_node ~= nil then + meta1:set_string("saved_node", minetest.serialize(saved_node)) + else + --meta1:set_string("saved_node", "") + end + end +end + +local function compress_templates(pos) + local templates, connectors = get_templates(pos) + if #connectors == 0 then + connectors = {pos} + end + for _, cn in ipairs(connectors) do + local meta = minetest.get_meta(cn) + local c = {} + for _,p in ipairs(templates) do + local np = vector.subtract(p, cn) + if not pos_in_list(c,np) then + c[#c+1] = np + end + end + local cc = {} + 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 + end + end + swap_template(cn, "technic:template") + meta:set_string("connected", minetest.serialize(c)) + meta:set_string("connectors_connected", minetest.serialize(cc)) + end + + for _,p in ipairs(templates) do + if not pos_in_list(connectors, p) then + minetest.set_node(p, {name = "air"}) + end + end +end + +local function template_drops(pos, node, oldmeta, digger) + local c = oldmeta.fields.connected + local cc = oldmeta.fields.connectors_connected + local drops + if c == "" or c == nil then + drops = {"technic:template 1"} + else + if cc == "" or cc == nil then + drops = {"technic:template 1"} + else + local dcc = minetest.deserialize(cc) + if not table_empty(dcc) then + drops = {} + for sp, _ in pairs(dcc) do + local ssp = pos_from_string(sp) + local p = vector.add(ssp, pos) + 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 + meta:set_string("connectors_connected", minetest.serialize(d)) + end + end + else + local stack_max = 99 + local num = #(minetest.deserialize(c)) + drops = {} + while num > stack_max do + drops[#drops+1] = "technic:template "..stack_max + num = num - stack_max + end + drops[#drops+1] = "technic:template "..num + end + end + end + minetest.handle_node_drops(pos, drops, digger) +end + +local function template_on_destruct(pos, node) + local meta = minetest.get_meta(pos) + local saved_node = meta:get_string("saved_node") + if saved_node ~= "" then + local nnode = minetest.deserialize(saved_node) + minetest.after(0, restore_node, pos, nnode) + end +end + +minetest.register_node("technic:template",{ + description = S("Template"), + tiles = {"technic_mv_cable.png"}, + drop = "", + 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) + swap_template(pos, "technic:template_disabled") + end +}) + +minetest.register_node("technic:template_disabled",{ + description = S("Template"), + tiles = {"technic_hv_cable.png"}, + drop = "", + 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) + local meta = minetest.get_meta(pos) + swap_template(pos, "technic:template_connector") + end +}) + +minetest.register_node("technic:template_connector",{ + description = S("Template"), + tiles = {"technic_lv_cable.png"}, + drop = "", + 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) + swap_template(pos, "technic:template") + end +}) + +minetest.register_craftitem("technic:template_replacer",{ + description = S("Template (replacing)"), + inventory_image = "technic_template_replacer.png", + on_place = function(itemstack, placer, pointed_thing) + local p = pointed_thing.under + if minetest.is_protected and minetest.is_protected(p, placer:get_player_name()) then + return nil + end + local node = minetest.get_node(p) + if node.name == "technic:template" then return end + local saved_node = save_node(p) + itemstack:take_item() + if saved_node ~= nil then + local meta = minetest.get_meta(p) + meta:set_string("saved_node", minetest.serialize(saved_node)) + end + return itemstack + end +}) + +minetest.register_tool("technic:template_tool",{ + description = S("Template Tool"), + inventory_image = "technic_template_tool.png", + on_use = function(itemstack, puncher, pointed_thing) + local pos = pointed_thing.under + if pos == nil or (minetest.is_protected and minetest.is_protected(pos, puncher:get_player_name())) then + return nil + end + local node = minetest.get_node(pos) + if node.name ~= "technic:template" and node.name ~= "technic:template_connector" then return end + local meta = minetest.get_meta(pos) + local c2 = meta:get_string("connected") + if c2 ~= "" then + expand_template(pos) + else + compress_templates(pos) + end + + end +}) + + + +-- Template motor +local function get_template_nodes(pos) + local meta = minetest.get_meta(pos) + local connected = meta:get_string("connected") + 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 + 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 dir = minetest.facedir_to_dir(node.param2) + 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) + end + minetest.get_meta(vector.add(pos, dir)):set_int("last_moved", minetest.get_gametime()) +end + +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}, + paramtype2 = "facedir", + 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()) + end, +}) + +-- Crafts +minetest.register_craft({ + output = 'technic:frame_111111', + recipe = { + {'', 'default:stick', ''}, + {'default:stick', 'technic:brass_ingot', 'default:stick'}, + {'', 'default:stick', ''}, + } +}) + +minetest.register_craft({ + output = 'technic:frame_motor', + recipe = { + {'', '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', ''}, + } +}) + +minetest.register_craft({ + output = 'technic:template_replacer', + recipe = {{'technic:template'}} +}) + +minetest.register_craft({ + output = 'technic:template', + recipe = {{'technic:template_replacer'}} +}) + +minetest.register_craft({ + output = 'technic:template_motor', + recipe = { + {'', 'technic:template', ''}, + {'group:mesecon_conductor_craftable', 'technic:motor', 'group:mesecon_conductor_craftable'}, + {'', 'technic:template', ''}, + } +}) + +minetest.register_craft({ + output = 'technic:template_tool', + recipe = { + {'', 'technic:template', ''}, + {'default:mese_crystal', 'default:stick', 'default:mese_crystal'}, + {'', 'default:stick', ''}, + } +}) diff --git a/mods/technic-master/technic/machines/other/init.lua b/mods/technic-master/technic/machines/other/init.lua new file mode 100644 index 0000000..27a47d5 --- /dev/null +++ b/mods/technic-master/technic/machines/other/init.lua @@ -0,0 +1,9 @@ +local path = technic.modpath.."/machines/other" + +-- mesecons and tubes related +dofile(path.."/injector.lua") +dofile(path.."/constructor.lua") +if minetest.get_modpath("mesecons_mvps") ~= nil then + dofile(path.."/frames.lua") +end +dofile(path.."/anchor.lua") diff --git a/mods/technic-master/technic/machines/other/injector.lua b/mods/technic-master/technic/machines/other/injector.lua new file mode 100644 index 0000000..36c2592 --- /dev/null +++ b/mods/technic-master/technic/machines/other/injector.lua @@ -0,0 +1,107 @@ + +local S = technic.getter + +local function inject_items (pos) + local meta=minetest.env: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 + if stack then + local item0=stack:to_table() + if item0 then + item0["count"] = "1" + technic.tube_inject_item(pos, pos, vector.new(0, -1, 0), item0) + stack:take_item(1) + inv:set_stack("main", i, stack) + return + end + end + end + end + 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() + if item0 then + technic.tube_inject_item(pos, pos, vector.new(0, -1, 0), item0) + stack:clear() + inv:set_stack("main", i, stack) + return + end + end + end + end + +end + +minetest.register_craft({ + output = 'technic:injector 1', + recipe = { + {'', 'technic:control_logic_unit',''}, + {'', 'default:chest',''}, + {'', 'pipeworks:tube_1',''}, + } +}) + +local function set_injector_formspec(meta) + local is_stack = meta:get_string("mode") == "whole stacks" + meta:set_string("formspec", + "invsize[8,9;]".. + "item_image[0,0;1,1;technic:injector]".. + "label[1,0;"..S("Self-Contained Injector").."]".. + (is_stack and + "button[0,1;2,1;mode_item;"..S("Stackwise").."]" or + "button[0,1;2,1;mode_stack;"..S("Itemwise").."]").. + "list[current_name;main;0,2;8,2;]".. + "list[current_player;main;0,5;8,4;]") +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}, + tube = {connect_sides={bottom=1}}, + sounds = default.node_sound_wood_defaults(), + on_construct = function(pos) + local meta = minetest.env: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") + set_injector_formspec(meta) + end, + can_dig = function(pos,player) + local meta = minetest.env:get_meta(pos); + local inv = meta:get_inventory() + return inv:is_empty("main") + end, + on_receive_fields = function(pos, formanme, fields, sender) + local meta = minetest.env:get_meta(pos) + if fields.mode_item then meta:set_string("mode", "single items") end + if fields.mode_stack then meta:set_string("mode", "whole stacks") end + set_injector_formspec(meta) + end, + allow_metadata_inventory_put = technic.machine_inventory_put, + allow_metadata_inventory_take = technic.machine_inventory_take, + allow_metadata_inventory_move = technic.machine_inventory_move, +}) + +minetest.register_abm({ + nodenames = {"technic:injector"}, + interval = 1, + chance = 1, + action = function(pos, node, active_object_count, active_object_count_wider) + local pos1 = vector.add(pos, vector.new(0, -1, 0)) + local node1 = minetest.get_node(pos1) + if minetest.get_item_group(node1.name, "tubedevice") > 0 then + inject_items(pos) + end + end, +}) + diff --git a/mods/technic-master/technic/machines/register/alloy_furnace.lua b/mods/technic-master/technic/machines/register/alloy_furnace.lua new file mode 100644 index 0000000..879e528 --- /dev/null +++ b/mods/technic-master/technic/machines/register/alloy_furnace.lua @@ -0,0 +1,10 @@ + +local S = technic.getter + +function technic.register_alloy_furnace(data) + data.typename = "alloy" + data.machine_name = "alloy_furnace" + data.machine_desc = S("%s Alloy Furnace") + technic.register_base_machine(data) +end + diff --git a/mods/technic-master/technic/machines/register/alloy_recipes.lua b/mods/technic-master/technic/machines/register/alloy_recipes.lua new file mode 100644 index 0000000..86fe87d --- /dev/null +++ b/mods/technic-master/technic/machines/register/alloy_recipes.lua @@ -0,0 +1,31 @@ + +local S = technic.getter + +technic.register_recipe_type("alloy", { + description = S("Alloying"), + input_size = 2, +}) + +function technic.register_alloy_recipe(data) + data.time = data.time or 6 + technic.register_recipe("alloy", 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"}, +} + +for _, data in pairs(recipes) do + technic.register_alloy_recipe({input = {data[1], data[2]}, output = data[3], time = data[4]}) +end diff --git a/mods/technic-master/technic/machines/register/battery_box.lua b/mods/technic-master/technic/machines/register/battery_box.lua new file mode 100644 index 0000000..4474dcf --- /dev/null +++ b/mods/technic-master/technic/machines/register/battery_box.lua @@ -0,0 +1,282 @@ + +local S = technic.getter + +technic.register_power_tool("technic:battery", 10000) +technic.register_power_tool("technic:red_energy_crystal", 50000) +technic.register_power_tool("technic:green_energy_crystal", 150000) +technic.register_power_tool("technic:blue_energy_crystal", 450000) + +minetest.register_craft({ + 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'}, + } +}) + +minetest.register_tool("technic:battery", { + description = S("RE Battery"), + inventory_image = "technic_battery.png", + wear_represents = "technic_RE_charge", + on_refill = technic.refill_RE_charge, + tool_capabilities = { + charge = 0, + max_drop_level = 0, + groupcaps = { + fleshy = {times={}, uses=10000, maxlevel=0} + } + } +}) + +local tube = { + insert_object = function(pos, node, stack, direction) + if direction.y == 0 then + return stack + end + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + if direction.y > 0 then + return inv:add_item("src", stack) + else + return inv:add_item("dst", stack) + end + end, + can_insert = function(pos, node, stack, direction) + if direction.y == 0 then + return false + end + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + if direction.y > 0 then + return inv:room_for_item("src", stack) + else + return inv:room_for_item("dst", stack) + end + end, + connect_sides = {left=1, right=1, back=1, top=1, bottom=1}, +} + +function technic.register_battery_box(data) + local tier = data.tier + local ltier = string.lower(tier) + + local formspec = + "invsize[8,9;]".. + "image[1,1;1,2;technic_power_meter_bg.png]".. + "list[current_name;src;3,1;1,1;]".. + "image[4,1;1,1;technic_battery_reload.png]".. + "list[current_name;dst;5,1;1,1;]".. + "label[0,0;"..S("%s Battery Box"):format(tier).."]".. + "label[3,0;"..S("Charge").."]".. + "label[5,0;"..S("Discharge").."]".. + "label[1,3;"..S("Power level").."]".. + "list[current_player;main;0,5;8,4;]" + + if data.upgrade then + formspec = formspec.. + "list[current_name;upgrade1;3.5,3;1,1;]".. + "list[current_name;upgrade2;4.5,3;1,1;]".. + "label[3.5,4;"..S("Upgrade Slots").."]" + end + + local run = function(pos, node) + local meta = minetest.get_meta(pos) + local eu_input = meta:get_int(tier.."_EU_input") + local current_charge = meta:get_int("internal_EU_charge") + + local EU_upgrade, tube_upgrade = 0, 0 + if data.upgrade then + EU_upgrade, tube_upgrade = technic.handle_machine_upgrades(meta) + end + local max_charge = data.max_charge * (1 + EU_upgrade / 10) + + -- Charge/discharge the battery with the input EUs + if eu_input >= 0 then + current_charge = math.min(current_charge + eu_input, max_charge) + else + current_charge = math.max(current_charge + eu_input, 0) + end + + -- Charging/discharging tools here + local tool_full, tool_empty + current_charge, tool_full = technic.charge_tools(meta, + current_charge, data.charge_step) + current_charge, tool_empty = technic.discharge_tools(meta, + current_charge, data.discharge_step, + max_charge) + + if data.tube then + local inv = meta:get_inventory() + technic.handle_machine_pipeworks(pos, tube_upgrade, + function(pos, x_velocity, z_velocity) + if tool_full and not inv:is_empty("src") then + technic.send_items(pos, x_velocity, z_velocity, "src") + elseif tool_empty and not inv:is_empty("dst") then + technic.send_items(pos, x_velocity, z_velocity, "dst") + end + end) + end + + -- We allow batteries to charge on less than the demand + meta:set_int(tier.."_EU_demand", + math.min(data.charge_rate, max_charge - current_charge)) + meta:set_int(tier.."_EU_supply", + math.min(data.discharge_rate, current_charge)) + meta:set_int("internal_EU_charge", current_charge) + + -- Select node textures + local charge_count = math.ceil((current_charge / max_charge) * 8) + charge_count = math.min(charge_count, 8) + 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) + meta:set_float("last_side_shown", charge_count) + end + + local charge_percent = math.floor(current_charge / max_charge * 100) + meta:set_string("formspec", + formspec.. + "image[1,1;1,2;technic_power_meter_bg.png" + .."^[lowpart:"..charge_percent + ..":technic_power_meter_fg.png]") + + local infotext = S("%s Battery Box: %d/%d"):format(tier, + current_charge, max_charge) + if eu_input == 0 then + infotext = S("%s Idle"):format(infotext) + end + meta:set_string("infotext", infotext) + end + + for i = 0, 8 do + local groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1} + if i ~= 0 then + groups.not_in_creative_inventory = 1 + end + + if data.tube then + groups.tubedevice = 1 + groups.tubedevice_receiver = 1 + end + + minetest.register_node("technic:"..ltier.."_battery_box"..i, { + description = S("%s Battery Box"):format(tier), + 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"}, + groups = groups, + tube = data.tube and tube or nil, + paramtype2 = "facedir", + sounds = default.node_sound_wood_defaults(), + drop = "technic:"..ltier.."_battery_box0", + on_construct = function(pos) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + local node = minetest.get_node(pos) + + meta:set_string("infotext", S("%s Battery Box"):format(tier)) + meta:set_string("formspec", formspec) + meta:set_int(tier.."_EU_demand", 0) + meta:set_int(tier.."_EU_supply", 0) + meta:set_int(tier.."_EU_input", 0) + meta:set_float("internal_EU_charge", 0) + inv:set_size("src", 1) + inv:set_size("dst", 1) + inv:set_size("upgrade1", 1) + inv:set_size("upgrade2", 1) + end, + can_dig = technic.machine_can_dig, + allow_metadata_inventory_put = technic.machine_inventory_put, + allow_metadata_inventory_take = technic.machine_inventory_take, + allow_metadata_inventory_move = technic.machine_inventory_move, + technic_run = run, + }) + end + + -- Register as a battery type + -- Battery type machines function as power reservoirs and can both receive and give back power + for i = 0, 8 do + technic.register_machine(tier, "technic:"..ltier.."_battery_box"..i, technic.battery) + end + +end -- End registration + + +function technic.charge_tools(meta, batt_charge, charge_step) + local inv = meta:get_inventory() + if inv:is_empty("src") then + return batt_charge, false + end + local srcstack = inv:get_stack("src", 1) + + local toolname = srcstack:get_name() + if not technic.power_tools[toolname] then + return batt_charge, false + end + -- Set meta data for the tool if it didn't do it itself + src_meta = minetest.deserialize(srcstack:get_metadata()) + src_meta = src_meta or {} + if not src_meta.charge then + src_meta.charge = 0 + end + -- Do the charging + local item_max_charge = technic.power_tools[toolname] + local tool_charge = src_meta.charge + if tool_charge >= item_max_charge then + return batt_charge, true + elseif batt_charge <= 0 then + return batt_charge, false + end + charge_step = math.min(charge_step, batt_charge) + charge_step = math.min(charge_step, item_max_charge - tool_charge) + tool_charge = tool_charge + charge_step + batt_charge = batt_charge - charge_step + technic.set_RE_wear(srcstack, tool_charge, item_max_charge) + src_meta.charge = tool_charge + srcstack:set_metadata(minetest.serialize(src_meta)) + inv:set_stack("src", 1, srcstack) + return batt_charge, (tool_charge == item_max_charge) +end + + +function technic.discharge_tools(meta, batt_charge, charge_step, max_charge) + local inv = meta:get_inventory() + if inv:is_empty("dst") then + return batt_charge, false + end + srcstack = inv:get_stack("dst", 1) + local toolname = srcstack:get_name() + if technic.power_tools[toolname] == nil then + return batt_charge, false + end + -- Set meta data for the tool if it didn't do it itself :-( + local src_meta = minetest.deserialize(srcstack:get_metadata()) + src_meta = src_meta or {} + if not src_meta.charge then + src_meta.charge = 0 + end + + -- Do the discharging + local item_max_charge = technic.power_tools[toolname] + local tool_charge = src_meta.charge + if tool_charge <= 0 then + return batt_charge, true + elseif batt_charge >= max_charge then + return batt_charge, false + end + charge_step = math.min(charge_step, max_charge - batt_charge) + charge_step = math.min(charge_step, tool_charge) + tool_charge = tool_charge - charge_step + batt_charge = batt_charge + charge_step + technic.set_RE_wear(srcstack, tool_charge, item_max_charge) + src_meta.charge = tool_charge + srcstack:set_metadata(minetest.serialize(src_meta)) + inv:set_stack("dst", 1, srcstack) + return batt_charge, (tool_charge == 0) +end + diff --git a/mods/technic-master/technic/machines/register/cables.lua b/mods/technic-master/technic/machines/register/cables.lua new file mode 100644 index 0000000..9ec1cfa --- /dev/null +++ b/mods/technic-master/technic/machines/register/cables.lua @@ -0,0 +1,173 @@ + +local S = technic.getter + +technic.cables = {} + +function technic.register_cable(tier, size) + local ltier = string.lower(tier) + + for x1 = 0, 1 do + for x2 = 0, 1 do + for y1 = 0, 1 do + for y2 = 0, 1 do + for z1 = 0, 1 do + for z2 = 0, 1 do + local id = technic.get_cable_id({x1, x2, y1, y2, z1, z2}) + + technic.cables["technic:"..ltier.."_cable"..id] = tier + + local groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2} + if id ~= 0 then + groups.not_in_creative_inventory = 1 + end + + minetest.register_node("technic:"..ltier.."_cable"..id, { + description = S("%s Cable"):format(tier), + tiles = {"technic_"..ltier.."_cable.png"}, + inventory_image = "technic_"..ltier.."_cable_wield.png", + wield_image = "technic_"..ltier.."_cable_wield.png", + groups = groups, + sounds = default.node_sound_wood_defaults(), + drop = "technic:"..ltier.."_cable0", + paramtype = "light", + sunlight_propagates = true, + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = technic.gen_cable_nodebox(x1, y1, z1, x2, y2, z2, size) + }, + on_construct = function() + technic.networks = {} + end, + on_destruct = function() + technic.networks = {} + end, + after_place_node = function(pos) + local node = minetest.get_node(pos) + technic.update_cables(pos, technic.get_cable_tier(node.name)) + end, + after_dig_node = function(pos, oldnode) + local tier = technic.get_cable_tier(oldnode.name) + technic.update_cables(pos, tier, true) + end + }) + end + end + end + end + end + end +end + +minetest.register_on_placenode(function(pos, node) + for tier, machine_list in pairs(technic.machines) do + if machine_list[node.name] ~= nil then + technic.update_cables(pos, tier, true) + technic.networks = {} + end + end +end) + + +minetest.register_on_dignode(function(pos, node) + for tier, machine_list in pairs(technic.machines) do + if machine_list[node.name] ~= nil then + technic.update_cables(pos, tier, true) + technic.networks = {} + end + end +end) + +function technic.get_cable_id(links) + return (links[6] * 1) + (links[5] * 2) + + (links[4] * 4) + (links[3] * 8) + + (links[2] * 16) + (links[1] * 32) +end + +function technic.update_cables(pos, tier, no_set, secondrun) + local link_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}} + + local links = {0, 0, 0, 0, 0, 0} + + for i, link_pos in pairs(link_positions) do + local connect_type = technic.cables_should_connect(pos, link_pos, tier) + if connect_type then + links[i] = 1 + -- Have cables next to us update theirselves, + -- but only once. (We don't want to update the entire + -- network or start an infinite loop of updates) + if not secondrun and connect_type == "cable" then + technic.update_cables(link_pos, tier, false, true) + end + end + end + -- We don't want to set ourselves if we have been removed or we are + -- updating a machine + if not no_set then + minetest.set_node(pos, {name="technic:"..string.lower(tier) + .."_cable"..technic.get_cable_id(links)}) + + end +end + + +function technic.is_tier_cable(name, tier) + return technic.cables[name] and technic.cables[name] == tier +end + + +function technic.get_cable_tier(name) + return technic.cables[name] +end + + +function technic.cables_should_connect(pos1, pos2, tier) + local name = minetest.get_node(pos2).name + + if technic.is_tier_cable(name, tier) then + return "cable" + elseif technic.machines[tier][name] then + return "machine" + end + return false +end + + +function technic.gen_cable_nodebox(x1, y1, z1, x2, y2, z2, size) + -- Nodeboxes + local box_center = {-size, -size, -size, size, size, size} + local box_y1 = {-size, -size, -size, size, 0.5, size} -- y+ + local box_x1 = {-size, -size, -size, 0.5, size, size} -- x+ + local box_z1 = {-size, -size, size, size, size, 0.5} -- z+ + local box_z2 = {-size, -size, -0.5, size, size, size} -- z- + local box_y2 = {-size, -0.5, -size, size, size, size} -- y- + local box_x2 = {-0.5, -size, -size, size, size, size} -- x- + + local box = {box_center} + if x1 == 1 then + table.insert(box, box_x1) + end + if y1 == 1 then + table.insert(box, box_y1) + end + if z1 == 1 then + table.insert(box, box_z1) + end + if x2 == 1 then + table.insert(box, box_x2) + end + if y2 == 1 then + table.insert(box, box_y2) + end + if z2 == 1 then + table.insert(box, box_z2) + end + return box +end + diff --git a/mods/technic-master/technic/machines/register/centrifuge.lua b/mods/technic-master/technic/machines/register/centrifuge.lua new file mode 100644 index 0000000..dd05977 --- /dev/null +++ b/mods/technic-master/technic/machines/register/centrifuge.lua @@ -0,0 +1,8 @@ +local S = technic.getter + +function technic.register_centrifuge(data) + data.typename = "separating" + data.machine_name = "centrifuge" + data.machine_desc = S("%s Centrifuge") + technic.register_base_machine(data) +end diff --git a/mods/technic-master/technic/machines/register/centrifuge_recipes.lua b/mods/technic-master/technic/machines/register/centrifuge_recipes.lua new file mode 100644 index 0000000..8b447a2 --- /dev/null +++ b/mods/technic-master/technic/machines/register/centrifuge_recipes.lua @@ -0,0 +1,38 @@ +local S = technic.getter + +technic.register_recipe_type("separating", { + description = S("Separating"), + output_size = 2, +}) + +function technic.register_separating_recipe(data) + data.time = data.time or 10 + technic.register_recipe("separating", data) +end + +local rubber_tree_planks = minetest.get_modpath("moretrees") and "moretrees:rubber_tree_planks" or "default:wood" + +local recipes = { + { "technic:bronze_dust 4", "technic:copper_dust 3", "technic:tin_dust" }, + { "technic:stainless_steel_dust 4", "technic:wrought_iron_dust 3", "technic:chromium_dust" }, + { "technic:brass_dust 3", "technic:copper_dust 2", "technic:zinc_dust" }, + { "moretrees:rubber_tree_trunk_empty", rubber_tree_planks.." 4", "technic:raw_latex" }, + { "moretrees:rubber_tree_trunk", rubber_tree_planks.." 4", "technic:raw_latex" }, +} + +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) }) +end + +if minetest.get_modpath("bushes_classic") then + for _, berry in ipairs({ "blackberry", "blueberry", "gooseberry", "raspberry", "strawberry" }) do + table.insert(recipes, { "bushes:"..berry.."_bush", "default:stick 20", "bushes:"..berry.." 4" }) + end +end + +for _, data in pairs(recipes) do + technic.register_separating_recipe({ input = { data[1] }, output = { data[2], data[3] } }) +end diff --git a/mods/technic-master/technic/machines/register/common.lua b/mods/technic-master/technic/machines/register/common.lua new file mode 100644 index 0000000..0e59d0e --- /dev/null +++ b/mods/technic-master/technic/machines/register/common.lua @@ -0,0 +1,154 @@ + +local S = technic.getter + +function technic.handle_machine_upgrades(meta) + -- Get the names of the upgrades + local inv = meta:get_inventory() + local upg_item1 + local upg_item2 + local srcstack = inv:get_stack("upgrade1", 1) + if srcstack then + upg_item1 = srcstack:to_table() + end + srcstack = inv:get_stack("upgrade2", 1) + if srcstack then + upg_item2 = srcstack:to_table() + end + + -- Save some power by installing battery upgrades. + -- Tube loading speed can be upgraded using control logic units. + local EU_upgrade = 0 + local tube_upgrade = 0 + if upg_item1 then + if upg_item1.name == "technic:battery" then + EU_upgrade = EU_upgrade + 1 + elseif upg_item1.name == "technic:control_logic_unit" then + tube_upgrade = tube_upgrade + 1 + end + end + if upg_item2 then + if upg_item2.name == "technic:battery" then + EU_upgrade = EU_upgrade + 1 + elseif upg_item2.name == "technic:control_logic_unit" then + tube_upgrade = tube_upgrade + 1 + end + end + return EU_upgrade, tube_upgrade +end + + +function technic.send_items(pos, x_velocity, z_velocity, output_name) + -- Send items on their way in the pipe system. + if output_name == nil then + output_name = "dst" + end + + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + local i = 0 + for _, stack in ipairs(inv:get_list(output_name)) do + i = i + 1 + if stack then + local item0 = stack:to_table() + if item0 then + item0["count"] = "1" + technic.tube_inject_item(pos, pos, vector.new(x_velocity, 0, z_velocity), item0) + stack:take_item(1) + inv:set_stack(output_name, i, stack) + return + end + end + end +end + + +function technic.smelt_item(meta, result, speed) + local inv = meta:get_inventory() + meta:set_int("cook_time", meta:get_int("cook_time") + 1) + if meta:get_int("cook_time") < result.time / speed then + return + end + local result + local afterfuel + 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) + -- check if there's room for output in "dst" list + if inv:room_for_item("dst", result.item) then + inv:set_stack("src", 1, afterfuel.items[1]) + inv:add_item("dst", result.item) + end + end +end + +function technic.handle_machine_pipeworks(pos, tube_upgrade, send_function) + if send_function == nil then + send_function = technic.send_items + end + + local node = minetest.get_node(pos) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + local pos1 = vector.new(pos) + local x_velocity = 0 + local z_velocity = 0 + + -- Output is on the left side of the furnace + if node.param2 == 3 then pos1.z = pos1.z - 1 z_velocity = -1 end + if node.param2 == 2 then pos1.x = pos1.x - 1 x_velocity = -1 end + if node.param2 == 1 then pos1.z = pos1.z + 1 z_velocity = 1 end + if node.param2 == 0 then pos1.x = pos1.x + 1 x_velocity = 1 end + + local output_tube_connected = false + local node1 = minetest.get_node(pos1) + if minetest.get_item_group(node1.name, "tubedevice") > 0 then + output_tube_connected = true + end + tube_time = meta:get_int("tube_time") + tube_time = tube_time + tube_upgrade + if tube_time >= 2 then + tube_time = 0 + if output_tube_connected then + send_function(pos, x_velocity, z_velocity) + end + end + meta:set_int("tube_time", tube_time) +end + + +function technic.machine_can_dig(pos, player) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + if not inv:is_empty("src") or not inv:is_empty("dst") or + not inv:is_empty("upgrade1") or not inv:is_empty("upgrade2") then + minetest.chat_send_player(player:get_player_name(), + S("Machine cannot be removed because it is not empty")) + return false + else + return true + end +end + +local function inv_change(pos, player, count) + if minetest.is_protected(pos, player:get_player_name()) then + minetest.chat_send_player(player:get_player_name(), + S("Inventory move disallowed due to protection")) + return 0 + end + return count +end + +function technic.machine_inventory_put(pos, listname, index, stack, player) + return inv_change(pos, player, stack:get_count()) +end + +function technic.machine_inventory_take(pos, listname, index, stack, player) + return inv_change(pos, player, stack:get_count()) +end + +function technic.machine_inventory_move(pos, from_list, from_index, + to_list, to_index, count, player) + return inv_change(pos, player, count) +end + diff --git a/mods/technic-master/technic/machines/register/compressor.lua b/mods/technic-master/technic/machines/register/compressor.lua new file mode 100644 index 0000000..49830d7 --- /dev/null +++ b/mods/technic-master/technic/machines/register/compressor.lua @@ -0,0 +1,9 @@ + +local S = technic.getter + +function technic.register_compressor(data) + data.typename = "compressing" + data.machine_name = "compressor" + data.machine_desc = S("%s Compressor") + technic.register_base_machine(data) +end diff --git a/mods/technic-master/technic/machines/register/compressor_recipes.lua b/mods/technic-master/technic/machines/register/compressor_recipes.lua new file mode 100644 index 0000000..4fba03b --- /dev/null +++ b/mods/technic-master/technic/machines/register/compressor_recipes.lua @@ -0,0 +1,24 @@ + +local S = technic.getter + +technic.register_recipe_type("compressing", { description = S("Compressing") }) + +function technic.register_compressor_recipe(data) + data.time = data.time or 4 + technic.register_recipe("compressing", data) +end + +local recipes = { + {"default:snowblock", "default:ice"}, + {"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"}, +} + +for _, data in pairs(recipes) do + technic.register_compressor_recipe({input = {data[1]}, output = data[2]}) +end + diff --git a/mods/technic-master/technic/machines/register/electric_furnace.lua b/mods/technic-master/technic/machines/register/electric_furnace.lua new file mode 100644 index 0000000..44de16c --- /dev/null +++ b/mods/technic-master/technic/machines/register/electric_furnace.lua @@ -0,0 +1,9 @@ + +local S = technic.getter + +function technic.register_electric_furnace(data) + data.typename = "cooking" + data.machine_name = "electric_furnace" + data.machine_desc = S("%s Furnace") + technic.register_base_machine(data) +end diff --git a/mods/technic-master/technic/machines/register/extractor.lua b/mods/technic-master/technic/machines/register/extractor.lua new file mode 100644 index 0000000..eeef9ff --- /dev/null +++ b/mods/technic-master/technic/machines/register/extractor.lua @@ -0,0 +1,9 @@ + +local S = technic.getter + +function technic.register_extractor(data) + data.typename = "extracting" + data.machine_name = "extractor" + data.machine_desc = S("%s Extractor") + technic.register_base_machine(data) +end diff --git a/mods/technic-master/technic/machines/register/extractor_recipes.lua b/mods/technic-master/technic/machines/register/extractor_recipes.lua new file mode 100644 index 0000000..f752144 --- /dev/null +++ b/mods/technic-master/technic/machines/register/extractor_recipes.lua @@ -0,0 +1,32 @@ + +local S = technic.getter + +technic.register_recipe_type("extracting", { description = S("Extracting") }) + +function technic.register_extractor_recipe(data) + data.time = data.time or 4 + technic.register_recipe("extracting", data) +end + +local recipes = { + -- Dyes + {"technic:coal_dust", "dye:black 2"}, + {"default:cactus", "dye:green 2"}, + {"default:dry_shrub", "dye:brown 2"}, + {"flowers:geranium", "dye:blue 2"}, + {"flowers:dandelion_white", "dye:white 2"}, + {"flowers:dandelion_yellow", "dye:yellow 2"}, + {"flowers:tulip", "dye:orange 2"}, + {"flowers:rose", "dye:red 2"}, + {"flowers:viola", "dye:violet 2"}, + + -- Rubber + {"technic:raw_latex", "technic:rubber 3"}, + {"moretrees:rubber_tree_trunk_empty", "technic:rubber"}, + {"moretrees:rubber_tree_trunk", "technic:rubber"}, +} + +for _, data in pairs(recipes) do + technic.register_extractor_recipe({input = {data[1]}, output = data[2]}) +end + diff --git a/mods/technic-master/technic/machines/register/generator.lua b/mods/technic-master/technic/machines/register/generator.lua new file mode 100644 index 0000000..64f75be --- /dev/null +++ b/mods/technic-master/technic/machines/register/generator.lua @@ -0,0 +1,168 @@ +local S = technic.getter + +local tube = { + insert_object = function(pos, node, stack, direction) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + return inv:add_item("src", 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("src", stack) + end, + 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} + local active_groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1, not_in_creative_inventory=1} + if data.tube then + groups.tubedevice = 1 + groups.tubedevice_receiver = 1 + active_groups.tubedevice = 1 + active_groups.tubedevice_receiver = 1 + end + + local generator_formspec = + "invsize[8,9;]".. + "label[0,0;"..S("Fuel-Fired %s Generator"):format(tier).."]".. + "list[current_name;src;3,1;1,1;]".. + "image[4,1;1,1;default_furnace_fire_bg.png]".. + "list[current_player;main;0,5;8,4;]" + + local desc = S("Fuel-Fired %s Generator"):format(tier) + + local run = function(pos, node) + local meta = minetest.get_meta(pos) + local burn_time = meta:get_int("burn_time") + local burn_totaltime = meta:get_int("burn_totaltime") + -- If more to burn and the energy produced was used: produce some more + if burn_time > 0 then + meta:set_int(tier.."_EU_supply", data.supply) + burn_time = burn_time - 1 + meta:set_int("burn_time", burn_time) + end + -- Burn another piece of fuel + if burn_time == 0 then + local inv = meta:get_inventory() + if not inv:is_empty("src") then + local fuellist = inv:get_list("src") + local fuel + local afterfuel + 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") + return + end + meta:set_int("burn_time", fuel.time) + meta:set_int("burn_totaltime", fuel.time) + inv:set_stack("src", 1, afterfuel.items[1]) + technic.swap_node(pos, "technic:"..ltier.."_generator_active") + meta:set_int(tier.."_EU_supply", data.supply) + else + technic.swap_node(pos, "technic:"..ltier.."_generator") + meta:set_int(tier.."_EU_supply", 0) + end + end + if burn_totaltime == 0 then burn_totaltime = 1 end + local percent = math.floor((burn_time / burn_totaltime) * 100) + meta:set_string("infotext", desc.." ("..percent.."%)") + meta:set_string("formspec", + "size[8, 9]".. + "label[0, 0;"..minetest.formspec_escape(desc).."]".. + "list[current_name;src;3, 1;1, 1;]".. + "image[4, 1;1, 1;default_furnace_fire_bg.png^[lowpart:".. + (percent)..":default_furnace_fire_fg.png]".. + "list[current_player;main;0, 5;8, 4;]") + end + + minetest.register_node("technic:"..ltier.."_generator", { + description = desc, + 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"}, + paramtype2 = "facedir", + groups = groups, + legacy_facedir_simple = true, + sounds = default.node_sound_wood_defaults(), + tube = data.tube and tube or nil, + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("infotext", desc) + meta:set_int(data.tier.."_EU_supply", 0) + meta:set_int("burn_time", 0) + meta:set_int("tube_time", 0) + meta:set_string("formspec", generator_formspec) + local inv = meta:get_inventory() + inv:set_size("src", 1) + end, + can_dig = technic.machine_can_dig, + allow_metadata_inventory_put = technic.machine_inventory_put, + allow_metadata_inventory_take = technic.machine_inventory_take, + allow_metadata_inventory_move = technic.machine_inventory_move, + technic_run = run, + }) + + minetest.register_node("technic:"..ltier.."_generator_active", { + description = desc, + 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"}, + paramtype2 = "facedir", + groups = active_groups, + legacy_facedir_simple = true, + sounds = default.node_sound_wood_defaults(), + tube = data.tube and tube or nil, + drop = "technic:"..ltier.."_generator", + can_dig = technic.machine_can_dig, + allow_metadata_inventory_put = technic.machine_inventory_put, + allow_metadata_inventory_take = technic.machine_inventory_take, + allow_metadata_inventory_move = technic.machine_inventory_move, + technic_run = run, + technic_on_disable = function(pos, node) + local timer = minetest.get_node_timer(pos) + timer:start(1) + end, + on_timer = function(pos, node) + local meta = minetest.get_meta(pos) + + -- Connected back? + if meta:get_int(tier.."_EU_timeout") > 0 then return end + + local burn_time = meta:get_int("burn_time") or 0 + + if burn_time <= 0 then + meta:set_int(tier.."_EU_supply", 0) + meta:set_int("burn_time", 0) + technic.swap_node(pos, "technic:"..ltier.."_generator") + return + end + + local burn_totaltime = meta:get_int("burn_totaltime") or 0 + if burn_totaltime == 0 then burn_totaltime = 1 end + burn_time = burn_time - 1 + meta:set_int("burn_time", burn_time) + local percent = math.floor(burn_time / burn_totaltime * 100) + meta:set_string("formspec", + "size[8, 9]".. + "label[0, 0;"..minetest.formspec_escape(desc).."]".. + "list[current_name;src;3, 1;1, 1;]".. + "image[4, 1;1, 1;default_furnace_fire_bg.png^[lowpart:".. + (percent)..":default_furnace_fire_fg.png]".. + "list[current_player;main;0, 5;8, 4;]") + local timer = minetest.get_node_timer(pos) + timer:start(1) + end, + }) + + technic.register_machine(tier, "technic:"..ltier.."_generator", technic.producer) + technic.register_machine(tier, "technic:"..ltier.."_generator_active", technic.producer) +end + diff --git a/mods/technic-master/technic/machines/register/grinder.lua b/mods/technic-master/technic/machines/register/grinder.lua new file mode 100644 index 0000000..19ea094 --- /dev/null +++ b/mods/technic-master/technic/machines/register/grinder.lua @@ -0,0 +1,9 @@ + +local S = technic.getter + +function technic.register_grinder(data) + data.typename = "grinding" + data.machine_name = "grinder" + data.machine_desc = S("%s Grinder") + technic.register_base_machine(data) +end diff --git a/mods/technic-master/technic/machines/register/grinder_recipes.lua b/mods/technic-master/technic/machines/register/grinder_recipes.lua new file mode 100644 index 0000000..6ab19e7 --- /dev/null +++ b/mods/technic-master/technic/machines/register/grinder_recipes.lua @@ -0,0 +1,131 @@ + +local S = technic.getter + +technic.register_recipe_type("grinding", { description = S("Grinding") }) + +function technic.register_grinder_recipe(data) + data.time = data.time or 3 + technic.register_recipe("grinding", data) +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"}, + + -- Other + {"default:cobble", "default:gravel"}, + {"default:gravel", "default:dirt"}, + {"default:stone", "default:sand"}, +} + +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"}) +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"}) +end + +if minetest.get_modpath("homedecor") then + 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]}) +end + +local function register_dust(name, ingot) + local lname = string.lower(name) + lname = string.gsub(lname, ' ', '_') + minetest.register_craftitem("technic:"..lname.."_dust", { + description = S("%s Dust"):format(S(name)), + inventory_image = "technic_"..lname.."_dust.png", + on_place_on_ground = minetest.craftitem_place_item, + }) + if ingot then + minetest.register_craft({ + type = "cooking", + recipe = "technic:"..lname.."_dust", + output = ingot, + }) + technic.register_grinder_recipe({ input = {ingot}, output = "technic:"..lname.."_dust 1" }) + end +end + +-- Sorted alphibeticaly +register_dust("Brass", "technic:brass_ingot") +register_dust("Bronze", "default:bronze_ingot") +register_dust("Carbon Steel", "technic:carbon_steel_ingot") +register_dust("Cast Iron", "technic:cast_iron_ingot") +register_dust("Chromium", "technic:chromium_ingot") +register_dust("Coal", nil) +register_dust("Copper", "default:copper_ingot") +register_dust("Gold", "default:gold_ingot") +register_dust("Mithril", "moreores:mithril_ingot") +register_dust("Silver", "moreores:silver_ingot") +register_dust("Stainless Steel", "technic:stainless_steel_ingot") +register_dust("Tin", "moreores:tin_ingot") +register_dust("Wrought Iron", "technic:wrought_iron_ingot") +register_dust("Zinc", "technic:zinc_ingot") +if minetest.get_modpath("gloopores") or minetest.get_modpath("glooptest") then + register_dust("Akalin", "glooptest:akalin_ingot") + register_dust("Alatro", "glooptest:alatro_ingot") + register_dust("Arol", "glooptest:arol_ingot") + register_dust("Kalite", nil) + register_dust("Talinite", "glooptest:talinite_ingot") +end + +for p = 0, 35 do + local nici = (p ~= 0 and p ~= 7 and p ~= 35) and 1 or nil + local psuffix = p == 7 and "" or p + 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)), + inventory_image = "technic_uranium_dust.png", + on_place_on_ground = minetest.craftitem_place_item, + 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 }) +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 + if pc == math.floor(pc) then + minetest.register_craft({ + type = "shapeless", + recipe = { uranium_dust(pa), uranium_dust(pb) }, + output = uranium_dust(pc).." 2", + }) + end + end +end + +minetest.register_craft({ + type = "fuel", + recipe = "technic:coal_dust", + burntime = 50, +}) + diff --git a/mods/technic-master/technic/machines/register/init.lua b/mods/technic-master/technic/machines/register/init.lua new file mode 100644 index 0000000..3cf373d --- /dev/null +++ b/mods/technic-master/technic/machines/register/init.lua @@ -0,0 +1,30 @@ +local path = technic.modpath.."/machines/register" + +dofile(path.."/common.lua") + +-- Wiring stuff +dofile(path.."/cables.lua") +dofile(path.."/battery_box.lua") + +-- Generators +dofile(path.."/solar_array.lua") +dofile(path.."/generator.lua") + +-- API for machines +dofile(path.."/recipes.lua") +dofile(path.."/machine_base.lua") + +-- Recipes +dofile(path.."/alloy_recipes.lua") +dofile(path.."/grinder_recipes.lua") +dofile(path.."/extractor_recipes.lua") +dofile(path.."/compressor_recipes.lua") +dofile(path.."/centrifuge_recipes.lua") + +-- Machines +dofile(path.."/alloy_furnace.lua") +dofile(path.."/electric_furnace.lua") +dofile(path.."/grinder.lua") +dofile(path.."/extractor.lua") +dofile(path.."/compressor.lua") +dofile(path.."/centrifuge.lua") diff --git a/mods/technic-master/technic/machines/register/machine_base.lua b/mods/technic-master/technic/machines/register/machine_base.lua new file mode 100644 index 0000000..6972b9c --- /dev/null +++ b/mods/technic-master/technic/machines/register/machine_base.lua @@ -0,0 +1,178 @@ + +local S = technic.getter + +local tube = { + insert_object = function(pos, node, stack, direction) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + return inv:add_item("src", 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("src", stack) + end, + connect_sides = {left = 1, right = 1, back = 1, top = 1, bottom = 1}, +} + +function technic.register_base_machine(data) + local typename = data.typename + local input_size = technic.recipes[typename].input_size + local machine_name = data.machine_name + local machine_desc = data.machine_desc + local tier = data.tier + local ltier = string.lower(tier) + + local groups = {cracky = 2, technic_machine = 1} + local active_groups = {cracky = 2, technic_machine = 1, not_in_creative_inventory = 1} + if data.tube then + groups.tubedevice = 1 + groups.tubedevice_receiver = 1 + active_groups.tubedevice = 1 + active_groups.tubedevice_receiver = 1 + end + + + local formspec = + "invsize[8,9;]".. + "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).."]" + if data.upgrade then + formspec = formspec.. + "list[current_name;upgrade1;1,3;1,1;]".. + "list[current_name;upgrade2;2,3;1,1;]".. + "label[1,4;"..S("Upgrade Slots").."]" + end + + local run = function(pos, node) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + local eu_input = meta:get_int(tier.."_EU_input") + + local machine_desc_tier = machine_desc:format(tier) + local machine_node = "technic:"..ltier.."_"..machine_name + local machine_demand = data.demand + + -- Setup meta data if it does not exist. + if not eu_input then + meta:set_int(tier.."_EU_demand", machine_demand[1]) + meta:set_int(tier.."_EU_input", 0) + return + end + + local EU_upgrade, tube_upgrade = 0, 0 + if data.upgrade then + EU_upgrade, tube_upgrade = technic.handle_machine_upgrades(meta) + end + if data.tube then + technic.handle_machine_pipeworks(pos, tube_upgrade) + end + + local result = technic.get_recipe(typename, inv:get_list("src")) + + if not result then + technic.swap_node(pos, machine_node) + meta:set_string("infotext", S("%s Idle"):format(machine_desc_tier)) + meta:set_int(tier.."_EU_demand", 0) + return + end + + if eu_input < machine_demand[EU_upgrade+1] then + -- Unpowered - go idle + technic.swap_node(pos, machine_node) + meta:set_string("infotext", S("%s Unpowered"):format(machine_desc_tier)) + elseif eu_input >= machine_demand[EU_upgrade+1] then + -- Powered + technic.swap_node(pos, machine_node.."_active") + meta:set_string("infotext", S("%s Active"):format(machine_desc_tier)) + + meta:set_int("src_time", meta:get_int("src_time") + 1) + if meta:get_int("src_time") >= result.time / data.speed then + meta:set_int("src_time", 0) + local output = result.output + if type(output) ~= "table" then output = { output } end + local output_stacks = {} + for _, o in ipairs(output) do + table.insert(output_stacks, ItemStack(o)) + end + local room_for_output = true + inv:set_size("dst_tmp", inv:get_size("dst")) + inv:set_list("dst_tmp", inv:get_list("dst")) + for _, o in ipairs(output_stacks) do + if not inv:room_for_item("dst_tmp", o) then + room_for_output = false + break + end + inv:add_item("dst_tmp", o) + end + if room_for_output then + inv:set_list("src", result.new_input) + inv:set_list("dst", inv:get_list("dst_tmp")) + else + end + end + end + meta:set_int(tier.."_EU_demand", machine_demand[EU_upgrade+1]) + end + + minetest.register_node("technic:"..ltier.."_"..machine_name, { + description = machine_desc:format(tier), + 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"}, + paramtype2 = "facedir", + groups = groups, + tube = data.tube and tube or nil, + legacy_facedir_simple = true, + sounds = default.node_sound_wood_defaults(), + on_construct = function(pos) + local node = minetest.get_node(pos) + local meta = minetest.get_meta(pos) + meta:set_string("infotext", machine_desc:format(tier)) + meta:set_int("tube_time", 0) + meta:set_string("formspec", formspec) + local inv = meta:get_inventory() + inv:set_size("src", input_size) + inv:set_size("dst", 4) + inv:set_size("upgrade1", 1) + inv:set_size("upgrade2", 1) + end, + can_dig = technic.machine_can_dig, + allow_metadata_inventory_put = technic.machine_inventory_put, + allow_metadata_inventory_take = technic.machine_inventory_take, + allow_metadata_inventory_move = technic.machine_inventory_move, + technic_run = run, + }) + + minetest.register_node("technic:"..ltier.."_"..machine_name.."_active",{ + description = machine_desc:format(tier), + 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"}, + paramtype2 = "facedir", + drop = "technic:"..ltier.."_"..machine_name, + groups = active_groups, + legacy_facedir_simple = true, + sounds = default.node_sound_wood_defaults(), + tube = data.tube and tube or nil, + can_dig = technic.machine_can_dig, + allow_metadata_inventory_put = technic.machine_inventory_put, + allow_metadata_inventory_take = technic.machine_inventory_take, + allow_metadata_inventory_move = technic.machine_inventory_move, + technic_run = run, + technic_disabled_machine_name = "technic:"..ltier.."_"..machine_name, + }) + + technic.register_machine(tier, "technic:"..ltier.."_"..machine_name, technic.receiver) + technic.register_machine(tier, "technic:"..ltier.."_"..machine_name.."_active", technic.receiver) + +end -- End registration + diff --git a/mods/technic-master/technic/machines/register/recipes.lua b/mods/technic-master/technic/machines/register/recipes.lua new file mode 100644 index 0000000..22e9866 --- /dev/null +++ b/mods/technic-master/technic/machines/register/recipes.lua @@ -0,0 +1,97 @@ + +technic.recipes = { cooking = { input_size = 1, output_size = 1 } } +function technic.register_recipe_type(typename, origdata) + local data = {} + for k, v in pairs(origdata) do data[k] = v end + data.input_size = data.input_size or 1 + data.output_size = data.output_size or 1 + if unified_inventory and unified_inventory.register_craft_type and data.output_size == 1 then + unified_inventory.register_craft_type(typename, { + description = data.description, + width = data.input_size, + height = 1, + }) + end + data.recipes = {} + technic.recipes[typename] = data +end + +local function get_recipe_index(items) + local l = {} + for i, stack in ipairs(items) do + l[i] = ItemStack(stack):get_name() + end + table.sort(l) + return table.concat(l, "/") +end + +local function register_recipe(typename, data) + -- Handle aliases + for i, stack in ipairs(data.input) do + data.input[i] = ItemStack(stack):to_string() + end + if type(data.output) == "table" then + for i, v in ipairs(data.output) do + data.output[i] = ItemStack(data.output[i]):to_string() + end + else + data.output = ItemStack(data.output):to_string() + end + + local recipe = {time = data.time, input = {}, output = data.output} + local index = get_recipe_index(data.input) + for _, stack in ipairs(data.input) do + recipe.input[ItemStack(stack):get_name()] = ItemStack(stack):get_count() + end + + technic.recipes[typename].recipes[index] = recipe + if unified_inventory and technic.recipes[typename].output_size == 1 then + unified_inventory.register_craft({ + type = typename, + output = data.output, + items = data.input, + width = 0, + }) + end +end + +function technic.register_recipe(typename, data) + minetest.after(0.01, register_recipe, typename, data) -- Handle aliases +end + +function technic.get_recipe(typename, items) + if typename == "cooking" then -- Already builtin in Minetest, so use that + local result, new_input = minetest.get_craft_result({ + method = "cooking", + width = 1, + items = items}) + -- Compatibility layer + if not result or result.time == 0 then + return nil + else + return {time = result.time, + new_input = new_input.items, + output = result.item} + end + end + local index = get_recipe_index(items) + local recipe = technic.recipes[typename].recipes[index] + if recipe then + local new_input = {} + for i, stack in ipairs(items) do + if stack:get_count() < recipe.input[stack:get_name()] then + return nil + else + new_input[i] = ItemStack(stack) + new_input[i]:take_item(recipe.input[stack:get_name()]) + end + end + return {time = recipe.time, + new_input = new_input, + output = recipe.output} + else + return nil + end +end + + diff --git a/mods/technic-master/technic/machines/register/solar_array.lua b/mods/technic-master/technic/machines/register/solar_array.lua new file mode 100644 index 0000000..615219b --- /dev/null +++ b/mods/technic-master/technic/machines/register/solar_array.lua @@ -0,0 +1,63 @@ + +local S = technic.getter + +function technic.register_solar_array(data) + local tier = data.tier + local ltier = string.lower(tier) + + local run = function(pos, node) + -- The action here is to make the solar array produce power + -- Power is dependent on the light level and the height above ground + -- There are many ways to cheat by using other light sources like lamps. + -- 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 = {} + local machine_name = S("Arrayed Solar %s Generator"):format(tier) + pos1.y = pos.y + 1 + pos1.x = pos.x + pos1.z = pos.z + local light = minetest.get_node_light(pos1, nil) + local time_of_day = minetest.get_timeofday() + local meta = minetest.get_meta(pos) + light = light or 0 + + -- turn on array only during day time and if sufficient light + -- I know this is counter intuitive when cheating by using other light sources. + if light >= 12 and time_of_day >= 0.24 and time_of_day <= 0.76 and pos.y > 0 then + local charge_to_give = math.floor((light + pos.y) * data.power) + charge_to_give = math.max(charge_to_give, 0) + charge_to_give = math.min(charge_to_give, data.power * 50) + meta:set_string("infotext", S("%s Active"):format(machine_name).." ("..charge_to_give.."EU)") + meta:set_int(tier.."_EU_supply", charge_to_give) + else + meta:set_string("infotext", S("%s Idle"):format(machine_name)) + meta:set_int(tier.."_EU_supply", 0) + end + end + + minetest.register_node("technic:solar_array_"..ltier, { + 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}, + sounds = default.node_sound_wood_defaults(), + description = S("Arrayed Solar %s Generator"):format(tier), + active = false, + drawtype = "nodebox", + paramtype = "light", + node_box = { + type = "fixed", + fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5}, + }, + on_construct = function(pos) + local meta = minetest.get_meta(pos) + local name = minetest.get_node(pos).name + meta:set_int(tier.."_EU_supply", 0) + end, + technic_run = run, + }) + + technic.register_machine(tier, "technic:solar_array_"..ltier, technic.producer) +end + diff --git a/mods/technic-master/technic/machines/supply_converter.lua b/mods/technic-master/technic/machines/supply_converter.lua new file mode 100644 index 0000000..d89c3c1 --- /dev/null +++ b/mods/technic-master/technic/machines/supply_converter.lua @@ -0,0 +1,82 @@ +-- The supply converter is a generic device which can convert from +-- LV to MV and back, and HV to MV and back. +-- The machine is configured by the wiring below and above it. +-- +-- It works like this: +-- The top side is setup as the receiver side, the bottom as the producer side. +-- Once the receiver side is powered it will deliver power to the other side. +-- Unused power is wasted just like any other producer! + +local S = technic.getter + +local run = function(pos, node) + local demand = 10000 + local remain = 0.9 + -- Machine information + local machine_name = S("Supply Converter") + local meta = minetest.get_meta(pos) + + 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 + + local from = technic.get_cable_tier(name_up) + local to = technic.get_cable_tier(name_down) + + if from and to then + local input = meta:get_int(from.."_EU_input") + meta:set_int(from.."_EU_demand", demand) + meta:set_int(from.."_EU_supply", 0) + meta:set_int(to.."_EU_demand", 0) + meta:set_int(to.."_EU_supply", input * remain) + meta:set_string("infotext", machine_name + .." ("..input.." "..from.." -> " + ..input * remain.." "..to..")") + else + meta:set_string("infotext", S("%s Has Bad Cabling"):format(machine_name)) + if to then + meta:set_int(to.."_EU_supply", 0) + end + if from then + meta:set_int(from.."_EU_demand", 0) + 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", + "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}, + sounds = default.node_sound_wood_defaults(), + drawtype = "nodebox", + paramtype = "light", + node_box = { + type = "fixed", + fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, + }, + on_construct = function(pos) + local meta = minetest.env:get_meta(pos) + meta:set_string("infotext", S("Supply Converter")) + meta:set_float("active", false) + end, + technic_run = run, +}) + +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_cable0', 'technic:rubber', 'technic:lv_cable0'}, + } +}) + +for tier, machines in pairs(technic.machines) do + technic.register_machine(tier, "technic:supply_converter", technic.producer_receiver) +end + diff --git a/mods/technic-master/technic/machines/switching_station.lua b/mods/technic-master/technic/machines/switching_station.lua new file mode 100644 index 0000000..5517917 --- /dev/null +++ b/mods/technic-master/technic/machines/switching_station.lua @@ -0,0 +1,408 @@ +-- SWITCHING STATION +-- The switching station is the center of all power distribution on an electric network. +-- +-- The station collects power from sources (PR), distributes it to sinks (RE), +-- and uses the excess/shortfall to charge and discharge batteries (BA). +-- +-- For now, all supply and demand values are expressed in kW. +-- +-- It works like this: +-- All PR,BA,RE nodes are indexed and tagged with the switching station. +-- The tagging is to allow more stations to be built without allowing a cheat +-- with duplicating power. +-- All the RE nodes are queried for their current EU demand. Those which are off +-- would require no or a small standby EU demand, while those which are on would +-- require more. +-- If the total demand is less than the available power they are all updated with the +-- demand number. +-- If any surplus exists from the PR nodes the batteries will be charged evenly with this. +-- If the total demand requires draw on the batteries they will be discharged evenly. +-- +-- If the total demand is more than the available power all RE nodes will be shut down. +-- We have a brown-out situation. +-- +-- Hence all the power distribution logic resides in this single node. +-- +-- Nodes connected to the network will have one or more of these parameters as meta data: +-- _EU_supply : Exists for PR and BA node types. This is the EU value supplied by the node. Output +-- _EU_demand : Exists for RE and BA node types. This is the EU value the node requires to run. Output +-- _EU_input : Exists for RE and BA node types. This is the actual EU value the network can give the node. Input +-- +-- The reason the LV|MV|HV type is prepended toe meta data is because some machine could require several supplies to work. +-- This way the supplies are separated per network. + +technic.networks = {} + +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_cable0", "technic:lv_cable0", "technic:lv_cable0"} + } +}) + +minetest.register_node("technic:switching_station",{ + description = S("Switching Station"), + 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", + "technic_water_mill_top_active.png", "technic_water_mill_top_active.png"}, + groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2}, + sounds = default.node_sound_wood_defaults(), + drawtype = "nodebox", + paramtype = "light", + node_box = { + type = "fixed", + 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_string("infotext", S("Switching Station")) + meta:set_string("active", 1) + end, +}) + +-------------------------------------------------- +-- Functions to traverse the electrical network +-------------------------------------------------- + +-- Add a wire node to the LV/MV/HV network +local add_new_cable_node = function(nodes, pos) + -- Ignore if the node has already been added + for i = 1, #nodes do + if pos.x == nodes[i].x and + pos.y == nodes[i].y and + pos.z == nodes[i].z then + return false + end + end + table.insert(nodes, {x=pos.x, y=pos.y, z=pos.z, visited=1}) + return true +end + +local load_position = function(pos) + if minetest.get_node_or_nil(pos) then return end + local vm = VoxelManip() + local MinEdge, MaxEdge = vm:read_from_map(pos, pos) +end + +-- Generic function to add found connected nodes to the right classification array +local check_node_subp = function(PR_nodes, RE_nodes, BA_nodes, SP_nodes, all_nodes, pos, machines, tier, sw_pos) + load_position(pos) + local meta = minetest.get_meta(pos) + local name = minetest.get_node(pos).name + + if technic.is_tier_cable(name, tier) then + add_new_cable_node(all_nodes, pos) + elseif machines[name] then + --dprint(name.." is a "..machines[name]) + if machines[name] == technic.producer then + add_new_cable_node(PR_nodes, pos) + elseif machines[name] == technic.receiver then + add_new_cable_node(RE_nodes, pos) + elseif machines[name] == technic.producer_receiver then + add_new_cable_node(PR_nodes, pos) + add_new_cable_node(RE_nodes, pos) + elseif machines[name] == "SPECIAL" and + (pos.x ~= sw_pos.x or pos.y ~= sw_pos.y or pos.z ~= sw_pos.z) then + -- Another switching station -> disable it + add_new_cable_node(SP_nodes, pos) + meta:set_int("active", 0) + meta:set_string("active_pos", minetest.serialize(sw_pos)) + elseif machines[name] == technic.battery then + add_new_cable_node(BA_nodes, pos) + end + + meta:set_int(tier.."_EU_timeout", 2) -- Touch node + end +end + +-- Traverse a network given a list of machines and a cable type name +local traverse_network = function(PR_nodes, RE_nodes, BA_nodes, SP_nodes, all_nodes, i, machines, tier, sw_pos) + 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}} + --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) + end +end + +local touch_nodes = function(list, tier) + for _, pos in ipairs(list) do + local meta = minetest.get_meta(pos) + meta:set_int(tier.."_EU_timeout", 2) -- Touch node + end +end + +local get_network = function(sw_pos, pos1, tier) + local cached = technic.networks[minetest.hash_node_position(pos1)] + if cached and cached.tier == tier then + touch_nodes(cached.PR_nodes, tier) + touch_nodes(cached.BA_nodes, tier) + touch_nodes(cached.RE_nodes, tier) + for _, pos in ipairs(cached.SP_nodes) do + local meta = minetest.get_meta(pos) + meta:set_int("active", 0) + meta:set_string("active_pos", minetest.serialize(sw_pos)) + end + return cached.PR_nodes, cached.BA_nodes, cached.RE_nodes + end + local i = 1 + local PR_nodes = {} + local BA_nodes = {} + local RE_nodes = {} + local SP_nodes = {} + local all_nodes = {pos1} + repeat + traverse_network(PR_nodes, RE_nodes, BA_nodes, SP_nodes, all_nodes, + i, technic.machines[tier], tier, sw_pos) + 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} + return PR_nodes, BA_nodes, RE_nodes +end + +----------------------------------------------- +-- The action code for the switching station -- +----------------------------------------------- +minetest.register_abm({ + 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 meta1 = nil + local pos1 = {} + local PR_EU = 0 -- EUs from PR nodes + local BA_PR_EU = 0 -- EUs from BA nodes (discharching) + local BA_RE_EU = 0 -- EUs to BA nodes (charging) + local RE_EU = 0 -- EUs to RE nodes + + local tier = "" + local PR_nodes + local BA_nodes + local RE_nodes + local machine_name = S("Switching Station") + + if meta:get_int("active") ~= 1 then + meta:set_int("active", 1) + local active_pos = minetest.deserialize(meta:get_string("active_pos")) + if active_pos then + local meta1 = minetest.get_meta(active_pos) + meta:set_string("infotext", S("%s (Slave)"):format(meta1:get_string("infotext"))) + end + return + end + + -- Which kind of network are we on: + pos1 = {x=pos.x, y=pos.y-1, z=pos.z} + + local name = minetest.get_node(pos1).name + local tier = technic.get_cable_tier(name) + if tier then + PR_nodes, BA_nodes, RE_nodes = get_network(pos, pos1, tier) + else + --dprint("Not connected to a network") + meta:set_string("infotext", S("%s Has No Network"):format(machine_name)) + return + end + + -- Run all the nodes + local function run_nodes(list) + for _, pos2 in ipairs(list) do + load_position(pos2) + local node2 = minetest.get_node(pos2) + local nodedef + if node2 and node2.name then + nodedef = minetest.registered_nodes[node2.name] + end + if nodedef and nodedef.technic_run then + nodedef.technic_run(pos2, node2) + end + end + end + + run_nodes(PR_nodes) + run_nodes(RE_nodes) + run_nodes(BA_nodes) + + -- Strings for the meta data + local eu_demand_str = tier.."_EU_demand" + local eu_input_str = tier.."_EU_input" + local eu_supply_str = tier.."_EU_supply" + + -- Distribute charge equally across multiple batteries. + local charge_total = 0 + local battery_count = 0 + + for n, pos1 in pairs(BA_nodes) do + meta1 = minetest.get_meta(pos1) + local charge = meta1:get_int("internal_EU_charge") + + if (meta1:get_int(eu_demand_str) ~= 0) then + charge_total = charge_total + charge + battery_count = battery_count + 1 + end + end + + local charge_distributed = math.floor(charge_total / battery_count) + + for n, pos1 in pairs(BA_nodes) do + meta1 = minetest.get_meta(pos1) + + if (meta1:get_int(eu_demand_str) ~= 0) then + meta1:set_int("internal_EU_charge", charge_distributed) + end + end + + -- Get all the power from the PR nodes + local PR_eu_supply = 0 -- Total power + for _, pos1 in pairs(PR_nodes) do + meta1 = minetest.get_meta(pos1) + PR_eu_supply = PR_eu_supply + meta1:get_int(eu_supply_str) + end + --dprint("Total PR supply:"..PR_eu_supply) + + -- Get all the demand from the RE nodes + local RE_eu_demand = 0 + for _, pos1 in pairs(RE_nodes) do + meta1 = minetest.get_meta(pos1) + RE_eu_demand = RE_eu_demand + meta1:get_int(eu_demand_str) + end + --dprint("Total RE demand:"..RE_eu_demand) + + -- Get all the power from the BA nodes + local BA_eu_supply = 0 + for _, pos1 in pairs(BA_nodes) do + meta1 = minetest.get_meta(pos1) + BA_eu_supply = BA_eu_supply + meta1:get_int(eu_supply_str) + end + --dprint("Total BA supply:"..BA_eu_supply) + + -- Get all the demand from the BA nodes + local BA_eu_demand = 0 + for _, pos1 in pairs(BA_nodes) do + meta1 = minetest.get_meta(pos1) + BA_eu_demand = BA_eu_demand + meta1:get_int(eu_demand_str) + end + --dprint("Total BA demand:"..BA_eu_demand) + + meta:set_string("infotext", + S("%s. Supply: %d Demand: %d"):format( + machine_name, PR_eu_supply, RE_eu_demand)) + + -- If the PR supply is enough for the RE demand supply them all + if PR_eu_supply >= RE_eu_demand then + --dprint("PR_eu_supply"..PR_eu_supply.." >= RE_eu_demand"..RE_eu_demand) + for _, pos1 in pairs(RE_nodes) do + meta1 = minetest.get_meta(pos1) + local eu_demand = meta1:get_int(eu_demand_str) + meta1:set_int(eu_input_str, eu_demand) + end + -- We have a surplus, so distribute the rest equally to the BA nodes + -- Let's calculate the factor of the demand + PR_eu_supply = PR_eu_supply - RE_eu_demand + local charge_factor = 0 -- Assume all batteries fully charged + if BA_eu_demand > 0 then + charge_factor = PR_eu_supply / BA_eu_demand + end + for n, pos1 in pairs(BA_nodes) do + meta1 = minetest.get_meta(pos1) + local eu_demand = meta1:get_int(eu_demand_str) + meta1:set_int(eu_input_str, math.floor(eu_demand * charge_factor)) + --dprint("Charging battery:"..math.floor(eu_demand*charge_factor)) + end + return + end + + -- If the PR supply is not enough for the RE demand we will discharge the batteries too + if PR_eu_supply + BA_eu_supply >= RE_eu_demand then + --dprint("PR_eu_supply "..PR_eu_supply.."+BA_eu_supply "..BA_eu_supply.." >= RE_eu_demand"..RE_eu_demand) + for _, pos1 in pairs(RE_nodes) do + meta1 = minetest.get_meta(pos1) + local eu_demand = meta1:get_int(eu_demand_str) + meta1:set_int(eu_input_str, eu_demand) + end + -- We have a deficit, so distribute to the BA nodes + -- Let's calculate the factor of the supply + local charge_factor = 0 -- Assume all batteries depleted + 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 + 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)) + --dprint("Discharging battery:"..math.floor(eu_supply*charge_factor)) + end + return + end + + -- If the PR+BA supply is not enough for the RE demand: Power only the batteries + local charge_factor = 0 -- Assume all batteries fully charged + if BA_eu_demand > 0 then + charge_factor = PR_eu_supply / BA_eu_demand + end + for n, pos1 in pairs(BA_nodes) do + meta1 = minetest.get_meta(pos1) + local eu_demand = meta1:get_int(eu_demand_str) + meta1:set_int(eu_input_str, math.floor(eu_demand * charge_factor)) + end + for n, pos1 in pairs(RE_nodes) do + meta1 = minetest.get_meta(pos1) + meta1:set_int(eu_input_str, 0) + end + end, +}) + +-- Timeout ABM +-- Timeout for a node in case it was disconnected from the network +-- A node must be touched by the station continuously in order to function +local function switching_station_timeout_count(pos, tier) + local meta = minetest.get_meta(pos) + local timeout = meta:get_int(tier.."_EU_timeout") + if timeout <= 0 then + --meta:set_int(tier.."_EU_input", 0) -- Not needed anymore + return true + else + meta:set_int(tier.."_EU_timeout", timeout - 1) + return false + end +end +minetest.register_abm({ + nodenames = {"group:technic_machine"}, + interval = 1, + chance = 1, + action = function(pos, node, active_object_count, active_object_count_wider) + for tier, machines in pairs(technic.machines) do + if machines[node.name] and switching_station_timeout_count(pos, tier) then + local nodedef = minetest.registered_nodes[node.name] + if nodedef and nodedef.technic_disabled_machine_name then + node.name = nodedef.technic_disabled_machine_name + minetest.swap_node(pos, node) + elseif nodedef and nodedef.technic_on_disable then + nodedef.technic_on_disable(pos, node) + end + if nodedef then + local meta = minetest.get_meta(pos) + meta:set_string("infotext", S("%s Has No Network"):format(nodedef.description)) + end + end + end + end, +}) + +for tier, machines in pairs(technic.machines) do + -- SPECIAL will not be traversed + technic.register_machine(tier, "technic:switching_station", "SPECIAL") +end + diff --git a/mods/technic-master/technic/register.lua b/mods/technic-master/technic/register.lua new file mode 100644 index 0000000..6a237f9 --- /dev/null +++ b/mods/technic-master/technic/register.lua @@ -0,0 +1,59 @@ +-- This file includes the functions and data structures for registering machines and tools for LV, MV, HV types. +-- We use the technic namespace for these functions and data to avoid eventual conflict. + +technic.receiver = "RE" +technic.producer = "PR" +technic.producer_receiver = "PR_RE" +technic.battery = "BA" + +technic.machines = {} +technic.power_tools = {} +technic.networks = {} + + +function technic.register_tier(tier, description) + technic.machines[tier] = {} + technic.cables[tier] = {} +end + +function technic.register_machine(tier, nodename, machine_type) + if not technic.machines[tier] then + return + end + technic.machines[tier][nodename] = machine_type +end + +function technic.register_power_tool(craftitem, max_charge) + technic.power_tools[craftitem] = max_charge +end + + +-- Utility functions. Not sure exactly what they do.. water.lua uses the two first. +function technic.get_RE_item_load(load1, max_load) + if load1 == 0 then load1 = 65535 end + local temp = 65536 - load1 + temp = temp / 65535 * max_load + return math.floor(temp + 0.5) +end + +function technic.set_RE_item_load(load1, max_load) + if load1 == 0 then return 65535 end + local temp = load1 / max_load * 65535 + temp = 65536 - temp + return math.floor(temp) +end + +-- Wear down a tool depending on the remaining charge. +function technic.set_RE_wear(itemstack, item_load, max_load) + if (minetest.registered_items[itemstack:get_name()].wear_represents or "mechanical_wear") ~= "technic_RE_charge" then return itemstack end + local temp + if item_load == 0 then + temp = 0 + else + temp = 65536 - math.floor(item_load / max_load * 65535) + if temp > 65535 then temp = 65535 end + if temp < 1 then temp = 1 end + end + itemstack:set_wear(temp) + return itemstack +end diff --git a/mods/technic-master/technic/sounds/chainsaw.ogg b/mods/technic-master/technic/sounds/chainsaw.ogg new file mode 100644 index 0000000..5fe7552 Binary files /dev/null and b/mods/technic-master/technic/sounds/chainsaw.ogg differ diff --git a/mods/technic-master/technic/sounds/item_drop_pickup.1.ogg b/mods/technic-master/technic/sounds/item_drop_pickup.1.ogg new file mode 100644 index 0000000..2ae432d Binary files /dev/null and b/mods/technic-master/technic/sounds/item_drop_pickup.1.ogg differ diff --git a/mods/technic-master/technic/sounds/item_drop_pickup.2.ogg b/mods/technic-master/technic/sounds/item_drop_pickup.2.ogg new file mode 100644 index 0000000..f58bf08 Binary files /dev/null and b/mods/technic-master/technic/sounds/item_drop_pickup.2.ogg differ diff --git a/mods/technic-master/technic/sounds/item_drop_pickup.3.ogg b/mods/technic-master/technic/sounds/item_drop_pickup.3.ogg new file mode 100644 index 0000000..cf57c94 Binary files /dev/null and b/mods/technic-master/technic/sounds/item_drop_pickup.3.ogg differ diff --git a/mods/technic-master/technic/sounds/item_drop_pickup.4.ogg b/mods/technic-master/technic/sounds/item_drop_pickup.4.ogg new file mode 100644 index 0000000..bfe99d9 Binary files /dev/null and b/mods/technic-master/technic/sounds/item_drop_pickup.4.ogg differ diff --git a/mods/technic-master/technic/sounds/mining_drill.ogg b/mods/technic-master/technic/sounds/mining_drill.ogg new file mode 100644 index 0000000..1493544 Binary files /dev/null and b/mods/technic-master/technic/sounds/mining_drill.ogg differ diff --git a/mods/technic-master/technic/sounds/technic_hv_nuclear_reactor_siren_clear.ogg b/mods/technic-master/technic/sounds/technic_hv_nuclear_reactor_siren_clear.ogg new file mode 100644 index 0000000..3332deb Binary files /dev/null and b/mods/technic-master/technic/sounds/technic_hv_nuclear_reactor_siren_clear.ogg differ diff --git a/mods/technic-master/technic/sounds/technic_hv_nuclear_reactor_siren_danger_loop.ogg b/mods/technic-master/technic/sounds/technic_hv_nuclear_reactor_siren_danger_loop.ogg new file mode 100644 index 0000000..3d290b0 Binary files /dev/null and b/mods/technic-master/technic/sounds/technic_hv_nuclear_reactor_siren_danger_loop.ogg differ diff --git a/mods/technic-master/technic/sounds/technic_laser_mk1.0.ogg b/mods/technic-master/technic/sounds/technic_laser_mk1.0.ogg new file mode 100644 index 0000000..19be080 Binary files /dev/null and b/mods/technic-master/technic/sounds/technic_laser_mk1.0.ogg differ diff --git a/mods/technic-master/technic/sounds/technic_laser_mk1.1.ogg b/mods/technic-master/technic/sounds/technic_laser_mk1.1.ogg new file mode 100644 index 0000000..7792be1 Binary files /dev/null and b/mods/technic-master/technic/sounds/technic_laser_mk1.1.ogg differ diff --git a/mods/technic-master/technic/sounds/technic_laser_mk2.0.ogg b/mods/technic-master/technic/sounds/technic_laser_mk2.0.ogg new file mode 100644 index 0000000..2cf1548 Binary files /dev/null and b/mods/technic-master/technic/sounds/technic_laser_mk2.0.ogg differ diff --git a/mods/technic-master/technic/sounds/technic_laser_mk2.1.ogg b/mods/technic-master/technic/sounds/technic_laser_mk2.1.ogg new file mode 100644 index 0000000..b3f9afb Binary files /dev/null and b/mods/technic-master/technic/sounds/technic_laser_mk2.1.ogg differ diff --git a/mods/technic-master/technic/sounds/technic_laser_mk2.2.ogg b/mods/technic-master/technic/sounds/technic_laser_mk2.2.ogg new file mode 100644 index 0000000..a4ee091 Binary files /dev/null and b/mods/technic-master/technic/sounds/technic_laser_mk2.2.ogg differ diff --git a/mods/technic-master/technic/sounds/technic_laser_mk3.1.ogg b/mods/technic-master/technic/sounds/technic_laser_mk3.1.ogg new file mode 100644 index 0000000..f948913 Binary files /dev/null and b/mods/technic-master/technic/sounds/technic_laser_mk3.1.ogg differ diff --git a/mods/technic-master/technic/sounds/technic_laser_mk3.2.ogg b/mods/technic-master/technic/sounds/technic_laser_mk3.2.ogg new file mode 100644 index 0000000..636c306 Binary files /dev/null and b/mods/technic-master/technic/sounds/technic_laser_mk3.2.ogg differ diff --git a/mods/technic-master/technic/sounds/technic_prospector_hit.ogg b/mods/technic-master/technic/sounds/technic_prospector_hit.ogg new file mode 100644 index 0000000..3a8ad2d Binary files /dev/null and b/mods/technic-master/technic/sounds/technic_prospector_hit.ogg differ diff --git a/mods/technic-master/technic/sounds/technic_prospector_miss.ogg b/mods/technic-master/technic/sounds/technic_prospector_miss.ogg new file mode 100644 index 0000000..0f050d0 Binary files /dev/null and b/mods/technic-master/technic/sounds/technic_prospector_miss.ogg differ diff --git a/mods/technic-master/technic/sounds/technic_sonic_screwdriver.ogg b/mods/technic-master/technic/sounds/technic_sonic_screwdriver.ogg new file mode 100644 index 0000000..471bb72 Binary files /dev/null and b/mods/technic-master/technic/sounds/technic_sonic_screwdriver.ogg differ diff --git a/mods/technic-master/technic/textures/hires/technic_hv_nuclear_reactor_core_128.png b/mods/technic-master/technic/textures/hires/technic_hv_nuclear_reactor_core_128.png new file mode 100644 index 0000000..2848f89 Binary files /dev/null and b/mods/technic-master/technic/textures/hires/technic_hv_nuclear_reactor_core_128.png differ diff --git a/mods/technic-master/technic/textures/hires/technic_hv_nuclear_reactor_core_16.png b/mods/technic-master/technic/textures/hires/technic_hv_nuclear_reactor_core_16.png new file mode 100644 index 0000000..4661177 Binary files /dev/null and b/mods/technic-master/technic/textures/hires/technic_hv_nuclear_reactor_core_16.png differ diff --git a/mods/technic-master/technic/textures/hires/technic_hv_nuclear_reactor_core_256.png b/mods/technic-master/technic/textures/hires/technic_hv_nuclear_reactor_core_256.png new file mode 100644 index 0000000..5187fab Binary files /dev/null and b/mods/technic-master/technic/textures/hires/technic_hv_nuclear_reactor_core_256.png differ diff --git a/mods/technic-master/technic/textures/hires/technic_hv_nuclear_reactor_core_32.png b/mods/technic-master/technic/textures/hires/technic_hv_nuclear_reactor_core_32.png new file mode 100644 index 0000000..3d380da Binary files /dev/null and b/mods/technic-master/technic/textures/hires/technic_hv_nuclear_reactor_core_32.png differ diff --git a/mods/technic-master/technic/textures/hires/technic_hv_nuclear_reactor_core_512.png b/mods/technic-master/technic/textures/hires/technic_hv_nuclear_reactor_core_512.png new file mode 100644 index 0000000..ba2bd89 Binary files /dev/null and b/mods/technic-master/technic/textures/hires/technic_hv_nuclear_reactor_core_512.png differ diff --git a/mods/technic-master/technic/textures/hires/technic_hv_nuclear_reactor_core_64.png b/mods/technic-master/technic/textures/hires/technic_hv_nuclear_reactor_core_64.png new file mode 100644 index 0000000..2fa8f18 Binary files /dev/null and b/mods/technic-master/technic/textures/hires/technic_hv_nuclear_reactor_core_64.png differ diff --git a/mods/technic-master/technic/textures/power_meter.png b/mods/technic-master/technic/textures/power_meter.png new file mode 100644 index 0000000..9f96cac Binary files /dev/null and b/mods/technic-master/technic/textures/power_meter.png differ diff --git a/mods/technic-master/technic/textures/technic_admin_anchor.png b/mods/technic-master/technic/textures/technic_admin_anchor.png new file mode 100644 index 0000000..7ce9b4c Binary files /dev/null and b/mods/technic-master/technic/textures/technic_admin_anchor.png differ diff --git a/mods/technic-master/technic/textures/technic_akalin_dust.png b/mods/technic-master/technic/textures/technic_akalin_dust.png new file mode 100644 index 0000000..052b0ac Binary files /dev/null and b/mods/technic-master/technic/textures/technic_akalin_dust.png differ diff --git a/mods/technic-master/technic/textures/technic_alatro_dust.png b/mods/technic-master/technic/textures/technic_alatro_dust.png new file mode 100644 index 0000000..172af25 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_alatro_dust.png differ diff --git a/mods/technic-master/technic/textures/technic_arol_dust.png b/mods/technic-master/technic/textures/technic_arol_dust.png new file mode 100644 index 0000000..1a575ed Binary files /dev/null and b/mods/technic-master/technic/textures/technic_arol_dust.png differ diff --git a/mods/technic-master/technic/textures/technic_battery.png b/mods/technic-master/technic/textures/technic_battery.png new file mode 100644 index 0000000..ee83b74 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_battery.png differ diff --git a/mods/technic-master/technic/textures/technic_battery_box_side.png b/mods/technic-master/technic/textures/technic_battery_box_side.png new file mode 100644 index 0000000..98a22d6 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_battery_box_side.png differ diff --git a/mods/technic-master/technic/textures/technic_battery_box_side8.png b/mods/technic-master/technic/textures/technic_battery_box_side8.png new file mode 100644 index 0000000..65806f4 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_battery_box_side8.png differ diff --git a/mods/technic-master/technic/textures/technic_battery_box_side_mv.png b/mods/technic-master/technic/textures/technic_battery_box_side_mv.png new file mode 100644 index 0000000..06a4be5 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_battery_box_side_mv.png differ diff --git a/mods/technic-master/technic/textures/technic_battery_meter_fg.png b/mods/technic-master/technic/textures/technic_battery_meter_fg.png new file mode 100644 index 0000000..2f19bc7 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_battery_meter_fg.png differ diff --git a/mods/technic-master/technic/textures/technic_battery_reload.png b/mods/technic-master/technic/textures/technic_battery_reload.png new file mode 100644 index 0000000..4ce48d8 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_battery_reload.png differ diff --git a/mods/technic-master/technic/textures/technic_bronze_dust.png b/mods/technic-master/technic/textures/technic_bronze_dust.png new file mode 100644 index 0000000..a613205 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_bronze_dust.png differ diff --git a/mods/technic-master/technic/textures/technic_bucket_corium.png b/mods/technic-master/technic/textures/technic_bucket_corium.png new file mode 100644 index 0000000..82da7ca Binary files /dev/null and b/mods/technic-master/technic/textures/technic_bucket_corium.png differ diff --git a/mods/technic-master/technic/textures/technic_carbon_cloth.png b/mods/technic-master/technic/textures/technic_carbon_cloth.png new file mode 100644 index 0000000..65a6dab Binary files /dev/null and b/mods/technic-master/technic/textures/technic_carbon_cloth.png differ diff --git a/mods/technic-master/technic/textures/technic_carbon_plate.png b/mods/technic-master/technic/textures/technic_carbon_plate.png new file mode 100644 index 0000000..5da83b8 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_carbon_plate.png differ diff --git a/mods/technic-master/technic/textures/technic_carbon_steel_dust.png b/mods/technic-master/technic/textures/technic_carbon_steel_dust.png new file mode 100644 index 0000000..0fa8a17 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_carbon_steel_dust.png differ diff --git a/mods/technic-master/technic/textures/technic_cast_iron_dust.png b/mods/technic-master/technic/textures/technic_cast_iron_dust.png new file mode 100644 index 0000000..b5690ac Binary files /dev/null and b/mods/technic-master/technic/textures/technic_cast_iron_dust.png differ diff --git a/mods/technic-master/technic/textures/technic_chainsaw.png b/mods/technic-master/technic/textures/technic_chainsaw.png new file mode 100644 index 0000000..1a69893 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_chainsaw.png differ diff --git a/mods/technic-master/technic/textures/technic_chernobylite_block.png b/mods/technic-master/technic/textures/technic_chernobylite_block.png new file mode 100644 index 0000000..a837c66 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_chernobylite_block.png differ diff --git a/mods/technic-master/technic/textures/technic_chromium_dust.png b/mods/technic-master/technic/textures/technic_chromium_dust.png new file mode 100644 index 0000000..0e48069 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_chromium_dust.png differ diff --git a/mods/technic-master/technic/textures/technic_cnc_bottom.png b/mods/technic-master/technic/textures/technic_cnc_bottom.png new file mode 100644 index 0000000..e600cb1 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_cnc_bottom.png differ diff --git a/mods/technic-master/technic/textures/technic_cnc_cylinder.png b/mods/technic-master/technic/textures/technic_cnc_cylinder.png new file mode 100644 index 0000000..06da024 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_cnc_cylinder.png differ diff --git a/mods/technic-master/technic/textures/technic_cnc_cylinder_horizontal.png b/mods/technic-master/technic/textures/technic_cnc_cylinder_horizontal.png new file mode 100644 index 0000000..670ecf2 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_cnc_cylinder_horizontal.png differ diff --git a/mods/technic-master/technic/textures/technic_cnc_element_cross.png b/mods/technic-master/technic/textures/technic_cnc_element_cross.png new file mode 100644 index 0000000..f2ad0b7 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_cnc_element_cross.png differ diff --git a/mods/technic-master/technic/textures/technic_cnc_element_edge.png b/mods/technic-master/technic/textures/technic_cnc_element_edge.png new file mode 100644 index 0000000..e6104cf Binary files /dev/null and b/mods/technic-master/technic/textures/technic_cnc_element_edge.png differ diff --git a/mods/technic-master/technic/textures/technic_cnc_element_end.png b/mods/technic-master/technic/textures/technic_cnc_element_end.png new file mode 100644 index 0000000..6bc6837 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_cnc_element_end.png differ diff --git a/mods/technic-master/technic/textures/technic_cnc_element_straight.png b/mods/technic-master/technic/textures/technic_cnc_element_straight.png new file mode 100644 index 0000000..1648b7b Binary files /dev/null and b/mods/technic-master/technic/textures/technic_cnc_element_straight.png differ diff --git a/mods/technic-master/technic/textures/technic_cnc_element_t.png b/mods/technic-master/technic/textures/technic_cnc_element_t.png new file mode 100644 index 0000000..0d49cd8 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_cnc_element_t.png differ diff --git a/mods/technic-master/technic/textures/technic_cnc_front.png b/mods/technic-master/technic/textures/technic_cnc_front.png new file mode 100644 index 0000000..6cc0490 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_cnc_front.png differ diff --git a/mods/technic-master/technic/textures/technic_cnc_front_active.png b/mods/technic-master/technic/textures/technic_cnc_front_active.png new file mode 100644 index 0000000..f7a3c7f Binary files /dev/null and b/mods/technic-master/technic/textures/technic_cnc_front_active.png differ diff --git a/mods/technic-master/technic/textures/technic_cnc_full.png b/mods/technic-master/technic/textures/technic_cnc_full.png new file mode 100644 index 0000000..d551a45 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_cnc_full.png differ diff --git a/mods/technic-master/technic/textures/technic_cnc_half.png b/mods/technic-master/technic/textures/technic_cnc_half.png new file mode 100644 index 0000000..51ebcd7 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_cnc_half.png differ diff --git a/mods/technic-master/technic/textures/technic_cnc_milling_background.png b/mods/technic-master/technic/textures/technic_cnc_milling_background.png new file mode 100644 index 0000000..6a9c2f4 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_cnc_milling_background.png differ diff --git a/mods/technic-master/technic/textures/technic_cnc_onecurvededge.png b/mods/technic-master/technic/textures/technic_cnc_onecurvededge.png new file mode 100644 index 0000000..46779fd Binary files /dev/null and b/mods/technic-master/technic/textures/technic_cnc_onecurvededge.png differ diff --git a/mods/technic-master/technic/textures/technic_cnc_pyramid.png b/mods/technic-master/technic/textures/technic_cnc_pyramid.png new file mode 100644 index 0000000..5dc3322 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_cnc_pyramid.png differ diff --git a/mods/technic-master/technic/textures/technic_cnc_side.png b/mods/technic-master/technic/textures/technic_cnc_side.png new file mode 100644 index 0000000..1ecbbac Binary files /dev/null and b/mods/technic-master/technic/textures/technic_cnc_side.png differ diff --git a/mods/technic-master/technic/textures/technic_cnc_slope.png b/mods/technic-master/technic/textures/technic_cnc_slope.png new file mode 100644 index 0000000..083ae18 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_cnc_slope.png differ diff --git a/mods/technic-master/technic/textures/technic_cnc_slope_edge.png b/mods/technic-master/technic/textures/technic_cnc_slope_edge.png new file mode 100644 index 0000000..785adf6 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_cnc_slope_edge.png differ diff --git a/mods/technic-master/technic/textures/technic_cnc_slope_edge_upsdwn.png b/mods/technic-master/technic/textures/technic_cnc_slope_edge_upsdwn.png new file mode 100644 index 0000000..5adb788 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_cnc_slope_edge_upsdwn.png differ diff --git a/mods/technic-master/technic/textures/technic_cnc_slope_inner_edge.png b/mods/technic-master/technic/textures/technic_cnc_slope_inner_edge.png new file mode 100644 index 0000000..906dd25 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_cnc_slope_inner_edge.png differ diff --git a/mods/technic-master/technic/textures/technic_cnc_slope_inner_edge_upsdwn.png b/mods/technic-master/technic/textures/technic_cnc_slope_inner_edge_upsdwn.png new file mode 100644 index 0000000..0ae0e14 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_cnc_slope_inner_edge_upsdwn.png differ diff --git a/mods/technic-master/technic/textures/technic_cnc_slope_lying.png b/mods/technic-master/technic/textures/technic_cnc_slope_lying.png new file mode 100644 index 0000000..377769a Binary files /dev/null and b/mods/technic-master/technic/textures/technic_cnc_slope_lying.png differ diff --git a/mods/technic-master/technic/textures/technic_cnc_slope_upsdwn.png b/mods/technic-master/technic/textures/technic_cnc_slope_upsdwn.png new file mode 100644 index 0000000..b802b60 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_cnc_slope_upsdwn.png differ diff --git a/mods/technic-master/technic/textures/technic_cnc_sphere.png b/mods/technic-master/technic/textures/technic_cnc_sphere.png new file mode 100644 index 0000000..69ada47 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_cnc_sphere.png differ diff --git a/mods/technic-master/technic/textures/technic_cnc_spike.png b/mods/technic-master/technic/textures/technic_cnc_spike.png new file mode 100644 index 0000000..92e6e58 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_cnc_spike.png differ diff --git a/mods/technic-master/technic/textures/technic_cnc_stick.png b/mods/technic-master/technic/textures/technic_cnc_stick.png new file mode 100644 index 0000000..8dfe408 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_cnc_stick.png differ diff --git a/mods/technic-master/technic/textures/technic_cnc_top.png b/mods/technic-master/technic/textures/technic_cnc_top.png new file mode 100644 index 0000000..5123334 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_cnc_top.png differ diff --git a/mods/technic-master/technic/textures/technic_cnc_top_active.png b/mods/technic-master/technic/textures/technic_cnc_top_active.png new file mode 100644 index 0000000..2bc9d81 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_cnc_top_active.png differ diff --git a/mods/technic-master/technic/textures/technic_cnc_twocurvededge.png b/mods/technic-master/technic/textures/technic_cnc_twocurvededge.png new file mode 100644 index 0000000..3219a90 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_cnc_twocurvededge.png differ diff --git a/mods/technic-master/technic/textures/technic_coal_alloy_furnace_bottom.png b/mods/technic-master/technic/textures/technic_coal_alloy_furnace_bottom.png new file mode 100644 index 0000000..077dec5 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_coal_alloy_furnace_bottom.png differ diff --git a/mods/technic-master/technic/textures/technic_coal_alloy_furnace_front.png b/mods/technic-master/technic/textures/technic_coal_alloy_furnace_front.png new file mode 100644 index 0000000..d9d93dd Binary files /dev/null and b/mods/technic-master/technic/textures/technic_coal_alloy_furnace_front.png differ diff --git a/mods/technic-master/technic/textures/technic_coal_alloy_furnace_front_active.png b/mods/technic-master/technic/textures/technic_coal_alloy_furnace_front_active.png new file mode 100644 index 0000000..ffc4e0a Binary files /dev/null and b/mods/technic-master/technic/textures/technic_coal_alloy_furnace_front_active.png differ diff --git a/mods/technic-master/technic/textures/technic_coal_alloy_furnace_side.png b/mods/technic-master/technic/textures/technic_coal_alloy_furnace_side.png new file mode 100644 index 0000000..d5c7066 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_coal_alloy_furnace_side.png differ diff --git a/mods/technic-master/technic/textures/technic_coal_alloy_furnace_top.png b/mods/technic-master/technic/textures/technic_coal_alloy_furnace_top.png new file mode 100644 index 0000000..6424fc0 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_coal_alloy_furnace_top.png differ diff --git a/mods/technic-master/technic/textures/technic_coal_dust.png b/mods/technic-master/technic/textures/technic_coal_dust.png new file mode 100644 index 0000000..a1486c6 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_coal_dust.png differ diff --git a/mods/technic-master/technic/textures/technic_composite_plate.png b/mods/technic-master/technic/textures/technic_composite_plate.png new file mode 100644 index 0000000..79b7b8d Binary files /dev/null and b/mods/technic-master/technic/textures/technic_composite_plate.png differ diff --git a/mods/technic-master/technic/textures/technic_constructor_back.png b/mods/technic-master/technic/textures/technic_constructor_back.png new file mode 100644 index 0000000..f002363 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_constructor_back.png differ diff --git a/mods/technic-master/technic/textures/technic_constructor_front_off.png b/mods/technic-master/technic/textures/technic_constructor_front_off.png new file mode 100644 index 0000000..f3f7856 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_constructor_front_off.png differ diff --git a/mods/technic-master/technic/textures/technic_constructor_front_on.png b/mods/technic-master/technic/textures/technic_constructor_front_on.png new file mode 100644 index 0000000..d733765 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_constructor_front_on.png differ diff --git a/mods/technic-master/technic/textures/technic_constructor_mk1_bottom_off.png b/mods/technic-master/technic/textures/technic_constructor_mk1_bottom_off.png new file mode 100644 index 0000000..0c52557 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_constructor_mk1_bottom_off.png differ diff --git a/mods/technic-master/technic/textures/technic_constructor_mk1_bottom_on.png b/mods/technic-master/technic/textures/technic_constructor_mk1_bottom_on.png new file mode 100644 index 0000000..0c46c57 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_constructor_mk1_bottom_on.png differ diff --git a/mods/technic-master/technic/textures/technic_constructor_mk1_side1_off.png b/mods/technic-master/technic/textures/technic_constructor_mk1_side1_off.png new file mode 100644 index 0000000..e64ddbe Binary files /dev/null and b/mods/technic-master/technic/textures/technic_constructor_mk1_side1_off.png differ diff --git a/mods/technic-master/technic/textures/technic_constructor_mk1_side1_on.png b/mods/technic-master/technic/textures/technic_constructor_mk1_side1_on.png new file mode 100644 index 0000000..eda98d8 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_constructor_mk1_side1_on.png differ diff --git a/mods/technic-master/technic/textures/technic_constructor_mk1_side2_off.png b/mods/technic-master/technic/textures/technic_constructor_mk1_side2_off.png new file mode 100644 index 0000000..b33fcfb Binary files /dev/null and b/mods/technic-master/technic/textures/technic_constructor_mk1_side2_off.png differ diff --git a/mods/technic-master/technic/textures/technic_constructor_mk1_side2_on.png b/mods/technic-master/technic/textures/technic_constructor_mk1_side2_on.png new file mode 100644 index 0000000..17e4786 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_constructor_mk1_side2_on.png differ diff --git a/mods/technic-master/technic/textures/technic_constructor_mk1_top_off.png b/mods/technic-master/technic/textures/technic_constructor_mk1_top_off.png new file mode 100644 index 0000000..9f3846c Binary files /dev/null and b/mods/technic-master/technic/textures/technic_constructor_mk1_top_off.png differ diff --git a/mods/technic-master/technic/textures/technic_constructor_mk1_top_on.png b/mods/technic-master/technic/textures/technic_constructor_mk1_top_on.png new file mode 100644 index 0000000..5c8d6fb Binary files /dev/null and b/mods/technic-master/technic/textures/technic_constructor_mk1_top_on.png differ diff --git a/mods/technic-master/technic/textures/technic_constructor_mk2_bottom_off.png b/mods/technic-master/technic/textures/technic_constructor_mk2_bottom_off.png new file mode 100644 index 0000000..e926dda Binary files /dev/null and b/mods/technic-master/technic/textures/technic_constructor_mk2_bottom_off.png differ diff --git a/mods/technic-master/technic/textures/technic_constructor_mk2_bottom_on.png b/mods/technic-master/technic/textures/technic_constructor_mk2_bottom_on.png new file mode 100644 index 0000000..52d739b Binary files /dev/null and b/mods/technic-master/technic/textures/technic_constructor_mk2_bottom_on.png differ diff --git a/mods/technic-master/technic/textures/technic_constructor_mk2_side1_off.png b/mods/technic-master/technic/textures/technic_constructor_mk2_side1_off.png new file mode 100644 index 0000000..2fd42a2 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_constructor_mk2_side1_off.png differ diff --git a/mods/technic-master/technic/textures/technic_constructor_mk2_side1_on.png b/mods/technic-master/technic/textures/technic_constructor_mk2_side1_on.png new file mode 100644 index 0000000..4c75c83 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_constructor_mk2_side1_on.png differ diff --git a/mods/technic-master/technic/textures/technic_constructor_mk2_side2_off.png b/mods/technic-master/technic/textures/technic_constructor_mk2_side2_off.png new file mode 100644 index 0000000..f6407e7 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_constructor_mk2_side2_off.png differ diff --git a/mods/technic-master/technic/textures/technic_constructor_mk2_side2_on.png b/mods/technic-master/technic/textures/technic_constructor_mk2_side2_on.png new file mode 100644 index 0000000..e40db48 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_constructor_mk2_side2_on.png differ diff --git a/mods/technic-master/technic/textures/technic_constructor_mk2_top_off.png b/mods/technic-master/technic/textures/technic_constructor_mk2_top_off.png new file mode 100644 index 0000000..e5227d1 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_constructor_mk2_top_off.png differ diff --git a/mods/technic-master/technic/textures/technic_constructor_mk2_top_on.png b/mods/technic-master/technic/textures/technic_constructor_mk2_top_on.png new file mode 100644 index 0000000..9762bd6 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_constructor_mk2_top_on.png differ diff --git a/mods/technic-master/technic/textures/technic_constructor_mk3_bottom_off.png b/mods/technic-master/technic/textures/technic_constructor_mk3_bottom_off.png new file mode 100644 index 0000000..606d97e Binary files /dev/null and b/mods/technic-master/technic/textures/technic_constructor_mk3_bottom_off.png differ diff --git a/mods/technic-master/technic/textures/technic_constructor_mk3_bottom_on.png b/mods/technic-master/technic/textures/technic_constructor_mk3_bottom_on.png new file mode 100644 index 0000000..878e4ff Binary files /dev/null and b/mods/technic-master/technic/textures/technic_constructor_mk3_bottom_on.png differ diff --git a/mods/technic-master/technic/textures/technic_constructor_mk3_side1_off.png b/mods/technic-master/technic/textures/technic_constructor_mk3_side1_off.png new file mode 100644 index 0000000..84dd7eb Binary files /dev/null and b/mods/technic-master/technic/textures/technic_constructor_mk3_side1_off.png differ diff --git a/mods/technic-master/technic/textures/technic_constructor_mk3_side1_on.png b/mods/technic-master/technic/textures/technic_constructor_mk3_side1_on.png new file mode 100644 index 0000000..2741d2d Binary files /dev/null and b/mods/technic-master/technic/textures/technic_constructor_mk3_side1_on.png differ diff --git a/mods/technic-master/technic/textures/technic_constructor_mk3_side2_off.png b/mods/technic-master/technic/textures/technic_constructor_mk3_side2_off.png new file mode 100644 index 0000000..75a5031 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_constructor_mk3_side2_off.png differ diff --git a/mods/technic-master/technic/textures/technic_constructor_mk3_side2_on.png b/mods/technic-master/technic/textures/technic_constructor_mk3_side2_on.png new file mode 100644 index 0000000..0a150ed Binary files /dev/null and b/mods/technic-master/technic/textures/technic_constructor_mk3_side2_on.png differ diff --git a/mods/technic-master/technic/textures/technic_constructor_mk3_top_off.png b/mods/technic-master/technic/textures/technic_constructor_mk3_top_off.png new file mode 100644 index 0000000..c716752 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_constructor_mk3_top_off.png differ diff --git a/mods/technic-master/technic/textures/technic_constructor_mk3_top_on.png b/mods/technic-master/technic/textures/technic_constructor_mk3_top_on.png new file mode 100644 index 0000000..acbe85b Binary files /dev/null and b/mods/technic-master/technic/textures/technic_constructor_mk3_top_on.png differ diff --git a/mods/technic-master/technic/textures/technic_control_logic_unit.png b/mods/technic-master/technic/textures/technic_control_logic_unit.png new file mode 100644 index 0000000..c7b4b16 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_control_logic_unit.png differ diff --git a/mods/technic-master/technic/textures/technic_copper_coil.png b/mods/technic-master/technic/textures/technic_copper_coil.png new file mode 100644 index 0000000..db6db1a Binary files /dev/null and b/mods/technic-master/technic/textures/technic_copper_coil.png differ diff --git a/mods/technic-master/technic/textures/technic_copper_dust.png b/mods/technic-master/technic/textures/technic_copper_dust.png new file mode 100644 index 0000000..cad33ea Binary files /dev/null and b/mods/technic-master/technic/textures/technic_copper_dust.png differ diff --git a/mods/technic-master/technic/textures/technic_copper_plate.png b/mods/technic-master/technic/textures/technic_copper_plate.png new file mode 100644 index 0000000..99a49c8 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_copper_plate.png differ diff --git a/mods/technic-master/technic/textures/technic_corium_flowing_animated.png b/mods/technic-master/technic/textures/technic_corium_flowing_animated.png new file mode 100644 index 0000000..1d29f16 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_corium_flowing_animated.png differ diff --git a/mods/technic-master/technic/textures/technic_corium_source_animated.png b/mods/technic-master/technic/textures/technic_corium_source_animated.png new file mode 100644 index 0000000..6c3ee56 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_corium_source_animated.png differ diff --git a/mods/technic-master/technic/textures/technic_deployer_back.png b/mods/technic-master/technic/textures/technic_deployer_back.png new file mode 100644 index 0000000..12e5a31 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_deployer_back.png differ diff --git a/mods/technic-master/technic/textures/technic_deployer_bottom.png b/mods/technic-master/technic/textures/technic_deployer_bottom.png new file mode 100644 index 0000000..febbe18 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_deployer_bottom.png differ diff --git a/mods/technic-master/technic/textures/technic_deployer_front_off.png b/mods/technic-master/technic/textures/technic_deployer_front_off.png new file mode 100644 index 0000000..9593112 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_deployer_front_off.png differ diff --git a/mods/technic-master/technic/textures/technic_deployer_front_on.png b/mods/technic-master/technic/textures/technic_deployer_front_on.png new file mode 100644 index 0000000..f78de4c Binary files /dev/null and b/mods/technic-master/technic/textures/technic_deployer_front_on.png differ diff --git a/mods/technic-master/technic/textures/technic_deployer_side.png b/mods/technic-master/technic/textures/technic_deployer_side.png new file mode 100644 index 0000000..73af8f8 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_deployer_side.png differ diff --git a/mods/technic-master/technic/textures/technic_deployer_side1.png b/mods/technic-master/technic/textures/technic_deployer_side1.png new file mode 100644 index 0000000..8ef28d3 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_deployer_side1.png differ diff --git a/mods/technic-master/technic/textures/technic_deployer_side2.png b/mods/technic-master/technic/textures/technic_deployer_side2.png new file mode 100644 index 0000000..ccb2cb9 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_deployer_side2.png differ diff --git a/mods/technic-master/technic/textures/technic_deployer_top.png b/mods/technic-master/technic/textures/technic_deployer_top.png new file mode 100644 index 0000000..262c9f6 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_deployer_top.png differ diff --git a/mods/technic-master/technic/textures/technic_diamond_block_blue.png b/mods/technic-master/technic/textures/technic_diamond_block_blue.png new file mode 100644 index 0000000..9f59fba Binary files /dev/null and b/mods/technic-master/technic/textures/technic_diamond_block_blue.png differ diff --git a/mods/technic-master/technic/textures/technic_diamond_block_green.png b/mods/technic-master/technic/textures/technic_diamond_block_green.png new file mode 100644 index 0000000..585c4b8 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_diamond_block_green.png differ diff --git a/mods/technic-master/technic/textures/technic_diamond_block_red.png b/mods/technic-master/technic/textures/technic_diamond_block_red.png new file mode 100644 index 0000000..ed30957 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_diamond_block_red.png differ diff --git a/mods/technic-master/technic/textures/technic_diamond_drill_head.png b/mods/technic-master/technic/textures/technic_diamond_drill_head.png new file mode 100644 index 0000000..e3d31e8 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_diamond_drill_head.png differ diff --git a/mods/technic-master/technic/textures/technic_doped_silicon_wafer.png b/mods/technic-master/technic/textures/technic_doped_silicon_wafer.png new file mode 100644 index 0000000..6365137 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_doped_silicon_wafer.png differ diff --git a/mods/technic-master/technic/textures/technic_fine_copper_wire.png b/mods/technic-master/technic/textures/technic_fine_copper_wire.png new file mode 100644 index 0000000..3e663bb Binary files /dev/null and b/mods/technic-master/technic/textures/technic_fine_copper_wire.png differ diff --git a/mods/technic-master/technic/textures/technic_fine_gold_wire.png b/mods/technic-master/technic/textures/technic_fine_gold_wire.png new file mode 100644 index 0000000..54a7a52 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_fine_gold_wire.png differ diff --git a/mods/technic-master/technic/textures/technic_fine_silver_wire.png b/mods/technic-master/technic/textures/technic_fine_silver_wire.png new file mode 100644 index 0000000..f40a52b Binary files /dev/null and b/mods/technic-master/technic/textures/technic_fine_silver_wire.png differ diff --git a/mods/technic-master/technic/textures/technic_flashlight.png b/mods/technic-master/technic/textures/technic_flashlight.png new file mode 100644 index 0000000..8e7b75a Binary files /dev/null and b/mods/technic-master/technic/textures/technic_flashlight.png differ diff --git a/mods/technic-master/technic/textures/technic_forcefield_animated.png b/mods/technic-master/technic/textures/technic_forcefield_animated.png new file mode 100644 index 0000000..7763840 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_forcefield_animated.png differ diff --git a/mods/technic-master/technic/textures/technic_forcefield_emitter_off.png b/mods/technic-master/technic/textures/technic_forcefield_emitter_off.png new file mode 100644 index 0000000..4c4582f Binary files /dev/null and b/mods/technic-master/technic/textures/technic_forcefield_emitter_off.png differ diff --git a/mods/technic-master/technic/textures/technic_forcefield_emitter_on.png b/mods/technic-master/technic/textures/technic_forcefield_emitter_on.png new file mode 100644 index 0000000..1f32af6 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_forcefield_emitter_on.png differ diff --git a/mods/technic-master/technic/textures/technic_frame.png b/mods/technic-master/technic/textures/technic_frame.png new file mode 100644 index 0000000..4998120 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_frame.png differ diff --git a/mods/technic-master/technic/textures/technic_geothermal_side.png b/mods/technic-master/technic/textures/technic_geothermal_side.png new file mode 100644 index 0000000..90fb430 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_geothermal_side.png differ diff --git a/mods/technic-master/technic/textures/technic_geothermal_top.png b/mods/technic-master/technic/textures/technic_geothermal_top.png new file mode 100644 index 0000000..601ff15 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_geothermal_top.png differ diff --git a/mods/technic-master/technic/textures/technic_geothermal_top_active.png b/mods/technic-master/technic/textures/technic_geothermal_top_active.png new file mode 100644 index 0000000..f02bec6 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_geothermal_top_active.png differ diff --git a/mods/technic-master/technic/textures/technic_gold_dust.png b/mods/technic-master/technic/textures/technic_gold_dust.png new file mode 100644 index 0000000..48c24ae Binary files /dev/null and b/mods/technic-master/technic/textures/technic_gold_dust.png differ diff --git a/mods/technic-master/technic/textures/technic_graphite.png b/mods/technic-master/technic/textures/technic_graphite.png new file mode 100644 index 0000000..00cd0ee Binary files /dev/null and b/mods/technic-master/technic/textures/technic_graphite.png differ diff --git a/mods/technic-master/technic/textures/technic_grinder_front.png b/mods/technic-master/technic/textures/technic_grinder_front.png new file mode 100644 index 0000000..a28dbc1 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_grinder_front.png differ diff --git a/mods/technic-master/technic/textures/technic_grinder_side.png b/mods/technic-master/technic/textures/technic_grinder_side.png new file mode 100644 index 0000000..af562f2 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_grinder_side.png differ diff --git a/mods/technic-master/technic/textures/technic_grinder_top.png b/mods/technic-master/technic/textures/technic_grinder_top.png new file mode 100644 index 0000000..b074e13 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_grinder_top.png differ diff --git a/mods/technic-master/technic/textures/technic_homedecor_glowlight_cube_white_sides.png b/mods/technic-master/technic/textures/technic_homedecor_glowlight_cube_white_sides.png new file mode 100644 index 0000000..9121999 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_homedecor_glowlight_cube_white_sides.png differ diff --git a/mods/technic-master/technic/textures/technic_homedecor_glowlight_cube_white_sides_ceiling.png b/mods/technic-master/technic/textures/technic_homedecor_glowlight_cube_white_sides_ceiling.png new file mode 100644 index 0000000..c8006eb Binary files /dev/null and b/mods/technic-master/technic/textures/technic_homedecor_glowlight_cube_white_sides_ceiling.png differ diff --git a/mods/technic-master/technic/textures/technic_homedecor_glowlight_cube_white_tb.png b/mods/technic-master/technic/textures/technic_homedecor_glowlight_cube_white_tb.png new file mode 100644 index 0000000..b2e355a Binary files /dev/null and b/mods/technic-master/technic/textures/technic_homedecor_glowlight_cube_white_tb.png differ diff --git a/mods/technic-master/technic/textures/technic_homedecor_glowlight_cube_yellow_sides.png b/mods/technic-master/technic/textures/technic_homedecor_glowlight_cube_yellow_sides.png new file mode 100644 index 0000000..b79be07 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_homedecor_glowlight_cube_yellow_sides.png differ diff --git a/mods/technic-master/technic/textures/technic_homedecor_glowlight_cube_yellow_sides_ceiling.png b/mods/technic-master/technic/textures/technic_homedecor_glowlight_cube_yellow_sides_ceiling.png new file mode 100644 index 0000000..a9d397a Binary files /dev/null and b/mods/technic-master/technic/textures/technic_homedecor_glowlight_cube_yellow_sides_ceiling.png differ diff --git a/mods/technic-master/technic/textures/technic_homedecor_glowlight_cube_yellow_tb.png b/mods/technic-master/technic/textures/technic_homedecor_glowlight_cube_yellow_tb.png new file mode 100644 index 0000000..daf03ab Binary files /dev/null and b/mods/technic-master/technic/textures/technic_homedecor_glowlight_cube_yellow_tb.png differ diff --git a/mods/technic-master/technic/textures/technic_homedecor_glowlight_thick_white_sides.png b/mods/technic-master/technic/textures/technic_homedecor_glowlight_thick_white_sides.png new file mode 100644 index 0000000..44c2b36 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_homedecor_glowlight_thick_white_sides.png differ diff --git a/mods/technic-master/technic/textures/technic_homedecor_glowlight_thick_white_wall_sides.png b/mods/technic-master/technic/textures/technic_homedecor_glowlight_thick_white_wall_sides.png new file mode 100644 index 0000000..937999e Binary files /dev/null and b/mods/technic-master/technic/textures/technic_homedecor_glowlight_thick_white_wall_sides.png differ diff --git a/mods/technic-master/technic/textures/technic_homedecor_glowlight_thick_yellow_sides.png b/mods/technic-master/technic/textures/technic_homedecor_glowlight_thick_yellow_sides.png new file mode 100644 index 0000000..769b054 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_homedecor_glowlight_thick_yellow_sides.png differ diff --git a/mods/technic-master/technic/textures/technic_homedecor_glowlight_thick_yellow_wall_sides.png b/mods/technic-master/technic/textures/technic_homedecor_glowlight_thick_yellow_wall_sides.png new file mode 100644 index 0000000..57820f1 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_homedecor_glowlight_thick_yellow_wall_sides.png differ diff --git a/mods/technic-master/technic/textures/technic_homedecor_glowlight_thin_white_sides.png b/mods/technic-master/technic/textures/technic_homedecor_glowlight_thin_white_sides.png new file mode 100644 index 0000000..0a337a5 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_homedecor_glowlight_thin_white_sides.png differ diff --git a/mods/technic-master/technic/textures/technic_homedecor_glowlight_thin_white_wall_sides.png b/mods/technic-master/technic/textures/technic_homedecor_glowlight_thin_white_wall_sides.png new file mode 100644 index 0000000..0fd3b1e Binary files /dev/null and b/mods/technic-master/technic/textures/technic_homedecor_glowlight_thin_white_wall_sides.png differ diff --git a/mods/technic-master/technic/textures/technic_homedecor_glowlight_thin_yellow_sides.png b/mods/technic-master/technic/textures/technic_homedecor_glowlight_thin_yellow_sides.png new file mode 100644 index 0000000..55bb6c0 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_homedecor_glowlight_thin_yellow_sides.png differ diff --git a/mods/technic-master/technic/textures/technic_homedecor_glowlight_thin_yellow_wall_sides.png b/mods/technic-master/technic/textures/technic_homedecor_glowlight_thin_yellow_wall_sides.png new file mode 100644 index 0000000..4b28a27 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_homedecor_glowlight_thin_yellow_wall_sides.png differ diff --git a/mods/technic-master/technic/textures/technic_homedecor_glowlight_white_tb.png b/mods/technic-master/technic/textures/technic_homedecor_glowlight_white_tb.png new file mode 100644 index 0000000..fdc8a4d Binary files /dev/null and b/mods/technic-master/technic/textures/technic_homedecor_glowlight_white_tb.png differ diff --git a/mods/technic-master/technic/textures/technic_homedecor_glowlight_yellow_tb.png b/mods/technic-master/technic/textures/technic_homedecor_glowlight_yellow_tb.png new file mode 100644 index 0000000..ffd9c58 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_homedecor_glowlight_yellow_tb.png differ diff --git a/mods/technic-master/technic/textures/technic_hv_battery_box_bottom.png b/mods/technic-master/technic/textures/technic_hv_battery_box_bottom.png new file mode 100644 index 0000000..996b2d4 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_hv_battery_box_bottom.png differ diff --git a/mods/technic-master/technic/textures/technic_hv_battery_box_side.png b/mods/technic-master/technic/textures/technic_hv_battery_box_side.png new file mode 100644 index 0000000..fffd8ea Binary files /dev/null and b/mods/technic-master/technic/textures/technic_hv_battery_box_side.png differ diff --git a/mods/technic-master/technic/textures/technic_hv_battery_box_top.png b/mods/technic-master/technic/textures/technic_hv_battery_box_top.png new file mode 100644 index 0000000..49dee71 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_hv_battery_box_top.png differ diff --git a/mods/technic-master/technic/textures/technic_hv_cable.png b/mods/technic-master/technic/textures/technic_hv_cable.png new file mode 100644 index 0000000..7cb368d Binary files /dev/null and b/mods/technic-master/technic/textures/technic_hv_cable.png differ diff --git a/mods/technic-master/technic/textures/technic_hv_cable_wield.png b/mods/technic-master/technic/textures/technic_hv_cable_wield.png new file mode 100644 index 0000000..7b9ca58 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_hv_cable_wield.png differ diff --git a/mods/technic-master/technic/textures/technic_hv_down_converter_bottom.png b/mods/technic-master/technic/textures/technic_hv_down_converter_bottom.png new file mode 100644 index 0000000..996b2d4 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_hv_down_converter_bottom.png differ diff --git a/mods/technic-master/technic/textures/technic_hv_down_converter_side.png b/mods/technic-master/technic/textures/technic_hv_down_converter_side.png new file mode 100644 index 0000000..ab904f1 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_hv_down_converter_side.png differ diff --git a/mods/technic-master/technic/textures/technic_hv_down_converter_top.png b/mods/technic-master/technic/textures/technic_hv_down_converter_top.png new file mode 100644 index 0000000..996b2d4 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_hv_down_converter_top.png differ diff --git a/mods/technic-master/technic/textures/technic_hv_generator_front.png b/mods/technic-master/technic/textures/technic_hv_generator_front.png new file mode 100644 index 0000000..6a14686 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_hv_generator_front.png differ diff --git a/mods/technic-master/technic/textures/technic_hv_generator_front_active.png b/mods/technic-master/technic/textures/technic_hv_generator_front_active.png new file mode 100644 index 0000000..d92c699 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_hv_generator_front_active.png differ diff --git a/mods/technic-master/technic/textures/technic_hv_generator_side.png b/mods/technic-master/technic/textures/technic_hv_generator_side.png new file mode 100644 index 0000000..3073e0f Binary files /dev/null and b/mods/technic-master/technic/textures/technic_hv_generator_side.png differ diff --git a/mods/technic-master/technic/textures/technic_hv_generator_top.png b/mods/technic-master/technic/textures/technic_hv_generator_top.png new file mode 100644 index 0000000..646168c Binary files /dev/null and b/mods/technic-master/technic/textures/technic_hv_generator_top.png differ diff --git a/mods/technic-master/technic/textures/technic_hv_grinder_bottom.png b/mods/technic-master/technic/textures/technic_hv_grinder_bottom.png new file mode 100644 index 0000000..fa2c135 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_hv_grinder_bottom.png differ diff --git a/mods/technic-master/technic/textures/technic_hv_grinder_front.png b/mods/technic-master/technic/textures/technic_hv_grinder_front.png new file mode 100644 index 0000000..a5bca0a Binary files /dev/null and b/mods/technic-master/technic/textures/technic_hv_grinder_front.png differ diff --git a/mods/technic-master/technic/textures/technic_hv_grinder_front_active.png b/mods/technic-master/technic/textures/technic_hv_grinder_front_active.png new file mode 100644 index 0000000..4077630 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_hv_grinder_front_active.png differ diff --git a/mods/technic-master/technic/textures/technic_hv_grinder_side.png b/mods/technic-master/technic/textures/technic_hv_grinder_side.png new file mode 100644 index 0000000..c3063c4 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_hv_grinder_side.png differ diff --git a/mods/technic-master/technic/textures/technic_hv_grinder_side_tube.png b/mods/technic-master/technic/textures/technic_hv_grinder_side_tube.png new file mode 100644 index 0000000..43bcca5 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_hv_grinder_side_tube.png differ diff --git a/mods/technic-master/technic/textures/technic_hv_grinder_top.png b/mods/technic-master/technic/textures/technic_hv_grinder_top.png new file mode 100644 index 0000000..e0df36b Binary files /dev/null and b/mods/technic-master/technic/textures/technic_hv_grinder_top.png differ diff --git a/mods/technic-master/technic/textures/technic_hv_nuclear_reactor_core.png b/mods/technic-master/technic/textures/technic_hv_nuclear_reactor_core.png new file mode 100644 index 0000000..4661177 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_hv_nuclear_reactor_core.png differ diff --git a/mods/technic-master/technic/textures/technic_hv_solar_array_bottom.png b/mods/technic-master/technic/textures/technic_hv_solar_array_bottom.png new file mode 100644 index 0000000..596e79a Binary files /dev/null and b/mods/technic-master/technic/textures/technic_hv_solar_array_bottom.png differ diff --git a/mods/technic-master/technic/textures/technic_hv_solar_array_side.png b/mods/technic-master/technic/textures/technic_hv_solar_array_side.png new file mode 100644 index 0000000..a3aa8c7 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_hv_solar_array_side.png differ diff --git a/mods/technic-master/technic/textures/technic_hv_solar_array_top.png b/mods/technic-master/technic/textures/technic_hv_solar_array_top.png new file mode 100644 index 0000000..b7f0b43 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_hv_solar_array_top.png differ diff --git a/mods/technic-master/technic/textures/technic_hv_transformer.png b/mods/technic-master/technic/textures/technic_hv_transformer.png new file mode 100644 index 0000000..e1d4c98 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_hv_transformer.png differ diff --git a/mods/technic-master/technic/textures/technic_injector_bottom.png b/mods/technic-master/technic/textures/technic_injector_bottom.png new file mode 100644 index 0000000..39916bd Binary files /dev/null and b/mods/technic-master/technic/textures/technic_injector_bottom.png differ diff --git a/mods/technic-master/technic/textures/technic_injector_side.png b/mods/technic-master/technic/textures/technic_injector_side.png new file mode 100644 index 0000000..a5419a1 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_injector_side.png differ diff --git a/mods/technic-master/technic/textures/technic_injector_top.png b/mods/technic-master/technic/textures/technic_injector_top.png new file mode 100644 index 0000000..440649c Binary files /dev/null and b/mods/technic-master/technic/textures/technic_injector_top.png differ diff --git a/mods/technic-master/technic/textures/technic_kalite_dust.png b/mods/technic-master/technic/textures/technic_kalite_dust.png new file mode 100644 index 0000000..3a9e10f Binary files /dev/null and b/mods/technic-master/technic/textures/technic_kalite_dust.png differ diff --git a/mods/technic-master/technic/textures/technic_laser_beam_mk1.png b/mods/technic-master/technic/textures/technic_laser_beam_mk1.png new file mode 100644 index 0000000..4cf9b3e Binary files /dev/null and b/mods/technic-master/technic/textures/technic_laser_beam_mk1.png differ diff --git a/mods/technic-master/technic/textures/technic_laser_beam_mk2.png b/mods/technic-master/technic/textures/technic_laser_beam_mk2.png new file mode 100644 index 0000000..9e27a8c Binary files /dev/null and b/mods/technic-master/technic/textures/technic_laser_beam_mk2.png differ diff --git a/mods/technic-master/technic/textures/technic_laser_beam_mk3.png b/mods/technic-master/technic/textures/technic_laser_beam_mk3.png new file mode 100644 index 0000000..5a17e83 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_laser_beam_mk3.png differ diff --git a/mods/technic-master/technic/textures/technic_lava_can.png b/mods/technic-master/technic/textures/technic_lava_can.png new file mode 100644 index 0000000..abe1a8c Binary files /dev/null and b/mods/technic-master/technic/textures/technic_lava_can.png differ diff --git a/mods/technic-master/technic/textures/technic_light.png b/mods/technic-master/technic/textures/technic_light.png new file mode 100644 index 0000000..334cb07 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_light.png differ diff --git a/mods/technic-master/technic/textures/technic_lv_alloy_furnace_bottom.png b/mods/technic-master/technic/textures/technic_lv_alloy_furnace_bottom.png new file mode 100644 index 0000000..2c0aaee Binary files /dev/null and b/mods/technic-master/technic/textures/technic_lv_alloy_furnace_bottom.png differ diff --git a/mods/technic-master/technic/textures/technic_lv_alloy_furnace_front.png b/mods/technic-master/technic/textures/technic_lv_alloy_furnace_front.png new file mode 100644 index 0000000..2d65cda Binary files /dev/null and b/mods/technic-master/technic/textures/technic_lv_alloy_furnace_front.png differ diff --git a/mods/technic-master/technic/textures/technic_lv_alloy_furnace_front_active.png b/mods/technic-master/technic/textures/technic_lv_alloy_furnace_front_active.png new file mode 100644 index 0000000..1ced989 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_lv_alloy_furnace_front_active.png differ diff --git a/mods/technic-master/technic/textures/technic_lv_alloy_furnace_side.png b/mods/technic-master/technic/textures/technic_lv_alloy_furnace_side.png new file mode 100644 index 0000000..778ad88 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_lv_alloy_furnace_side.png differ diff --git a/mods/technic-master/technic/textures/technic_lv_alloy_furnace_top.png b/mods/technic-master/technic/textures/technic_lv_alloy_furnace_top.png new file mode 100644 index 0000000..706793b Binary files /dev/null and b/mods/technic-master/technic/textures/technic_lv_alloy_furnace_top.png differ diff --git a/mods/technic-master/technic/textures/technic_lv_battery_box_bottom.png b/mods/technic-master/technic/textures/technic_lv_battery_box_bottom.png new file mode 100644 index 0000000..a6124e6 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_lv_battery_box_bottom.png differ diff --git a/mods/technic-master/technic/textures/technic_lv_battery_box_side.png b/mods/technic-master/technic/textures/technic_lv_battery_box_side.png new file mode 100644 index 0000000..24d4e4e Binary files /dev/null and b/mods/technic-master/technic/textures/technic_lv_battery_box_side.png differ diff --git a/mods/technic-master/technic/textures/technic_lv_battery_box_top.png b/mods/technic-master/technic/textures/technic_lv_battery_box_top.png new file mode 100644 index 0000000..b32100f Binary files /dev/null and b/mods/technic-master/technic/textures/technic_lv_battery_box_top.png differ diff --git a/mods/technic-master/technic/textures/technic_lv_cable.png b/mods/technic-master/technic/textures/technic_lv_cable.png new file mode 100644 index 0000000..0071bc9 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_lv_cable.png differ diff --git a/mods/technic-master/technic/textures/technic_lv_cable_wield.png b/mods/technic-master/technic/textures/technic_lv_cable_wield.png new file mode 100644 index 0000000..bc7704d Binary files /dev/null and b/mods/technic-master/technic/textures/technic_lv_cable_wield.png differ diff --git a/mods/technic-master/technic/textures/technic_lv_compressor_back.png b/mods/technic-master/technic/textures/technic_lv_compressor_back.png new file mode 100644 index 0000000..11286e3 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_lv_compressor_back.png differ diff --git a/mods/technic-master/technic/textures/technic_lv_compressor_bottom.png b/mods/technic-master/technic/textures/technic_lv_compressor_bottom.png new file mode 100644 index 0000000..886f27e Binary files /dev/null and b/mods/technic-master/technic/textures/technic_lv_compressor_bottom.png differ diff --git a/mods/technic-master/technic/textures/technic_lv_compressor_front.png b/mods/technic-master/technic/textures/technic_lv_compressor_front.png new file mode 100644 index 0000000..007d6de Binary files /dev/null and b/mods/technic-master/technic/textures/technic_lv_compressor_front.png differ diff --git a/mods/technic-master/technic/textures/technic_lv_compressor_front_active.png b/mods/technic-master/technic/textures/technic_lv_compressor_front_active.png new file mode 100644 index 0000000..b3d27c0 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_lv_compressor_front_active.png differ diff --git a/mods/technic-master/technic/textures/technic_lv_compressor_side.png b/mods/technic-master/technic/textures/technic_lv_compressor_side.png new file mode 100644 index 0000000..87acda6 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_lv_compressor_side.png differ diff --git a/mods/technic-master/technic/textures/technic_lv_compressor_top.png b/mods/technic-master/technic/textures/technic_lv_compressor_top.png new file mode 100644 index 0000000..786b859 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_lv_compressor_top.png differ diff --git a/mods/technic-master/technic/textures/technic_lv_electric_furnace_bottom.png b/mods/technic-master/technic/textures/technic_lv_electric_furnace_bottom.png new file mode 100644 index 0000000..15fa6de Binary files /dev/null and b/mods/technic-master/technic/textures/technic_lv_electric_furnace_bottom.png differ diff --git a/mods/technic-master/technic/textures/technic_lv_electric_furnace_front.png b/mods/technic-master/technic/textures/technic_lv_electric_furnace_front.png new file mode 100644 index 0000000..755aadf Binary files /dev/null and b/mods/technic-master/technic/textures/technic_lv_electric_furnace_front.png differ diff --git a/mods/technic-master/technic/textures/technic_lv_electric_furnace_front_active.png b/mods/technic-master/technic/textures/technic_lv_electric_furnace_front_active.png new file mode 100644 index 0000000..de7f1f9 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_lv_electric_furnace_front_active.png differ diff --git a/mods/technic-master/technic/textures/technic_lv_electric_furnace_side.png b/mods/technic-master/technic/textures/technic_lv_electric_furnace_side.png new file mode 100644 index 0000000..80cf742 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_lv_electric_furnace_side.png differ diff --git a/mods/technic-master/technic/textures/technic_lv_electric_furnace_top.png b/mods/technic-master/technic/textures/technic_lv_electric_furnace_top.png new file mode 100644 index 0000000..fbadd9a Binary files /dev/null and b/mods/technic-master/technic/textures/technic_lv_electric_furnace_top.png differ diff --git a/mods/technic-master/technic/textures/technic_lv_extractor_bottom.png b/mods/technic-master/technic/textures/technic_lv_extractor_bottom.png new file mode 100644 index 0000000..aecd719 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_lv_extractor_bottom.png differ diff --git a/mods/technic-master/technic/textures/technic_lv_extractor_front.png b/mods/technic-master/technic/textures/technic_lv_extractor_front.png new file mode 100644 index 0000000..1bd7e9a Binary files /dev/null and b/mods/technic-master/technic/textures/technic_lv_extractor_front.png differ diff --git a/mods/technic-master/technic/textures/technic_lv_extractor_front_active.png b/mods/technic-master/technic/textures/technic_lv_extractor_front_active.png new file mode 100644 index 0000000..7f8b30a Binary files /dev/null and b/mods/technic-master/technic/textures/technic_lv_extractor_front_active.png differ diff --git a/mods/technic-master/technic/textures/technic_lv_extractor_side.png b/mods/technic-master/technic/textures/technic_lv_extractor_side.png new file mode 100644 index 0000000..99d9486 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_lv_extractor_side.png differ diff --git a/mods/technic-master/technic/textures/technic_lv_extractor_top.png b/mods/technic-master/technic/textures/technic_lv_extractor_top.png new file mode 100644 index 0000000..e7d9ff9 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_lv_extractor_top.png differ diff --git a/mods/technic-master/technic/textures/technic_lv_generator_front.png b/mods/technic-master/technic/textures/technic_lv_generator_front.png new file mode 100644 index 0000000..2d64844 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_lv_generator_front.png differ diff --git a/mods/technic-master/technic/textures/technic_lv_generator_front_active.png b/mods/technic-master/technic/textures/technic_lv_generator_front_active.png new file mode 100644 index 0000000..4e57ca0 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_lv_generator_front_active.png differ diff --git a/mods/technic-master/technic/textures/technic_lv_generator_side.png b/mods/technic-master/technic/textures/technic_lv_generator_side.png new file mode 100644 index 0000000..5cbcbef Binary files /dev/null and b/mods/technic-master/technic/textures/technic_lv_generator_side.png differ diff --git a/mods/technic-master/technic/textures/technic_lv_generator_top.png b/mods/technic-master/technic/textures/technic_lv_generator_top.png new file mode 100644 index 0000000..e2f3db3 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_lv_generator_top.png differ diff --git a/mods/technic-master/technic/textures/technic_lv_grinder_bottom.png b/mods/technic-master/technic/textures/technic_lv_grinder_bottom.png new file mode 100644 index 0000000..aecd719 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_lv_grinder_bottom.png differ diff --git a/mods/technic-master/technic/textures/technic_lv_grinder_front.png b/mods/technic-master/technic/textures/technic_lv_grinder_front.png new file mode 100644 index 0000000..1bd7e9a Binary files /dev/null and b/mods/technic-master/technic/textures/technic_lv_grinder_front.png differ diff --git a/mods/technic-master/technic/textures/technic_lv_grinder_front_active.png b/mods/technic-master/technic/textures/technic_lv_grinder_front_active.png new file mode 100644 index 0000000..7f8b30a Binary files /dev/null and b/mods/technic-master/technic/textures/technic_lv_grinder_front_active.png differ diff --git a/mods/technic-master/technic/textures/technic_lv_grinder_side.png b/mods/technic-master/technic/textures/technic_lv_grinder_side.png new file mode 100644 index 0000000..99d9486 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_lv_grinder_side.png differ diff --git a/mods/technic-master/technic/textures/technic_lv_grinder_top.png b/mods/technic-master/technic/textures/technic_lv_grinder_top.png new file mode 100644 index 0000000..e7d9ff9 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_lv_grinder_top.png differ diff --git a/mods/technic-master/technic/textures/technic_lv_solar_array_bottom.png b/mods/technic-master/technic/textures/technic_lv_solar_array_bottom.png new file mode 100644 index 0000000..9e888e3 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_lv_solar_array_bottom.png differ diff --git a/mods/technic-master/technic/textures/technic_lv_solar_array_side.png b/mods/technic-master/technic/textures/technic_lv_solar_array_side.png new file mode 100644 index 0000000..b22447e Binary files /dev/null and b/mods/technic-master/technic/textures/technic_lv_solar_array_side.png differ diff --git a/mods/technic-master/technic/textures/technic_lv_solar_array_top.png b/mods/technic-master/technic/textures/technic_lv_solar_array_top.png new file mode 100644 index 0000000..cabd315 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_lv_solar_array_top.png differ diff --git a/mods/technic-master/technic/textures/technic_lv_transformer.png b/mods/technic-master/technic/textures/technic_lv_transformer.png new file mode 100644 index 0000000..613b196 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_lv_transformer.png differ diff --git a/mods/technic-master/technic/textures/technic_machine_bottom.png b/mods/technic-master/technic/textures/technic_machine_bottom.png new file mode 100644 index 0000000..48a47b0 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_machine_bottom.png differ diff --git a/mods/technic-master/technic/textures/technic_machine_casing.png b/mods/technic-master/technic/textures/technic_machine_casing.png new file mode 100644 index 0000000..d596733 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_machine_casing.png differ diff --git a/mods/technic-master/technic/textures/technic_mining_drill.png b/mods/technic-master/technic/textures/technic_mining_drill.png new file mode 100644 index 0000000..171888d Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mining_drill.png differ diff --git a/mods/technic-master/technic/textures/technic_mining_drill_mk2.png b/mods/technic-master/technic/textures/technic_mining_drill_mk2.png new file mode 100644 index 0000000..30be719 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mining_drill_mk2.png differ diff --git a/mods/technic-master/technic/textures/technic_mining_drill_mk3.png b/mods/technic-master/technic/textures/technic_mining_drill_mk3.png new file mode 100644 index 0000000..30de896 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mining_drill_mk3.png differ diff --git a/mods/technic-master/technic/textures/technic_mining_laser_mk1.png b/mods/technic-master/technic/textures/technic_mining_laser_mk1.png new file mode 100644 index 0000000..29faeb4 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mining_laser_mk1.png differ diff --git a/mods/technic-master/technic/textures/technic_mining_laser_mk2.png b/mods/technic-master/technic/textures/technic_mining_laser_mk2.png new file mode 100644 index 0000000..2d67c0f Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mining_laser_mk2.png differ diff --git a/mods/technic-master/technic/textures/technic_mining_laser_mk3.png b/mods/technic-master/technic/textures/technic_mining_laser_mk3.png new file mode 100644 index 0000000..db9ee26 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mining_laser_mk3.png differ diff --git a/mods/technic-master/technic/textures/technic_mithril_dust.png b/mods/technic-master/technic/textures/technic_mithril_dust.png new file mode 100644 index 0000000..adfbe6c Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mithril_dust.png differ diff --git a/mods/technic-master/technic/textures/technic_mixed_metal_ingot.png b/mods/technic-master/technic/textures/technic_mixed_metal_ingot.png new file mode 100644 index 0000000..8f6847b Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mixed_metal_ingot.png differ diff --git a/mods/technic-master/technic/textures/technic_motor.png b/mods/technic-master/technic/textures/technic_motor.png new file mode 100644 index 0000000..77d4b91 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_motor.png differ diff --git a/mods/technic-master/technic/textures/technic_music_player_bottom.png b/mods/technic-master/technic/textures/technic_music_player_bottom.png new file mode 100644 index 0000000..bd8fd55 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_music_player_bottom.png differ diff --git a/mods/technic-master/technic/textures/technic_music_player_side.png b/mods/technic-master/technic/textures/technic_music_player_side.png new file mode 100644 index 0000000..6c34fea Binary files /dev/null and b/mods/technic-master/technic/textures/technic_music_player_side.png differ diff --git a/mods/technic-master/technic/textures/technic_music_player_top.png b/mods/technic-master/technic/textures/technic_music_player_top.png new file mode 100644 index 0000000..0d34563 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_music_player_top.png differ diff --git a/mods/technic-master/technic/textures/technic_mv_alloy_furnace_bottom.png b/mods/technic-master/technic/textures/technic_mv_alloy_furnace_bottom.png new file mode 100644 index 0000000..2c0aaee Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mv_alloy_furnace_bottom.png differ diff --git a/mods/technic-master/technic/textures/technic_mv_alloy_furnace_front.png b/mods/technic-master/technic/textures/technic_mv_alloy_furnace_front.png new file mode 100644 index 0000000..a5dac82 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mv_alloy_furnace_front.png differ diff --git a/mods/technic-master/technic/textures/technic_mv_alloy_furnace_front_active.png b/mods/technic-master/technic/textures/technic_mv_alloy_furnace_front_active.png new file mode 100644 index 0000000..f6e69a9 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mv_alloy_furnace_front_active.png differ diff --git a/mods/technic-master/technic/textures/technic_mv_alloy_furnace_side.png b/mods/technic-master/technic/textures/technic_mv_alloy_furnace_side.png new file mode 100644 index 0000000..0430479 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mv_alloy_furnace_side.png differ diff --git a/mods/technic-master/technic/textures/technic_mv_alloy_furnace_side_tube.png b/mods/technic-master/technic/textures/technic_mv_alloy_furnace_side_tube.png new file mode 100644 index 0000000..1800eed Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mv_alloy_furnace_side_tube.png differ diff --git a/mods/technic-master/technic/textures/technic_mv_alloy_furnace_top.png b/mods/technic-master/technic/textures/technic_mv_alloy_furnace_top.png new file mode 100644 index 0000000..f44e3c0 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mv_alloy_furnace_top.png differ diff --git a/mods/technic-master/technic/textures/technic_mv_battery_box_bottom.png b/mods/technic-master/technic/textures/technic_mv_battery_box_bottom.png new file mode 100644 index 0000000..a610660 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mv_battery_box_bottom.png differ diff --git a/mods/technic-master/technic/textures/technic_mv_battery_box_side.png b/mods/technic-master/technic/textures/technic_mv_battery_box_side.png new file mode 100644 index 0000000..06a4be5 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mv_battery_box_side.png differ diff --git a/mods/technic-master/technic/textures/technic_mv_battery_box_top.png b/mods/technic-master/technic/textures/technic_mv_battery_box_top.png new file mode 100644 index 0000000..b32100f Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mv_battery_box_top.png differ diff --git a/mods/technic-master/technic/textures/technic_mv_cable.png b/mods/technic-master/technic/textures/technic_mv_cable.png new file mode 100644 index 0000000..2819d2b Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mv_cable.png differ diff --git a/mods/technic-master/technic/textures/technic_mv_cable_wield.png b/mods/technic-master/technic/textures/technic_mv_cable_wield.png new file mode 100644 index 0000000..2d41e27 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mv_cable_wield.png differ diff --git a/mods/technic-master/technic/textures/technic_mv_centrifuge_bottom.png b/mods/technic-master/technic/textures/technic_mv_centrifuge_bottom.png new file mode 100644 index 0000000..6dcd40f Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mv_centrifuge_bottom.png differ diff --git a/mods/technic-master/technic/textures/technic_mv_centrifuge_front.png b/mods/technic-master/technic/textures/technic_mv_centrifuge_front.png new file mode 100644 index 0000000..e278a33 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mv_centrifuge_front.png differ diff --git a/mods/technic-master/technic/textures/technic_mv_centrifuge_front_active.png b/mods/technic-master/technic/textures/technic_mv_centrifuge_front_active.png new file mode 100644 index 0000000..4cef912 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mv_centrifuge_front_active.png differ diff --git a/mods/technic-master/technic/textures/technic_mv_centrifuge_side.png b/mods/technic-master/technic/textures/technic_mv_centrifuge_side.png new file mode 100644 index 0000000..eeef44a Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mv_centrifuge_side.png differ diff --git a/mods/technic-master/technic/textures/technic_mv_centrifuge_top.png b/mods/technic-master/technic/textures/technic_mv_centrifuge_top.png new file mode 100644 index 0000000..813bbf8 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mv_centrifuge_top.png differ diff --git a/mods/technic-master/technic/textures/technic_mv_compressor_back.png b/mods/technic-master/technic/textures/technic_mv_compressor_back.png new file mode 100644 index 0000000..11286e3 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mv_compressor_back.png differ diff --git a/mods/technic-master/technic/textures/technic_mv_compressor_bottom.png b/mods/technic-master/technic/textures/technic_mv_compressor_bottom.png new file mode 100644 index 0000000..886f27e Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mv_compressor_bottom.png differ diff --git a/mods/technic-master/technic/textures/technic_mv_compressor_front.png b/mods/technic-master/technic/textures/technic_mv_compressor_front.png new file mode 100644 index 0000000..007d6de Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mv_compressor_front.png differ diff --git a/mods/technic-master/technic/textures/technic_mv_compressor_front_active.png b/mods/technic-master/technic/textures/technic_mv_compressor_front_active.png new file mode 100644 index 0000000..b3d27c0 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mv_compressor_front_active.png differ diff --git a/mods/technic-master/technic/textures/technic_mv_compressor_side.png b/mods/technic-master/technic/textures/technic_mv_compressor_side.png new file mode 100644 index 0000000..87acda6 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mv_compressor_side.png differ diff --git a/mods/technic-master/technic/textures/technic_mv_compressor_top.png b/mods/technic-master/technic/textures/technic_mv_compressor_top.png new file mode 100644 index 0000000..786b859 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mv_compressor_top.png differ diff --git a/mods/technic-master/technic/textures/technic_mv_down_converter_bottom.png b/mods/technic-master/technic/textures/technic_mv_down_converter_bottom.png new file mode 100644 index 0000000..a610660 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mv_down_converter_bottom.png differ diff --git a/mods/technic-master/technic/textures/technic_mv_down_converter_side.png b/mods/technic-master/technic/textures/technic_mv_down_converter_side.png new file mode 100644 index 0000000..6492d5c Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mv_down_converter_side.png differ diff --git a/mods/technic-master/technic/textures/technic_mv_down_converter_top.png b/mods/technic-master/technic/textures/technic_mv_down_converter_top.png new file mode 100644 index 0000000..a610660 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mv_down_converter_top.png differ diff --git a/mods/technic-master/technic/textures/technic_mv_electric_furnace_bottom.png b/mods/technic-master/technic/textures/technic_mv_electric_furnace_bottom.png new file mode 100644 index 0000000..e2e445e Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mv_electric_furnace_bottom.png differ diff --git a/mods/technic-master/technic/textures/technic_mv_electric_furnace_front.png b/mods/technic-master/technic/textures/technic_mv_electric_furnace_front.png new file mode 100644 index 0000000..81c33cf Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mv_electric_furnace_front.png differ diff --git a/mods/technic-master/technic/textures/technic_mv_electric_furnace_front_active.png b/mods/technic-master/technic/textures/technic_mv_electric_furnace_front_active.png new file mode 100644 index 0000000..2523f0e Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mv_electric_furnace_front_active.png differ diff --git a/mods/technic-master/technic/textures/technic_mv_electric_furnace_side.png b/mods/technic-master/technic/textures/technic_mv_electric_furnace_side.png new file mode 100644 index 0000000..cd22a73 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mv_electric_furnace_side.png differ diff --git a/mods/technic-master/technic/textures/technic_mv_electric_furnace_side_tube.png b/mods/technic-master/technic/textures/technic_mv_electric_furnace_side_tube.png new file mode 100644 index 0000000..bfeba18 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mv_electric_furnace_side_tube.png differ diff --git a/mods/technic-master/technic/textures/technic_mv_electric_furnace_top.png b/mods/technic-master/technic/textures/technic_mv_electric_furnace_top.png new file mode 100644 index 0000000..635b6b7 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mv_electric_furnace_top.png differ diff --git a/mods/technic-master/technic/textures/technic_mv_extractor_bottom.png b/mods/technic-master/technic/textures/technic_mv_extractor_bottom.png new file mode 100644 index 0000000..70f34ee Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mv_extractor_bottom.png differ diff --git a/mods/technic-master/technic/textures/technic_mv_extractor_front.png b/mods/technic-master/technic/textures/technic_mv_extractor_front.png new file mode 100644 index 0000000..18648c2 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mv_extractor_front.png differ diff --git a/mods/technic-master/technic/textures/technic_mv_extractor_front_active.png b/mods/technic-master/technic/textures/technic_mv_extractor_front_active.png new file mode 100644 index 0000000..ee86ade Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mv_extractor_front_active.png differ diff --git a/mods/technic-master/technic/textures/technic_mv_extractor_side.png b/mods/technic-master/technic/textures/technic_mv_extractor_side.png new file mode 100644 index 0000000..cbe3673 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mv_extractor_side.png differ diff --git a/mods/technic-master/technic/textures/technic_mv_extractor_top.png b/mods/technic-master/technic/textures/technic_mv_extractor_top.png new file mode 100644 index 0000000..2259d64 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mv_extractor_top.png differ diff --git a/mods/technic-master/technic/textures/technic_mv_generator_front.png b/mods/technic-master/technic/textures/technic_mv_generator_front.png new file mode 100644 index 0000000..570e0c5 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mv_generator_front.png differ diff --git a/mods/technic-master/technic/textures/technic_mv_generator_front_active.png b/mods/technic-master/technic/textures/technic_mv_generator_front_active.png new file mode 100644 index 0000000..3006a17 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mv_generator_front_active.png differ diff --git a/mods/technic-master/technic/textures/technic_mv_generator_side.png b/mods/technic-master/technic/textures/technic_mv_generator_side.png new file mode 100644 index 0000000..21c0d41 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mv_generator_side.png differ diff --git a/mods/technic-master/technic/textures/technic_mv_generator_top.png b/mods/technic-master/technic/textures/technic_mv_generator_top.png new file mode 100644 index 0000000..7afa5a1 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mv_generator_top.png differ diff --git a/mods/technic-master/technic/textures/technic_mv_grinder_bottom.png b/mods/technic-master/technic/textures/technic_mv_grinder_bottom.png new file mode 100644 index 0000000..70f34ee Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mv_grinder_bottom.png differ diff --git a/mods/technic-master/technic/textures/technic_mv_grinder_front.png b/mods/technic-master/technic/textures/technic_mv_grinder_front.png new file mode 100644 index 0000000..18648c2 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mv_grinder_front.png differ diff --git a/mods/technic-master/technic/textures/technic_mv_grinder_front_active.png b/mods/technic-master/technic/textures/technic_mv_grinder_front_active.png new file mode 100644 index 0000000..ee86ade Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mv_grinder_front_active.png differ diff --git a/mods/technic-master/technic/textures/technic_mv_grinder_side.png b/mods/technic-master/technic/textures/technic_mv_grinder_side.png new file mode 100644 index 0000000..cbe3673 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mv_grinder_side.png differ diff --git a/mods/technic-master/technic/textures/technic_mv_grinder_side_tube.png b/mods/technic-master/technic/textures/technic_mv_grinder_side_tube.png new file mode 100644 index 0000000..196b7c1 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mv_grinder_side_tube.png differ diff --git a/mods/technic-master/technic/textures/technic_mv_grinder_top.png b/mods/technic-master/technic/textures/technic_mv_grinder_top.png new file mode 100644 index 0000000..2259d64 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mv_grinder_top.png differ diff --git a/mods/technic-master/technic/textures/technic_mv_solar_array_bottom.png b/mods/technic-master/technic/textures/technic_mv_solar_array_bottom.png new file mode 100644 index 0000000..596e79a Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mv_solar_array_bottom.png differ diff --git a/mods/technic-master/technic/textures/technic_mv_solar_array_side.png b/mods/technic-master/technic/textures/technic_mv_solar_array_side.png new file mode 100644 index 0000000..917b9ed Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mv_solar_array_side.png differ diff --git a/mods/technic-master/technic/textures/technic_mv_solar_array_top.png b/mods/technic-master/technic/textures/technic_mv_solar_array_top.png new file mode 100644 index 0000000..cdb7cf7 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mv_solar_array_top.png differ diff --git a/mods/technic-master/technic/textures/technic_mv_transformer.png b/mods/technic-master/technic/textures/technic_mv_transformer.png new file mode 100644 index 0000000..7c4688e Binary files /dev/null and b/mods/technic-master/technic/textures/technic_mv_transformer.png differ diff --git a/mods/technic-master/technic/textures/technic_nodebreaker_back.png b/mods/technic-master/technic/textures/technic_nodebreaker_back.png new file mode 100644 index 0000000..0af7422 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_nodebreaker_back.png differ diff --git a/mods/technic-master/technic/textures/technic_nodebreaker_bottom.png b/mods/technic-master/technic/textures/technic_nodebreaker_bottom.png new file mode 100644 index 0000000..ff1a2c6 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_nodebreaker_bottom.png differ diff --git a/mods/technic-master/technic/textures/technic_nodebreaker_bottom_off.png b/mods/technic-master/technic/textures/technic_nodebreaker_bottom_off.png new file mode 100644 index 0000000..0f456eb Binary files /dev/null and b/mods/technic-master/technic/textures/technic_nodebreaker_bottom_off.png differ diff --git a/mods/technic-master/technic/textures/technic_nodebreaker_bottom_on.png b/mods/technic-master/technic/textures/technic_nodebreaker_bottom_on.png new file mode 100644 index 0000000..6c4811a Binary files /dev/null and b/mods/technic-master/technic/textures/technic_nodebreaker_bottom_on.png differ diff --git a/mods/technic-master/technic/textures/technic_nodebreaker_front_off.png b/mods/technic-master/technic/textures/technic_nodebreaker_front_off.png new file mode 100644 index 0000000..488fd0a Binary files /dev/null and b/mods/technic-master/technic/textures/technic_nodebreaker_front_off.png differ diff --git a/mods/technic-master/technic/textures/technic_nodebreaker_front_on.png b/mods/technic-master/technic/textures/technic_nodebreaker_front_on.png new file mode 100644 index 0000000..4904e8b Binary files /dev/null and b/mods/technic-master/technic/textures/technic_nodebreaker_front_on.png differ diff --git a/mods/technic-master/technic/textures/technic_nodebreaker_side.png b/mods/technic-master/technic/textures/technic_nodebreaker_side.png new file mode 100644 index 0000000..aefd7c8 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_nodebreaker_side.png differ diff --git a/mods/technic-master/technic/textures/technic_nodebreaker_side1.png b/mods/technic-master/technic/textures/technic_nodebreaker_side1.png new file mode 100644 index 0000000..8cb8634 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_nodebreaker_side1.png differ diff --git a/mods/technic-master/technic/textures/technic_nodebreaker_side1_off.png b/mods/technic-master/technic/textures/technic_nodebreaker_side1_off.png new file mode 100644 index 0000000..857face Binary files /dev/null and b/mods/technic-master/technic/textures/technic_nodebreaker_side1_off.png differ diff --git a/mods/technic-master/technic/textures/technic_nodebreaker_side1_on.png b/mods/technic-master/technic/textures/technic_nodebreaker_side1_on.png new file mode 100644 index 0000000..c756f09 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_nodebreaker_side1_on.png differ diff --git a/mods/technic-master/technic/textures/technic_nodebreaker_side2.png b/mods/technic-master/technic/textures/technic_nodebreaker_side2.png new file mode 100644 index 0000000..c2855d0 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_nodebreaker_side2.png differ diff --git a/mods/technic-master/technic/textures/technic_nodebreaker_side2_off.png b/mods/technic-master/technic/textures/technic_nodebreaker_side2_off.png new file mode 100644 index 0000000..4c62f98 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_nodebreaker_side2_off.png differ diff --git a/mods/technic-master/technic/textures/technic_nodebreaker_side2_on.png b/mods/technic-master/technic/textures/technic_nodebreaker_side2_on.png new file mode 100644 index 0000000..b9e4823 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_nodebreaker_side2_on.png differ diff --git a/mods/technic-master/technic/textures/technic_nodebreaker_top.png b/mods/technic-master/technic/textures/technic_nodebreaker_top.png new file mode 100644 index 0000000..941d333 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_nodebreaker_top.png differ diff --git a/mods/technic-master/technic/textures/technic_nodebreaker_top_off.png b/mods/technic-master/technic/textures/technic_nodebreaker_top_off.png new file mode 100644 index 0000000..9139afe Binary files /dev/null and b/mods/technic-master/technic/textures/technic_nodebreaker_top_off.png differ diff --git a/mods/technic-master/technic/textures/technic_nodebreaker_top_on.png b/mods/technic-master/technic/textures/technic_nodebreaker_top_on.png new file mode 100644 index 0000000..4b0a661 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_nodebreaker_top_on.png differ diff --git a/mods/technic-master/technic/textures/technic_power_meter.png b/mods/technic-master/technic/textures/technic_power_meter.png new file mode 100644 index 0000000..f1e5120 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_power_meter.png differ diff --git a/mods/technic-master/technic/textures/technic_power_meter0.png b/mods/technic-master/technic/textures/technic_power_meter0.png new file mode 100644 index 0000000..1b1e662 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_power_meter0.png differ diff --git a/mods/technic-master/technic/textures/technic_power_meter1.png b/mods/technic-master/technic/textures/technic_power_meter1.png new file mode 100644 index 0000000..eb6be3b Binary files /dev/null and b/mods/technic-master/technic/textures/technic_power_meter1.png differ diff --git a/mods/technic-master/technic/textures/technic_power_meter2.png b/mods/technic-master/technic/textures/technic_power_meter2.png new file mode 100644 index 0000000..e3a3772 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_power_meter2.png differ diff --git a/mods/technic-master/technic/textures/technic_power_meter3.png b/mods/technic-master/technic/textures/technic_power_meter3.png new file mode 100644 index 0000000..6333035 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_power_meter3.png differ diff --git a/mods/technic-master/technic/textures/technic_power_meter4.png b/mods/technic-master/technic/textures/technic_power_meter4.png new file mode 100644 index 0000000..6346dbd Binary files /dev/null and b/mods/technic-master/technic/textures/technic_power_meter4.png differ diff --git a/mods/technic-master/technic/textures/technic_power_meter5.png b/mods/technic-master/technic/textures/technic_power_meter5.png new file mode 100644 index 0000000..80f79c6 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_power_meter5.png differ diff --git a/mods/technic-master/technic/textures/technic_power_meter6.png b/mods/technic-master/technic/textures/technic_power_meter6.png new file mode 100644 index 0000000..fe91bf5 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_power_meter6.png differ diff --git a/mods/technic-master/technic/textures/technic_power_meter7.png b/mods/technic-master/technic/textures/technic_power_meter7.png new file mode 100644 index 0000000..e02dd6d Binary files /dev/null and b/mods/technic-master/technic/textures/technic_power_meter7.png differ diff --git a/mods/technic-master/technic/textures/technic_power_meter8.png b/mods/technic-master/technic/textures/technic_power_meter8.png new file mode 100644 index 0000000..a12064c Binary files /dev/null and b/mods/technic-master/technic/textures/technic_power_meter8.png differ diff --git a/mods/technic-master/technic/textures/technic_power_meter_bg.png b/mods/technic-master/technic/textures/technic_power_meter_bg.png new file mode 100644 index 0000000..9667cda Binary files /dev/null and b/mods/technic-master/technic/textures/technic_power_meter_bg.png differ diff --git a/mods/technic-master/technic/textures/technic_power_meter_fg.png b/mods/technic-master/technic/textures/technic_power_meter_fg.png new file mode 100644 index 0000000..7f2dde8 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_power_meter_fg.png differ diff --git a/mods/technic-master/technic/textures/technic_prospector.png b/mods/technic-master/technic/textures/technic_prospector.png new file mode 100644 index 0000000..2f9ee6c Binary files /dev/null and b/mods/technic-master/technic/textures/technic_prospector.png differ diff --git a/mods/technic-master/technic/textures/technic_raw_latex.png b/mods/technic-master/technic/textures/technic_raw_latex.png new file mode 100644 index 0000000..49bb11b Binary files /dev/null and b/mods/technic-master/technic/textures/technic_raw_latex.png differ diff --git a/mods/technic-master/technic/textures/technic_rubber.png b/mods/technic-master/technic/textures/technic_rubber.png new file mode 100644 index 0000000..9ed4a9d Binary files /dev/null and b/mods/technic-master/technic/textures/technic_rubber.png differ diff --git a/mods/technic-master/technic/textures/technic_rubber_leaves.png b/mods/technic-master/technic/textures/technic_rubber_leaves.png new file mode 100644 index 0000000..ae013e0 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_rubber_leaves.png differ diff --git a/mods/technic-master/technic/textures/technic_rubber_sapling.png b/mods/technic-master/technic/textures/technic_rubber_sapling.png new file mode 100644 index 0000000..e5c9f5d Binary files /dev/null and b/mods/technic-master/technic/textures/technic_rubber_sapling.png differ diff --git a/mods/technic-master/technic/textures/technic_rubber_tree_empty.png b/mods/technic-master/technic/textures/technic_rubber_tree_empty.png new file mode 100644 index 0000000..1792951 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_rubber_tree_empty.png differ diff --git a/mods/technic-master/technic/textures/technic_rubber_tree_full.png b/mods/technic-master/technic/textures/technic_rubber_tree_full.png new file mode 100644 index 0000000..08067ef Binary files /dev/null and b/mods/technic-master/technic/textures/technic_rubber_tree_full.png differ diff --git a/mods/technic-master/technic/textures/technic_screwdriver.png b/mods/technic-master/technic/textures/technic_screwdriver.png new file mode 100644 index 0000000..bd2da22 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_screwdriver.png differ diff --git a/mods/technic-master/technic/textures/technic_silicon_wafer.png b/mods/technic-master/technic/textures/technic_silicon_wafer.png new file mode 100644 index 0000000..78aef20 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_silicon_wafer.png differ diff --git a/mods/technic-master/technic/textures/technic_silver_dust.png b/mods/technic-master/technic/textures/technic_silver_dust.png new file mode 100644 index 0000000..19a5754 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_silver_dust.png differ diff --git a/mods/technic-master/technic/textures/technic_solar_panel_bottom.png b/mods/technic-master/technic/textures/technic_solar_panel_bottom.png new file mode 100644 index 0000000..9e888e3 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_solar_panel_bottom.png differ diff --git a/mods/technic-master/technic/textures/technic_solar_panel_side.png b/mods/technic-master/technic/textures/technic_solar_panel_side.png new file mode 100644 index 0000000..b22447e Binary files /dev/null and b/mods/technic-master/technic/textures/technic_solar_panel_side.png differ diff --git a/mods/technic-master/technic/textures/technic_solar_panel_top.png b/mods/technic-master/technic/textures/technic_solar_panel_top.png new file mode 100644 index 0000000..492764b Binary files /dev/null and b/mods/technic-master/technic/textures/technic_solar_panel_top.png differ diff --git a/mods/technic-master/technic/textures/technic_sonic_screwdriver.png b/mods/technic-master/technic/textures/technic_sonic_screwdriver.png new file mode 100644 index 0000000..9b26b81 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_sonic_screwdriver.png differ diff --git a/mods/technic-master/technic/textures/technic_stainless_steel_dust.png b/mods/technic-master/technic/textures/technic_stainless_steel_dust.png new file mode 100644 index 0000000..6398be8 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_stainless_steel_dust.png differ diff --git a/mods/technic-master/technic/textures/technic_stainless_steel_ingot.png b/mods/technic-master/technic/textures/technic_stainless_steel_ingot.png new file mode 100644 index 0000000..7ec5e00 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_stainless_steel_ingot.png differ diff --git a/mods/technic-master/technic/textures/technic_supply_converter_bottom.png b/mods/technic-master/technic/textures/technic_supply_converter_bottom.png new file mode 100644 index 0000000..a610660 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_supply_converter_bottom.png differ diff --git a/mods/technic-master/technic/textures/technic_supply_converter_side.png b/mods/technic-master/technic/textures/technic_supply_converter_side.png new file mode 100644 index 0000000..6492d5c Binary files /dev/null and b/mods/technic-master/technic/textures/technic_supply_converter_side.png differ diff --git a/mods/technic-master/technic/textures/technic_supply_converter_top.png b/mods/technic-master/technic/textures/technic_supply_converter_top.png new file mode 100644 index 0000000..a610660 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_supply_converter_top.png differ diff --git a/mods/technic-master/technic/textures/technic_talinite_dust.png b/mods/technic-master/technic/textures/technic_talinite_dust.png new file mode 100644 index 0000000..f228206 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_talinite_dust.png differ diff --git a/mods/technic-master/technic/textures/technic_tin_dust.png b/mods/technic-master/technic/textures/technic_tin_dust.png new file mode 100644 index 0000000..98e6f3f Binary files /dev/null and b/mods/technic-master/technic/textures/technic_tin_dust.png differ diff --git a/mods/technic-master/technic/textures/technic_tool_mode1.png b/mods/technic-master/technic/textures/technic_tool_mode1.png new file mode 100644 index 0000000..571dbe5 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_tool_mode1.png differ diff --git a/mods/technic-master/technic/textures/technic_tool_mode2.png b/mods/technic-master/technic/textures/technic_tool_mode2.png new file mode 100644 index 0000000..891aa82 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_tool_mode2.png differ diff --git a/mods/technic-master/technic/textures/technic_tool_mode3.png b/mods/technic-master/technic/textures/technic_tool_mode3.png new file mode 100644 index 0000000..cd099a7 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_tool_mode3.png differ diff --git a/mods/technic-master/technic/textures/technic_tool_mode4.png b/mods/technic-master/technic/textures/technic_tool_mode4.png new file mode 100644 index 0000000..62f50d7 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_tool_mode4.png differ diff --git a/mods/technic-master/technic/textures/technic_tool_mode5.png b/mods/technic-master/technic/textures/technic_tool_mode5.png new file mode 100644 index 0000000..c918314 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_tool_mode5.png differ diff --git a/mods/technic-master/technic/textures/technic_tool_mode6.png b/mods/technic-master/technic/textures/technic_tool_mode6.png new file mode 100644 index 0000000..9268f47 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_tool_mode6.png differ diff --git a/mods/technic-master/technic/textures/technic_tool_mode7.png b/mods/technic-master/technic/textures/technic_tool_mode7.png new file mode 100644 index 0000000..5ba572a Binary files /dev/null and b/mods/technic-master/technic/textures/technic_tool_mode7.png differ diff --git a/mods/technic-master/technic/textures/technic_tool_mode8.png b/mods/technic-master/technic/textures/technic_tool_mode8.png new file mode 100644 index 0000000..b2655b6 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_tool_mode8.png differ diff --git a/mods/technic-master/technic/textures/technic_tool_mode9.png b/mods/technic-master/technic/textures/technic_tool_mode9.png new file mode 100644 index 0000000..2077afb Binary files /dev/null and b/mods/technic-master/technic/textures/technic_tool_mode9.png differ diff --git a/mods/technic-master/technic/textures/technic_tree_tap.png b/mods/technic-master/technic/textures/technic_tree_tap.png new file mode 100644 index 0000000..542f30f Binary files /dev/null and b/mods/technic-master/technic/textures/technic_tree_tap.png differ diff --git a/mods/technic-master/technic/textures/technic_uranium_dust.png b/mods/technic-master/technic/textures/technic_uranium_dust.png new file mode 100644 index 0000000..9c211dc Binary files /dev/null and b/mods/technic-master/technic/textures/technic_uranium_dust.png differ diff --git a/mods/technic-master/technic/textures/technic_uranium_fuel.png b/mods/technic-master/technic/textures/technic_uranium_fuel.png new file mode 100644 index 0000000..0a32c62 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_uranium_fuel.png differ diff --git a/mods/technic-master/technic/textures/technic_water_can.png b/mods/technic-master/technic/textures/technic_water_can.png new file mode 100644 index 0000000..eec75db Binary files /dev/null and b/mods/technic-master/technic/textures/technic_water_can.png differ diff --git a/mods/technic-master/technic/textures/technic_water_mill_side.png b/mods/technic-master/technic/textures/technic_water_mill_side.png new file mode 100644 index 0000000..f4bdb16 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_water_mill_side.png differ diff --git a/mods/technic-master/technic/textures/technic_water_mill_top.png b/mods/technic-master/technic/textures/technic_water_mill_top.png new file mode 100644 index 0000000..601ff15 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_water_mill_top.png differ diff --git a/mods/technic-master/technic/textures/technic_water_mill_top_active.png b/mods/technic-master/technic/textures/technic_water_mill_top_active.png new file mode 100644 index 0000000..f02bec6 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_water_mill_top_active.png differ diff --git a/mods/technic-master/technic/textures/technic_workshop_bottom.png b/mods/technic-master/technic/textures/technic_workshop_bottom.png new file mode 100644 index 0000000..bd8fd55 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_workshop_bottom.png differ diff --git a/mods/technic-master/technic/textures/technic_workshop_side.png b/mods/technic-master/technic/textures/technic_workshop_side.png new file mode 100644 index 0000000..9e3e7a7 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_workshop_side.png differ diff --git a/mods/technic-master/technic/textures/technic_workshop_top.png b/mods/technic-master/technic/textures/technic_workshop_top.png new file mode 100644 index 0000000..feae141 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_workshop_top.png differ diff --git a/mods/technic-master/technic/textures/technic_wrought_iron_dust.png b/mods/technic-master/technic/textures/technic_wrought_iron_dust.png new file mode 100644 index 0000000..ad23c62 Binary files /dev/null and b/mods/technic-master/technic/textures/technic_wrought_iron_dust.png differ diff --git a/mods/technic-master/technic/textures/technic_zinc_dust.png b/mods/technic-master/technic/textures/technic_zinc_dust.png new file mode 100644 index 0000000..bbd826c Binary files /dev/null and b/mods/technic-master/technic/textures/technic_zinc_dust.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_akalin_dust.png b/mods/technic-master/technic/textures/technicx32/technic_akalin_dust.png new file mode 100644 index 0000000..90f3bac Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_akalin_dust.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_alatro_dust.png b/mods/technic-master/technic/textures/technicx32/technic_alatro_dust.png new file mode 100644 index 0000000..1199614 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_alatro_dust.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_alloy_furnace_front.png b/mods/technic-master/technic/textures/technicx32/technic_alloy_furnace_front.png new file mode 100644 index 0000000..9123fb6 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_alloy_furnace_front.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_alloy_furnace_front_active.png b/mods/technic-master/technic/textures/technicx32/technic_alloy_furnace_front_active.png new file mode 100644 index 0000000..4dda2e6 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_alloy_furnace_front_active.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_alloy_furnace_side.png b/mods/technic-master/technic/textures/technicx32/technic_alloy_furnace_side.png new file mode 100644 index 0000000..b5bd428 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_alloy_furnace_side.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_alloy_furnace_top.png b/mods/technic-master/technic/textures/technicx32/technic_alloy_furnace_top.png new file mode 100644 index 0000000..67ef4b7 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_alloy_furnace_top.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_arol_dust.png b/mods/technic-master/technic/textures/technicx32/technic_arol_dust.png new file mode 100644 index 0000000..f5a392f Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_arol_dust.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_battery.png b/mods/technic-master/technic/textures/technicx32/technic_battery.png new file mode 100644 index 0000000..ee83b74 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_battery.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_battery_box_bottom.png b/mods/technic-master/technic/textures/technicx32/technic_battery_box_bottom.png new file mode 100644 index 0000000..03c7ccc Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_battery_box_bottom.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_battery_box_side0.png b/mods/technic-master/technic/textures/technicx32/technic_battery_box_side0.png new file mode 100644 index 0000000..2662ac0 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_battery_box_side0.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_battery_box_top.png b/mods/technic-master/technic/textures/technicx32/technic_battery_box_top.png new file mode 100644 index 0000000..4953a32 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_battery_box_top.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_battery_reload.png b/mods/technic-master/technic/textures/technicx32/technic_battery_reload.png new file mode 100644 index 0000000..164b4ac Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_battery_reload.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_brass_dust.png b/mods/technic-master/technic/textures/technicx32/technic_brass_dust.png new file mode 100644 index 0000000..f86167a Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_brass_dust.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_bronze_dust.png b/mods/technic-master/technic/textures/technicx32/technic_bronze_dust.png new file mode 100644 index 0000000..0a2401e Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_bronze_dust.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_carbon_steel_dust.png b/mods/technic-master/technic/textures/technicx32/technic_carbon_steel_dust.png new file mode 100644 index 0000000..0bf350f Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_carbon_steel_dust.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_cast_iron_dust.png b/mods/technic-master/technic/textures/technicx32/technic_cast_iron_dust.png new file mode 100644 index 0000000..f355094 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_cast_iron_dust.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_chainsaw.png b/mods/technic-master/technic/textures/technicx32/technic_chainsaw.png new file mode 100644 index 0000000..b7ceee6 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_chainsaw.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_chromium_dust.png b/mods/technic-master/technic/textures/technicx32/technic_chromium_dust.png new file mode 100644 index 0000000..a33358b Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_chromium_dust.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_coal_alloy_furnace_bottom.png b/mods/technic-master/technic/textures/technicx32/technic_coal_alloy_furnace_bottom.png new file mode 100644 index 0000000..7a5eed7 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_coal_alloy_furnace_bottom.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_coal_alloy_furnace_front.png b/mods/technic-master/technic/textures/technicx32/technic_coal_alloy_furnace_front.png new file mode 100644 index 0000000..b00bef3 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_coal_alloy_furnace_front.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_coal_alloy_furnace_front_active.png b/mods/technic-master/technic/textures/technicx32/technic_coal_alloy_furnace_front_active.png new file mode 100644 index 0000000..b41f619 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_coal_alloy_furnace_front_active.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_coal_alloy_furnace_side.png b/mods/technic-master/technic/textures/technicx32/technic_coal_alloy_furnace_side.png new file mode 100644 index 0000000..3db8daa Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_coal_alloy_furnace_side.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_coal_alloy_furnace_top.png b/mods/technic-master/technic/textures/technicx32/technic_coal_alloy_furnace_top.png new file mode 100644 index 0000000..c648fe8 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_coal_alloy_furnace_top.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_coal_dust.png b/mods/technic-master/technic/textures/technicx32/technic_coal_dust.png new file mode 100644 index 0000000..0fe7db7 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_coal_dust.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_constructor_back.png b/mods/technic-master/technic/textures/technicx32/technic_constructor_back.png new file mode 100644 index 0000000..6baf788 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_constructor_back.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_constructor_front_off.png b/mods/technic-master/technic/textures/technicx32/technic_constructor_front_off.png new file mode 100644 index 0000000..f878e55 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_constructor_front_off.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_constructor_front_on.png b/mods/technic-master/technic/textures/technicx32/technic_constructor_front_on.png new file mode 100644 index 0000000..89189d6 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_constructor_front_on.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_constructor_mk1_bottom_off.png b/mods/technic-master/technic/textures/technicx32/technic_constructor_mk1_bottom_off.png new file mode 100644 index 0000000..205dcc4 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_constructor_mk1_bottom_off.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_constructor_mk1_bottom_on.png b/mods/technic-master/technic/textures/technicx32/technic_constructor_mk1_bottom_on.png new file mode 100644 index 0000000..9896c52 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_constructor_mk1_bottom_on.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_constructor_mk1_side1_off.png b/mods/technic-master/technic/textures/technicx32/technic_constructor_mk1_side1_off.png new file mode 100644 index 0000000..e8a01ff Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_constructor_mk1_side1_off.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_constructor_mk1_side1_on.png b/mods/technic-master/technic/textures/technicx32/technic_constructor_mk1_side1_on.png new file mode 100644 index 0000000..c897942 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_constructor_mk1_side1_on.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_constructor_mk1_side2_off.png b/mods/technic-master/technic/textures/technicx32/technic_constructor_mk1_side2_off.png new file mode 100644 index 0000000..8da65f6 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_constructor_mk1_side2_off.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_constructor_mk1_side2_on.png b/mods/technic-master/technic/textures/technicx32/technic_constructor_mk1_side2_on.png new file mode 100644 index 0000000..da8ed34 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_constructor_mk1_side2_on.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_constructor_mk1_top_off.png b/mods/technic-master/technic/textures/technicx32/technic_constructor_mk1_top_off.png new file mode 100644 index 0000000..7d8c7e0 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_constructor_mk1_top_off.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_constructor_mk1_top_on.png b/mods/technic-master/technic/textures/technicx32/technic_constructor_mk1_top_on.png new file mode 100644 index 0000000..439caf5 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_constructor_mk1_top_on.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_constructor_mk2_bottom_off.png b/mods/technic-master/technic/textures/technicx32/technic_constructor_mk2_bottom_off.png new file mode 100644 index 0000000..83c5b07 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_constructor_mk2_bottom_off.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_constructor_mk2_bottom_on.png b/mods/technic-master/technic/textures/technicx32/technic_constructor_mk2_bottom_on.png new file mode 100644 index 0000000..9ad76f4 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_constructor_mk2_bottom_on.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_constructor_mk2_side1_off.png b/mods/technic-master/technic/textures/technicx32/technic_constructor_mk2_side1_off.png new file mode 100644 index 0000000..584dfe3 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_constructor_mk2_side1_off.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_constructor_mk2_side1_on.png b/mods/technic-master/technic/textures/technicx32/technic_constructor_mk2_side1_on.png new file mode 100644 index 0000000..fe02042 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_constructor_mk2_side1_on.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_constructor_mk2_side2_off.png b/mods/technic-master/technic/textures/technicx32/technic_constructor_mk2_side2_off.png new file mode 100644 index 0000000..fd9ad74 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_constructor_mk2_side2_off.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_constructor_mk2_side2_on.png b/mods/technic-master/technic/textures/technicx32/technic_constructor_mk2_side2_on.png new file mode 100644 index 0000000..f51411a Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_constructor_mk2_side2_on.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_constructor_mk2_top_off.png b/mods/technic-master/technic/textures/technicx32/technic_constructor_mk2_top_off.png new file mode 100644 index 0000000..e3e3292 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_constructor_mk2_top_off.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_constructor_mk2_top_on.png b/mods/technic-master/technic/textures/technicx32/technic_constructor_mk2_top_on.png new file mode 100644 index 0000000..83043d4 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_constructor_mk2_top_on.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_constructor_mk3_bottom_off.png b/mods/technic-master/technic/textures/technicx32/technic_constructor_mk3_bottom_off.png new file mode 100644 index 0000000..5f46154 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_constructor_mk3_bottom_off.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_constructor_mk3_bottom_on.png b/mods/technic-master/technic/textures/technicx32/technic_constructor_mk3_bottom_on.png new file mode 100644 index 0000000..f76f29b Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_constructor_mk3_bottom_on.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_constructor_mk3_side1_off.png b/mods/technic-master/technic/textures/technicx32/technic_constructor_mk3_side1_off.png new file mode 100644 index 0000000..0ea1fc0 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_constructor_mk3_side1_off.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_constructor_mk3_side1_on.png b/mods/technic-master/technic/textures/technicx32/technic_constructor_mk3_side1_on.png new file mode 100644 index 0000000..ba86332 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_constructor_mk3_side1_on.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_constructor_mk3_side2_off.png b/mods/technic-master/technic/textures/technicx32/technic_constructor_mk3_side2_off.png new file mode 100644 index 0000000..8e8dce4 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_constructor_mk3_side2_off.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_constructor_mk3_side2_on.png b/mods/technic-master/technic/textures/technicx32/technic_constructor_mk3_side2_on.png new file mode 100644 index 0000000..12dff69 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_constructor_mk3_side2_on.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_constructor_mk3_top_off.png b/mods/technic-master/technic/textures/technicx32/technic_constructor_mk3_top_off.png new file mode 100644 index 0000000..705f255 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_constructor_mk3_top_off.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_constructor_mk3_top_on.png b/mods/technic-master/technic/textures/technicx32/technic_constructor_mk3_top_on.png new file mode 100644 index 0000000..cef077e Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_constructor_mk3_top_on.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_control_logic_unit.png b/mods/technic-master/technic/textures/technicx32/technic_control_logic_unit.png new file mode 100644 index 0000000..6ed00eb Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_control_logic_unit.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_copper_coil.png b/mods/technic-master/technic/textures/technicx32/technic_copper_coil.png new file mode 100644 index 0000000..db6db1a Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_copper_coil.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_copper_dust.png b/mods/technic-master/technic/textures/technicx32/technic_copper_dust.png new file mode 100644 index 0000000..68678ed Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_copper_dust.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_deployer_back.png b/mods/technic-master/technic/textures/technicx32/technic_deployer_back.png new file mode 100644 index 0000000..0bc8df9 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_deployer_back.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_deployer_bottom.png b/mods/technic-master/technic/textures/technicx32/technic_deployer_bottom.png new file mode 100644 index 0000000..ff1a2c6 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_deployer_bottom.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_deployer_front_off.png b/mods/technic-master/technic/textures/technicx32/technic_deployer_front_off.png new file mode 100644 index 0000000..d0f6f55 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_deployer_front_off.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_deployer_front_on.png b/mods/technic-master/technic/textures/technicx32/technic_deployer_front_on.png new file mode 100644 index 0000000..368ce32 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_deployer_front_on.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_deployer_side.png b/mods/technic-master/technic/textures/technicx32/technic_deployer_side.png new file mode 100644 index 0000000..aefd7c8 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_deployer_side.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_deployer_side1.png b/mods/technic-master/technic/textures/technicx32/technic_deployer_side1.png new file mode 100644 index 0000000..8cb8634 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_deployer_side1.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_deployer_side2.png b/mods/technic-master/technic/textures/technicx32/technic_deployer_side2.png new file mode 100644 index 0000000..c2855d0 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_deployer_side2.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_deployer_top.png b/mods/technic-master/technic/textures/technicx32/technic_deployer_top.png new file mode 100644 index 0000000..941d333 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_deployer_top.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_diamond_block_blue.png b/mods/technic-master/technic/textures/technicx32/technic_diamond_block_blue.png new file mode 100644 index 0000000..d89bd6e Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_diamond_block_blue.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_diamond_block_green.png b/mods/technic-master/technic/textures/technicx32/technic_diamond_block_green.png new file mode 100644 index 0000000..996b254 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_diamond_block_green.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_diamond_block_red.png b/mods/technic-master/technic/textures/technicx32/technic_diamond_block_red.png new file mode 100644 index 0000000..52fd893 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_diamond_block_red.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_diamond_drill_head.png b/mods/technic-master/technic/textures/technicx32/technic_diamond_drill_head.png new file mode 100644 index 0000000..e3d31e8 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_diamond_drill_head.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_doped_silicon_wafer.png b/mods/technic-master/technic/textures/technicx32/technic_doped_silicon_wafer.png new file mode 100644 index 0000000..6ff06a6 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_doped_silicon_wafer.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_electric_furnace_bottom.png b/mods/technic-master/technic/textures/technicx32/technic_electric_furnace_bottom.png new file mode 100644 index 0000000..d16ac47 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_electric_furnace_bottom.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_electric_furnace_front.png b/mods/technic-master/technic/textures/technicx32/technic_electric_furnace_front.png new file mode 100644 index 0000000..dfee663 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_electric_furnace_front.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_electric_furnace_front_active.png b/mods/technic-master/technic/textures/technicx32/technic_electric_furnace_front_active.png new file mode 100644 index 0000000..038eec4 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_electric_furnace_front_active.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_electric_furnace_side.png b/mods/technic-master/technic/textures/technicx32/technic_electric_furnace_side.png new file mode 100644 index 0000000..cf345e7 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_electric_furnace_side.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_electric_furnace_top.png b/mods/technic-master/technic/textures/technicx32/technic_electric_furnace_top.png new file mode 100644 index 0000000..d3309ec Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_electric_furnace_top.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_fine_copper_wire.png b/mods/technic-master/technic/textures/technicx32/technic_fine_copper_wire.png new file mode 100644 index 0000000..36e2ed6 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_fine_copper_wire.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_fine_gold_wire.png b/mods/technic-master/technic/textures/technicx32/technic_fine_gold_wire.png new file mode 100644 index 0000000..be2a38a Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_fine_gold_wire.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_fine_silver_wire.png b/mods/technic-master/technic/textures/technicx32/technic_fine_silver_wire.png new file mode 100644 index 0000000..d43cb6a Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_fine_silver_wire.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_flashlight.png b/mods/technic-master/technic/textures/technicx32/technic_flashlight.png new file mode 100644 index 0000000..01afdbb Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_flashlight.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_generator_front.png b/mods/technic-master/technic/textures/technicx32/technic_generator_front.png new file mode 100644 index 0000000..2d64844 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_generator_front.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_generator_front_active.png b/mods/technic-master/technic/textures/technicx32/technic_generator_front_active.png new file mode 100644 index 0000000..4e57ca0 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_generator_front_active.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_generator_side.png b/mods/technic-master/technic/textures/technicx32/technic_generator_side.png new file mode 100644 index 0000000..5cbcbef Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_generator_side.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_generator_top.png b/mods/technic-master/technic/textures/technicx32/technic_generator_top.png new file mode 100644 index 0000000..e2f3db3 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_generator_top.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_geothermal_side.png b/mods/technic-master/technic/textures/technicx32/technic_geothermal_side.png new file mode 100644 index 0000000..90fb430 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_geothermal_side.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_geothermal_top.png b/mods/technic-master/technic/textures/technicx32/technic_geothermal_top.png new file mode 100644 index 0000000..601ff15 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_geothermal_top.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_geothermal_top_active.png b/mods/technic-master/technic/textures/technicx32/technic_geothermal_top_active.png new file mode 100644 index 0000000..f02bec6 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_geothermal_top_active.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_gold_dust.png b/mods/technic-master/technic/textures/technicx32/technic_gold_dust.png new file mode 100644 index 0000000..e545bb6 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_gold_dust.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_grinder_front.png b/mods/technic-master/technic/textures/technicx32/technic_grinder_front.png new file mode 100644 index 0000000..a28dbc1 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_grinder_front.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_grinder_side.png b/mods/technic-master/technic/textures/technicx32/technic_grinder_side.png new file mode 100644 index 0000000..af562f2 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_grinder_side.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_grinder_top.png b/mods/technic-master/technic/textures/technicx32/technic_grinder_top.png new file mode 100644 index 0000000..b074e13 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_grinder_top.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_hv_grinder_bottom.png b/mods/technic-master/technic/textures/technicx32/technic_hv_grinder_bottom.png new file mode 100644 index 0000000..d854193 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_hv_grinder_bottom.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_hv_grinder_front.png b/mods/technic-master/technic/textures/technicx32/technic_hv_grinder_front.png new file mode 100644 index 0000000..f20cb22 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_hv_grinder_front.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_hv_grinder_front_active.png b/mods/technic-master/technic/textures/technicx32/technic_hv_grinder_front_active.png new file mode 100644 index 0000000..d1fa468 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_hv_grinder_front_active.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_hv_grinder_side.png b/mods/technic-master/technic/textures/technicx32/technic_hv_grinder_side.png new file mode 100644 index 0000000..35cf031 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_hv_grinder_side.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_hv_grinder_side_tube.png b/mods/technic-master/technic/textures/technicx32/technic_hv_grinder_side_tube.png new file mode 100644 index 0000000..5b5b450 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_hv_grinder_side_tube.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_hv_grinder_top.png b/mods/technic-master/technic/textures/technicx32/technic_hv_grinder_top.png new file mode 100644 index 0000000..7869ea8 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_hv_grinder_top.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_hv_nuclear_reactor_core.png b/mods/technic-master/technic/textures/technicx32/technic_hv_nuclear_reactor_core.png new file mode 100644 index 0000000..3d380da Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_hv_nuclear_reactor_core.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_hv_solar_array_bottom.png b/mods/technic-master/technic/textures/technicx32/technic_hv_solar_array_bottom.png new file mode 100644 index 0000000..94c8222 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_hv_solar_array_bottom.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_hv_solar_array_side.png b/mods/technic-master/technic/textures/technicx32/technic_hv_solar_array_side.png new file mode 100644 index 0000000..d39d3d8 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_hv_solar_array_side.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_hv_solar_array_top.png b/mods/technic-master/technic/textures/technicx32/technic_hv_solar_array_top.png new file mode 100644 index 0000000..3e1b9e0 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_hv_solar_array_top.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_hv_transformer.png b/mods/technic-master/technic/textures/technicx32/technic_hv_transformer.png new file mode 100644 index 0000000..7794644 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_hv_transformer.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_injector_bottom.png b/mods/technic-master/technic/textures/technicx32/technic_injector_bottom.png new file mode 100644 index 0000000..39916bd Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_injector_bottom.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_injector_side.png b/mods/technic-master/technic/textures/technicx32/technic_injector_side.png new file mode 100644 index 0000000..a5419a1 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_injector_side.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_injector_top.png b/mods/technic-master/technic/textures/technicx32/technic_injector_top.png new file mode 100644 index 0000000..440649c Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_injector_top.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_kalite_dust.png b/mods/technic-master/technic/textures/technicx32/technic_kalite_dust.png new file mode 100644 index 0000000..595edb5 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_kalite_dust.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_laser_beam.png b/mods/technic-master/technic/textures/technicx32/technic_laser_beam.png new file mode 100644 index 0000000..4814a9b Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_laser_beam.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_lava_can.png b/mods/technic-master/technic/textures/technicx32/technic_lava_can.png new file mode 100644 index 0000000..80d15a6 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_lava_can.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_light.png b/mods/technic-master/technic/textures/technicx32/technic_light.png new file mode 100644 index 0000000..334cb07 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_light.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_lv_grinder_bottom.png b/mods/technic-master/technic/textures/technicx32/technic_lv_grinder_bottom.png new file mode 100644 index 0000000..816b969 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_lv_grinder_bottom.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_lv_grinder_front.png b/mods/technic-master/technic/textures/technicx32/technic_lv_grinder_front.png new file mode 100644 index 0000000..7451ca9 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_lv_grinder_front.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_lv_grinder_front_active.png b/mods/technic-master/technic/textures/technicx32/technic_lv_grinder_front_active.png new file mode 100644 index 0000000..8e17e4d Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_lv_grinder_front_active.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_lv_grinder_side.png b/mods/technic-master/technic/textures/technicx32/technic_lv_grinder_side.png new file mode 100644 index 0000000..908287b Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_lv_grinder_side.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_lv_grinder_top.png b/mods/technic-master/technic/textures/technicx32/technic_lv_grinder_top.png new file mode 100644 index 0000000..8520baf Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_lv_grinder_top.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_lv_solar_array_bottom.png b/mods/technic-master/technic/textures/technicx32/technic_lv_solar_array_bottom.png new file mode 100644 index 0000000..94c8222 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_lv_solar_array_bottom.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_lv_solar_array_side.png b/mods/technic-master/technic/textures/technicx32/technic_lv_solar_array_side.png new file mode 100644 index 0000000..d39d3d8 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_lv_solar_array_side.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_lv_solar_array_top.png b/mods/technic-master/technic/textures/technicx32/technic_lv_solar_array_top.png new file mode 100644 index 0000000..3d8c7ab Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_lv_solar_array_top.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_lv_transformer.png b/mods/technic-master/technic/textures/technicx32/technic_lv_transformer.png new file mode 100644 index 0000000..99ac927 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_lv_transformer.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_machine_bottom.png b/mods/technic-master/technic/textures/technicx32/technic_machine_bottom.png new file mode 100644 index 0000000..943dae1 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_machine_bottom.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_mining_drill.png b/mods/technic-master/technic/textures/technicx32/technic_mining_drill.png new file mode 100644 index 0000000..171888d Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_mining_drill.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_mining_laser_mk1.png b/mods/technic-master/technic/textures/technicx32/technic_mining_laser_mk1.png new file mode 100644 index 0000000..acde392 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_mining_laser_mk1.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_mithril_dust.png b/mods/technic-master/technic/textures/technicx32/technic_mithril_dust.png new file mode 100644 index 0000000..988e449 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_mithril_dust.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_motor.png b/mods/technic-master/technic/textures/technicx32/technic_motor.png new file mode 100644 index 0000000..77d4b91 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_motor.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_music_player_bottom.png b/mods/technic-master/technic/textures/technicx32/technic_music_player_bottom.png new file mode 100644 index 0000000..bd8fd55 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_music_player_bottom.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_music_player_side.png b/mods/technic-master/technic/textures/technicx32/technic_music_player_side.png new file mode 100644 index 0000000..6c34fea Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_music_player_side.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_music_player_top.png b/mods/technic-master/technic/textures/technicx32/technic_music_player_top.png new file mode 100644 index 0000000..0d34563 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_music_player_top.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_mv_alloy_furnace_bottom.png b/mods/technic-master/technic/textures/technicx32/technic_mv_alloy_furnace_bottom.png new file mode 100644 index 0000000..3723bb1 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_mv_alloy_furnace_bottom.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_mv_alloy_furnace_front.png b/mods/technic-master/technic/textures/technicx32/technic_mv_alloy_furnace_front.png new file mode 100644 index 0000000..a5dac82 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_mv_alloy_furnace_front.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_mv_alloy_furnace_front_active.png b/mods/technic-master/technic/textures/technicx32/technic_mv_alloy_furnace_front_active.png new file mode 100644 index 0000000..f6e69a9 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_mv_alloy_furnace_front_active.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_mv_alloy_furnace_side.png b/mods/technic-master/technic/textures/technicx32/technic_mv_alloy_furnace_side.png new file mode 100644 index 0000000..0430479 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_mv_alloy_furnace_side.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_mv_alloy_furnace_side_tube.png b/mods/technic-master/technic/textures/technicx32/technic_mv_alloy_furnace_side_tube.png new file mode 100644 index 0000000..69f89e7 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_mv_alloy_furnace_side_tube.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_mv_alloy_furnace_top.png b/mods/technic-master/technic/textures/technicx32/technic_mv_alloy_furnace_top.png new file mode 100644 index 0000000..f44e3c0 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_mv_alloy_furnace_top.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_mv_battery_box_bottom.png b/mods/technic-master/technic/textures/technicx32/technic_mv_battery_box_bottom.png new file mode 100644 index 0000000..2a9b292 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_mv_battery_box_bottom.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_mv_battery_box_side0.png b/mods/technic-master/technic/textures/technicx32/technic_mv_battery_box_side0.png new file mode 100644 index 0000000..39d8986 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_mv_battery_box_side0.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_mv_battery_box_top.png b/mods/technic-master/technic/textures/technicx32/technic_mv_battery_box_top.png new file mode 100644 index 0000000..f7f1ea9 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_mv_battery_box_top.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_mv_cable_wield.png b/mods/technic-master/technic/textures/technicx32/technic_mv_cable_wield.png new file mode 100644 index 0000000..aca9fd4 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_mv_cable_wield.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_mv_electric_furnace_bottom.png b/mods/technic-master/technic/textures/technicx32/technic_mv_electric_furnace_bottom.png new file mode 100644 index 0000000..d16ac47 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_mv_electric_furnace_bottom.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_mv_electric_furnace_front.png b/mods/technic-master/technic/textures/technicx32/technic_mv_electric_furnace_front.png new file mode 100644 index 0000000..4dfac63 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_mv_electric_furnace_front.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_mv_electric_furnace_front_active.png b/mods/technic-master/technic/textures/technicx32/technic_mv_electric_furnace_front_active.png new file mode 100644 index 0000000..e206cd2 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_mv_electric_furnace_front_active.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_mv_electric_furnace_side.png b/mods/technic-master/technic/textures/technicx32/technic_mv_electric_furnace_side.png new file mode 100644 index 0000000..4aa27b7 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_mv_electric_furnace_side.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_mv_electric_furnace_side_tube.png b/mods/technic-master/technic/textures/technicx32/technic_mv_electric_furnace_side_tube.png new file mode 100644 index 0000000..bfeba18 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_mv_electric_furnace_side_tube.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_mv_electric_furnace_top.png b/mods/technic-master/technic/textures/technicx32/technic_mv_electric_furnace_top.png new file mode 100644 index 0000000..635b6b7 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_mv_electric_furnace_top.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_mv_grinder_bottom.png b/mods/technic-master/technic/textures/technicx32/technic_mv_grinder_bottom.png new file mode 100644 index 0000000..f46cd72 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_mv_grinder_bottom.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_mv_grinder_front.png b/mods/technic-master/technic/textures/technicx32/technic_mv_grinder_front.png new file mode 100644 index 0000000..6445dfe Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_mv_grinder_front.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_mv_grinder_front_active.png b/mods/technic-master/technic/textures/technicx32/technic_mv_grinder_front_active.png new file mode 100644 index 0000000..428e1dc Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_mv_grinder_front_active.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_mv_grinder_side.png b/mods/technic-master/technic/textures/technicx32/technic_mv_grinder_side.png new file mode 100644 index 0000000..c014f08 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_mv_grinder_side.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_mv_grinder_side_tube.png b/mods/technic-master/technic/textures/technicx32/technic_mv_grinder_side_tube.png new file mode 100644 index 0000000..69050e4 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_mv_grinder_side_tube.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_mv_grinder_top.png b/mods/technic-master/technic/textures/technicx32/technic_mv_grinder_top.png new file mode 100644 index 0000000..e0320ef Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_mv_grinder_top.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_mv_solar_array_bottom.png b/mods/technic-master/technic/textures/technicx32/technic_mv_solar_array_bottom.png new file mode 100644 index 0000000..94c8222 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_mv_solar_array_bottom.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_mv_solar_array_side.png b/mods/technic-master/technic/textures/technicx32/technic_mv_solar_array_side.png new file mode 100644 index 0000000..d39d3d8 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_mv_solar_array_side.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_mv_solar_array_top.png b/mods/technic-master/technic/textures/technicx32/technic_mv_solar_array_top.png new file mode 100644 index 0000000..e4999d5 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_mv_solar_array_top.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_mv_transformer.png b/mods/technic-master/technic/textures/technicx32/technic_mv_transformer.png new file mode 100644 index 0000000..7c4688e Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_mv_transformer.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_nodebreaker_back.png b/mods/technic-master/technic/textures/technicx32/technic_nodebreaker_back.png new file mode 100644 index 0000000..43ba821 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_nodebreaker_back.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_nodebreaker_bottom.png b/mods/technic-master/technic/textures/technicx32/technic_nodebreaker_bottom.png new file mode 100644 index 0000000..99ff685 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_nodebreaker_bottom.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_nodebreaker_bottom_off.png b/mods/technic-master/technic/textures/technicx32/technic_nodebreaker_bottom_off.png new file mode 100644 index 0000000..47cd4e8 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_nodebreaker_bottom_off.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_nodebreaker_bottom_on.png b/mods/technic-master/technic/textures/technicx32/technic_nodebreaker_bottom_on.png new file mode 100644 index 0000000..994f787 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_nodebreaker_bottom_on.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_nodebreaker_front_off.png b/mods/technic-master/technic/textures/technicx32/technic_nodebreaker_front_off.png new file mode 100644 index 0000000..5ece916 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_nodebreaker_front_off.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_nodebreaker_front_on.png b/mods/technic-master/technic/textures/technicx32/technic_nodebreaker_front_on.png new file mode 100644 index 0000000..a53de2a Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_nodebreaker_front_on.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_nodebreaker_side.png b/mods/technic-master/technic/textures/technicx32/technic_nodebreaker_side.png new file mode 100644 index 0000000..c2b401b Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_nodebreaker_side.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_nodebreaker_side1.png b/mods/technic-master/technic/textures/technicx32/technic_nodebreaker_side1.png new file mode 100644 index 0000000..07e74aa Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_nodebreaker_side1.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_nodebreaker_side1_off.png b/mods/technic-master/technic/textures/technicx32/technic_nodebreaker_side1_off.png new file mode 100644 index 0000000..b63f3bb Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_nodebreaker_side1_off.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_nodebreaker_side1_on.png b/mods/technic-master/technic/textures/technicx32/technic_nodebreaker_side1_on.png new file mode 100644 index 0000000..b455f06 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_nodebreaker_side1_on.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_nodebreaker_side2.png b/mods/technic-master/technic/textures/technicx32/technic_nodebreaker_side2.png new file mode 100644 index 0000000..7f4a0bf Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_nodebreaker_side2.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_nodebreaker_side2_off.png b/mods/technic-master/technic/textures/technicx32/technic_nodebreaker_side2_off.png new file mode 100644 index 0000000..7b60902 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_nodebreaker_side2_off.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_nodebreaker_side2_on.png b/mods/technic-master/technic/textures/technicx32/technic_nodebreaker_side2_on.png new file mode 100644 index 0000000..12985f6 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_nodebreaker_side2_on.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_nodebreaker_top.png b/mods/technic-master/technic/textures/technicx32/technic_nodebreaker_top.png new file mode 100644 index 0000000..0994c6d Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_nodebreaker_top.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_nodebreaker_top_off.png b/mods/technic-master/technic/textures/technicx32/technic_nodebreaker_top_off.png new file mode 100644 index 0000000..f08fc1b Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_nodebreaker_top_off.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_nodebreaker_top_on.png b/mods/technic-master/technic/textures/technicx32/technic_nodebreaker_top_on.png new file mode 100644 index 0000000..ec28210 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_nodebreaker_top_on.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_power_meter.png b/mods/technic-master/technic/textures/technicx32/technic_power_meter.png new file mode 100644 index 0000000..f1e5120 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_power_meter.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_power_meter1.png b/mods/technic-master/technic/textures/technicx32/technic_power_meter1.png new file mode 100644 index 0000000..0542c7b Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_power_meter1.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_power_meter2.png b/mods/technic-master/technic/textures/technicx32/technic_power_meter2.png new file mode 100644 index 0000000..bf5703c Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_power_meter2.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_power_meter3.png b/mods/technic-master/technic/textures/technicx32/technic_power_meter3.png new file mode 100644 index 0000000..4204815 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_power_meter3.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_power_meter4.png b/mods/technic-master/technic/textures/technicx32/technic_power_meter4.png new file mode 100644 index 0000000..82a0148 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_power_meter4.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_power_meter5.png b/mods/technic-master/technic/textures/technicx32/technic_power_meter5.png new file mode 100644 index 0000000..af783ca Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_power_meter5.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_power_meter6.png b/mods/technic-master/technic/textures/technicx32/technic_power_meter6.png new file mode 100644 index 0000000..44feff4 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_power_meter6.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_power_meter7.png b/mods/technic-master/technic/textures/technicx32/technic_power_meter7.png new file mode 100644 index 0000000..554baa2 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_power_meter7.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_power_meter8.png b/mods/technic-master/technic/textures/technicx32/technic_power_meter8.png new file mode 100644 index 0000000..8c4f4a8 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_power_meter8.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_power_meter_bg.png b/mods/technic-master/technic/textures/technicx32/technic_power_meter_bg.png new file mode 100644 index 0000000..9667cda Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_power_meter_bg.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_power_meter_fg.png b/mods/technic-master/technic/textures/technicx32/technic_power_meter_fg.png new file mode 100644 index 0000000..7f2dde8 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_power_meter_fg.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_raw_latex.png b/mods/technic-master/technic/textures/technicx32/technic_raw_latex.png new file mode 100644 index 0000000..7fbbe64 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_raw_latex.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_rubber.png b/mods/technic-master/technic/textures/technicx32/technic_rubber.png new file mode 100644 index 0000000..9ed4a9d Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_rubber.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_rubber_sapling.png b/mods/technic-master/technic/textures/technicx32/technic_rubber_sapling.png new file mode 100644 index 0000000..e5c9f5d Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_rubber_sapling.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_rubber_tree_empty.png b/mods/technic-master/technic/textures/technicx32/technic_rubber_tree_empty.png new file mode 100644 index 0000000..1792951 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_rubber_tree_empty.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_rubber_tree_full.png b/mods/technic-master/technic/textures/technicx32/technic_rubber_tree_full.png new file mode 100644 index 0000000..08067ef Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_rubber_tree_full.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_screwdriver.png b/mods/technic-master/technic/textures/technicx32/technic_screwdriver.png new file mode 100644 index 0000000..bd2da22 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_screwdriver.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_silicon_wafer.png b/mods/technic-master/technic/textures/technicx32/technic_silicon_wafer.png new file mode 100644 index 0000000..78aef20 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_silicon_wafer.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_silver_dust.png b/mods/technic-master/technic/textures/technicx32/technic_silver_dust.png new file mode 100644 index 0000000..9092c90 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_silver_dust.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_solar_panel_bottom.png b/mods/technic-master/technic/textures/technicx32/technic_solar_panel_bottom.png new file mode 100644 index 0000000..b0ad82f Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_solar_panel_bottom.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_solar_panel_side.png b/mods/technic-master/technic/textures/technicx32/technic_solar_panel_side.png new file mode 100644 index 0000000..b22447e Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_solar_panel_side.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_solar_panel_top.png b/mods/technic-master/technic/textures/technicx32/technic_solar_panel_top.png new file mode 100644 index 0000000..492764b Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_solar_panel_top.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_sonic_screwdriver.png b/mods/technic-master/technic/textures/technicx32/technic_sonic_screwdriver.png new file mode 100644 index 0000000..fb61d96 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_sonic_screwdriver.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_stainless_steel_dust.png b/mods/technic-master/technic/textures/technicx32/technic_stainless_steel_dust.png new file mode 100644 index 0000000..450e2bb Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_stainless_steel_dust.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_talinite_dust.png b/mods/technic-master/technic/textures/technicx32/technic_talinite_dust.png new file mode 100644 index 0000000..39f9330 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_talinite_dust.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_tin_dust.png b/mods/technic-master/technic/textures/technicx32/technic_tin_dust.png new file mode 100644 index 0000000..4e94e00 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_tin_dust.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_tree_tap.png b/mods/technic-master/technic/textures/technicx32/technic_tree_tap.png new file mode 100644 index 0000000..542f30f Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_tree_tap.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_uranium_dust.png b/mods/technic-master/technic/textures/technicx32/technic_uranium_dust.png new file mode 100644 index 0000000..d8095c3 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_uranium_dust.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_water_can.png b/mods/technic-master/technic/textures/technicx32/technic_water_can.png new file mode 100644 index 0000000..18e0225 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_water_can.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_water_mill_side.png b/mods/technic-master/technic/textures/technicx32/technic_water_mill_side.png new file mode 100644 index 0000000..f4bdb16 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_water_mill_side.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_water_mill_top.png b/mods/technic-master/technic/textures/technicx32/technic_water_mill_top.png new file mode 100644 index 0000000..601ff15 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_water_mill_top.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_water_mill_top_active.png b/mods/technic-master/technic/textures/technicx32/technic_water_mill_top_active.png new file mode 100644 index 0000000..f02bec6 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_water_mill_top_active.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_workshop_bottom.png b/mods/technic-master/technic/textures/technicx32/technic_workshop_bottom.png new file mode 100644 index 0000000..bd8fd55 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_workshop_bottom.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_workshop_side.png b/mods/technic-master/technic/textures/technicx32/technic_workshop_side.png new file mode 100644 index 0000000..9e3e7a7 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_workshop_side.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_workshop_top.png b/mods/technic-master/technic/textures/technicx32/technic_workshop_top.png new file mode 100644 index 0000000..feae141 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_workshop_top.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_wrought_iron_dust.png b/mods/technic-master/technic/textures/technicx32/technic_wrought_iron_dust.png new file mode 100644 index 0000000..d890e73 Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_wrought_iron_dust.png differ diff --git a/mods/technic-master/technic/textures/technicx32/technic_zinc_dust.png b/mods/technic-master/technic/textures/technicx32/technic_zinc_dust.png new file mode 100644 index 0000000..0d2f75a Binary files /dev/null and b/mods/technic-master/technic/textures/technicx32/technic_zinc_dust.png differ diff --git a/mods/technic-master/technic/tools/cans.lua b/mods/technic-master/technic/tools/cans.lua new file mode 100644 index 0000000..f12ec93 --- /dev/null +++ b/mods/technic-master/technic/tools/cans.lua @@ -0,0 +1,114 @@ +local S = technic.getter + +local function set_can_wear(itemstack, level, max_level) + local temp + if level == 0 then + temp = 0 + else + temp = 65536 - math.floor(level / max_level * 65535) + if temp > 65535 then temp = 65535 end + if temp < 1 then temp = 1 end + end + itemstack:set_wear(temp) +end + +local function get_can_level(itemstack) + if itemstack:get_metadata() == "" then + return 0 + else + return tonumber(itemstack:get_metadata()) + end +end + +function technic.register_can(d) + local data = {} + for k, v in pairs(d) do data[k] = v end + minetest.register_tool(data.can_name, { + description = data.can_description, + inventory_image = data.can_inventory_image, + stack_max = 1, + wear_represents = "content_level", + liquids_pointable = true, + on_use = function(itemstack, user, pointed_thing) + if pointed_thing.type ~= "node" then return end + local node = minetest.get_node(pointed_thing.under) + if node.name ~= data.liquid_source_name then return end + local charge = get_can_level(itemstack) + if charge == data.can_capacity then return end + if minetest.is_protected(pointed_thing.under, user:get_player_name()) then + minetest.log("action", user:get_player_name().." tried to take "..node.name.." at protected position "..minetest.pos_to_string(pointed_thing.under).." with a "..data.can_name) + return + end + minetest.remove_node(pointed_thing.under) + charge = charge + 1 + itemstack:set_metadata(tostring(charge)) + set_can_wear(itemstack, charge, data.can_capacity) + return itemstack + end, + on_place = function(itemstack, user, pointed_thing) + if pointed_thing.type ~= "node" then return end + local pos = pointed_thing.under + local def = minetest.registered_nodes[minetest.get_node(pos).name] or {} + if def.on_rightclick and user and not user:get_player_control().sneak then + return def.on_rightclick(pos, minetest.get_node(pos), user, itemstack, pointed_thing) + end + if not def.buildable_to then + pos = pointed_thing.above + def = minetest.registered_nodes[minetest.get_node(pos).name] or {} + if not def.buildable_to then return end + end + local charge = get_can_level(itemstack) + if charge == 0 then return end + if minetest.is_protected(pos, user:get_player_name()) then + 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}) + charge = charge - 1 + itemstack:set_metadata(tostring(charge)) + set_can_wear(itemstack, charge, data.can_capacity) + return itemstack + end, + on_refill = function(stack) + stack:set_metadata(tostring(data.can_capacity)) + set_can_wear(stack, data.can_capacity, data.can_capacity) + return stack + end, + }) +end + +technic.register_can({ + can_name = "technic:water_can", + can_description = S("Water Can"), + can_inventory_image = "technic_water_can.png", + can_capacity = 16, + liquid_source_name = "default:water_source", + liquid_flowing_name = "default:water_flowing", +}) + +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.register_can({ + can_name = "technic:lava_can", + can_description = S("Lava Can"), + can_inventory_image = "technic_lava_can.png", + can_capacity = 8, + liquid_source_name = "default:lava_source", + liquid_flowing_name = "default:lava_flowing", +}) + +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'}, + } +}) diff --git a/mods/technic-master/technic/tools/chainsaw.lua b/mods/technic-master/technic/tools/chainsaw.lua new file mode 100644 index 0000000..eaa33bf --- /dev/null +++ b/mods/technic-master/technic/tools/chainsaw.lua @@ -0,0 +1,315 @@ +-- Configuration + +local chainsaw_max_charge = 30000 -- Maximum charge of the saw +-- Gives 2500 nodes on a single charge (about 50 complete normal trees) +local chainsaw_charge_per_node = 12 +-- Cut down tree leaves. Leaf decay may cause slowness on large trees +-- if this is disabled. +local chainsaw_leaves = true + +-- The default trees +local timber_nodenames = { + ["default:jungletree"] = true, + ["default:papyrus"] = true, + ["default:cactus"] = true, + ["default:tree"] = true, + ["default:apple"] = true, +} + +if chainsaw_leaves then + timber_nodenames["default:leaves"] = true + timber_nodenames["default:jungleleaves"] = true +end + +-- technic_worldgen defines rubber trees if moretrees isn't installed +if minetest.get_modpath("technic_worldgen") or + minetest.get_modpath("moretrees") then + timber_nodenames["moretrees:rubber_tree_trunk_empty"] = true + timber_nodenames["moretrees:rubber_tree_trunk"] = true + if chainsaw_leaves then + timber_nodenames["moretrees:rubber_tree_leaves"] = true + end +end + +-- Support moretrees if it is there +if minetest.get_modpath("moretrees") then + timber_nodenames["moretrees:apple_tree_trunk"] = true + timber_nodenames["moretrees:apple_tree_trunk_sideways"] = true + timber_nodenames["moretrees:beech_trunk"] = true + timber_nodenames["moretrees:beech_trunk_sideways"] = true + timber_nodenames["moretrees:birch_trunk"] = true + timber_nodenames["moretrees:birch_trunk_sideways"] = true + timber_nodenames["moretrees:fir_trunk"] = true + timber_nodenames["moretrees:fir_trunk_sideways"] = true + timber_nodenames["moretrees:oak_trunk"] = true + timber_nodenames["moretrees:oak_trunk_sideways"] = true + timber_nodenames["moretrees:palm_trunk"] = true + timber_nodenames["moretrees:palm_trunk_sideways"] = true + timber_nodenames["moretrees:pine_trunk"] = true + timber_nodenames["moretrees:pine_trunk_sideways"] = true + timber_nodenames["moretrees:rubber_tree_trunk_sideways"] = true + timber_nodenames["moretrees:rubber_tree_trunk_sideways_empty"] = true + timber_nodenames["moretrees:sequoia_trunk"] = true + timber_nodenames["moretrees:sequoia_trunk_sideways"] = true + timber_nodenames["moretrees:spruce_trunk"] = true + timber_nodenames["moretrees:spruce_trunk_sideways"] = true + timber_nodenames["moretrees:willow_trunk"] = true + timber_nodenames["moretrees:willow_trunk_sideways"] = true + timber_nodenames["moretrees:jungletree_trunk"] = true + timber_nodenames["moretrees:jungletree_trunk_sideways"] = true + + if chainsaw_leaves then + timber_nodenames["moretrees:apple_tree_leaves"] = true + timber_nodenames["moretrees:oak_leaves"] = true + timber_nodenames["moretrees:fir_leaves"] = true + timber_nodenames["moretrees:fir_leaves_bright"] = true + timber_nodenames["moretrees:sequoia_leaves"] = true + timber_nodenames["moretrees:birch_leaves"] = true + timber_nodenames["moretrees:birch_leaves"] = true + timber_nodenames["moretrees:palm_leaves"] = true + timber_nodenames["moretrees:spruce_leaves"] = true + timber_nodenames["moretrees:spruce_leaves"] = true + timber_nodenames["moretrees:pine_leaves"] = true + timber_nodenames["moretrees:willow_leaves"] = true + timber_nodenames["moretrees:jungletree_leaves_green"] = true + timber_nodenames["moretrees:jungletree_leaves_yellow"] = true + timber_nodenames["moretrees:jungletree_leaves_red"] = true + end +end + +-- Support growing_trees +if minetest.get_modpath("growing_trees") then + timber_nodenames["growing_trees:trunk"] = true + timber_nodenames["growing_trees:medium_trunk"] = true + timber_nodenames["growing_trees:big_trunk"] = true + timber_nodenames["growing_trees:trunk_top"] = true + timber_nodenames["growing_trees:trunk_sprout"] = true + timber_nodenames["growing_trees:branch_sprout"] = true + timber_nodenames["growing_trees:branch"] = true + timber_nodenames["growing_trees:branch_xmzm"] = true + timber_nodenames["growing_trees:branch_xpzm"] = true + timber_nodenames["growing_trees:branch_xmzp"] = true + timber_nodenames["growing_trees:branch_xpzp"] = true + timber_nodenames["growing_trees:branch_zz"] = true + timber_nodenames["growing_trees:branch_xx"] = true + + if chainsaw_leaves then + timber_nodenames["growing_trees:leaves"] = true + end +end + +-- Support growing_cactus +if minetest.get_modpath("growing_cactus") then + timber_nodenames["growing_cactus:sprout"] = true + timber_nodenames["growing_cactus:branch_sprout_vertical"] = true + timber_nodenames["growing_cactus:branch_sprout_vertical_fixed"] = true + timber_nodenames["growing_cactus:branch_sprout_xp"] = true + timber_nodenames["growing_cactus:branch_sprout_xm"] = true + timber_nodenames["growing_cactus:branch_sprout_zp"] = true + timber_nodenames["growing_cactus:branch_sprout_zm"] = true + timber_nodenames["growing_cactus:trunk"] = true + timber_nodenames["growing_cactus:branch_trunk"] = true + timber_nodenames["growing_cactus:branch"] = true + timber_nodenames["growing_cactus:branch_xp"] = true + timber_nodenames["growing_cactus:branch_xm"] = true + timber_nodenames["growing_cactus:branch_zp"] = true + timber_nodenames["growing_cactus:branch_zm"] = true + timber_nodenames["growing_cactus:branch_zz"] = true + timber_nodenames["growing_cactus:branch_xx"] = true +end + +-- Support farming_plus +if minetest.get_modpath("farming_plus") then + if chainsaw_leaves then + timber_nodenames["farming_plus:cocoa_leaves"] = true + end +end + + +local S = technic.getter + +technic.register_power_tool("technic:chainsaw", chainsaw_max_charge) + +-- Table for saving what was sawed down +local produced = {} + +-- Save the items sawed down so that we can drop them in a nice single stack +local function handle_drops(drops) + for _, item in ipairs(drops) do + local stack = ItemStack(item) + local name = stack:get_name() + local p = produced[name] + if not p then + produced[name] = stack + else + p:set_count(p:get_count() + stack:get_count()) + end + end +end + +--- Iterator over positions to try to saw around a sawed node. +-- This returns nodes in a 3x2x3 area. It does not return lower (y) positions +-- to prevent the chainsaw from cutting down nodes below the cutting position. +-- @param pos Reference to sawing position. Note that this is overridden. +local function iterSawTries(pos) + -- Shift the position down on the x and z axes + pos.x, pos.z = pos.x - 1, pos.z - 1 + -- Save our starting position for reseting it later + local startx, startz = pos.x, pos.z + -- We will move out by one in every direction except -y + local endx, endy, endz = pos.x + 2, pos.y + 1, pos.z + 2 + -- Adjust for initial increment + pos.x = pos.x - 1 + + return function() + if pos.x < endx then + pos.x = pos.x + 1 + else + pos.x = startx + if pos.z < endz then + pos.z = pos.z + 1 + else + pos.z = startz + if pos.y < endy then + pos.y = pos.y + 1 + else + return nil + end + end + end + return pos + end +end + +-- This function does all the hard work. Recursively we dig the node at hand +-- if it is in the table and then search the surroundings for more stuff to dig. +local function recursive_dig(pos, remaining_charge) + if remaining_charge < chainsaw_charge_per_node then + return remaining_charge + end + local node = minetest.get_node(pos) + + if not timber_nodenames[node.name] then + return remaining_charge + end + + -- wood found - cut it + handle_drops(minetest.get_node_drops(node.name, "")) + minetest.remove_node(pos) + remaining_charge = remaining_charge - chainsaw_charge_per_node + + -- Check surroundings and run recursively if any charge left + for pos in iterSawTries(pos) do + if remaining_charge < chainsaw_charge_per_node then + break + end + if timber_nodenames[minetest.get_node(pos).name] then + remaining_charge = recursive_dig(pos, remaining_charge) + end + end + return remaining_charge +end + +-- Function to randomize positions for new node drops +local function get_drop_pos(pos) + local drop_pos = {} + + for i = 0, 8 do + -- Randomize position for a new drop + drop_pos.x = pos.x + math.random(-3, 3) + drop_pos.y = pos.y - 1 + drop_pos.z = pos.z + math.random(-3, 3) + + -- Move the randomized position upwards until + -- the node is air or unloaded. + for y = drop_pos.y, drop_pos.y + 5 do + drop_pos.y = y + local node = minetest.get_node_or_nil(drop_pos) + + if not node then + -- If the node is not loaded yet simply drop + -- the item at the original digging position. + return pos + elseif node.name == "air" then + -- Add variation to the entity drop position, + -- but don't let drops get too close to the edge + drop_pos.x = drop_pos.x + (math.random() * 0.8) - 0.5 + drop_pos.z = drop_pos.z + (math.random() * 0.8) - 0.5 + return drop_pos + end + end + end + + -- Return the original position if this takes too long + return pos +end + +-- Chainsaw entry point +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}) + + -- Now drop items for the player + for name, stack in pairs(produced) do + -- Drop stacks of stack max or less + local count, max = stack:get_count(), stack:get_stack_max() + stack:set_count(max) + while count > max do + minetest.add_item(get_drop_pos(pos), stack) + count = count - max + end + stack:set_count(count) + minetest.add_item(get_drop_pos(pos), stack) + end + + -- Clean up + produced = {} + + return remaining_charge +end + + +minetest.register_tool("technic:chainsaw", { + description = S("Chainsaw"), + inventory_image = "technic_chainsaw.png", + stack_max = 1, + wear_represents = "technic_RE_charge", + on_refill = technic.refill_RE_charge, + on_use = function(itemstack, user, pointed_thing) + if pointed_thing.type ~= "node" then + return itemstack + end + + local meta = minetest.deserialize(itemstack:get_metadata()) + if not meta or not meta.charge or + meta.charge < chainsaw_charge_per_node then + return + end + + local name = user:get_player_name() + if minetest.is_protected(pointed_thing.under, name) then + minetest.record_protection_violation(pointed_thing.under, name) + return + end + + -- Send current charge to digging function so that the + -- chainsaw will stop after digging a number of nodes + meta.charge = chainsaw_dig(pointed_thing.under, meta.charge) + + technic.set_RE_wear(itemstack, meta.charge, chainsaw_max_charge) + itemstack:set_metadata(minetest.serialize(meta)) + return itemstack + end, +}) + +minetest.register_craft({ + output = "technic:chainsaw", + recipe = { + {"technic:stainless_steel_ingot", "mesecons_button:button_off", "technic:battery"}, + {"technic:fine_copper_wire", "technic:motor", "technic:battery"}, + {"", "", "technic:stainless_steel_ingot"}, + } +}) + diff --git a/mods/technic-master/technic/tools/flashlight.lua b/mods/technic-master/technic/tools/flashlight.lua new file mode 100644 index 0000000..0d22f11 --- /dev/null +++ b/mods/technic-master/technic/tools/flashlight.lua @@ -0,0 +1,121 @@ +-- Original code comes from walkin_light mod by Echo +-- http://minetest.net/forum/viewtopic.php?id=2621 + +local flashlight_max_charge = 30000 + +local S = technic.getter + +technic.register_power_tool("technic:flashlight", flashlight_max_charge) + +minetest.register_alias("technic:light_off", "air") + +minetest.register_tool("technic:flashlight", { + description = S("Flashlight"), + inventory_image = "technic_flashlight.png", + stack_max = 1, + wear_represents = "technic_RE_charge", + on_refill = technic.refill_RE_charge, +}) + +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", ""} + } +}) + + +local player_positions = {} +local was_wielding = {} + +local function check_for_flashlight(player) + if player == nil then + return false + end + local inv = player:get_inventory() + local hotbar = inv:get_list("main") + for i = 1, 8 do + if hotbar[i]:get_name() == "technic:flashlight" then + local meta = minetest.deserialize(hotbar[i]:get_metadata()) + if meta and meta.charge and meta.charge >= 2 then + meta.charge = meta.charge - 2; + technic.set_RE_wear(hotbar[i], meta.charge, flashlight_max_charge) + hotbar[i]:set_metadata(minetest.serialize(meta)) + inv:set_stack("main", i, hotbar[i]) + return true + end + end + end + return false +end + +minetest.register_on_joinplayer(function(player) + local player_name = player:get_player_name() + local pos = player:getpos() + local rounded_pos = vector.round(pos) + rounded_pos.y = rounded_pos.y + 1 + player_positions[player_name] = rounded_pos + was_wielding[player_name] = true +end) + + +minetest.register_on_leaveplayer(function(player) + local player_name = player:get_player_name() + local pos = player_positions[player_name] + local nodename = minetest.get_node(pos).name + if nodename == "technic:light" then + minetest.remove_node(pos) + end + player_positions[player_name] = nil +end) + +minetest.register_globalstep(function(dtime) + for i, player in pairs(minetest.get_connected_players()) do + local player_name = player:get_player_name() + local flashlight_weared = check_for_flashlight(player) + local pos = player:getpos() + local rounded_pos = vector.round(pos) + rounded_pos.y = rounded_pos.y + 1 + local old_pos = player_positions[player_name] + local player_moved = old_pos and not vector.equals(old_pos, rounded_pos) + if not old_pos then + old_pos = rounded_pos + player_moved = true + end + + -- Remove light, flashlight weared out or was removed from hotbar + if was_wielding[player_name] and not flashlight_weared then + was_wielding[player_name] = false + local node = minetest.get_node_or_nil(old_pos) + if node and node.name == "technic:light" then + minetest.remove_node(old_pos) + end + 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"}) + end + local node = minetest.get_node_or_nil(old_pos) + if node and node.name == "technic:light" then + minetest.remove_node(old_pos) + end + player_positions[player_name] = rounded_pos + was_wielding[player_name] = true + end + end +end) + +minetest.register_node("technic:light", { + drawtype = "glasslike", + tile_images = {"technic_light.png"}, + paramtype = "light", + groups = {not_in_creative_inventory=1}, + drop = "", + walkable = false, + buildable_to = true, + sunlight_propagates = true, + light_source = LIGHT_MAX, + pointable = false, +}) diff --git a/mods/technic-master/technic/tools/init.lua b/mods/technic-master/technic/tools/init.lua new file mode 100644 index 0000000..b8d9127 --- /dev/null +++ b/mods/technic-master/technic/tools/init.lua @@ -0,0 +1,22 @@ +local path = technic.modpath.."/tools" + +if technic.config:get_bool("enable_mining_drill") then + dofile(path.."/mining_drill.lua") +end +if technic.config:get_bool("enable_mining_laser") then + dofile(path.."/mining_lasers.lua") +end +if technic.config:get_bool("enable_flashlight") then + dofile(path.."/flashlight.lua") +end +dofile(path.."/cans.lua") +dofile(path.."/chainsaw.lua") +dofile(path.."/tree_tap.lua") +dofile(path.."/sonic_screwdriver.lua") +dofile(path.."/prospector.lua") + +if minetest.get_modpath("screwdriver") then + -- compatibility alias + minetest.register_alias("technic:screwdriver", "screwdriver:screwdriver") +end + diff --git a/mods/technic-master/technic/tools/mining_drill.lua b/mods/technic-master/technic/tools/mining_drill.lua new file mode 100644 index 0000000..cd8d551 --- /dev/null +++ b/mods/technic-master/technic/tools/mining_drill.lua @@ -0,0 +1,413 @@ +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', + 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'}, + } +}) +minetest.register_craft({ + 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', ''}, + } +}) +minetest.register_craft({ + 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', ''}, + } +}) +for i = 1, 4 do + minetest.register_craft({ + 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', ''}, + } + }) +end + +local mining_drill_mode_text = { + {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) + if minetest.is_protected(pos, player:get_player_name()) then + minetest.record_protection_violation(pos, player:get_player_name()) + return + end + local node=minetest.env: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.env:remove_node(pos) return end + if node.name == "default:water_flowing" then minetest.env:remove_node(pos) return end + 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 + return 1 + end + if dir.z>0 then return 2 end + return 3 +end + +local function drill_dig_it2 (pos,player) + 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-2 + 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) + 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-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 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) + local mult + if mode == 1 then + mult = 1 + elseif mode <= 4 then + mult = 3 + else + mult = 9 + end + return power_usage_per_node[drill_type] * mult +end + +local function drill_dig_it(pos, player, mode) + if mode == 1 then + drill_dig_it0(pos, player) + end + + if mode == 2 then -- 3 deep + dir = drill_dig_it1(player) + if dir == 0 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + end + if dir==2 or dir==3 then -- z + drill_dig_it3(pos,player) + end + else + drill_dig_it4(pos,player) + end + end + + minetest.sound_play("mining_drill", {pos = pos, gain = 1.0, max_hear_distance = 10,}) +end + +local function pos_is_pointable(pos) + local node = minetest.env:get_node(pos) + local nodedef = minetest.registered_nodes[node.name] + 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 + end + 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 + 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]) + item["name"]="technic:mining_drill_mk2_"..mode + meta["mode"]=mode + item["metadata"]=minetest.serialize(meta) + itemstack:replace(item) + 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 + end + 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 + 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]) + item["name"]="technic:mining_drill_mk3_"..mode + meta["mode"]=mode + item["metadata"]=minetest.serialize(meta) + itemstack:replace(item) + return itemstack +end + + +local function mining_drill_mk2_handler(itemstack, user, pointed_thing) + local keys = user:get_player_control() + local player_name = user:get_player_name() + local meta = minetest.deserialize(itemstack:get_metadata()) + if not meta or not meta.mode or keys.sneak then + return mining_drill_mk2_setmode(user, itemstack) + end + if pointed_thing.type ~= "node" or not pos_is_pointable(pointed_thing.under) or not meta.charge then + return + end + local charge_to_take = cost_to_use(2, meta.mode) + if meta.charge >= charge_to_take then + local pos = minetest.get_pointed_thing_position(pointed_thing, above) + drill_dig_it(pos, user, meta.mode) + meta.charge = meta.charge - charge_to_take + itemstack:set_metadata(minetest.serialize(meta)) + technic.set_RE_wear(itemstack, meta.charge, max_charge[2]) + end + return itemstack +end + +local function mining_drill_mk3_handler(itemstack, user, pointed_thing) + local keys = user:get_player_control() + local player_name = user:get_player_name() + local meta = minetest.deserialize(itemstack:get_metadata()) + if not meta or not meta.mode or keys.sneak then + return mining_drill_mk3_setmode(user, itemstack) + end + if pointed_thing.type ~= "node" or not pos_is_pointable(pointed_thing.under) or not meta.charge then + return + end + local charge_to_take = cost_to_use(3, meta.mode) + if meta.charge >= charge_to_take then + local pos = minetest.get_pointed_thing_position(pointed_thing, above) + drill_dig_it(pos, user, meta.mode) + meta.charge = meta.charge - charge_to_take + itemstack:set_metadata(minetest.serialize(meta)) + technic.set_RE_wear(itemstack, meta.charge, max_charge[3]) + end + return itemstack +end + +technic.register_power_tool("technic:mining_drill", max_charge[1]) + +minetest.register_tool("technic:mining_drill", { + description = S("Mining Drill Mk%d"):format(1), + inventory_image = "technic_mining_drill.png", + stack_max = 1, + wear_represents = "technic_RE_charge", + on_refill = technic.refill_RE_charge, + on_use = function(itemstack, user, pointed_thing) + if pointed_thing.type ~= "node" or not pos_is_pointable(pointed_thing.under) then + return itemstack + end + local meta = minetest.deserialize(itemstack:get_metadata()) + if not meta or not meta.charge then + return + end + local charge_to_take = cost_to_use(1, 1) + if meta.charge >= charge_to_take then + local pos = minetest.get_pointed_thing_position(pointed_thing, above) + drill_dig_it(pos, user, 1) + meta.charge = meta.charge - charge_to_take + itemstack:set_metadata(minetest.serialize(meta)) + technic.set_RE_wear(itemstack, meta.charge, max_charge[1]) + end + return itemstack + end, +}) + +minetest.register_tool("technic:mining_drill_mk2", { + description = S("Mining Drill Mk%d"):format(2), + inventory_image = "technic_mining_drill_mk2.png", + wear_represents = "technic_RE_charge", + on_refill = technic.refill_RE_charge, + on_use = function(itemstack, user, pointed_thing) + mining_drill_mk2_handler(itemstack, user, pointed_thing) + return itemstack + end, +}) + +technic.register_power_tool("technic:mining_drill_mk2", max_charge[2]) + +for i = 1, 4 do + technic.register_power_tool("technic:mining_drill_mk2_"..i, max_charge[2]) + minetest.register_tool("technic:mining_drill_mk2_"..i, { + description = S("Mining Drill Mk%d Mode %d"):format(2, i), + inventory_image = "technic_mining_drill_mk2.png^technic_tool_mode"..i..".png", + wield_image = "technic_mining_drill_mk2.png", + wear_represents = "technic_RE_charge", + on_refill = technic.refill_RE_charge, + groups = {not_in_creative_inventory=1}, + on_use = function(itemstack, user, pointed_thing) + mining_drill_mk2_handler(itemstack, user, pointed_thing) + return itemstack + end, + }) +end + +minetest.register_tool("technic:mining_drill_mk3", { + description = S("Mining Drill Mk%d"):format(3), + inventory_image = "technic_mining_drill_mk3.png", + 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) + return itemstack + end, +}) + +technic.register_power_tool("technic:mining_drill_mk3", max_charge[3]) + +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), + inventory_image = "technic_mining_drill_mk3.png^technic_tool_mode"..i..".png", + wield_image = "technic_mining_drill_mk3.png", + wear_represents = "technic_RE_charge", + on_refill = technic.refill_RE_charge, + groups = {not_in_creative_inventory=1}, + on_use = function(itemstack, user, pointed_thing) + mining_drill_mk3_handler(itemstack,user,pointed_thing) + return itemstack + end, + }) +end diff --git a/mods/technic-master/technic/tools/mining_lasers.lua b/mods/technic-master/technic/tools/mining_lasers.lua new file mode 100644 index 0000000..a6c8682 --- /dev/null +++ b/mods/technic-master/technic/tools/mining_lasers.lua @@ -0,0 +1,190 @@ + +local r_corr = 0.25 -- Remove a bit more nodes (if shooting diagonal) to let it look like a hole (sth like antialiasing) + +local mining_lasers_list = { +-- {, , , }, + {"1", 7, 50000, 1000}, + {"2", 14, 200000, 2000}, + {"3", 21, 650000, 3000}, +} + +local f_1 = 0.5 - r_corr +local f_2 = 0.5 + r_corr + +local S = technic.getter + +minetest.register_craft({ + output = 'technic:laser_mk1', + recipe = { + {'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', + recipe = { + {'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', + recipe = { + {'default:diamond', 'technic:carbon_steel_ingot', 'technic:laser_mk2'}, + {'', 'technic:carbon_steel_ingot', 'technic:blue_energy_crystal'}, + {'', '', 'default:copper_ingot'}, + } +}) + + +local function get_used_dir(dir) + local abs_dir = {x = math.abs(dir.x), + y = math.abs(dir.y), + z = math.abs(dir.z)} + local dir_max = math.max(abs_dir.x, abs_dir.y, abs_dir.z) + if dir_max == abs_dir.x then + local tab = {"x", {x = 1, y = dir.y / dir.x, z = dir.z / dir.x}} + if dir.x >= 0 then + tab[3] = "+" + end + return tab + end + if dir_max == abs_dir.y then + local tab = {"y", {x = dir.x / dir.y, y = 1, z = dir.z / dir.y}} + if dir.y >= 0 then + tab[3] = "+" + end + return tab + end + local tab = {"z", {x = dir.x / dir.z, y = dir.y / dir.z, z = 1}} + if dir.z >= 0 then + tab[3] = "+" + end + return tab +end + +local function node_tab(z, d) + local n1 = math.floor(z * d + f_1) + local n2 = math.floor(z * d + f_2) + if n1 == n2 then + return {n1} + end + return {n1, n2} +end + +local function laser_node(pos, player) + local node = minetest.get_node(pos) + if node.name == "air" + or node.name == "ignore" + or node.name == "default:lava_source" + or node.name == "default:lava_flowing" then + return + end + if minetest.is_protected(pos, player:get_player_name()) then + minetest.record_protection_violation(pos, player:get_player_name()) + return + end + if node.name == "default:water_source" + or node.name == "default:water_flowing" then + minetest.remove_node(pos) + minetest.add_particle(pos, + {x=0, y=2, z=0}, + {x=0, y=-1, z=0}, + 1.5, + 8, + false, + "smoke_puff.png") + return + end + if player then + minetest.node_dig(pos, node, player) + end +end + +local function laser_nodes(pos, dir, player, range) + local t_dir = get_used_dir(dir) + local dir_typ = t_dir[1] + if t_dir[3] == "+" then + f_tab = {1, range} + else + f_tab = {-range, -1} + end + local d_ch = t_dir[2] + if dir_typ == "x" then + for d = f_tab[1],f_tab[2],1 do + local x = d + local ytab = node_tab(d_ch.y, d) + local ztab = node_tab(d_ch.z, d) + for _, y in pairs(ytab) do + for _, z in pairs(ztab) do + laser_node({x = pos.x + x, y = pos.y + y, z = pos.z + z}, player) + end + end + end + return + end + if dir_typ == "y" then + for d = f_tab[1], f_tab[2] do + local xtab = node_tab(d_ch.x, d) + local y = d + local ztab = node_tab(d_ch.z, d) + for _, x in pairs(xtab) do + for _, z in pairs(ztab) do + laser_node({x = pos.x + x, y = pos.y + y, z = pos.z + z}, player) + end + end + end + return + end + for d = f_tab[1], f_tab[2] do + local xtab = node_tab(d_ch.x, d) + local ytab = node_tab(d_ch.y, d) + local z = d + for _, x in pairs(xtab) do + for _, y in pairs(ytab) do + laser_node({x = pos.x + x, y = pos.y + y, z = pos.z + z}, player) + end + end + end +end + +local function laser_shoot(player, range, particle_texture, sound) + local playerpos = player:getpos() + local dir = player:get_look_dir() + + local startpos = {x = playerpos.x, y = playerpos.y + 1.6, z = playerpos.z} + local mult_dir = vector.multiply(dir, 50) + minetest.add_particle(startpos, dir, mult_dir, range / 11, 1, false, particle_texture) + laser_nodes(vector.round(startpos), dir, player, range) + minetest.sound_play(sound, {pos = playerpos, gain = 1.0, max_hear_distance = range}) +end + + +for _, m in pairs(mining_lasers_list) do + technic.register_power_tool("technic:laser_mk"..m[1], m[3]) + minetest.register_tool("technic:laser_mk"..m[1], { + description = S("Mining Laser Mk%d"):format(m[1]), + inventory_image = "technic_mining_laser_mk"..m[1]..".png", + stack_max = 1, + wear_represents = "technic_RE_charge", + on_refill = technic.refill_RE_charge, + on_use = function(itemstack, user) + local meta = minetest.deserialize(itemstack:get_metadata()) + if not meta or not meta.charge then + return + end + + -- If there's enough charge left, fire the laser + if meta.charge >= m[4] then + meta.charge = meta.charge - m[4] + laser_shoot(user, m[2], "technic_laser_beam_mk"..m[1]..".png", "technic_laser_mk"..m[1]) + technic.set_RE_wear(itemstack, meta.charge, m[3]) + itemstack:set_metadata(minetest.serialize(meta)) + end + return itemstack + end, + }) +end + diff --git a/mods/technic-master/technic/tools/prospector.lua b/mods/technic-master/technic/tools/prospector.lua new file mode 100644 index 0000000..d663bd2 --- /dev/null +++ b/mods/technic-master/technic/tools/prospector.lua @@ -0,0 +1,126 @@ +local S = technic.getter + +technic.register_power_tool("technic:prospector", 300000) + +local function get_metadata(toolstack) + local m = minetest.deserialize(toolstack:get_metadata()) + if not m then m = {} end + if not m.charge then m.charge = 0 end + if not m.target then m.target = "" end + if not m.look_depth then m.look_depth = 7 end + if not m.look_radius then m.look_radius = 1 end + return m +end + +minetest.register_tool("technic:prospector", { + description = S("Prospector"), + inventory_image = "technic_prospector.png", + wear_represents = "technic_RE_charge", + on_refill = technic.refill_RE_charge, + on_use = function(toolstack, user, pointed_thing) + if not user or not user:is_player() or user.is_fake_player then return end + if pointed_thing.type ~= "node" then return end + local toolmeta = get_metadata(toolstack) + local look_diameter = toolmeta.look_radius * 2 + 1 + local charge_to_take = toolmeta.look_depth * (toolmeta.look_depth + 1) * look_diameter * look_diameter + if toolmeta.charge < charge_to_take then return end + if toolmeta.target == "" then + minetest.chat_send_player(user:get_player_name(), "Right-click to set target block type") + return + end + toolmeta.charge = toolmeta.charge - charge_to_take + toolstack:set_metadata(minetest.serialize(toolmeta)) + technic.set_RE_wear(toolstack, toolmeta.charge, technic.power_tools[toolstack:get_name()]) + 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 found = false + 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 + end + if math.random() < 0.02 then found = not found end + minetest.chat_send_player(user:get_player_name(), minetest.registered_nodes[toolmeta.target].description.." is "..(found and "present" or "absent").." in "..look_diameter.."x"..look_diameter.."x"..toolmeta.look_depth.." region") + minetest.sound_play("technic_prospector_"..(found and "hit" or "miss"), { pos = vector.add(user:getpos(), { x = 0, y = 1, z = 0 }), gain = 1.0, max_hear_distance = 10 }) + return toolstack + end, + on_place = function(toolstack, user, pointed_thing) + if not user or not user:is_player() or user.is_fake_player then return end + local toolmeta = get_metadata(toolstack) + local pointed + if pointed_thing.type == "node" then + local pname = minetest.get_node(pointed_thing.under).name + local pdef = minetest.registered_nodes[pname] + if pdef and (pdef.groups.not_in_creative_inventory or 0) == 0 and pname ~= toolmeta.target then + pointed = pname + end + end + local look_diameter = toolmeta.look_radius * 2 + 1 + minetest.show_formspec(user:get_player_name(), "technic:prospector_control", + "size[7,8.5]".. + "item_image[0,0;1,1;"..toolstack:get_name().."]".. + "label[1,0;"..minetest.formspec_escape(toolstack:get_definition().description).."]".. + (toolmeta.target ~= "" and + "label[0,1.5;Current target:]".. + "label[0,2;"..minetest.formspec_escape(minetest.registered_nodes[toolmeta.target].description).."]".. + "item_image[0,2.5;1,1;"..toolmeta.target.."]" or + "label[0,1.5;No target set]").. + (pointed and + "label[3.5,1.5;May set new target:]".. + "label[3.5,2;"..minetest.formspec_escape(minetest.registered_nodes[pointed].description).."]".. + "item_image[3.5,2.5;1,1;"..pointed.."]".. + "button_exit[3.5,3.65;2,0.5;target_"..pointed..";Set target]" or + "label[3.5,1.5;No new target available]").. + "label[0,4.5;Region cross section:]".. + "label[0,5;"..look_diameter.."x"..look_diameter.."]".. + "label[3.5,4.5;Set region cross section:]".. + "button_exit[3.5,5.15;1,0.5;look_radius_0;1x1]".. + "button_exit[4.5,5.15;1,0.5;look_radius_1;3x3]".. + "button_exit[5.5,5.15;1,0.5;look_radius_3;7x7]".. + "label[0,6;Region depth:]".. + "label[0,6.5;"..toolmeta.look_depth.."]".. + "label[3.5,6;Set region depth:]".. + "button_exit[3.5,6.65;1,0.5;look_depth_7;7]".. + "button_exit[4.5,6.65;1,0.5;look_depth_14;14]".. + "button_exit[5.5,6.65;1,0.5;look_depth_21;21]".. + "label[0,7.5;Accuracy:]".. + "label[0,8;98%]") + return + end, +}) + +minetest.register_on_player_receive_fields(function(user, formname, fields) + if formname ~= "technic:prospector_control" then return false end + if not user or not user:is_player() or user.is_fake_player then return end + local toolstack = user:get_wielded_item() + if toolstack:get_name() ~= "technic:prospector" then return true end + local toolmeta = get_metadata(toolstack) + for field, value in pairs(fields) do + if field:sub(1, 7) == "target_" then + toolmeta.target = field:sub(8) + end + if field:sub(1, 12) == "look_radius_" then + toolmeta.look_radius = field:sub(13) + end + if field:sub(1, 11) == "look_depth_" then + toolmeta.look_depth = field:sub(12) + end + end + toolstack:set_metadata(minetest.serialize(toolmeta)) + user:set_wielded_item(toolstack) + return true +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", ""}, + } +}) diff --git a/mods/technic-master/technic/tools/sonic_screwdriver.lua b/mods/technic-master/technic/tools/sonic_screwdriver.lua new file mode 100644 index 0000000..7d8957f --- /dev/null +++ b/mods/technic-master/technic/tools/sonic_screwdriver.lua @@ -0,0 +1,73 @@ +local sonic_screwdriver_max_charge = 15000 + +local S = technic.getter + +technic.register_power_tool("technic:sonic_screwdriver", sonic_screwdriver_max_charge) + +minetest.register_tool("technic:sonic_screwdriver", { + description = S("Sonic Screwdriver"), + inventory_image = "technic_sonic_screwdriver.png", + wear_represents = "technic_RE_charge", + on_refill = technic.refill_RE_charge, + on_use = function(itemstack, user, pointed_thing) + -- Must be pointing to facedir applicable node + if pointed_thing.type ~= "node" then + return + end + local pos = pointed_thing.under + if minetest.is_protected(pos, user:get_player_name()) then + minetest.record_protection_violation(pos, user:get_player_name()) + return + end + local node = minetest.get_node(pos) + local node_name = node.name + if minetest.registered_nodes[node_name].paramtype2 ~= "facedir" and + minetest.registered_nodes[node_name].paramtype2 ~= "wallmounted" then + return + end + if node.param2 == nil then + return + end + local meta1 = minetest.deserialize(itemstack:get_metadata()) + if not meta1 or not meta1.charge then + return + end + if meta1.charge >= 100 then + minetest.sound_play("technic_sonic_screwdriver", + {pos = pos, gain = 0.3, max_hear_distance = 10}) + local p = node.param2 + if minetest.registered_nodes[node_name].paramtype2 == "facedir" then + p = p + 1 + if p == 4 then + p = 0 + end + else + p = p + 1 + if p == 6 then + p = 0 + end + end + if minetest.is_protected(pos, user:get_player_name()) then + minetest.record_protection_violation(pos, user:get_player_name()) + else + node.param2 = p + minetest.swap_node(pos, node) + + meta1.charge = meta1.charge - 100 + itemstack:set_metadata(minetest.serialize(meta1)) + technic.set_RE_wear(itemstack, meta1.charge, sonic_screwdriver_max_charge) + end + end + return itemstack + end, +}) + +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"} + } +}) + diff --git a/mods/technic-master/technic/tools/tree_tap.lua b/mods/technic-master/technic/tools/tree_tap.lua new file mode 100644 index 0000000..f4b12bf --- /dev/null +++ b/mods/technic-master/technic/tools/tree_tap.lua @@ -0,0 +1,74 @@ + +local S = technic.getter + +minetest.register_tool("technic:treetap", { + description = S("Tree Tap"), + inventory_image = "technic_tree_tap.png", + on_use = function(itemstack, user, pointed_thing) + if pointed_thing.type ~= "node" then + return + end + local inv = user:get_inventory() + if not inv:room_for_item("main", ItemStack("technic:raw_latex")) then + return + end + local pos = pointed_thing.under + if minetest.is_protected(pos, user:get_player_name()) then + minetest.record_protection_violation(pos, user:get_player_name()) + return + end + local node = minetest.get_node(pos) + local node_name = node.name + if node_name ~= "moretrees:rubber_tree_trunk" then + return + end + node.name = "moretrees:rubber_tree_trunk_empty" + inv:add_item("main", ItemStack("technic:raw_latex")) + minetest.swap_node(pos, node) + local item_wear = tonumber(itemstack:get_wear()) + item_wear = item_wear + 819 + if item_wear > 65535 then + itemstack:clear() + return itemstack + end + itemstack:set_wear(item_wear) + return itemstack + end, +}) + +minetest.register_craft({ + output = "technic:treetap", + recipe = { + {"pipeworks:tube_1", "group:wood", "default:stick"}, + {"", "default:stick", "default:stick"} + }, +}) + +minetest.register_craftitem("technic:raw_latex", { + description = S("Raw Latex"), + inventory_image = "technic_raw_latex.png", +}) + +minetest.register_craft({ + type = "cooking", + output = "technic:rubber", + recipe = "technic:raw_latex", +}) + +minetest.register_craftitem("technic:rubber", { + description = S("Rubber Fiber"), + inventory_image = "technic_rubber.png", +}) + +minetest.register_abm({ + 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 + node.name = "moretrees:rubber_tree_trunk" + minetest.swap_node(pos, node) + end + end +}) + diff --git a/mods/technic-master/technic_chests/README.md b/mods/technic-master/technic_chests/README.md new file mode 100644 index 0000000..8b31761 --- /dev/null +++ b/mods/technic-master/technic_chests/README.md @@ -0,0 +1,21 @@ +Technic chests +============== + +License +------- + +Copyright (C) 2012-2014 Maciej Kasatkin (RealBadAngel) + +Technic chests code is licensed under the GNU LGPLv2+. + +Texture licenses: + +VanessaE: (WTFPL) + * technic\_pencil\_icon.png + * technic\_checkmark\_icon.png + * technic\_chest\_overlay\_*.png + * technic\_*\_chest\_lock\_overlay.png + +RealBadAngel: (WTFPL) + * Everything else. + diff --git a/mods/technic-master/technic_chests/common.lua b/mods/technic-master/technic_chests/common.lua new file mode 100644 index 0000000..47054f5 --- /dev/null +++ b/mods/technic-master/technic_chests/common.lua @@ -0,0 +1,71 @@ + +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) + end, + can_insert = function(pos, node, stack, direction) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + return inv:room_for_item("main",stack) + end, + input_inventory = "main", + connect_sides = {left=1, right=1, front=1, back=1, top=1, bottom=1}, +} + +technic.chests.can_dig = function(pos, player) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + return inv:is_empty("main") +end + +local function inv_change(pos, count, player) + local meta = minetest.get_meta(pos) + if not has_locked_chest_privilege(meta, player) then + minetest.log("action", player:get_player_name().. + " tried to access a locked chest belonging to ".. + meta:get_string("owner").." at ".. + minetest.pos_to_string(pos)) + return 0 + end + return count +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 + +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)) +end + +function technic.chests.on_inv_put(pos, listname, index, stack, player) + minetest.log("action", player:get_player_name().. + " puts stuff in 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 stuff from chest at " + ..minetest.pos_to_string(pos)) +end + +function has_locked_chest_privilege(meta, player) + return player:get_player_name() == meta:get_string("owner") +end + diff --git a/mods/technic-master/technic_chests/copper_chest.lua b/mods/technic-master/technic_chests/copper_chest.lua new file mode 100644 index 0000000..d40284b --- /dev/null +++ b/mods/technic-master/technic_chests/copper_chest.lua @@ -0,0 +1,46 @@ +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'}, + } +}) + +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'}, + } +}) + +minetest.register_craft({ + output = 'technic:copper_locked_chest 1', + recipe = { + {'default:steel_ingot'}, + {'technic:copper_chest'}, + } +}) + +technic.chests:register("Copper", { + width = 12, + height = 5, + sort = true, + autosort = true, + infotext = false, + color = false, + locked = false, +}) + +technic.chests:register("Copper", { + width = 12, + height = 5, + sort = true, + autosort = true, + infotext = false, + color = false, + locked = true, +}) + diff --git a/mods/technic-master/technic_chests/depends.txt b/mods/technic-master/technic_chests/depends.txt new file mode 100644 index 0000000..4d04e9d --- /dev/null +++ b/mods/technic-master/technic_chests/depends.txt @@ -0,0 +1,3 @@ +default +pipeworks +intllib? diff --git a/mods/technic-master/technic_chests/gold_chest.lua b/mods/technic-master/technic_chests/gold_chest.lua new file mode 100644 index 0000000..161d8fe --- /dev/null +++ b/mods/technic-master/technic_chests/gold_chest.lua @@ -0,0 +1,47 @@ + +minetest.register_craft({ + output = 'technic:gold_chest', + recipe = { + {'default:gold_ingot','default:gold_ingot','default:gold_ingot'}, + {'default:gold_ingot','technic:silver_chest','default:gold_ingot'}, + {'default:gold_ingot','default:gold_ingot','default:gold_ingot'}, + } +}) + +minetest.register_craft({ + output = 'technic:gold_locked_chest', + recipe = { + {'default:gold_ingot','default:gold_ingot','default:gold_ingot'}, + {'default:gold_ingot','technic:silver_locked_chest','default:gold_ingot'}, + {'default:gold_ingot','default:gold_ingot','default:gold_ingot'}, + } +}) + +minetest.register_craft({ + output = 'technic:gold_locked_chest', + recipe = { + {'default:steel_ingot'}, + {'technic:gold_chest'}, + } +}) + +technic.chests:register("Gold", { + width = 15, + height = 6, + sort = true, + autosort = true, + infotext = true, + color = true, + locked = false, +}) + +technic.chests:register("Gold", { + width = 15, + height = 6, + sort = true, + autosort = true, + infotext = true, + color = true, + locked = true, +}) + diff --git a/mods/technic-master/technic_chests/init.lua b/mods/technic-master/technic_chests/init.lua new file mode 100644 index 0000000..5fa96ff --- /dev/null +++ b/mods/technic-master/technic_chests/init.lua @@ -0,0 +1,18 @@ +-- Minetest 0.4.6 mod: technic_chests +-- namespace: technic +-- (c) 2012-2013 by RealBadAngel + +modpath = minetest.get_modpath("technic_chests") + +technic = technic or {} +technic.chests = {} + +dofile(modpath.."/common.lua") +dofile(modpath.."/register.lua") +dofile(modpath.."/wooden_chest.lua") +dofile(modpath.."/iron_chest.lua") +dofile(modpath.."/copper_chest.lua") +dofile(modpath.."/silver_chest.lua") +dofile(modpath.."/gold_chest.lua") +dofile(modpath.."/mithril_chest.lua") + diff --git a/mods/technic-master/technic_chests/iron_chest.lua b/mods/technic-master/technic_chests/iron_chest.lua new file mode 100644 index 0000000..90434bb --- /dev/null +++ b/mods/technic-master/technic_chests/iron_chest.lua @@ -0,0 +1,53 @@ +local cast_iron_ingot +if minetest.get_modpath("technic_worldgen") then + cast_iron_ingot = "technic:cast_iron_ingot" +else + cast_iron_ingot = "default:steel_ingot" +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}, + } +}) + +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}, + } +}) + +minetest.register_craft({ + output = 'technic:iron_locked_chest 1', + recipe = { + {'default:steel_ingot'}, + {'technic:iron_chest'}, + } +}) + +technic.chests:register("Iron", { + width = 9, + height = 5, + sort = true, + autosort = false, + infotext = false, + color = false, + locked = false, +}) + +technic.chests:register("Iron", { + width = 9, + height = 5, + sort = true, + autosort = false, + infotext = false, + color = false, + locked = true, +}) + diff --git a/mods/technic-master/technic_chests/locale/de.txt b/mods/technic-master/technic_chests/locale/de.txt new file mode 100644 index 0000000..e22d2c2 --- /dev/null +++ b/mods/technic-master/technic_chests/locale/de.txt @@ -0,0 +1,41 @@ +# German Translation for technic_chests +# Deutsche Übersetzung von technic_chests +# by Xanthin + +%s Chest = %struhe +%s Locked Chest = Verschlossene %struhe +%s Locked Chest (owned by %s) = Verschlossene %struhe (gehoert %s) +Color Filter: %s = Farbfilter: %s +Edit chest description: = Bearbeite die Beschreibung + +# Colors +Black = Schwarz +Blue = Blau +Brown = Braun +Cyan = Tuerkis +Dark Green = Dunkelgruen +Dark Grey = Dunkelgrau +Green = Gruen +Grey = Grau +Magenta = Magenta +Orange = Orange +Pink = Rosa +Red = Rot +Violet = Violett +White = Weiss +Yellow = Gelb +None = Farblos + +# Materials +Copper = Kupfer +Gold = Gold +Iron = Eisen +Mithril = Mithril +Silver = Silber +Wooden = Holz + +# Sorting +Sort = +Auto-sort is %s = +Off = +On = diff --git a/mods/technic-master/technic_chests/locale/template.txt b/mods/technic-master/technic_chests/locale/template.txt new file mode 100644 index 0000000..4d422b2 --- /dev/null +++ b/mods/technic-master/technic_chests/locale/template.txt @@ -0,0 +1,39 @@ +# technic_chests translation template + +%s Chest = +%s Locked Chest = +%s Locked Chest (owned by %s) = +Color Filter: %s = +Edit chest description: = + +# Colors +Black = +Blue = +Brown = +Cyan = +Dark Green = +Dark Grey = +Green = +Grey = +Magenta = +Orange = +Pink = +Red = +Violet = +White = +Yellow = +None = + +# Materials +Copper = +Gold = +Iron = +Mithril = +Silver = +Wooden = + +# Sorting +Sort = +Auto-sort is %s = +Off = +On = diff --git a/mods/technic-master/technic_chests/mithril_chest.lua b/mods/technic-master/technic_chests/mithril_chest.lua new file mode 100644 index 0000000..bd2b981 --- /dev/null +++ b/mods/technic-master/technic_chests/mithril_chest.lua @@ -0,0 +1,46 @@ +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'}, + } +}) + +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'}, + } +}) + +minetest.register_craft({ + output = 'technic:mithril_locked_chest 1', + recipe = { + {'default:steel_ingot'}, + {'technic:mithril_chest'}, + } +}) + +technic.chests:register("Mithril", { + width = 15, + height = 6, + sort = true, + autosort = true, + infotext = false, + color = false, + locked = false, +}) + +technic.chests:register("Mithril", { + width = 15, + height = 6, + sort = true, + autosort = true, + infotext = false, + color = false, + locked = true, +}) + diff --git a/mods/technic-master/technic_chests/register.lua b/mods/technic-master/technic_chests/register.lua new file mode 100644 index 0000000..0344c2c --- /dev/null +++ b/mods/technic-master/technic_chests/register.lua @@ -0,0 +1,287 @@ + + +local S +if intllib then + S = intllib.Getter() +else + S = function(s) return s end +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")}, +} + + +local function colorid_to_postfix(id) + return chest_mark_colors[id] and "_"..chest_mark_colors[id][1] or "" +end + + +local function get_color_buttons(coleft, lotop) + local buttons_string = "" + for y = 0, 3 do + 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)..";]" + end + end + return buttons_string +end + + +local function check_color_buttons(pos, meta, chest_name, fields) + for i = 1, 16 do + if fields["color_button"..i] then + local node = minetest.get_node(pos) + node.name = chest_name..colorid_to_postfix(i) + minetest.swap_node(pos, node) + meta:set_string("color", i) + return + end + end +end + +local function set_formspec(pos, data, page) + local meta = minetest.get_meta(pos) + local node = minetest.get_node(pos) + 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")).."]" + 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.."]" + 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.."]" + end + end + if data.color then + local colorID = meta:get_int("color") + local colorName + if chest_mark_colors[colorID] then + colorName = chest_mark_colors[colorID][2] + else + colorName = S("None") + end + formspec = formspec.."label["..(data.coleft+0.2)..","..(data.lotop+3)..";"..S("Color Filter: %s"):format(colorName).."]" + end + meta:set_string("formspec", formspec) +end + +local function sort_inventory(inv) + local inlist = inv:get_list("main") + local typecnt = {} + local typekeys = {} + for _, st in ipairs(inlist) do + if not st:is_empty() then + local n = st:get_name() + local w = st:get_wear() + local m = st:get_metadata() + local k = string.format("%s %05d %s", n, w, m) + if not typecnt[k] then + typecnt[k] = { + name = n, + wear = w, + metadata = m, + stack_max = st:get_stack_max(), + count = 0, + } + table.insert(typekeys, k) + end + typecnt[k].count = typecnt[k].count + st:get_count() + end + end + table.sort(typekeys) + local outlist = {} + for _, k in ipairs(typekeys) do + local tc = typecnt[k] + while tc.count > 0 do + local c = math.min(tc.count, tc.stack_max) + table.insert(outlist, ItemStack({ + name = tc.name, + wear = tc.wear, + metadata = tc.metadata, + count = c, + })) + tc.count = tc.count - c + end + end + if #outlist > #inlist then return end + while #outlist < #inlist do + table.insert(outlist, ItemStack(nil)) + end + inv:set_list("main", outlist) +end + +local function get_receive_fields(name, data) + local lname = name:lower() + return function(pos, formname, fields, sender) + local meta = minetest.get_meta(pos) + local page = "main" + if fields.sort or (data.autosort and fields.quit and meta:get_int("autosort") == 1) then + sort_inventory(meta:get_inventory()) + end + if fields.edit_infotext then + page = "edit_infotext" + end + if fields.autosort_to_1 then meta:set_int("autosort", 1) end + if fields.autosort_to_0 then meta:set_int("autosort", 0) end + if fields.infotext_box then + meta:set_string("infotext", fields.infotext_box) + end + if data.color then + -- This sets the node + local nn = "technic:"..lname..(data.locked and "_locked" or "").."_chest" + check_color_buttons(pos, meta, nn, fields) + end + meta:get_inventory():set_size("main", data.width * data.height) + set_formspec(pos, data, page) + end +end + + +function technic.chests:definition(name, data) + local lname = name:lower() + name = S(name) + local d = {} + for k, v in pairs(data) do d[k] = v end + data = d + + data.lowidth = 8 + data.ovwidth = math.max(data.lowidth, data.width) + data.hileft = (data.ovwidth - data.width) / 2 + data.loleft = (data.ovwidth - data.lowidth) / 2 + if data.color then + if data.lowidth + 3 <= data.ovwidth then + data.coleft = data.ovwidth - 3 + if data.loleft + data.lowidth > data.coleft then + data.loleft = data.coleft - data.lowidth + end + else + data.loleft = 0 + data.coleft = data.lowidth + data.ovwidth = data.lowidth + 3 + end + end + data.lotop = data.height + 2 + data.ovheight = data.lotop + 4 + + local locked_after_place = nil + local front = {"technic_"..lname.."_chest_front.png"} + data.base_formspec = "invsize["..data.ovwidth..","..data.ovheight..";]".. + "label[0,0;"..S("%s Chest"):format(name).."]".. + "list[current_name;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)..";ui_form_bg.png]".. + "background["..data.hileft..",1;"..data.width..","..data.height..";technic_"..lname.."_chest_inventory.png]".. + "background["..data.loleft..","..data.lotop..";8,4;ui_main_inventory.png]" + if data.sort then + 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) + end + + if data.locked then + locked_after_place = function(pos, placer) + 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"))) + end + table.insert(front, "technic_"..lname.."_chest_lock_overlay.png") + end + + local desc + if data.locked then + desc = S("%s Locked Chest"):format(name) + else + desc = S("%s Chest"):format(name) + end + + local def = { + description = desc, + 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, "^")}, + paramtype2 = "facedir", + groups = self.groups, + tube = self.tube, + legacy_facedir_simple = true, + sounds = default.node_sound_wood_defaults(), + after_place_node = locked_after_place, + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("infotext", S("%s Chest"):format(name)) + set_formspec(pos, data, "main") + local inv = meta:get_inventory() + inv:set_size("main", data.width * data.height) + end, + can_dig = self.can_dig, + on_receive_fields = get_receive_fields(name, data), + on_metadata_inventory_move = self.on_inv_move, + on_metadata_inventory_put = self.on_inv_put, + on_metadata_inventory_take = self.on_inv_take, + } + if data.locked then + def.allow_metadata_inventory_move = self.inv_move + def.allow_metadata_inventory_put = self.inv_put + def.allow_metadata_inventory_take = self.inv_take + end + return def +end + +function technic.chests:register(name, data) + local def = technic.chests:definition(name, data) + + local nn = "technic:"..name:lower()..(data.locked and "_locked" or "").."_chest" + minetest.register_node(":"..nn, def) + + 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 + else + mk_front = function (overlay) return def.tiles[6].."^"..overlay end + end + for i = 1, 15 do + local postfix = colorid_to_postfix(i) + local colordef = {} + for k, v in pairs(def) do + colordef[k] = v + end + colordef.drop = nn + colordef.groups = self.groups_noinv + colordef.tiles = { def.tiles[1], def.tiles[2], def.tiles[3], def.tiles[4], def.tiles[5], mk_front("technic_chest_overlay"..postfix..".png") } + minetest.register_node(":"..nn..postfix, colordef) + end + end + +end + diff --git a/mods/technic-master/technic_chests/silver_chest.lua b/mods/technic-master/technic_chests/silver_chest.lua new file mode 100644 index 0000000..505156a --- /dev/null +++ b/mods/technic-master/technic_chests/silver_chest.lua @@ -0,0 +1,46 @@ +minetest.register_craft({ + 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'}, + } +}) + +minetest.register_craft({ + 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'}, + } +}) + +minetest.register_craft({ + output = 'technic:silver_locked_chest', + recipe = { + {'default:steel_ingot'}, + {'technic:silver_chest'}, + } +}) + +technic.chests:register("Silver", { + width = 12, + height = 6, + sort = true, + autosort = true, + infotext = true, + color = false, + locked = false, +}) + +technic.chests:register("Silver", { + width = 12, + height = 6, + sort = true, + autosort = true, + infotext = true, + color = false, + locked = true, +}) + diff --git a/mods/technic-master/technic_chests/textures/technic_checkmark_icon.png b/mods/technic-master/technic_chests/textures/technic_checkmark_icon.png new file mode 100644 index 0000000..369d294 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_checkmark_icon.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_chest_overlay_black.png b/mods/technic-master/technic_chests/textures/technic_chest_overlay_black.png new file mode 100644 index 0000000..fa25304 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_chest_overlay_black.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_chest_overlay_blue.png b/mods/technic-master/technic_chests/textures/technic_chest_overlay_blue.png new file mode 100644 index 0000000..512cd4f Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_chest_overlay_blue.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_chest_overlay_brown.png b/mods/technic-master/technic_chests/textures/technic_chest_overlay_brown.png new file mode 100644 index 0000000..64c1d55 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_chest_overlay_brown.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_chest_overlay_cyan.png b/mods/technic-master/technic_chests/textures/technic_chest_overlay_cyan.png new file mode 100644 index 0000000..46732f4 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_chest_overlay_cyan.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_chest_overlay_dark_green.png b/mods/technic-master/technic_chests/textures/technic_chest_overlay_dark_green.png new file mode 100644 index 0000000..941236b Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_chest_overlay_dark_green.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_chest_overlay_dark_grey.png b/mods/technic-master/technic_chests/textures/technic_chest_overlay_dark_grey.png new file mode 100644 index 0000000..e6b8f77 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_chest_overlay_dark_grey.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_chest_overlay_green.png b/mods/technic-master/technic_chests/textures/technic_chest_overlay_green.png new file mode 100644 index 0000000..4b9543f Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_chest_overlay_green.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_chest_overlay_grey.png b/mods/technic-master/technic_chests/textures/technic_chest_overlay_grey.png new file mode 100644 index 0000000..8a1c9f0 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_chest_overlay_grey.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_chest_overlay_magenta.png b/mods/technic-master/technic_chests/textures/technic_chest_overlay_magenta.png new file mode 100644 index 0000000..75b220d Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_chest_overlay_magenta.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_chest_overlay_orange.png b/mods/technic-master/technic_chests/textures/technic_chest_overlay_orange.png new file mode 100644 index 0000000..02c095d Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_chest_overlay_orange.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_chest_overlay_pink.png b/mods/technic-master/technic_chests/textures/technic_chest_overlay_pink.png new file mode 100644 index 0000000..0b6ccb4 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_chest_overlay_pink.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_chest_overlay_red.png b/mods/technic-master/technic_chests/textures/technic_chest_overlay_red.png new file mode 100644 index 0000000..4b44642 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_chest_overlay_red.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_chest_overlay_violet.png b/mods/technic-master/technic_chests/textures/technic_chest_overlay_violet.png new file mode 100644 index 0000000..89471f9 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_chest_overlay_violet.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_chest_overlay_white.png b/mods/technic-master/technic_chests/textures/technic_chest_overlay_white.png new file mode 100644 index 0000000..b49e253 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_chest_overlay_white.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_chest_overlay_yellow.png b/mods/technic-master/technic_chests/textures/technic_chest_overlay_yellow.png new file mode 100644 index 0000000..d563257 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_chest_overlay_yellow.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_colorbutton0.png b/mods/technic-master/technic_chests/textures/technic_colorbutton0.png new file mode 100644 index 0000000..35b7db2 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_colorbutton0.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_colorbutton1.png b/mods/technic-master/technic_chests/textures/technic_colorbutton1.png new file mode 100644 index 0000000..cbf095d Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_colorbutton1.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_colorbutton10.png b/mods/technic-master/technic_chests/textures/technic_colorbutton10.png new file mode 100644 index 0000000..8dfc5f0 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_colorbutton10.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_colorbutton11.png b/mods/technic-master/technic_chests/textures/technic_colorbutton11.png new file mode 100644 index 0000000..3b279e0 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_colorbutton11.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_colorbutton12.png b/mods/technic-master/technic_chests/textures/technic_colorbutton12.png new file mode 100644 index 0000000..a387b5f Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_colorbutton12.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_colorbutton13.png b/mods/technic-master/technic_chests/textures/technic_colorbutton13.png new file mode 100644 index 0000000..b1e7790 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_colorbutton13.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_colorbutton14.png b/mods/technic-master/technic_chests/textures/technic_colorbutton14.png new file mode 100644 index 0000000..c4ad486 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_colorbutton14.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_colorbutton15.png b/mods/technic-master/technic_chests/textures/technic_colorbutton15.png new file mode 100644 index 0000000..b7060d6 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_colorbutton15.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_colorbutton2.png b/mods/technic-master/technic_chests/textures/technic_colorbutton2.png new file mode 100644 index 0000000..caf1fc6 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_colorbutton2.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_colorbutton3.png b/mods/technic-master/technic_chests/textures/technic_colorbutton3.png new file mode 100644 index 0000000..6ac79a3 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_colorbutton3.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_colorbutton4.png b/mods/technic-master/technic_chests/textures/technic_colorbutton4.png new file mode 100644 index 0000000..dc43592 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_colorbutton4.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_colorbutton5.png b/mods/technic-master/technic_chests/textures/technic_colorbutton5.png new file mode 100644 index 0000000..98b8c67 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_colorbutton5.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_colorbutton6.png b/mods/technic-master/technic_chests/textures/technic_colorbutton6.png new file mode 100644 index 0000000..66478bc Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_colorbutton6.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_colorbutton7.png b/mods/technic-master/technic_chests/textures/technic_colorbutton7.png new file mode 100644 index 0000000..85f6b93 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_colorbutton7.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_colorbutton8.png b/mods/technic-master/technic_chests/textures/technic_colorbutton8.png new file mode 100644 index 0000000..868c35d Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_colorbutton8.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_colorbutton9.png b/mods/technic-master/technic_chests/textures/technic_colorbutton9.png new file mode 100644 index 0000000..50eac0b Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_colorbutton9.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_copper_chest_front.png b/mods/technic-master/technic_chests/textures/technic_copper_chest_front.png new file mode 100644 index 0000000..add51e8 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_copper_chest_front.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_copper_chest_inventory.png b/mods/technic-master/technic_chests/textures/technic_copper_chest_inventory.png new file mode 100644 index 0000000..70da510 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_copper_chest_inventory.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_copper_chest_lock_overlay.png b/mods/technic-master/technic_chests/textures/technic_copper_chest_lock_overlay.png new file mode 100644 index 0000000..49f7f2a Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_copper_chest_lock_overlay.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_copper_chest_side.png b/mods/technic-master/technic_chests/textures/technic_copper_chest_side.png new file mode 100644 index 0000000..2231cce Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_copper_chest_side.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_copper_chest_top.png b/mods/technic-master/technic_chests/textures/technic_copper_chest_top.png new file mode 100644 index 0000000..69f1078 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_copper_chest_top.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_gold_chest_front.png b/mods/technic-master/technic_chests/textures/technic_gold_chest_front.png new file mode 100644 index 0000000..27036d7 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_gold_chest_front.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_gold_chest_inventory.png b/mods/technic-master/technic_chests/textures/technic_gold_chest_inventory.png new file mode 100644 index 0000000..d4aa8b3 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_gold_chest_inventory.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_gold_chest_lock_overlay.png b/mods/technic-master/technic_chests/textures/technic_gold_chest_lock_overlay.png new file mode 100644 index 0000000..51dea71 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_gold_chest_lock_overlay.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_gold_chest_side.png b/mods/technic-master/technic_chests/textures/technic_gold_chest_side.png new file mode 100644 index 0000000..9a0de39 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_gold_chest_side.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_gold_chest_top.png b/mods/technic-master/technic_chests/textures/technic_gold_chest_top.png new file mode 100644 index 0000000..abfc081 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_gold_chest_top.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_iron_chest_front.png b/mods/technic-master/technic_chests/textures/technic_iron_chest_front.png new file mode 100644 index 0000000..8c00473 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_iron_chest_front.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_iron_chest_inventory.png b/mods/technic-master/technic_chests/textures/technic_iron_chest_inventory.png new file mode 100644 index 0000000..a33967b Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_iron_chest_inventory.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_iron_chest_lock_overlay.png b/mods/technic-master/technic_chests/textures/technic_iron_chest_lock_overlay.png new file mode 100644 index 0000000..1750b82 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_iron_chest_lock_overlay.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_iron_chest_side.png b/mods/technic-master/technic_chests/textures/technic_iron_chest_side.png new file mode 100644 index 0000000..7233688 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_iron_chest_side.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_iron_chest_top.png b/mods/technic-master/technic_chests/textures/technic_iron_chest_top.png new file mode 100644 index 0000000..48d2437 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_iron_chest_top.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_mithril_chest_front.png b/mods/technic-master/technic_chests/textures/technic_mithril_chest_front.png new file mode 100644 index 0000000..f0e0c23 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_mithril_chest_front.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_mithril_chest_inventory.png b/mods/technic-master/technic_chests/textures/technic_mithril_chest_inventory.png new file mode 100644 index 0000000..d4aa8b3 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_mithril_chest_inventory.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_mithril_chest_lock_overlay.png b/mods/technic-master/technic_chests/textures/technic_mithril_chest_lock_overlay.png new file mode 100644 index 0000000..d227c51 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_mithril_chest_lock_overlay.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_mithril_chest_side.png b/mods/technic-master/technic_chests/textures/technic_mithril_chest_side.png new file mode 100644 index 0000000..1c2c3a7 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_mithril_chest_side.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_mithril_chest_top.png b/mods/technic-master/technic_chests/textures/technic_mithril_chest_top.png new file mode 100644 index 0000000..e196baf Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_mithril_chest_top.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_pencil_icon.png b/mods/technic-master/technic_chests/textures/technic_pencil_icon.png new file mode 100644 index 0000000..8079ede Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_pencil_icon.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_silver_chest_front.png b/mods/technic-master/technic_chests/textures/technic_silver_chest_front.png new file mode 100644 index 0000000..5ae5831 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_silver_chest_front.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_silver_chest_inventory.png b/mods/technic-master/technic_chests/textures/technic_silver_chest_inventory.png new file mode 100644 index 0000000..b2fe835 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_silver_chest_inventory.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_silver_chest_lock_overlay.png b/mods/technic-master/technic_chests/textures/technic_silver_chest_lock_overlay.png new file mode 100644 index 0000000..cb1bdb0 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_silver_chest_lock_overlay.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_silver_chest_side.png b/mods/technic-master/technic_chests/textures/technic_silver_chest_side.png new file mode 100644 index 0000000..4b4ce54 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_silver_chest_side.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_silver_chest_top.png b/mods/technic-master/technic_chests/textures/technic_silver_chest_top.png new file mode 100644 index 0000000..79196d6 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_silver_chest_top.png differ diff --git a/mods/technic-master/technic_chests/textures/technic_wooden_chest_inventory.png b/mods/technic-master/technic_chests/textures/technic_wooden_chest_inventory.png new file mode 100644 index 0000000..5ffbc12 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/technic_wooden_chest_inventory.png differ diff --git a/mods/technic-master/technic_chests/textures/x32/technic_copper_chest_front.png b/mods/technic-master/technic_chests/textures/x32/technic_copper_chest_front.png new file mode 100644 index 0000000..1769435 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/x32/technic_copper_chest_front.png differ diff --git a/mods/technic-master/technic_chests/textures/x32/technic_copper_chest_side.png b/mods/technic-master/technic_chests/textures/x32/technic_copper_chest_side.png new file mode 100644 index 0000000..2c7943f Binary files /dev/null and b/mods/technic-master/technic_chests/textures/x32/technic_copper_chest_side.png differ diff --git a/mods/technic-master/technic_chests/textures/x32/technic_copper_chest_top.png b/mods/technic-master/technic_chests/textures/x32/technic_copper_chest_top.png new file mode 100644 index 0000000..2ab8104 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/x32/technic_copper_chest_top.png differ diff --git a/mods/technic-master/technic_chests/textures/x32/technic_gold_chest_front.png b/mods/technic-master/technic_chests/textures/x32/technic_gold_chest_front.png new file mode 100644 index 0000000..9bc9615 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/x32/technic_gold_chest_front.png differ diff --git a/mods/technic-master/technic_chests/textures/x32/technic_gold_chest_side.png b/mods/technic-master/technic_chests/textures/x32/technic_gold_chest_side.png new file mode 100644 index 0000000..5d5ad0f Binary files /dev/null and b/mods/technic-master/technic_chests/textures/x32/technic_gold_chest_side.png differ diff --git a/mods/technic-master/technic_chests/textures/x32/technic_gold_chest_top.png b/mods/technic-master/technic_chests/textures/x32/technic_gold_chest_top.png new file mode 100644 index 0000000..f9c8fec Binary files /dev/null and b/mods/technic-master/technic_chests/textures/x32/technic_gold_chest_top.png differ diff --git a/mods/technic-master/technic_chests/textures/x32/technic_iron_chest_front.png b/mods/technic-master/technic_chests/textures/x32/technic_iron_chest_front.png new file mode 100644 index 0000000..79d5b49 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/x32/technic_iron_chest_front.png differ diff --git a/mods/technic-master/technic_chests/textures/x32/technic_iron_chest_side.png b/mods/technic-master/technic_chests/textures/x32/technic_iron_chest_side.png new file mode 100644 index 0000000..e12daa5 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/x32/technic_iron_chest_side.png differ diff --git a/mods/technic-master/technic_chests/textures/x32/technic_iron_chest_top.png b/mods/technic-master/technic_chests/textures/x32/technic_iron_chest_top.png new file mode 100644 index 0000000..da1ab7b Binary files /dev/null and b/mods/technic-master/technic_chests/textures/x32/technic_iron_chest_top.png differ diff --git a/mods/technic-master/technic_chests/textures/x32/technic_mithril_chest_front.png b/mods/technic-master/technic_chests/textures/x32/technic_mithril_chest_front.png new file mode 100644 index 0000000..9f7ca7e Binary files /dev/null and b/mods/technic-master/technic_chests/textures/x32/technic_mithril_chest_front.png differ diff --git a/mods/technic-master/technic_chests/textures/x32/technic_mithril_chest_side.png b/mods/technic-master/technic_chests/textures/x32/technic_mithril_chest_side.png new file mode 100644 index 0000000..0763511 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/x32/technic_mithril_chest_side.png differ diff --git a/mods/technic-master/technic_chests/textures/x32/technic_mithril_chest_top.png b/mods/technic-master/technic_chests/textures/x32/technic_mithril_chest_top.png new file mode 100644 index 0000000..2429576 Binary files /dev/null and b/mods/technic-master/technic_chests/textures/x32/technic_mithril_chest_top.png differ diff --git a/mods/technic-master/technic_chests/textures/x32/technic_silver_chest_front.png b/mods/technic-master/technic_chests/textures/x32/technic_silver_chest_front.png new file mode 100644 index 0000000..fe5ce2c Binary files /dev/null and b/mods/technic-master/technic_chests/textures/x32/technic_silver_chest_front.png differ diff --git a/mods/technic-master/technic_chests/textures/x32/technic_silver_chest_side.png b/mods/technic-master/technic_chests/textures/x32/technic_silver_chest_side.png new file mode 100644 index 0000000..3a2ed4a Binary files /dev/null and b/mods/technic-master/technic_chests/textures/x32/technic_silver_chest_side.png differ diff --git a/mods/technic-master/technic_chests/textures/x32/technic_silver_chest_top.png b/mods/technic-master/technic_chests/textures/x32/technic_silver_chest_top.png new file mode 100644 index 0000000..353a11c Binary files /dev/null and b/mods/technic-master/technic_chests/textures/x32/technic_silver_chest_top.png differ diff --git a/mods/technic-master/technic_chests/wooden_chest.lua b/mods/technic-master/technic_chests/wooden_chest.lua new file mode 100644 index 0000000..0fad12c --- /dev/null +++ b/mods/technic-master/technic_chests/wooden_chest.lua @@ -0,0 +1,51 @@ +local udef = technic.chests:definition("Wooden", { + width = 8, + height = 4, + sort = false, + autosort = false, + infotext = false, + color = false, + locked = false, +}) +local uudef = { + groups = udef.groups, + tube = udef.tube, + on_construct = udef.on_construct, + can_dig = udef.can_dig, + on_receive_fields = udef.on_receive_fields, + on_metadata_inventory_move = udef.on_metadata_inventory_move, + on_metadata_inventory_put = udef.on_metadata_inventory_put, + on_metadata_inventory_take = udef.on_metadata_inventory_take, +} +if minetest.registered_nodes["default:chest"].description == "Chest" then + uudef.description = udef.description +end +minetest.override_item("default:chest", uudef) + +local ldef = technic.chests:definition("Wooden", { + width = 8, + height = 4, + sort = false, + autosort = false, + infotext = false, + color = false, + locked = true, +}) +local lldef = { + groups = ldef.groups, + tube = ldef.tube, + after_place_node = ldef.after_place_node, + on_construct = ldef.on_construct, + can_dig = ldef.can_dig, + on_receive_fields = ldef.on_receive_fields, + allow_metadata_inventory_move = ldef.allow_metadata_inventory_move, + allow_metadata_inventory_put = ldef.allow_metadata_inventory_put, + allow_metadata_inventory_take = ldef.allow_metadata_inventory_take, + on_metadata_inventory_move = ldef.on_metadata_inventory_move, + on_metadata_inventory_put = ldef.on_metadata_inventory_put, + on_metadata_inventory_take = ldef.on_metadata_inventory_take, +} +if minetest.registered_nodes["default:chest_locked"].description == "Locked Chest" then + lldef.description = ldef.description +end +minetest.override_item("default:chest_locked", lldef) diff --git a/mods/technic-master/technic_worldgen/config.lua b/mods/technic-master/technic_worldgen/config.lua new file mode 100644 index 0000000..4ac748c --- /dev/null +++ b/mods/technic-master/technic_worldgen/config.lua @@ -0,0 +1,15 @@ +technic.config = technic.config or Settings(minetest.get_worldpath().."/technic.conf") + +local conf_table = technic.config:to_table() + +local defaults = { + enable_granite_generation = "true", + enable_marble_generation = "true", + enable_rubber_tree_generation = "true", +} + +for k, v in pairs(defaults) do + if conf_table[k] == nil then + technic.config:set(k, v) + end +end diff --git a/mods/technic-master/technic_worldgen/crafts.lua b/mods/technic-master/technic_worldgen/crafts.lua new file mode 100644 index 0000000..3965258 --- /dev/null +++ b/mods/technic-master/technic_worldgen/crafts.lua @@ -0,0 +1,179 @@ + +local S = technic.worldgen.gettext + +minetest.register_craftitem(":technic:uranium_lump", { + description = S("Uranium Lump"), + inventory_image = "technic_uranium_lump.png", + on_place_on_ground = minetest.craftitem_place_item, +}) +minetest.register_alias("technic:uranium", "technic:uranium_lump") + +minetest.register_craftitem(":technic:uranium_ingot", { + description = S("Uranium Ingot"), + inventory_image = "technic_uranium_ingot.png", + on_place_on_ground = minetest.craftitem_place_item, + groups = {uranium_ingot=1}, +}) + +minetest.register_craftitem(":technic:chromium_lump", { + description = S("Chromium Lump"), + inventory_image = "technic_chromium_lump.png", + on_place_on_ground = minetest.craftitem_place_item, +}) + +minetest.register_craftitem(":technic:chromium_ingot", { + description = S("Chromium Ingot"), + inventory_image = "technic_chromium_ingot.png", + on_place_on_ground = minetest.craftitem_place_item, +}) + +minetest.register_craftitem(":technic:zinc_lump", { + description = S("Zinc Lump"), + inventory_image = "technic_zinc_lump.png", +}) + +minetest.register_craftitem(":technic:zinc_ingot", { + description = S("Zinc Ingot"), + inventory_image = "technic_zinc_ingot.png", +}) + +minetest.register_craftitem(":technic:brass_ingot", { + description = S("Brass Ingot"), + inventory_image = "technic_brass_ingot.png", +}) + +minetest.register_alias("technic:wrought_iron_ingot", "default:steel_ingot") + +minetest.override_item("default:steel_ingot", { + description = S("Wrought Iron Ingot"), + inventory_image = "technic_wrought_iron_ingot.png", +}) + +minetest.register_craftitem(":technic:cast_iron_ingot", { + description = S("Cast Iron Ingot"), + inventory_image = "technic_cast_iron_ingot.png", +}) + +minetest.register_craftitem(":technic:carbon_steel_ingot", { + description = S("Carbon Steel Ingot"), + inventory_image = "technic_carbon_steel_ingot.png", +}) + +minetest.register_craftitem(":technic:stainless_steel_ingot", { + description = S("Stainless Steel Ingot"), + inventory_image = "technic_stainless_steel_ingot.png", +}) + +local function register_block(block, ingot) + minetest.register_craft({ + output = block, + recipe = { + {ingot, ingot, ingot}, + {ingot, ingot, ingot}, + {ingot, ingot, ingot}, + } + }) + + minetest.register_craft({ + output = ingot.." 9", + recipe = { + {block} + } + }) +end + +register_block("technic:uranium_block", "technic:uranium_ingot") +register_block("technic:chromium_block", "technic:chromium_ingot") +register_block("technic:zinc_block", "technic:zinc_ingot") +register_block("technic:brass_block", "technic:brass_ingot") +register_block("technic:cast_iron_block", "technic:cast_iron_ingot") +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', + recipe = "technic:zinc_lump", + output = "technic:zinc_ingot", +}) + +minetest.register_craft({ + type = 'cooking', + recipe = "technic:chromium_lump", + output = "technic:chromium_ingot", +}) + +minetest.register_craft({ + type = 'cooking', + recipe = "technic:uranium_lump", + output = "technic:uranium_ingot", +}) + +minetest.register_craft({ + type = 'cooking', + recipe = minetest.registered_aliases["technic:wrought_iron_ingot"], + output = "technic:cast_iron_ingot", +}) + +minetest.register_craft({ + type = 'cooking', + recipe = "technic:cast_iron_ingot", + cooktime = 2, + output = "technic:wrought_iron_ingot", +}) + +minetest.register_craft({ + type = 'cooking', + recipe = "technic:carbon_steel_ingot", + cooktime = 2, + output = "technic:wrought_iron_ingot", +}) + +local function for_each_registered_item(action) + local already_reg = {} + for k, _ in pairs(minetest.registered_items) do + table.insert(already_reg, k) + end + local really_register_craftitem = minetest.register_craftitem + minetest.register_craftitem = function(name, def) + really_register_craftitem(name, def) + action(string.gsub(name, "^:", "")) + end + local really_register_tool = minetest.register_tool + minetest.register_tool = function(name, def) + really_register_tool(name, def) + action(string.gsub(name, "^:", "")) + end + local really_register_node = minetest.register_node + minetest.register_node = function(name, def) + really_register_node(name, def) + action(string.gsub(name, "^:", "")) + end + for _, name in ipairs(already_reg) do + action(name) + end +end + +local steel_to_iron = {} +for _, i in ipairs({ + "default:axe_steel", + "default:pick_steel", + "default:shovel_steel", + "default:sword_steel", + "doors:door_steel", + "farming:hoe_steel", + "glooptest:hammer_steel", + "glooptest:handsaw_steel", + "glooptest:reinforced_crystal_glass", + "mesecons_doors:op_door_steel", + "mesecons_doors:sig_door_steel", + "vessels:steel_bottle", +}) do + steel_to_iron[i] = true +end + +for_each_registered_item(function(item_name) + local item_def = minetest.registered_items[item_name] + if steel_to_iron[item_name] and string.find(item_def.description, "Steel") then + minetest.override_item(item_name, { description = string.gsub(item_def.description, "Steel", S("Iron")) }) + end +end) diff --git a/mods/technic-master/technic_worldgen/depends.txt b/mods/technic-master/technic_worldgen/depends.txt new file mode 100644 index 0000000..ac858d0 --- /dev/null +++ b/mods/technic-master/technic_worldgen/depends.txt @@ -0,0 +1,3 @@ +default +intllib? +mg? diff --git a/mods/technic-master/technic_worldgen/init.lua b/mods/technic-master/technic_worldgen/init.lua new file mode 100644 index 0000000..73e9fc7 --- /dev/null +++ b/mods/technic-master/technic_worldgen/init.lua @@ -0,0 +1,29 @@ +local modpath = minetest.get_modpath("technic_worldgen") + +technic = technic or {} +technic.worldgen = {} +if intllib then + technic.worldgen.gettext = intllib.Getter() +else + technic.worldgen.gettext = function(s) return s end +end + +dofile(modpath.."/config.lua") +dofile(modpath.."/nodes.lua") +dofile(modpath.."/oregen.lua") +dofile(modpath.."/crafts.lua") + +-- Rubber trees, moretrees also supplies these +if not minetest.get_modpath("moretrees") then + dofile(modpath.."/rubber.lua") +else + -- older versions of technic provided rubber trees regardless + minetest.register_alias("technic:rubber_sapling", "moretrees:rubber_tree_sapling") + minetest.register_alias("technic:rubber_tree_empty", "moretrees:rubber_tree_trunk_empty") +end + +-- mg suppport +if minetest.get_modpath("mg") then + dofile(modpath.."/mg.lua") +end + diff --git a/mods/technic-master/technic_worldgen/locale/de.txt b/mods/technic-master/technic_worldgen/locale/de.txt new file mode 100644 index 0000000..401c94c --- /dev/null +++ b/mods/technic-master/technic_worldgen/locale/de.txt @@ -0,0 +1,39 @@ +# German Translation for technic_worldgen +# Deutsche Übersetzung von technic_worldgen +# by Xanthin + +## crafts.lua +Uranium Lump = Uranklumpen +Uranium Ingot = Uranbarren +Chromium Lump = Chromklumpen +Chromium Ingot = Chrombarren +Zinc Lump = Zinkklumpen +Zinc Ingot = Zinkbarren +Brass Ingot = Messingbarren +Wrought Iron Ingot = Schmiedeeisenbarren +Cast Iron Ingot = Gusseisenbarren +Carbon Steel Ingot = Kohlenstoffstahlbarren +Stainless Steel Ingot = Edelstahlbarren +Iron = Eisen + +## nodes.lua +Uranium Ore = Uranerz +Chromium Ore = Chromerz +Zinc Ore = Zinkerz +Granite = Granit +Marble = Marmor +Marble Bricks = Marmorziegel +Uranium Block = Uranblock +Chromium Block = Chromblock +Zinc Block = Zinkblock +Wrought Iron Block = Schmiedeeisenblock +Cast Iron Block = Gusseisenblock +Carbon Steel Block = Kohlenstoffstahlblock +Stainless Steel Block = Edelstahlblock +Brass Block = Messingblock +Wrought Iron = Schmiedeeisen + +## rubber.lua +Rubber Tree Sapling = Gummibaumsetzling +Rubber Tree = Gummibaum + diff --git a/mods/technic-master/technic_worldgen/locale/template.txt b/mods/technic-master/technic_worldgen/locale/template.txt new file mode 100644 index 0000000..594e0ce --- /dev/null +++ b/mods/technic-master/technic_worldgen/locale/template.txt @@ -0,0 +1,37 @@ +# template.txt +# technic_worldgen translation template + +###crafts.lua +Uranium Lump = +Uranium Ingot = +Chromium Lump = +Chromium Ingot = +Zinc Lump = +Zinc Ingot = +Brass Ingot = +Wrought Iron Ingot = +Cast Iron Ingot = +Carbon Steel Ingot = +Stainless Steel Ingot = +Iron = + +###nodes.lua +Uranium Ore = +Chromium Ore = +Zinc Ore = +Granite = +Marble = +Marble Bricks = +Uranium Block = +Chromium Block = +Zinc Block = +Wrought Iron Block = +Cast Iron Block = +Carbon Steel Block = +Stainless Steel Block = +Brass Block = +Wrought Iron = + +###rubber.lua +Rubber Tree Sapling = +Rubber Tree = diff --git a/mods/technic-master/technic_worldgen/mg.lua b/mods/technic-master/technic_worldgen/mg.lua new file mode 100644 index 0000000..d511277 --- /dev/null +++ b/mods/technic-master/technic_worldgen/mg.lua @@ -0,0 +1,75 @@ +mg.register_ore({ + name = "technic:mineral_uranium", + wherein = "default:stone", + seeddiff = 11, + maxvdistance = 10.5, + maxheight = -80, + minheight = -300, + sizen = 20, + sizedev = 10, + seglenghtn = 3, + seglenghtdev = 1, + segincln = 0.4, + segincldev = 0.6, + turnangle = 57, + numperblock = 1, + fork_chance = 0 +}) + +mg.register_ore({ + name = "technic:mineral_chromium", + wherein = "default:stone", + seeddiff = 12, + maxvdistance = 10.5, + maxheight = -100, + sizen = 50, + sizedev = 20, + seglenghtn = 8, + seglenghtdev = 3, + segincln = 0, + segincldev = 0.6, + turnangle = 57, + forkturnangle = 57, + numperblock = 2 +}) + +mg.register_ore({ + name = "technic:mineral_zinc", + wherein = "default:stone", + seeddiff = 13, + maxvdistance = 10.5, + maxheight = 2, + seglenghtn = 15, + seglenghtdev = 6, + segincln = 0, + segincldev = 0.6, + turnangle = 57, + forkturnangle = 57, + numperblock = 2 +}) + +if technic.config:get_bool("enable_granite_generation") then + mg.register_ore_sheet({ + name = "technic:granite", + wherein = "default:stone", + height_min = -31000, + height_max = -150, + 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} + }) +end + +if technic.config:get_bool("enable_marble_generation") then + mg.register_ore_sheet({ + name = "technic:marble", + wherein = "default:stone", + height_min = -31000, + height_max = -50, + 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} + }) +end diff --git a/mods/technic-master/technic_worldgen/nodes.lua b/mods/technic-master/technic_worldgen/nodes.lua new file mode 100644 index 0000000..e4774ce --- /dev/null +++ b/mods/technic-master/technic_worldgen/nodes.lua @@ -0,0 +1,163 @@ + +local S = technic.worldgen.gettext + +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}, + sounds = default.node_sound_stone_defaults(), + drop = 'craft "technic:uranium_lump" 1', +}) + +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}, + sounds = default.node_sound_stone_defaults(), + drop = 'craft "technic:chromium_lump" 1', +}) + +minetest.register_node( ":technic:mineral_zinc", { + description = S("Zinc Ore"), + tile_images = { "default_stone.png^technic_mineral_zinc.png" }, + is_ground_content = true, + groups = {cracky=3}, + sounds = default.node_sound_stone_defaults(), + drop = 'craft "technic:zinc_lump" 1', +}) + +minetest.register_node( ":technic:granite", { + description = S("Granite"), + tiles = { "technic_granite.png" }, + is_ground_content = true, + groups = {cracky=1}, + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_node( ":technic:marble", { + description = S("Marble"), + tiles = { "technic_marble.png" }, + is_ground_content = true, + groups = {cracky=3}, + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_node( ":technic:marble_bricks", { + description = S("Marble Bricks"), + tiles = { "technic_marble_bricks.png" }, + is_ground_content = true, + groups = {cracky=3}, + sounds = default.node_sound_stone_defaults(), +}) + +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=3}, + sounds = default.node_sound_stone_defaults() +}) + +minetest.register_node(":technic:chromium_block", { + description = S("Chromium Block"), + tiles = { "technic_chromium_block.png" }, + is_ground_content = true, + groups = {cracky=1, level=2}, + sounds = default.node_sound_stone_defaults() +}) + +minetest.register_node(":technic:zinc_block", { + description = S("Zinc Block"), + tiles = { "technic_zinc_block.png" }, + is_ground_content = true, + groups = {cracky=1, level=2}, + sounds = default.node_sound_stone_defaults() +}) + +minetest.register_alias("technic:wrought_iron_block", "default:steelblock") + +minetest.override_item("default:steelblock", { + description = S("Wrought Iron Block"), + tiles = { "technic_wrought_iron_block.png" }, +}) + +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}, + sounds = default.node_sound_stone_defaults() +}) + +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}, + sounds = default.node_sound_stone_defaults() +}) + +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}, + sounds = default.node_sound_stone_defaults() +}) + +minetest.register_node(":technic:brass_block", { + description = S("Brass Block"), + tiles = { "technic_brass_block.png" }, + is_ground_content = true, + 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'} + } +}) + +minetest.register_alias("technic:diamond_block", "default:diamondblock") +minetest.register_alias("technic:diamond", "default:diamond") +minetest.register_alias("technic:mineral_diamond", "default:stone_with_diamond") + +local function for_each_registered_node(action) + local already_reg = {} + for k, _ in pairs(minetest.registered_nodes) do + table.insert(already_reg, k) + end + local really_register_node = minetest.register_node + minetest.register_node = function(name, def) + really_register_node(name, def) + action(string.gsub(name, "^:", "")) + end + for _, name in ipairs(already_reg) do + action(name) + end +end + +for_each_registered_node(function(node_name) + local node_def = minetest.registered_nodes[node_name] + if node_name ~= "default:steelblock" and string.find(node_name, "steelblock") and string.find(node_def.description, "Steel") then + minetest.override_item(node_name, { description = string.gsub(node_def.description, "Steel", S("Wrought Iron")) }) + end + if node_def.tiles or node_def.tile_images then + local tn = node_def.tiles and "tiles" or "tile_images" + local tl = {} + local ca = false + for i, t in ipairs(node_def[tn]) do + if type(t) == "string" and t == "default_steel_block.png" then + ca = true + t = "technic_wrought_iron_block.png" + end + table.insert(tl, t) + end + if ca then minetest.override_item(node_name, { [tn] = tl }) end + end +end) diff --git a/mods/technic-master/technic_worldgen/oregen.lua b/mods/technic-master/technic_worldgen/oregen.lua new file mode 100644 index 0000000..c48e358 --- /dev/null +++ b/mods/technic-master/technic_worldgen/oregen.lua @@ -0,0 +1,63 @@ +minetest.register_ore({ + ore_type = "scatter", + ore = "technic:mineral_uranium", + wherein = "default:stone", + clust_scarcity = 10*10*10, + clust_num_ores = 4, + clust_size = 3, + height_min = -300, + height_max = -80, +}) + +minetest.register_ore({ + ore_type = "scatter", + ore = "technic:mineral_chromium", + wherein = "default:stone", + clust_scarcity = 10*10*10, + clust_num_ores = 2, + clust_size = 3, + height_min = -31000, + height_max = -100, +}) + +minetest.register_ore({ + ore_type = "scatter", + ore = "technic:mineral_zinc", + wherein = "default:stone", + clust_scarcity = 9*9*9, + clust_num_ores = 4, + clust_size = 3, + height_min = -31000, + height_max = 2, +}) + +if technic.config:get_bool("enable_marble_generation") then +minetest.register_ore({ + ore_type = "sheet", + ore = "technic:marble", + wherein = "default:stone", + clust_scarcity = 1, + clust_num_ores = 1, + clust_size = 3, + height_min = -31000, + height_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} +}) +end + +if technic.config:get_bool("enable_granite_generation") then +minetest.register_ore({ + ore_type = "sheet", + ore = "technic:granite", + wherein = "default:stone", + clust_scarcity = 1, + clust_num_ores = 1, + clust_size = 4, + height_min = -31000, + height_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} +}) +end + diff --git a/mods/technic-master/technic_worldgen/rubber.lua b/mods/technic-master/technic_worldgen/rubber.lua new file mode 100644 index 0000000..93b6d66 --- /dev/null +++ b/mods/technic-master/technic_worldgen/rubber.lua @@ -0,0 +1,95 @@ +-- Code of rubber tree by PilzAdam + +local S = technic.worldgen.gettext + +minetest.register_node(":moretrees:rubber_tree_sapling", { + description = S("Rubber Tree Sapling"), + drawtype = "plantlike", + 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}, + sounds = default.node_sound_defaults(), +}) + +minetest.register_craft({ + type = "fuel", + recipe = "moretrees:rubber_tree_sapling", + burntime = 10 +}) + +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}, + 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}, + sounds = default.node_sound_wood_defaults(), +}) + +minetest.register_node(":moretrees:rubber_tree_leaves", { + drawtype = "allfaces_optional", + tiles = {"technic_rubber_leaves.png"}, + paramtype = "light", + groups = {snappy=3, leafdecay=3, flammable=2, not_in_creative_inventory=1}, + drop = { + max_items = 1, + items = {{ + items = {"moretrees:rubber_tree_sapling"}, + rarity = 20, + }} + }, + sounds = default.node_sound_leaves_defaults(), +}) + +technic.rubber_tree_model={ + axiom = "FFFFA", + rules_a = "[&FFBFA]////[&BFFFA]////[&FBFFA]", + rules_b = "[&FFA]////[&FFA]////[&FFA]", + trunk = "moretrees:rubber_tree_trunk", + leaves = "moretrees:rubber_tree_leaves", + angle = 35, + iterations = 3, + random_level = 1, + trunk_type = "double", + thin_branches = true +} + +minetest.register_abm({ + nodenames = {"moretrees:rubber_tree_sapling"}, + interval = 60, + chance = 20, + action = function(pos, node) + minetest.remove_node(pos) + minetest.spawn_tree(pos, technic.rubber_tree_model) + end +}) + +if technic.config:get_bool("enable_rubber_tree_generation") then + minetest.register_on_generated(function(minp, maxp, blockseed) + if math.random(1, 100) > 5 then + return + end + 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} + local pos = minetest.find_node_near(tmp, maxp.x - minp.x, + {"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) + end + end) +end + diff --git a/mods/technic-master/technic_worldgen/textures/technic_brass_block.png b/mods/technic-master/technic_worldgen/textures/technic_brass_block.png new file mode 100644 index 0000000..bc6fe78 Binary files /dev/null and b/mods/technic-master/technic_worldgen/textures/technic_brass_block.png differ diff --git a/mods/technic-master/technic_worldgen/textures/technic_brass_dust.png b/mods/technic-master/technic_worldgen/textures/technic_brass_dust.png new file mode 100644 index 0000000..63d9ba4 Binary files /dev/null and b/mods/technic-master/technic_worldgen/textures/technic_brass_dust.png differ diff --git a/mods/technic-master/technic_worldgen/textures/technic_brass_ingot.png b/mods/technic-master/technic_worldgen/textures/technic_brass_ingot.png new file mode 100644 index 0000000..06056e7 Binary files /dev/null and b/mods/technic-master/technic_worldgen/textures/technic_brass_ingot.png differ diff --git a/mods/technic-master/technic_worldgen/textures/technic_carbon_steel_block.png b/mods/technic-master/technic_worldgen/textures/technic_carbon_steel_block.png new file mode 100644 index 0000000..f3cfdc1 Binary files /dev/null and b/mods/technic-master/technic_worldgen/textures/technic_carbon_steel_block.png differ diff --git a/mods/technic-master/technic_worldgen/textures/technic_carbon_steel_ingot.png b/mods/technic-master/technic_worldgen/textures/technic_carbon_steel_ingot.png new file mode 100644 index 0000000..c30ec80 Binary files /dev/null and b/mods/technic-master/technic_worldgen/textures/technic_carbon_steel_ingot.png differ diff --git a/mods/technic-master/technic_worldgen/textures/technic_cast_iron_block.png b/mods/technic-master/technic_worldgen/textures/technic_cast_iron_block.png new file mode 100644 index 0000000..2df61e5 Binary files /dev/null and b/mods/technic-master/technic_worldgen/textures/technic_cast_iron_block.png differ diff --git a/mods/technic-master/technic_worldgen/textures/technic_cast_iron_ingot.png b/mods/technic-master/technic_worldgen/textures/technic_cast_iron_ingot.png new file mode 100644 index 0000000..5c182ce Binary files /dev/null and b/mods/technic-master/technic_worldgen/textures/technic_cast_iron_ingot.png differ diff --git a/mods/technic-master/technic_worldgen/textures/technic_chromium_block.png b/mods/technic-master/technic_worldgen/textures/technic_chromium_block.png new file mode 100644 index 0000000..ad173ca Binary files /dev/null and b/mods/technic-master/technic_worldgen/textures/technic_chromium_block.png differ diff --git a/mods/technic-master/technic_worldgen/textures/technic_chromium_ingot.png b/mods/technic-master/technic_worldgen/textures/technic_chromium_ingot.png new file mode 100644 index 0000000..248b0c3 Binary files /dev/null and b/mods/technic-master/technic_worldgen/textures/technic_chromium_ingot.png differ diff --git a/mods/technic-master/technic_worldgen/textures/technic_chromium_lump.png b/mods/technic-master/technic_worldgen/textures/technic_chromium_lump.png new file mode 100644 index 0000000..0fe03a1 Binary files /dev/null and b/mods/technic-master/technic_worldgen/textures/technic_chromium_lump.png differ diff --git a/mods/technic-master/technic_worldgen/textures/technic_granite.png b/mods/technic-master/technic_worldgen/textures/technic_granite.png new file mode 100644 index 0000000..abb1385 Binary files /dev/null and b/mods/technic-master/technic_worldgen/textures/technic_granite.png differ diff --git a/mods/technic-master/technic_worldgen/textures/technic_marble.png b/mods/technic-master/technic_worldgen/textures/technic_marble.png new file mode 100644 index 0000000..846a170 Binary files /dev/null and b/mods/technic-master/technic_worldgen/textures/technic_marble.png differ diff --git a/mods/technic-master/technic_worldgen/textures/technic_marble_bricks.png b/mods/technic-master/technic_worldgen/textures/technic_marble_bricks.png new file mode 100644 index 0000000..2ea1e42 Binary files /dev/null and b/mods/technic-master/technic_worldgen/textures/technic_marble_bricks.png differ diff --git a/mods/technic-master/technic_worldgen/textures/technic_mineral_chromium.png b/mods/technic-master/technic_worldgen/textures/technic_mineral_chromium.png new file mode 100644 index 0000000..c66f1c5 Binary files /dev/null and b/mods/technic-master/technic_worldgen/textures/technic_mineral_chromium.png differ diff --git a/mods/technic-master/technic_worldgen/textures/technic_mineral_uranium.png b/mods/technic-master/technic_worldgen/textures/technic_mineral_uranium.png new file mode 100644 index 0000000..aad9c07 Binary files /dev/null and b/mods/technic-master/technic_worldgen/textures/technic_mineral_uranium.png differ diff --git a/mods/technic-master/technic_worldgen/textures/technic_mineral_zinc.png b/mods/technic-master/technic_worldgen/textures/technic_mineral_zinc.png new file mode 100644 index 0000000..598efeb Binary files /dev/null and b/mods/technic-master/technic_worldgen/textures/technic_mineral_zinc.png differ diff --git a/mods/technic-master/technic_worldgen/textures/technic_stainless_steel_block.png b/mods/technic-master/technic_worldgen/textures/technic_stainless_steel_block.png new file mode 100644 index 0000000..e451768 Binary files /dev/null and b/mods/technic-master/technic_worldgen/textures/technic_stainless_steel_block.png differ diff --git a/mods/technic-master/technic_worldgen/textures/technic_uranium_block.png b/mods/technic-master/technic_worldgen/textures/technic_uranium_block.png new file mode 100644 index 0000000..99dd51c Binary files /dev/null and b/mods/technic-master/technic_worldgen/textures/technic_uranium_block.png differ diff --git a/mods/technic-master/technic_worldgen/textures/technic_uranium_ingot.png b/mods/technic-master/technic_worldgen/textures/technic_uranium_ingot.png new file mode 100644 index 0000000..38978f8 Binary files /dev/null and b/mods/technic-master/technic_worldgen/textures/technic_uranium_ingot.png differ diff --git a/mods/technic-master/technic_worldgen/textures/technic_uranium_lump.png b/mods/technic-master/technic_worldgen/textures/technic_uranium_lump.png new file mode 100644 index 0000000..2f5a66c Binary files /dev/null and b/mods/technic-master/technic_worldgen/textures/technic_uranium_lump.png differ diff --git a/mods/technic-master/technic_worldgen/textures/technic_wrought_iron_block.png b/mods/technic-master/technic_worldgen/textures/technic_wrought_iron_block.png new file mode 100644 index 0000000..cf6c961 Binary files /dev/null and b/mods/technic-master/technic_worldgen/textures/technic_wrought_iron_block.png differ diff --git a/mods/technic-master/technic_worldgen/textures/technic_wrought_iron_ingot.png b/mods/technic-master/technic_worldgen/textures/technic_wrought_iron_ingot.png new file mode 100644 index 0000000..af00ea0 Binary files /dev/null and b/mods/technic-master/technic_worldgen/textures/technic_wrought_iron_ingot.png differ diff --git a/mods/technic-master/technic_worldgen/textures/technic_zinc_block.png b/mods/technic-master/technic_worldgen/textures/technic_zinc_block.png new file mode 100644 index 0000000..5ae7947 Binary files /dev/null and b/mods/technic-master/technic_worldgen/textures/technic_zinc_block.png differ diff --git a/mods/technic-master/technic_worldgen/textures/technic_zinc_ingot.png b/mods/technic-master/technic_worldgen/textures/technic_zinc_ingot.png new file mode 100644 index 0000000..a36a11c Binary files /dev/null and b/mods/technic-master/technic_worldgen/textures/technic_zinc_ingot.png differ diff --git a/mods/technic-master/technic_worldgen/textures/technic_zinc_lump.png b/mods/technic-master/technic_worldgen/textures/technic_zinc_lump.png new file mode 100644 index 0000000..1a620ab Binary files /dev/null and b/mods/technic-master/technic_worldgen/textures/technic_zinc_lump.png differ diff --git a/mods/technic-master/technic_worldgen/textures/x32/technic_brass_ingot.png b/mods/technic-master/technic_worldgen/textures/x32/technic_brass_ingot.png new file mode 100644 index 0000000..2d8b153 Binary files /dev/null and b/mods/technic-master/technic_worldgen/textures/x32/technic_brass_ingot.png differ diff --git a/mods/technic-master/technic_worldgen/textures/x32/technic_chromium_ingot.png b/mods/technic-master/technic_worldgen/textures/x32/technic_chromium_ingot.png new file mode 100644 index 0000000..91d5b20 Binary files /dev/null and b/mods/technic-master/technic_worldgen/textures/x32/technic_chromium_ingot.png differ diff --git a/mods/technic-master/technic_worldgen/textures/x32/technic_chromium_lump.png b/mods/technic-master/technic_worldgen/textures/x32/technic_chromium_lump.png new file mode 100644 index 0000000..1588f92 Binary files /dev/null and b/mods/technic-master/technic_worldgen/textures/x32/technic_chromium_lump.png differ diff --git a/mods/technic-master/technic_worldgen/textures/x32/technic_concrete_block.png b/mods/technic-master/technic_worldgen/textures/x32/technic_concrete_block.png new file mode 100644 index 0000000..91364f3 Binary files /dev/null and b/mods/technic-master/technic_worldgen/textures/x32/technic_concrete_block.png differ diff --git a/mods/technic-master/technic_worldgen/textures/x32/technic_granite.png b/mods/technic-master/technic_worldgen/textures/x32/technic_granite.png new file mode 100644 index 0000000..abb1385 Binary files /dev/null and b/mods/technic-master/technic_worldgen/textures/x32/technic_granite.png differ diff --git a/mods/technic-master/technic_worldgen/textures/x32/technic_marble.png b/mods/technic-master/technic_worldgen/textures/x32/technic_marble.png new file mode 100644 index 0000000..846a170 Binary files /dev/null and b/mods/technic-master/technic_worldgen/textures/x32/technic_marble.png differ diff --git a/mods/technic-master/technic_worldgen/textures/x32/technic_marble_bricks.png b/mods/technic-master/technic_worldgen/textures/x32/technic_marble_bricks.png new file mode 100644 index 0000000..2ea1e42 Binary files /dev/null and b/mods/technic-master/technic_worldgen/textures/x32/technic_marble_bricks.png differ diff --git a/mods/technic-master/technic_worldgen/textures/x32/technic_mineral_chromium.png b/mods/technic-master/technic_worldgen/textures/x32/technic_mineral_chromium.png new file mode 100644 index 0000000..c66f1c5 Binary files /dev/null and b/mods/technic-master/technic_worldgen/textures/x32/technic_mineral_chromium.png differ diff --git a/mods/technic-master/technic_worldgen/textures/x32/technic_mineral_uranium.png b/mods/technic-master/technic_worldgen/textures/x32/technic_mineral_uranium.png new file mode 100644 index 0000000..aad9c07 Binary files /dev/null and b/mods/technic-master/technic_worldgen/textures/x32/technic_mineral_uranium.png differ diff --git a/mods/technic-master/technic_worldgen/textures/x32/technic_mineral_zinc.png b/mods/technic-master/technic_worldgen/textures/x32/technic_mineral_zinc.png new file mode 100644 index 0000000..598efeb Binary files /dev/null and b/mods/technic-master/technic_worldgen/textures/x32/technic_mineral_zinc.png differ diff --git a/mods/technic-master/technic_worldgen/textures/x32/technic_rebar.png b/mods/technic-master/technic_worldgen/textures/x32/technic_rebar.png new file mode 100644 index 0000000..16d1fc5 Binary files /dev/null and b/mods/technic-master/technic_worldgen/textures/x32/technic_rebar.png differ diff --git a/mods/technic-master/technic_worldgen/textures/x32/technic_stainless_steel_ingot.png b/mods/technic-master/technic_worldgen/textures/x32/technic_stainless_steel_ingot.png new file mode 100644 index 0000000..46fa296 Binary files /dev/null and b/mods/technic-master/technic_worldgen/textures/x32/technic_stainless_steel_ingot.png differ diff --git a/mods/technic-master/technic_worldgen/textures/x32/technic_uranium.png b/mods/technic-master/technic_worldgen/textures/x32/technic_uranium.png new file mode 100644 index 0000000..54225f8 Binary files /dev/null and b/mods/technic-master/technic_worldgen/textures/x32/technic_uranium.png differ diff --git a/mods/technic-master/technic_worldgen/textures/x32/technic_zinc_ingot.png b/mods/technic-master/technic_worldgen/textures/x32/technic_zinc_ingot.png new file mode 100644 index 0000000..096ff9c Binary files /dev/null and b/mods/technic-master/technic_worldgen/textures/x32/technic_zinc_ingot.png differ diff --git a/mods/technic-master/technic_worldgen/textures/x32/technic_zinc_lump.png b/mods/technic-master/technic_worldgen/textures/x32/technic_zinc_lump.png new file mode 100644 index 0000000..d28a6dc Binary files /dev/null and b/mods/technic-master/technic_worldgen/textures/x32/technic_zinc_lump.png differ diff --git a/mods/technic-master/wrench/depends.txt b/mods/technic-master/wrench/depends.txt new file mode 100644 index 0000000..4d126c6 --- /dev/null +++ b/mods/technic-master/wrench/depends.txt @@ -0,0 +1,6 @@ +default +technic +technic_chests +technic_worldgen +intllib? + diff --git a/mods/technic-master/wrench/init.lua b/mods/technic-master/wrench/init.lua new file mode 100644 index 0000000..f0a0e00 --- /dev/null +++ b/mods/technic-master/wrench/init.lua @@ -0,0 +1,172 @@ +--[[ +Wrench mod + +Adds a wrench that allows the player to pickup nodes that contain an inventory +with items or metadata that needs perserving. +The wrench has the same tool capability as the normal hand. +To pickup a node simply right click on it. If the node contains a formspec, +you will need to shift+right click instead. +--]] + +local LATEST_SERIALIZATION_VERSION = 1 + +wrench = {} + +local modpath = minetest.get_modpath(minetest.get_current_modname()) +dofile(modpath.."/support.lua") +dofile(modpath.."/technic.lua") + +-- Boilerplate to support localized strings if intllib mod is installed. +local S +if intllib then + S = intllib.Getter() +else + S = function(s) return s end +end + +local function get_meta_type(name, metaname) + local def = wrench.registered_nodes[name] + if not def or not def.metas or not def.metas[metaname] then + return nil + end + return def.metas[metaname] +end + +local function get_pickup_name(name) + return "wrench:picked_up_"..(name:gsub(":", "_")) +end + +local function restore(pos, placer, itemstack) + local name = itemstack:get_name() + 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}) + local lists = data.lists + for listname, list in pairs(lists) do + inv:set_list(listname, list) + end + for name, value in pairs(data.metas) do + local meta_type = get_meta_type(data.name, name) + if meta_type == wrench.META_TYPE_INT then + meta:set_int(name, value) + elseif meta_type == wrench.META_TYPE_FLOAT then + meta:set_float(name, value) + elseif meta_type == wrench.META_TYPE_STRING then + meta:set_string(name, value) + end + end + itemstack:take_item() + return itemstack +end + +for name, info in pairs(wrench.registered_nodes) do + local olddef = minetest.registered_nodes[name] + if olddef then + local newdef = {} + for key, value in pairs(olddef) do + newdef[key] = value + end + newdef.stack_max = 1 + newdef.description = S("%s with items"):format(newdef.description) + newdef.groups = {} + newdef.groups.not_in_creative_inventory = 1 + newdef.on_construct = nil + newdef.on_destruct = nil + newdef.after_place_node = restore + minetest.register_node(":"..get_pickup_name(name), newdef) + end +end + +minetest.register_tool("wrench:wrench", { + description = S("Wrench"), + inventory_image = "technic_wrench.png", + tool_capabilities = { + 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} + }, + damage_groups = {fleshy=1}, + }, + on_place = function(itemstack, placer, pointed_thing) + local pos = pointed_thing.under + if not placer or not pos then + return + end + if minetest.is_protected(pos, placer:get_player_name()) then + minetest.record_protection_violation(pos, placer:get_player_name()) + return + end + local name = minetest.get_node(pos).name + local def = wrench.registered_nodes[name] + if not def then + return + end + + local stack = ItemStack(get_pickup_name(name)) + local player_inv = placer:get_inventory() + if not player_inv:room_for_item("main", stack) then + return + end + local meta = minetest.get_meta(pos) + if def.owned then + local owner = meta:get_string("owner") + if owner and owner ~= placer:get_player_name() then + minetest.log("action", placer:get_player_name().. + " tried to pick up a owned node belonging to ".. + owner.." at ".. + minetest.pos_to_string(pos)) + return + end + end + + local metadata = {} + metadata.name = name + metadata.version = LATEST_SERIALIZATION_VERSION + + local inv = meta:get_inventory() + local lists = {} + for _, listname in pairs(def.lists or {}) do + if not inv:is_empty(listname) then + empty = false + end + local list = inv:get_list(listname) + for i, stack in pairs(list) do + list[i] = stack:to_string() + end + lists[listname] = list + end + metadata.lists = lists + + local metas = {} + for name, meta_type in pairs(def.metas or {}) do + if meta_type == wrench.META_TYPE_INT then + metas[name] = meta:get_int(name) + elseif meta_type == wrench.META_TYPE_FLOAT then + metas[name] = meta:get_float(name) + elseif meta_type == wrench.META_TYPE_STRING then + metas[name] = meta:get_string(name) + end + end + metadata.metas = metas + + stack:set_metadata(minetest.serialize(metadata)) + minetest.remove_node(pos) + itemstack:add_wear(65535 / 20) + player_inv:add_item("main", stack) + return itemstack + end, +}) + +minetest.register_craft({ + output = "wrench:wrench", + recipe = { + {"technic:carbon_steel_ingot", "", "technic:carbon_steel_ingot"}, + {"", "technic:carbon_steel_ingot", ""}, + {"", "technic:carbon_steel_ingot", ""}, + }, +}) diff --git a/mods/technic-master/wrench/locale/de.txt b/mods/technic-master/wrench/locale/de.txt new file mode 100644 index 0000000..b285cd3 --- /dev/null +++ b/mods/technic-master/wrench/locale/de.txt @@ -0,0 +1,7 @@ +# German Translation for technic_wrench +# Deutsche Übersetzung von technic_wrench +# by Xanthin + +Wrench = Schraubenschluessel +%s with items = %s mit Gegenstaenden + diff --git a/mods/technic-master/wrench/locale/template.txt b/mods/technic-master/wrench/locale/template.txt new file mode 100644 index 0000000..eff2da2 --- /dev/null +++ b/mods/technic-master/wrench/locale/template.txt @@ -0,0 +1,5 @@ +# technic_wrench translation template + +Wrench = +%s with items = + diff --git a/mods/technic-master/wrench/support.lua b/mods/technic-master/wrench/support.lua new file mode 100644 index 0000000..6d1c9ab --- /dev/null +++ b/mods/technic-master/wrench/support.lua @@ -0,0 +1,71 @@ +--[[ +supported_nodes +This table stores all nodes that are compatible with the wrench mod. +Syntax: + [] = { + lists = {""}, + metas = {[""] = STRING, + [""] = INT, + [""] = FLOAT}, + owned = true, + store_meta_always = true, + } + owned - nodes that are protected by owner requirements (Ex. locked chests) + store_meta_always - when nodes are broken this ensures metadata and + inventory is always stored (Ex. active state for machines) +--]] + +wrench.META_TYPE_INT = 0 +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.registered_nodes = { + ["default:chest"] = { + lists = {"main"}, + }, + ["default:chest_locked"] = { + lists = {"main"}, + metas = {owner = STRING, + infotext = STRING}, + owned = true, + }, + ["default:furnace"] = { + lists = {"fuel", "src", "dst"}, + metas = {infotext = STRING, + fuel_totaltime = FLOAT, + fuel_time = FLOAT, + src_totaltime = FLOAT, + src_time = FLOAT}, + }, + ["default:furnace_active"] = { + lists = {"fuel", "src", "dst"}, + metas = {infotext = STRING, + fuel_totaltime = FLOAT, + fuel_time = FLOAT, + src_totaltime = FLOAT, + src_time = FLOAT}, + store_meta_always = true, + }, + ["default:sign_wall"] = { + metas = {infotext = STRING, + text = STRING}, + }, +} + +function wrench:original_name(name) + for key, value in pairs(self.registered_nodes) do + if name == value.name then + return key + end + end +end + +function wrench:register_node(name, def) + self.registered_nodes[name] = def +end + diff --git a/mods/technic-master/wrench/technic.lua b/mods/technic-master/wrench/technic.lua new file mode 100644 index 0000000..4122e35 --- /dev/null +++ b/mods/technic-master/wrench/technic.lua @@ -0,0 +1,286 @@ + +local INT, STRING, FLOAT = + wrench.META_TYPE_INT, + wrench.META_TYPE_STRING, + wrench.META_TYPE_FLOAT + +wrench:register_node("technic:iron_chest", { + lists = {"main"}, +}) +wrench:register_node("technic:iron_locked_chest", { + lists = {"main"}, + metas = {infotext = STRING, + owner = STRING}, + owned = true, +}) +wrench:register_node("technic:copper_chest", { + lists = {"main"}, +}) +wrench:register_node("technic:copper_locked_chest", { + lists = {"main"}, + metas = {infotext = STRING, + owner = STRING}, + owned = true, +}) +wrench:register_node("technic:silver_chest", { + lists = {"main"}, + metas = {infotext = STRING, + formspec = STRING}, +}) +wrench:register_node("technic:silver_locked_chest", { + lists = {"main"}, + metas = {infotext = STRING, + owner = STRING, + formspec = STRING}, + owned = true, +}) +wrench:register_node("technic:gold_chest", { + lists = {"main"}, + metas = {infotext = STRING, + formspec = STRING}, +}) +wrench:register_node("technic:gold_locked_chest", { + lists = {"main"}, + metas = {infotext = STRING, + owner = STRING, + formspec = STRING}, + owned = true, +}) +wrench:register_node("technic:mithril_chest", { + lists = {"main"}, + metas = {infotext = STRING, + formspec = STRING}, +}) +wrench:register_node("technic:mithril_locked_chest", { + lists = {"main"}, + metas = {infotext = STRING, + owner = STRING, + formspec = STRING}, + owned = true, +}) +wrench:register_node("technic:lv_electric_furnace", { + lists = {"src", "dst"}, + metas = {infotext = STRING, + formspec = STRING, + LV_EU_demand = INT, + LV_EU_input = INT, + src_time = INT}, +}) +wrench:register_node("technic:lv_electric_furnace_active", { + lists = {"src", "dst"}, + metas = {infotext = STRING, + formspec = STRING, + LV_EU_demand = INT, + LV_EU_input = INT, + src_time = INT}, +}) +wrench:register_node("technic:mv_electric_furnace", { + lists = {"src", "dst", "upgrade1", "upgrade2"}, + metas = {infotext = STRING, + formspec = STRING, + MV_EU_demand = INT, + MV_EU_input = INT, + tube_time = INT, + src_time = INT}, +}) +wrench:register_node("technic:mv_electric_furnace_active", { + lists = {"src", "dst", "upgrade1", "upgrade2"}, + metas = {infotext = STRING, + formspec = STRING, + MV_EU_demand = INT, + MV_EU_input = INT, + tube_time = INT, + src_time = INT}, +}) +wrench:register_node("technic:coal_alloy_furnace", { + lists = {"fuel", "src", "src2", "dst"}, + metas = {infotext = STRING, + fuel_totaltime = FLOAT, + fuel_time = FLOAT, + src_totaltime = FLOAT, + src_time = FLOAT}, +}) +wrench:register_node("technic:coal_alloy_furnace_active", { + lists = {"fuel", "src", "src2", "dst"}, + metas = {infotext = STRING, + fuel_totaltime = FLOAT, + fuel_time = FLOAT, + src_totaltime = FLOAT, + src_time = FLOAT}, +}) +wrench:register_node("technic:alloy_furnace", { + lists = {"src", "src2", "dst"}, + metas = {infotext = STRING, + formspec = STRING, + LV_EU_demand = INT, + LV_EU_input = INT, + tube_time = INT, + src_time = INT}, +}) +wrench:register_node("technic:alloy_furnace_active", { + lists = {"src", "src2", "dst"}, + metas = {infotext = STRING, + formspec = STRING, + LV_EU_demand = INT, + LV_EU_input = INT, + tube_time = INT, + src_time = INT}, +}) +wrench:register_node("technic:mv_alloy_furnace", { + lists = {"src", "src2", "dst", "upgrade1", "upgrade2"}, + metas = {infotext = STRING, + formspec = STRING, + MV_EU_demand = INT, + MV_EU_input = INT, + tube_time = INT, + src_time = INT}, +}) +wrench:register_node("technic:mv_alloy_furnace_active", { + lists = {"src", "src2", "dst", "upgrade1", "upgrade2"}, + metas = {infotext = STRING, + formspec = STRING, + MV_EU_demand = INT, + MV_EU_input = INT, + tube_time = INT, + src_time = INT}, +}) +wrench:register_node("technic:tool_workshop", { + lists = {"src"}, + metas = {infotext = STRING, + formspec = STRING, + LV_EU_demand = INT, + LV_EU_input = INT}, +}) +wrench:register_node("technic:grinder", { + lists = {"src", "dst"}, + metas = {infotext = STRING, + formspec = STRING, + LV_EU_demand = INT, + LV_EU_input = INT, + src_time = INT}, +}) +wrench:register_node("technic:grinder_active", { + lists = {"src", "dst"}, + metas = {infotext = STRING, + formspec = STRING, + LV_EU_demand = INT, + LV_EU_input = INT, + src_time = INT}, +}) +wrench:register_node("technic:mv_grinder", { + lists = {"src", "dst", "upgrade1", "upgrade2"}, + metas = {infotext = STRING, + formspec = STRING, + MV_EU_demand = INT, + MV_EU_input = INT, + tube_time = INT, + src_time = INT}, +}) +wrench:register_node("technic:mv_grinder_active", { + lists = {"src", "dst", "upgrade1", "upgrade2"}, + metas = {infotext = STRING, + formspec = STRING, + MV_EU_demand = INT, + MV_EU_input = INT, + tube_time = INT, + src_time = INT}, +}) +wrench:register_node("technic:extractor", { + lists = {"src", "dst"}, + metas = {infotext = STRING, + formspec = STRING, + LV_EU_demand = INT, + LV_EU_input = INT, + src_time = INT}, +}) +wrench:register_node("technic:extractor_active", { + lists = {"src", "dst"}, + metas = {infotext = STRING, + formspec = STRING, + LV_EU_demand = INT, + LV_EU_input = INT, + src_time = INT}, +}) +wrench:register_node("technic:compressor", { + lists = {"src", "dst"}, + metas = {infotext = STRING, + formspec = STRING, + LV_EU_demand = INT, + LV_EU_input = INT, + src_time = INT}, +}) +wrench:register_node("technic:compressor_active", { + lists = {"src", "dst"}, + metas = {infotext = STRING, + formspec = STRING, + LV_EU_demand = INT, + LV_EU_input = INT, + src_time = INT}, +}) +wrench:register_node("technic:cnc", { + lists = {"src", "dst"}, + metas = {infotext = STRING, + formspec = STRING, + LV_EU_demand = INT, + LV_EU_input = INT, + src_time = INT, + cnc_product = STRING}, +}) +wrench:register_node("technic:cnc_active", { + lists = {"src", "dst"}, + metas = {infotext = STRING, + formspec = STRING, + LV_EU_demand = INT, + LV_EU_input = INT, + src_time = INT, + cnc_product = STRING}, +}) + + +local chest_mark_colors = { + '_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}, + }) + wrench:register_node("technic:gold_locked_chest"..chest_mark_colors[i], { + lists = {"main"}, + metas = {infotext = STRING,owner = STRING,formspec = STRING}, + owned = true, + }) +end + +for tier, _ in pairs(technic.machines) do + local ltier = tier:lower() + for i = 0, 8 do + wrench:register_node("technic:"..ltier.."_battery_box"..i, { + 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}, + }) + end +end + diff --git a/mods/technic-master/wrench/textures/technic_wrench.png b/mods/technic-master/wrench/textures/technic_wrench.png new file mode 100644 index 0000000..471b47e Binary files /dev/null and b/mods/technic-master/wrench/textures/technic_wrench.png differ