bugfixes, recipes changed, electronic fab menu changed
@ -22,74 +22,38 @@ local STANDBY_TICKS = 10
|
||||
local COUNTDOWN_TICKS = 6
|
||||
local CYCLE_TIME = 6
|
||||
|
||||
local recipes = techage.recipes
|
||||
|
||||
local ValidInput = {
|
||||
{}, -- 1
|
||||
{ -- 2
|
||||
["default:glass"] = true,
|
||||
["basic_materials:copper_wire"] = true,
|
||||
["basic_materials:plastic_sheet"] = true,
|
||||
["techage:usmium_nuggets"] = true,
|
||||
},
|
||||
{ -- 3
|
||||
["default:mese_crystal"] = true,
|
||||
["default:copper_ingot"] = true,
|
||||
["default:gold_ingot"] = true,
|
||||
["techage:ta4_silicon_wafer"] = true,
|
||||
},
|
||||
{}, -- 4
|
||||
}
|
||||
|
||||
local Input = {
|
||||
{}, -- 1
|
||||
{"default:glass", "basic_materials:copper_wire", "basic_materials:plastic_sheet", "techage:usmium_nuggets"}, --2
|
||||
{"default:mese_crystal", "default:copper_ingot", "default:gold_ingot", "techage:ta4_silicon_wafer"}, -- 3
|
||||
{}, -- 4
|
||||
}
|
||||
|
||||
local Output = {
|
||||
"", -- 1
|
||||
"techage:vacuum_tube 2", -- 2
|
||||
"techage:ta4_wlanchip 8", -- 3
|
||||
"", -- 4
|
||||
local RecipeType = {
[2] = "ta2_electronic_fab",
|
||||
[3] = "ta3_electronic_fab",
|
||||
[4] = "ta4_electronic_fab",
|
||||
}
|
||||
|
||||
local function formspec(self, pos, mem)
|
||||
local icon
|
||||
local crd = CRD(pos)
|
||||
if crd.stage == 2 then
|
||||
icon = "techage:vacuum_tube"
|
||||
elseif crd.stage == 3 then
|
||||
icon = "techage:ta4_wlanchip"
|
||||
else
|
||||
icon = ""
|
||||
end
|
||||
return "size[8,8]"..
|
||||
local rtype = RecipeType[CRD(pos).stage]
|
||||
return "size[8.4,8.4]"..
|
||||
default.gui_bg..
|
||||
default.gui_bg_img..
|
||||
default.gui_slots..
|
||||
"list[context;src;0,0;3,3;]"..
|
||||
"image[3.5,0;1,1;"..techage.get_power_image(pos, mem).."]"..
|
||||
"image[3.5,1;1,1;techage_form_arrow.png]"..
|
||||
"image_button[3.5,2;1,1;".. self:get_state_button_image(mem) ..";state_button;]"..
|
||||
"list[context;dst;5,0;3,3;]"..
|
||||
"item_image[5,0;1,1;"..icon.."]"..
|
||||
"list[current_player;main;0,4;8,4;]"..
|
||||
"list[context;src;0,0;2,4;]"..
|
||||
recipes.formspec(2.2, 0, rtype, mem)..
|
||||
"list[context;dst;6.4,0;2,4;]"..
|
||||
"image_button[3.7,3.3;1,1;".. self:get_state_button_image(mem) ..";state_button;]"..
|
||||
"tooltip[3.7,3.3;1,1;"..self:get_state_tooltip(mem).."]"..
|
||||
"list[current_player;main;0.2,4.5;8,4;]"..
|
||||
"listring[context;dst]"..
|
||||
"listring[current_player;main]"..
|
||||
"listring[context;src]"..
|
||||
"listring[current_player;main]"..
|
||||
default.get_hotbar_bg(0, 4)
|
||||
default.get_hotbar_bg(0.2, 4.5)
|
||||
end
|
||||
|
||||
local function allow_metadata_inventory_put(pos, listname, index, stack, player)
|
||||
if minetest.is_protected(pos, player:get_player_name()) then
|
||||
return 0
|
||||
end
|
||||
--local meta = minetest.get_meta(pos)
|
||||
--local inv = meta:get_inventory()
|
||||
local crd = CRD(pos)
|
||||
if listname == "src" and ValidInput[crd.stage][stack:get_name()] then
|
||||
if listname == "src" then
|
||||
crd.State:start_if_standby(pos)
|
||||
return stack:get_count()
|
||||
end
|
||||
@ -111,17 +75,22 @@ local function allow_metadata_inventory_take(pos, listname, index, stack, player
|
||||
end
|
||||
|
||||
local function making(pos, crd, mem, inv)
|
||||
if inv:room_for_item("dst", ItemStack(Output[crd.stage])) then
|
||||
for _,name in ipairs(Input[crd.stage]) do
|
||||
if not inv:contains_item("src", ItemStack(name)) then
|
||||
local rtype = RecipeType[crd.stage]
|
||||
local recipe = recipes.get(mem, rtype)
|
||||
local output = ItemStack(recipe.output.name.." "..recipe.output.num)
|
||||
if inv:room_for_item("dst", output) then
|
||||
for _,item in ipairs(recipe.input) do
|
||||
local input = ItemStack(item.name.." "..item.num)
|
||||
if not inv:contains_item("src", input) then
|
||||
crd.State:idle(pos, mem)
|
||||
return
|
||||
end
|
||||
end
|
||||
for _,name in ipairs(Input[crd.stage]) do
|
||||
inv:remove_item("src", ItemStack(name))
|
||||
for _,item in ipairs(recipe.input) do
|
||||
local input = ItemStack(item.name.." "..item.num)
|
||||
inv:remove_item("src", input)
|
||||
end
|
||||
inv:add_item("dst", ItemStack(Output[crd.stage]))
|
||||
inv:add_item("dst", output)
|
||||
crd.State:keep_running(pos, mem, COUNTDOWN_TICKS)
|
||||
return
|
||||
end
|
||||
@ -142,8 +111,16 @@ local function on_receive_fields(pos, formname, fields, player)
|
||||
if minetest.is_protected(pos, player:get_player_name()) then
|
||||
return
|
||||
end
|
||||
|
||||
local mem = tubelib2.get_mem(pos)
|
||||
CRD(pos).State:state_button_event(pos, mem, fields)
|
||||
local crd = CRD(pos)
|
||||
|
||||
if not mem.running then
|
||||
recipes.on_receive_fields(pos, formname, fields, player)
|
||||
end
|
||||
|
||||
crd.State:state_button_event(pos, mem, fields)
|
||||
M(pos):set_string("formspec", formspec(crd.State, pos, mem))
|
||||
end
|
||||
|
||||
local function can_dig(pos, player)
|
||||
@ -238,8 +215,8 @@ local node_name_ta2, node_name_ta3, node_name_ta4 =
|
||||
tubing = tubing,
|
||||
after_place_node = function(pos, placer)
|
||||
local inv = M(pos):get_inventory()
|
||||
inv:set_size("src", 3*3)
|
||||
inv:set_size("dst", 3*3)
|
||||
inv:set_size("src", 8)
|
||||
inv:set_size("dst", 8)
|
||||
end,
|
||||
can_dig = can_dig,
|
||||
node_timer = keep_running,
|
||||
@ -300,16 +277,20 @@ if minetest.global_exists("unified_inventory") then
|
||||
width = 2,
|
||||
height = 2,
|
||||
})
|
||||
unified_inventory.register_craft({
|
||||
output = "techage:vacuum_tube 2",
|
||||
items = {"default:glass", "basic_materials:copper_wire", "basic_materials:plastic_sheet", "techage:usmium_nuggets"},
|
||||
type = "ta2_electronic_fab",
|
||||
})
|
||||
unified_inventory.register_craft({
|
||||
output = "techage:ta4_wlanchip 8",
|
||||
items = {"default:mese_crystal", "default:copper_ingot", "default:gold_ingot", "techage:ta4_silicon_wafer"},
|
||||
type = "ta3_electronic_fab",
|
||||
})
|
||||
end
|
||||
|
||||
|
||||
recipes.add("ta2_electronic_fab", {
|
||||
output = "techage:vacuum_tube 2",
|
||||
input = {"default:glass 1", "basic_materials:copper_wire 1", "basic_materials:plastic_sheet 1", "techage:usmium_nuggets 1"}
|
||||
})
|
||||
|
||||
recipes.add("ta3_electronic_fab", {
|
||||
output = "techage:vacuum_tube 2",
|
||||
input = {"default:glass 1", "basic_materials:copper_wire 1", "basic_materials:plastic_sheet 1", "techage:usmium_nuggets 1"}
|
||||
})
|
||||
|
||||
recipes.add("ta3_electronic_fab", {
|
||||
output = "techage:ta4_wlanchip 8",
|
||||
input = {"default:mese_crystal 1", "default:copper_ingot 1", "default:gold_ingot 1", "techage:ta4_silicon_wafer 1"}
|
||||
})
|
||||
|
120
basis/recipe_lib.lua
Normal file
@ -0,0 +1,120 @@
|
||||
--[[
|
||||
|
||||
TechAge
|
||||
=======
|
||||
|
||||
Copyright (C) 2019 Joachim Stolberg
|
||||
|
||||
GPL v3
|
||||
See LICENSE.txt for more information
|
||||
|
||||
Recipe lib for formspecs
|
||||
|
||||
]]--
|
||||
|
||||
local S = techage.S
|
||||
local M = minetest.get_meta
|
||||
|
||||
local Recipes = {} -- {rtype = {ouput = {....},...}}
|
||||
local RecipeList = {} -- {rtype = {<output name>,...}}
|
||||
|
||||
local range = techage.range
|
||||
|
||||
techage.recipes = {}
|
||||
|
||||
-- Formspec
|
||||
local function input_string(recipe)
|
||||
local tbl = {}
|
||||
for idx, item in ipairs(recipe.input) do
|
||||
local x = ((idx-1) % 2)
|
||||
local y = math.floor((idx-1) / 2)
|
||||
tbl[idx] = techage.item_image(x, y, item.name.." "..item.num)
|
||||
end
|
||||
return table.concat(tbl, "")
|
||||
end
|
||||
|
||||
function techage.recipes.get(mem, rtype)
|
||||
local recipes = Recipes[rtype] or {}
|
||||
local recipe_list = RecipeList[rtype] or {}
|
||||
return recipes[recipe_list[mem.recipe_idx or 1]]
|
||||
end
|
||||
|
||||
-- Add 4 input/output/waste recipe
|
||||
-- {
|
||||
-- output = "<item-name> <units>", -- units = 1..n
|
||||
-- waste = "<item-name> <units>", -- units = 1..n
|
||||
-- input = { -- up to 4 items
|
||||
-- "<item-name> <units>",
|
||||
-- "<item-name> <units>",
|
||||
-- },
|
||||
-- }
|
||||
function techage.recipes.add(rtype, recipe)
|
||||
if not Recipes[rtype] then
|
||||
Recipes[rtype] = {}
|
||||
end
|
||||
if not RecipeList[rtype] then
|
||||
RecipeList[rtype] = {}
|
||||
end
|
||||
|
||||
local name, num
|
||||
local item = {input = {}}
|
||||
for idx = 1,4 do
|
||||
local inp = recipe.input[idx] or ""
|
||||
name, num = unpack(string.split(inp, " "))
|
||||
item.input[idx] = {name = name or "", num = tonumber(num) or 0}
|
||||
end
|
||||
if recipe.waste then
|
||||
name, num = unpack(string.split(recipe.waste, " "))
|
||||
else
|
||||
name, num = "", "0"
|
||||
end
|
||||
item.waste = {name = name or "", num = tonumber(num) or 0}
|
||||
name, num = unpack(string.split(recipe.output, " "))
|
||||
item.output = {name = name or "", num = tonumber(num) or 0}
|
||||
Recipes[rtype][name] = item
|
||||
RecipeList[rtype][#(RecipeList[rtype])+1] = name
|
||||
|
||||
if minetest.global_exists("unified_inventory") then
|
||||
unified_inventory.register_craft({
|
||||
output = recipe.output,
|
||||
items = recipe.input,
|
||||
type = rtype,
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
function techage.recipes.formspec(x, y, rtype, mem)
|
||||
local recipes = Recipes[rtype] or {}
|
||||
local recipe_list = RecipeList[rtype] or {}
|
||||
mem.recipe_idx = range(mem.recipe_idx or 1, 1, #recipe_list)
|
||||
local idx = mem.recipe_idx
|
||||
local recipe = recipes[recipe_list[idx]]
|
||||
local output = recipe.output.name.." "..recipe.output.num
|
||||
local waste = recipe.waste.name.." "..recipe.waste.num
|
||||
return "container["..x..","..y.."]"..
|
||||
"background[0,0;4,3;techage_form_grey.png]"..
|
||||
input_string(recipe)..
|
||||
"image[2,0.5;1,1;techage_form_arrow.png]"..
|
||||
techage.item_image(2.95, 0, output)..
|
||||
techage.item_image(2.95, 1, waste)..
|
||||
"button[0,2;1,1;priv;<<]"..
|
||||
"button[1,2;1,1;next;>>]"..
|
||||
"label[1.9,2.2;"..S("Recipe")..": "..idx.."/"..#recipe_list.."]"..
|
||||
"container_end[]"
|
||||
end
|
||||
|
||||
function techage.recipes.on_receive_fields(pos, formname, fields, player)
|
||||
if minetest.is_protected(pos, player:get_player_name()) then
|
||||
return
|
||||
end
|
||||
local mem = tubelib2.get_mem(pos)
|
||||
|
||||
mem.recipe_idx = mem.recipe_idx or 1
|
||||
if not mem.running then
|
||||
if fields.next == ">>" then
|
||||
mem.recipe_idx = mem.recipe_idx + 1
|
||||
elseif fields.priv == "<<" then
|
||||
mem.recipe_idx = mem.recipe_idx - 1
|
||||
end
|
||||
end
|
||||
end
|
@ -17,9 +17,8 @@ local M = minetest.get_meta
|
||||
local N = function(pos) return minetest.get_node(pos).name end
|
||||
local Pipe = techage.BiogasPipe
|
||||
local liquid = techage.liquid
|
||||
local recipes = techage.recipes
|
||||
|
||||
local Recipes = {} -- {ouput = {....},...}
|
||||
local RecipeList = {} -- {<output name>,...}
|
||||
local Liquids = {} -- {hash(pos) = {name = outdir},...}
|
||||
|
||||
local STANDBY_TICKS = 0
|
||||
@ -27,40 +26,15 @@ local COUNTDOWN_TICKS = 6
|
||||
local CYCLE_TIME = 2
|
||||
local POWER_NEED = 10
|
||||
|
||||
local range = techage.range
|
||||
|
||||
-- Formspec
|
||||
local function input_string(recipe)
|
||||
local tbl = {}
|
||||
for idx, item in ipairs(recipe.input) do
|
||||
local x = ((idx-1) % 2) + 1
|
||||
local y = math.floor((idx-1) / 2)
|
||||
tbl[idx] = techage.item_image(x, y, item.name.." "..item.num)
|
||||
end
|
||||
return table.concat(tbl, "")
|
||||
end
|
||||
|
||||
local function formspec(self, pos, mem)
|
||||
mem.recipe_idx = range(mem.recipe_idx or 1, 1, #RecipeList)
|
||||
local idx = mem.recipe_idx
|
||||
local recipe = Recipes[RecipeList[idx]]
|
||||
local output = recipe.output.name.." "..recipe.output.num
|
||||
local waste = recipe.waste.name.." "..recipe.waste.num
|
||||
return "size[8,7.2]"..
|
||||
return "size[8,7]"..
|
||||
default.gui_bg..
|
||||
default.gui_bg_img..
|
||||
default.gui_slots..
|
||||
input_string(recipe)..
|
||||
"image[3,0.5;1,1;techage_form_arrow.png]"..
|
||||
techage.item_image(4, 0, output)..
|
||||
techage.item_image(4, 1, waste)..
|
||||
"image_button[6.5,0.5;1,1;".. self:get_state_button_image(mem) ..";state_button;]"..
|
||||
"tooltip[6.5,0.5;1,1;"..self:get_state_tooltip(mem).."]"..
|
||||
"button[1,2.2;1,1;priv;<<]"..
|
||||
"button[2,2.2;1,1;next;>>]"..
|
||||
"label[3,2.5;"..S("Recipe")..": "..idx.."/"..#RecipeList.."]"..
|
||||
|
||||
"list[current_player;main;0,3.5;8,4;]" ..
|
||||
recipes.formspec(0, 0, "ta4_doser", mem)..
|
||||
"image_button[6,1;1,1;".. self:get_state_button_image(mem) ..";state_button;]"..
|
||||
"tooltip[6,1;1,1;"..self:get_state_tooltip(mem).."]"..
|
||||
"list[current_player;main;0,3.3;8,4;]" ..
|
||||
default.get_hotbar_bg(0, 3.5)
|
||||
end
|
||||
|
||||
@ -140,7 +114,7 @@ local function dosing(pos, mem, elapsed)
|
||||
end
|
||||
-- available liquids
|
||||
local liquids = get_liquids(pos)
|
||||
local recipe = Recipes[RecipeList[mem.recipe_idx or 1]]
|
||||
local recipe = recipes.get(mem, "ta4_doser")
|
||||
if not liquids or not recipe then return end
|
||||
-- inputs
|
||||
for _,item in pairs(recipe.input) do
|
||||
@ -184,19 +158,13 @@ local function on_receive_fields(pos, formname, fields, player)
|
||||
if minetest.is_protected(pos, player:get_player_name()) then
|
||||
return
|
||||
end
|
||||
local mem = tubelib2.get_mem(pos)
|
||||
|
||||
mem.recipe_idx = mem.recipe_idx or 1
|
||||
local mem = tubelib2.get_mem(pos)
|
||||
if not mem.running then
|
||||
if fields.next == ">>" then
|
||||
mem.recipe_idx = range(mem.recipe_idx + 1, 1, #RecipeList)
|
||||
M(pos):set_string("formspec", formspec(State, pos, mem))
|
||||
elseif fields.priv == "<<" then
|
||||
mem.recipe_idx = range(mem.recipe_idx - 1, 1, #RecipeList)
|
||||
M(pos):set_string("formspec", formspec(State, pos, mem))
|
||||
end
|
||||
recipes.on_receive_fields(pos, formname, fields, player)
|
||||
end
|
||||
State:state_button_event(pos, mem, fields)
|
||||
M(pos):set_string("formspec", formspec(State, pos, mem))
|
||||
end
|
||||
|
||||
|
||||
@ -270,37 +238,16 @@ techage.power.register_node({"techage:ta4_doser", "techage:ta4_doser_on"}, {
|
||||
end,
|
||||
})
|
||||
|
||||
-- Doser Recipe
|
||||
-- {
|
||||
-- output = "<item-name> <units>", -- units = 1..n
|
||||
-- waste = "<item-name> <units>",
|
||||
-- input = { -- up to 4
|
||||
-- "<item-name> <units>",
|
||||
-- "<item-name> <units>",
|
||||
-- },
|
||||
-- }
|
||||
--
|
||||
function techage.add_doser_recipe(recipe)
|
||||
local name, num
|
||||
local item = {input = {}}
|
||||
for idx = 1,4 do
|
||||
local inp = recipe.input[idx] or ""
|
||||
name, num = unpack(string.split(inp, " "))
|
||||
item.input[idx] = {name = name or "", num = tonumber(num) or 0}
|
||||
end
|
||||
if recipe.waste then
|
||||
name, num = unpack(string.split(recipe.waste, " "))
|
||||
else
|
||||
name, num = "", "0"
|
||||
end
|
||||
item.waste = {name = name or "", num = tonumber(num) or 0}
|
||||
name, num = unpack(string.split(recipe.output, " "))
|
||||
item.output = {name = name or "", num = tonumber(num) or 0}
|
||||
Recipes[name] = item
|
||||
RecipeList[#RecipeList+1] = name
|
||||
if minetest.global_exists("unified_inventory") then
|
||||
unified_inventory.register_craft_type("ta4_doser", {
|
||||
description = S("TA4 Doser"),
|
||||
icon = 'techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_pump.png^techage_appl_hole_pipe.png',
|
||||
width = 2,
|
||||
height = 2,
|
||||
})
|
||||
end
|
||||
|
||||
techage.add_doser_recipe({
|
||||
recipes.add("ta4_doser", {
|
||||
output = "techage:ta4_epoxy 3",
|
||||
input = {
|
||||
"techage:oil_source 2",
|
||||
|
@ -13,9 +13,11 @@
|
||||
]]--
|
||||
|
||||
local S = techage.S
|
||||
local Pipe = techage.BiogasPipe
|
||||
local Cable = techage.ElectricCable
|
||||
local power = techage.power
|
||||
local Pipe = techage.LiquidPipe
|
||||
local networks = techage.networks
|
||||
local liquid = techage.liquid
|
||||
|
||||
-- pos of the reactor stand
|
||||
local function on_power(pos, mem)
|
||||
@ -52,12 +54,12 @@ minetest.register_node("techage:ta4_reactor_stand", {
|
||||
description = S("TA4 Reactor"),
|
||||
tiles = {
|
||||
-- up, down, right, left, back, front
|
||||
"techage_reactor_stand_top.png",
|
||||
"techage_reactor_stand_bottom.png^[transformFY",
|
||||
"techage_reactor_stand_top.png^[transformR90",
|
||||
"techage_reactor_stand_bottom.png^[transformFY^[transformR270",
|
||||
"techage_reactor_stand_front.png",
|
||||
"techage_reactor_stand_back.png",
|
||||
"techage_reactor_stand_side.png^[transformFX",
|
||||
"techage_reactor_stand_side.png",
|
||||
"techage_reactor_stand_back.png",
|
||||
"techage_reactor_stand_front.png",
|
||||
},
|
||||
drawtype = "nodebox",
|
||||
node_box = {
|
||||
@ -70,11 +72,15 @@ minetest.register_node("techage:ta4_reactor_stand", {
|
||||
{ -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 },
|
||||
{ 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 },
|
||||
|
||||
{-1/8, -1/8, -4/8, 1/8, 1/8, 4/8},
|
||||
{-1/8, 0/8, -1/8, 1/8, 4/8, 1/8},
|
||||
{-3/8, -1/8, -4/8, 3/8, 1/8, -3/8},
|
||||
{-3/8, -1/8, 3/8, 3/8, 1/8, 4/8},
|
||||
},
|
||||
{-1/8, -4/8, -1/8, 1/8, 4/8, 1/8},
|
||||
|
||||
{-4/8, -1/8, -1/8, 4/8, 1/8, 1/8},
|
||||
-- {-3/8, -1/8, -4/8, 3/8, 1/8, -3/8},
|
||||
{-4/8, -1/8, -3/8, -3/8, 1/8, 3/8},
|
||||
|
||||
-- {-3/8, -1/8, 3/8, 3/8, 1/8, 4/8},
|
||||
{ 3/8, -1/8, -3/8, 4/8, 1/8, 3/8},
|
||||
},
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
@ -86,17 +92,18 @@ minetest.register_node("techage:ta4_reactor_stand", {
|
||||
groups = {cracky=2},
|
||||
is_ground_content = false,
|
||||
sounds = default.node_sound_metal_defaults(),
|
||||
})
|
||||
|
||||
-- for mechanical pipe connections
|
||||
techage.power.register_node({"techage:ta4_reactor_stand"}, {
|
||||
conn_sides = {"F"},
|
||||
power_network = Pipe,
|
||||
networks = {
|
||||
pipe = {
|
||||
sides = {R=1}, -- Pipe connection sides
|
||||
ntype = "pump",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- for electrical connections
|
||||
techage.power.register_node({"techage:ta4_reactor_stand"}, {
|
||||
conn_sides = {"B"},
|
||||
conn_sides = {"L"},
|
||||
power_network = Cable,
|
||||
})
|
||||
|
||||
@ -121,19 +128,6 @@ minetest.register_node("techage:ta4_reactor_fillerpipe", {
|
||||
type = "fixed",
|
||||
fixed = {-2/8, 0/8, -2/8, 2/8, 4/8, 2/8},
|
||||
},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
paramtype2 = "facedir",
|
||||
on_rotate = screwdriver.disallow,
|
||||
groups = {cracky=2},
|
||||
is_ground_content = false,
|
||||
sounds = default.node_sound_metal_defaults(),
|
||||
})
|
||||
|
||||
-- for mechanical pipe connections
|
||||
techage.power.register_node({"techage:ta4_reactor_fillerpipe"}, {
|
||||
conn_sides = {"U"},
|
||||
power_network = Pipe,
|
||||
after_place_node = function(pos)
|
||||
local pos1 = {x = pos.x, y = pos.y-1, z = pos.z}
|
||||
print(minetest.get_node(pos1).name)
|
||||
@ -141,8 +135,30 @@ techage.power.register_node({"techage:ta4_reactor_fillerpipe"}, {
|
||||
local node = minetest.get_node(pos)
|
||||
minetest.remove_node(pos)
|
||||
minetest.set_node(pos1, node)
|
||||
Pipe:after_place_node(pos1)
|
||||
end
|
||||
end,
|
||||
tubelib2_on_update2 = function(pos, dir, tlib2, node)
|
||||
liquid.update_network(pos)
|
||||
end,
|
||||
after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
||||
Pipe:after_dig_node(pos)
|
||||
end,
|
||||
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
paramtype2 = "facedir",
|
||||
on_rotate = screwdriver.disallow,
|
||||
groups = {cracky=2},
|
||||
is_ground_content = false,
|
||||
sounds = default.node_sound_metal_defaults(),
|
||||
|
||||
networks = {
|
||||
pipe = {
|
||||
sides = {U=1}, -- Pipe connection sides
|
||||
ntype = "tank",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- controlled by the doser
|
||||
@ -170,3 +186,45 @@ techage.register_node({"techage:ta4_reactor_fillerpipe"}, {
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("techage:ta4_reactor_base", {
|
||||
description = S("TA4 Reactor Base"),
|
||||
tiles = {
|
||||
-- up, down, right, left, back, front
|
||||
"techage_concrete.png^techage_appl_arrowXL.png^techage_appl_hole_pipe.png^[transformR270",
|
||||
"techage_concrete.png",
|
||||
"techage_concrete.png^techage_appl_hole_pipe.png",
|
||||
"techage_concrete.png",
|
||||
"techage_concrete.png",
|
||||
"techage_concrete.png",
|
||||
},
|
||||
|
||||
after_place_node = function(pos, placer)
|
||||
Pipe:after_place_node(pos)
|
||||
end,
|
||||
tubelib2_on_update2 = function(pos, dir, tlib2, node)
|
||||
liquid.update_network(pos)
|
||||
end,
|
||||
after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
||||
Pipe:after_dig_node(pos)
|
||||
end,
|
||||
|
||||
paramtype2 = "facedir",
|
||||
on_rotate = screwdriver.disallow,
|
||||
groups = {cracky=2},
|
||||
is_ground_content = false,
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
|
||||
networks = {
|
||||
pipe = {
|
||||
sides = {R=1}, -- Pipe connection sides
|
||||
ntype = "pump",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
Pipe:add_secondary_node_names({
|
||||
"techage:ta4_reactor_base",
|
||||
"techage:ta4_reactor_fillerpipe",
|
||||
"techage:ta4_reactor_stand",
|
||||
})
|
||||
|
@ -638,6 +638,8 @@ techage.manual_DE.aText = {
|
||||
"Es müssen alle Öffnungen am Turm mit Tanks verbunden werden.\n"..
|
||||
"Der Aufkocher (reboiler) muss mit dem Block \"Destillationsturm 1\" verbunden werden.\n"..
|
||||
"\n"..
|
||||
"Der Aufkocher benötigt Strom (nicht im Plan zu sehen)!\n"..
|
||||
"\n"..
|
||||
"\n"..
|
||||
"\n",
|
||||
"Der Aufkocher erhitzt das Erdöl auf ca. 400°C. Dabei verdampft es weitgehend und wird in den Destillationsturm zur Abkühlung geleitet.\n"..
|
||||
|
@ -19,6 +19,13 @@ techage.furnace.register_recipe({
|
||||
time = 2,
|
||||
})
|
||||
|
||||
techage.furnace.register_recipe({
|
||||
output = "default:obsidian",
|
||||
recipe = {"default:cobble"},
|
||||
time = 8,
|
||||
})
|
||||
|
||||
|
||||
if techage.modified_recipes_enabled then
|
||||
techage.furnace.register_recipe({
|
||||
output = "default:bronze_ingot 4",
|
||||
|
3
init.lua
@ -49,6 +49,7 @@ else
|
||||
dofile(MP.."/basis/mark2.lua")
|
||||
dofile(MP.."/basis/assemble.lua")
|
||||
dofile(MP.."/basis/networks.lua")
|
||||
dofile(MP.."/basis/recipe_lib.lua")
|
||||
|
||||
-- Main doc
|
||||
dofile(MP.."/doc/manual_DE.lua")
|
||||
@ -194,7 +195,7 @@ else
|
||||
|
||||
-- Test
|
||||
dofile(MP.."/recipe_checker.lua")
|
||||
dofile(MP.."/.test/sink.lua")
|
||||
--dofile(MP.."/.test/sink.lua")
|
||||
dofile(MP.."/.test/source.lua")
|
||||
--dofile(MP.."/.test/akku.lua")
|
||||
--dofile(MP.."/.test/switch.lua")
|
||||
|
@ -165,6 +165,7 @@ minetest.register_node("techage:ash", {
|
||||
description = S("Ash"),
|
||||
tiles = {"techage_ash.png"},
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
|
@ -47,6 +47,20 @@ if techage.modified_recipes_enabled then
|
||||
minetest.clear_craft({output = "fire:flint_and_steel"})
|
||||
minetest.clear_craft({output = "bucket:bucket_empty"})
|
||||
|
||||
-- add again
|
||||
minetest.register_craft({
|
||||
output = 'default:steel_ingot 9',
|
||||
recipe = {
|
||||
{'default:steelblock'},
|
||||
}
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = 'default:bronze_ingot 9',
|
||||
recipe = {
|
||||
{'default:bronzeblock'},
|
||||
}
|
||||
})
|
||||
|
||||
techage.ironage_register_recipe({
|
||||
output = "default:bronze_ingot 4",
|
||||
recipe = {"default:copper_ingot", "default:copper_ingot", "default:copper_ingot", "default:tin_ingot"},
|
||||
|
@ -56,6 +56,7 @@ Meridium Axe=Meridium Axt
|
||||
Meridium Pickaxe=Meridium Pickel
|
||||
Meridium Shovel=Meridium Schaufel
|
||||
Meridium Sword=Meridium Schwert
|
||||
More water expected (2 m deep)!=
|
||||
Network Data=Netzwerkdaten
|
||||
No plan available=Kein Plan verfügar
|
||||
No wind at this altitude!=Kein Wind auf dieser Höhe
|
||||
@ -213,6 +214,7 @@ TA4 Pipe Inlet=TA4 Rohrzulauf
|
||||
TA4 Protected Chest=TA4 Gesicherte Kiste
|
||||
TA4 Pump=TA4 Pumpe
|
||||
TA4 Reactor=Reaktor
|
||||
TA4 Reactor Base=
|
||||
TA4 Reactor Filler Pipe=TA4 Reaktor Einfüllstutzen
|
||||
TA4 Rotor Blade=TA4 Rotorblatt
|
||||
TA4 Silicon Wafer=TA4 Silizium-Wafer
|
||||
@ -249,7 +251,6 @@ Usmium Nuggets=Usmium Nuggets
|
||||
WLAN Chip=WLAN Chip
|
||||
Water=Wasser
|
||||
Water Barrel=Wasserfass
|
||||
Wrong place for wind turbines!=Falscher Ort für Windkraftanlagen
|
||||
[TA4 Wind Turbine]=[TA4 Windkraftanlage]
|
||||
[TA] Area is protected!=[TA] Bereich ist geschützt
|
||||
[TA] Derrick is being built!=[TA] Bohrturm wird errichtet
|
||||
@ -279,3 +280,4 @@ reactor has no power=Reaktor hat keinen Strom
|
||||
removed=entfernt
|
||||
stopped=gestoppt
|
||||
##### not used anymore #####
|
||||
Wrong place for wind turbines!=Falscher Ort für Windkraftanlagen
|
@ -100,7 +100,6 @@ TA Industrial Lamp 2=TA Industrielampe 2
|
||||
TA Industrial Lamp 3=TA Industrielampe 3
|
||||
TA Junction Pipe=TA Leitungskupplung
|
||||
TA Lamp=TA Lampe
|
||||
TA Oil=TA Öl
|
||||
TA Pipe=TA Leitung (Flüssigkeiten)
|
||||
TA Power Line=TA Stromleitung
|
||||
TA Power Pole=TA Strommast
|
||||
@ -136,27 +135,48 @@ TA2 Protected Chest=TA2 Gesicherte Kiste
|
||||
TA2 Steam Pipe=TA2 Dampfleitung
|
||||
TA3 Akku=TA3 Akku
|
||||
TA3 Akku Box=TA3 Akku Block
|
||||
TA3 Bitumen=TA3 Bitumen
|
||||
TA3 Bitumen Barrel=TA3 Bitumenfass
|
||||
TA3 Bitumen Canister=TA3 Bitumenkanister
|
||||
TA3 Boiler Base=TA3 Boiler unten
|
||||
TA3 Boiler Top=TA3 Boiler oben
|
||||
TA3 Booster=TA3 Gebläse
|
||||
TA3 Button/Switch=TA3 Taster/Schalter
|
||||
TA3 Canister=TA3 Kanister
|
||||
TA3 Cart Detector=TA3 Wagen Detektor
|
||||
TA3 Coal Power Station Firebox=TA3 Kohlekraftwerks-Feuerbox
|
||||
TA3 Coal/oil=TA3 Kohle/Öl
|
||||
TA3 Cooler=TA3 Kühler
|
||||
TA3 Derrick=TA3 Bohrturm
|
||||
TA3 Detector=TA3 Detektor
|
||||
TA3 Distillation Tower 1=TA3 Destillationsturm 1
|
||||
TA3 Distillation Tower 2=TA3 Destillationsturm 2
|
||||
TA3 Distillation Tower 3=TA3 Destillationsturm 3
|
||||
TA3 Distillation Tower 4=TA3 Destillationsturm 4
|
||||
TA3 Distillation Tower Base=TA3 Destillationsturm Basis
|
||||
TA3 Drill Bit=TA3 Bohrgestänge
|
||||
TA3 Ele Fab=TA3 E-Fabrik
|
||||
TA3 Fuel Oil=TA3 Schweröl
|
||||
TA3 Fuel Oil Barrel=TA3 Schwerölfass
|
||||
TA3 Fuel Oil Canister=TA3 Schwerölkanister
|
||||
TA3 Funnel=TA3 Trichter
|
||||
TA3 Furnace Oil Burner=TA3 Ofen-Ölbrenner
|
||||
TA3 Gas=TA3 Gas
|
||||
TA3 Gasoline=TA3 Benzin
|
||||
TA3 Gasoline Barrel=TA3 Benzinfass
|
||||
TA3 Gasoline Canister=TA3 Benzinkanister
|
||||
TA3 Generator=TA3 Generator
|
||||
TA3 Gravel Sieve=TA3 Kiessieb
|
||||
TA3 Logic Block=TA3 Logikblock
|
||||
TA3 Melting=TA3 Schmelzen
|
||||
TA3 Naphtha=TA3 Naphtha
|
||||
TA3 Naphtha Barrel=TA3 Naphtha-Fass
|
||||
TA3 Naphtha Canister=TA3 Naphtha-Kanister
|
||||
TA3 Node Detector=TA3 Block Detektor
|
||||
TA3 Oil Barrel=TA3 Ölfass
|
||||
TA3 Oil Canister=TA3 Erdölkanister
|
||||
TA3 Oil Explorer=TA3 Ölexplorer
|
||||
TA3 Oil Reboiler=TA3 Aufkocher
|
||||
TA3 Oil Storage=TA3 Öl Speicher
|
||||
TA3 Player Detector=TA3 Spieler Detektor
|
||||
TA3 Power Station Firebox=TA3 Kraftwerks-Feuerbox
|
||||
@ -174,7 +194,6 @@ TA3 Turbine=TA3 Turbine
|
||||
TA3 Vacuum Tube=TA3 Vakuumröhre
|
||||
TA4 Carbon Fiber=TA4 Kohlefaser
|
||||
TA4 Derrick=TA4 Bohrturm
|
||||
TA4 Distillation Tower=TA4 Destillationsturm
|
||||
TA4 Doser=TA4 Dosierer
|
||||
TA4 Electrolyzer=TA4 Elektrolyseur
|
||||
TA4 Energy Storage=TA4 Energiespeicher
|
||||
@ -187,7 +206,6 @@ TA4 Heat Exchanger 1=TA4 Wärmetauscher 1
|
||||
TA4 Heat Exchanger 2=TA4 Wärmetauscher 2
|
||||
TA4 Heat Exchanger 3=TA4 Wärmetauscher 3
|
||||
TA4 Hydrogen=TA4 Wasserstoff
|
||||
TA4 Junction Pipe=TA4 Verbindungsrohr
|
||||
TA4 Low Power Box==TA4 Niederspannungsverteilerbox
|
||||
TA4 Low Power Cable=TA4 Niederspannungskabel
|
||||
TA4 Pillar=TA4 Säule
|
||||
@ -260,4 +278,4 @@ reactor defect=Reaktor defekt
|
||||
reactor has no power=Reaktor hat keinen Strom
|
||||
removed=entfernt
|
||||
stopped=gestoppt
|
||||
##### not used anymore #####
|
||||
##### not used anymore #####
|
||||
|
@ -54,6 +54,7 @@ Meridium Axe=
|
||||
Meridium Pickaxe=
|
||||
Meridium Shovel=
|
||||
Meridium Sword=
|
||||
More water expected (2 m deep)!=
|
||||
Network Data=
|
||||
No plan available=
|
||||
No wind at this altitude!=
|
||||
@ -211,6 +212,7 @@ TA4 Pipe Inlet=
|
||||
TA4 Protected Chest=
|
||||
TA4 Pump=
|
||||
TA4 Reactor=
|
||||
TA4 Reactor Base=
|
||||
TA4 Reactor Filler Pipe=
|
||||
TA4 Rotor Blade=
|
||||
TA4 Silicon Wafer=
|
||||
@ -247,7 +249,6 @@ Usmium Nuggets=
|
||||
WLAN Chip=
|
||||
Water=
|
||||
Water Barrel=
|
||||
Wrong place for wind turbines!=
|
||||
[TA4 Wind Turbine]=
|
||||
[TA] Area is protected!=
|
||||
[TA] Derrick is being built!=
|
||||
|
@ -350,6 +350,8 @@ An den Öffnungen von unten nach oben werden Schweröl, Naphtha und Benzin abgel
|
||||
Es müssen alle Öffnungen am Turm mit Tanks verbunden werden.
|
||||
Der Aufkocher (reboiler) muss mit dem Block "Destillationsturm 1" verbunden werden.
|
||||
|
||||
Der Aufkocher benötigt Strom (nicht im Plan zu sehen)!
|
||||
|
||||
|
||||
[ta3_distiller|plan]
|
||||
|
||||
|
@ -82,7 +82,7 @@ minetest.register_node("techage:ta3_distiller_base", {
|
||||
on_rotate = screwdriver.disallow,
|
||||
groups = {cracky=2},
|
||||
is_ground_content = false,
|
||||
sounds = default.node_sound_metal_defaults(),
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
|
||||
networks = {
|
||||
pipe = {
|
||||
|
@ -237,8 +237,8 @@ minetest.register_node("techage:tiny_generator_on", {
|
||||
on_rotate = screwdriver.disallow,
|
||||
is_ground_content = false,
|
||||
|
||||
allow_metadata_inventory_put = allow_metadata_inventory_put,
|
||||
allow_metadata_inventory_take = allow_metadata_inventory_take,
|
||||
allow_metadata_inventory_put = fuel.allow_metadata_inventory_put,
|
||||
allow_metadata_inventory_take = fuel.allow_metadata_inventory_take,
|
||||
on_metadata_inventory_put = on_metadata_inventory_put,
|
||||
on_receive_fields = on_receive_fields,
|
||||
on_rightclick = on_rightclick,
|
||||
|
Before Width: | Height: | Size: 428 B After Width: | Height: | Size: 464 B |
Before Width: | Height: | Size: 772 B After Width: | Height: | Size: 745 B |
Before Width: | Height: | Size: 392 B After Width: | Height: | Size: 857 B |
Before Width: | Height: | Size: 329 B After Width: | Height: | Size: 351 B |
@ -81,7 +81,7 @@ local function replace_node(itemstack, placer, pointed_thing)
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_node("techage:trowel", {
|
||||
minetest.register_tool("techage:trowel", {
|
||||
description = S("TechAge Trowel"),
|
||||
inventory_image = "techage_trowel.png",
|
||||
wield_image = "techage_trowel.png",
|
||||
|
@ -57,6 +57,7 @@ local function add_rotor(pos, mem, player_name)
|
||||
local num = #minetest.find_nodes_in_area(pos1, pos2, {"techage:ta4_wind_turbine"})
|
||||
if num > 1 then
|
||||
if player_name then
|
||||
techage.mark_region(player_name, pos1, pos2, "")
|
||||
minetest.chat_send_player(player_name, S("[TA4 Wind Turbine]")..
|
||||
" "..S("The wind turbines are too close together!"))
|
||||
end
|
||||
@ -71,8 +72,9 @@ local function add_rotor(pos, mem, player_name)
|
||||
local num = #minetest.find_nodes_in_area(pos1, pos2, {"default:water_source", "default:water_flowing", "ignore"})
|
||||
if num < (41*41*2-MAX_NUM_FOREIGN_NODES) then
|
||||
if player_name then
|
||||
techage.mark_region(player_name, pos1, pos2, "")
|
||||
minetest.chat_send_player(player_name, S("[TA4 Wind Turbine]")..
|
||||
" "..S("Wrong place for wind turbines!"))
|
||||
" "..S("More water expected (2 m deep)!"))
|
||||
end
|
||||
M(pos):set_string("infotext", S("TA4 Wind Turbine").." "..S("Error"))
|
||||
mem.error = true
|
||||
@ -81,6 +83,9 @@ local function add_rotor(pos, mem, player_name)
|
||||
|
||||
if pos.y < 12 or pos.y > 20 then
|
||||
if player_name then
|
||||
pos1 = {x=pos.x-13, y=12, z=pos.z-13}
|
||||
pos2 = {x=pos.x+13, y=20, z=pos.z+13}
|
||||
techage.mark_region(player_name, pos1, pos2, "")
|
||||
minetest.chat_send_player(player_name, S("[TA4 Wind Turbine]")..
|
||||
" "..S("No wind at this altitude!"))
|
||||
end
|
||||
|