From 87822e94267392ac7457f1a6b46cdb4c8d6c08d8 Mon Sep 17 00:00:00 2001 From: Joachim Stolberg Date: Wed, 10 Feb 2021 21:34:22 +0100 Subject: [PATCH] Improve furnace, fix bakedclay dependency --- furnace/firebox.lua | 4 +- furnace/furnace_top.lua | 4 +- liquids/waterinlet.lua | 120 +++++++++++++++++++++++++++++++++++++++ manuals/manual_ta3_DE.md | 2 +- manuals/manual_ta3_EN.md | 2 +- mod.conf | 2 +- 6 files changed, 127 insertions(+), 7 deletions(-) create mode 100644 liquids/waterinlet.lua diff --git a/furnace/firebox.lua b/furnace/firebox.lua index 614e913..a6f2ca5 100644 --- a/furnace/firebox.lua +++ b/furnace/firebox.lua @@ -82,10 +82,10 @@ end local _liquid = { capa = fuel.CAPACITY, - fuel_cat = fuel.BT_OIL, + fuel_cat = fuel.BT_BITUMEN, peek = liquid.srv_peek, put = function(pos, indir, name, amount) - if fuel.valid_fuel(name, fuel.BT_OIL) then + if fuel.valid_fuel(name, fuel.BT_BITUMEN) then local res = liquid.srv_put(pos, indir, name, amount) if techage.is_activeformspec(pos) then local nvm = techage.get_nvm(pos) diff --git a/furnace/furnace_top.lua b/furnace/furnace_top.lua index 6e0dafc..1c894e9 100644 --- a/furnace/furnace_top.lua +++ b/furnace/furnace_top.lua @@ -212,8 +212,8 @@ tiles.pas = { -- up, down, right, left, back, front "techage_concrete.png^techage_frame_ta#_top.png", "techage_concrete.png^techage_frame_ta#_top.png", - "techage_concrete.png^techage_frame_ta#.png", - "techage_concrete.png^techage_frame_ta#.png", + "techage_concrete.png^techage_frame_ta#.png^techage_appl_outp.png", + "techage_concrete.png^techage_frame_ta#.png^techage_appl_inp.png", "techage_concrete.png^techage_frame_ta#.png", "techage_concrete.png^techage_appl_furnace.png^techage_frame_ta#.png", } diff --git a/liquids/waterinlet.lua b/liquids/waterinlet.lua new file mode 100644 index 0000000..d1065e6 --- /dev/null +++ b/liquids/waterinlet.lua @@ -0,0 +1,120 @@ +--[[ + + TechAge + ======= + + Copyright (C) 2019-2021 Joachim Stolberg + + AGPL v3 + See LICENSE.txt for more information + + TA4 Water Inlet (replacement for the water pump) + +]]-- + +-- for lazy programmers +local M = minetest.get_meta +local S = techage.S + +local Pipe = techage.LiquidPipe +local liquid = techage.liquid + +local function is_ocean(pos) + if pos.y > 1 then + M(pos):set_string("infotext", S("Error: Not on sea level!")) + return false + end + local node = techage.get_node_lvm({x = pos.x, y = pos.y - 1, z = pos.z}) + if node.name ~= "default:water_source" then + M(pos):set_string("infotext", S("Error: No water available!")) + return false + end + if node.param2 == 1 then + M(pos):set_string("infotext", S("Error: No natural water!")) + return false + end + return true +end + +local function srv_peek(pos) + local nvm = techage.get_nvm(pos) + if is_ocean(pos) then + nvm.liquid.name = "default:water_source" + nvm.liquid.amount = 1 + else + nvm.liquid.name = nil + nvm.liquid.amount = 0 + end + return nvm.liquid.name +end + +local function take_liquid(pos, indir, name, amount) + local nvm = techage.get_nvm(pos) + return nvm.liquid.amount, nvm.liquid.name +end + +local function untake_liquid(pos, indir, name, amount) + return 0 +end + +local netw_def = { + pipe2 = { + sides = {U = 1}, -- Pipe connection sides + ntype = "tank", + }, +} + +minetest.register_node("techage:ta4_waterinlet", { + description = S("TA4 Water Inlet"), + tiles = { + -- up, down, right, left, back, front + "techage_filling_ta4.png^techage_frame_waterpump_top.png^techage_appl_hole_pipe.png", + "techage_filling_ta4.png^techage_frame_ta4.png", + "techage_filling_ta4.png^techage_frame_waterpump.png", + "techage_filling_ta4.png^techage_frame_waterpump.png", + "techage_filling_ta4.png^techage_frame_waterpump.png", + "techage_filling_ta4.png^techage_frame_waterpump.png", + }, + + after_place_node = function(pos, placer) + local meta = M(pos) + local nvm = techage.get_nvm(pos) + nvm.liquid = {} + Pipe:after_place_node(pos) + srv_peek(pos) + end, + tubelib2_on_update2 = function(pos, outdir, tlib2, node) + liquid.update_network(pos, outdir) + end, + --on_timer = node_timer, + --on_punch = liquid.on_punch, + after_dig_node = function(pos, oldnode, oldmetadata, digger) + Pipe:after_dig_node(pos) + techage.remove_node(pos, oldnode, oldmetadata) + end, + liquid = { + capa = 1, + peek = liquid.srv_peek, + take = take_liquid, + untake = untake_liquid, + }, + networks = netw_def, + --on_rightclick = on_rightclick, + --can_dig = can_dig, + paramtype2 = "facedir", + on_rotate = screwdriver.disallow, + groups = {cracky=2}, + is_ground_content = false, + sounds = default.node_sound_metal_defaults(), +}) + +Pipe:add_secondary_node_names({"techage:ta4_waterinlet"}) + +minetest.register_craft({ + output = "techage:ta4_waterinlet", + recipe = { + {"techage:ta4_carbon_fiber", "techage:ta3_pipeS", "techage:ta4_carbon_fiber"}, + {"techage:iron_ingot", "techage:ta3_barrel_empty", "techage:iron_ingot"}, + }, +}) + diff --git a/manuals/manual_ta3_DE.md b/manuals/manual_ta3_DE.md index 548f268..7198668 100644 --- a/manuals/manual_ta3_DE.md +++ b/manuals/manual_ta3_DE.md @@ -235,7 +235,7 @@ Siehe auch TA4 Ofenheizung. Ist Teil des TA3 Industrieofen. -Der Ölbrenner kann mit Schweröl, Naphtha oder Benzin betrieben werden. Die Brennzeit beträgt für Schweröl 80 s, Naphtha 90 s und Benzin 100 s. +Der Ölbrenner kann mit Erdöl, Schweröl, Naphtha oder Benzin betrieben werden. Die Brennzeit beträgt für Erdöl 65 s, Schweröl 80 s, Naphtha 90 s und Benzin 100 s. Der Ölbrenner kann nur 50 Einheiten Kraftstoff aufnehmen. Ein zusätzlicher Tank und eine Pumpe sind daher ratsam. diff --git a/manuals/manual_ta3_EN.md b/manuals/manual_ta3_EN.md index ecca503..86a2960 100644 --- a/manuals/manual_ta3_EN.md +++ b/manuals/manual_ta3_EN.md @@ -226,7 +226,7 @@ See also TA4 heater. Is part of the TA3 industrial furnace. -The oil burner can be operated with fuel oil, naphtha or gasoline. The burning time is 80 s for fuel oil, 90 s for naphtha and 100 s for gasoline. +The oil burner can be operated with crude oil, fuel oil, naphtha or gasoline. The burning time is 64 s for crude oil, 80 s for fuel oil, 90 s for naphtha and 100 s for gasoline. The oil burner can only hold 50 units of fuel. An additional tank and a pump are therefore advisable. diff --git a/mod.conf b/mod.conf index 517295f..ea1e24d 100644 --- a/mod.conf +++ b/mod.conf @@ -1,4 +1,4 @@ name = techage depends = default,doors,flowers,tubelib2,basic_materials,bucket,stairs,screwdriver,minecart,lcdlib,safer_lua -optional_depends = unified_inventory,wielded_light,unifieddyes,moreores,ethereal,mesecon,digtron +optional_depends = unified_inventory,wielded_light,unifieddyes,moreores,ethereal,mesecon,digtron,bakedclay description = Techage, go through 4 tech ages in search of wealth and power!