From 546cd9195cb104c16da7783cdea1d5a03871ad8f Mon Sep 17 00:00:00 2001 From: Joachim Stolberg Date: Thu, 19 Aug 2021 10:04:19 +0200 Subject: [PATCH] built on 19/08/2021 10:04:19 --- techage/doc/items.lua | 4 + techage/doc/manual_DE.lua | 41 +++++++++- techage/doc/manual_EN.lua | 33 +++++++- techage/doc/plans.lua | 19 ++--- techage/init.lua | 1 - techage/locale/techage.de.tr | 2 +- techage/manuals/manual_ta1_DE.md | 41 +++++++++- techage/manuals/manual_ta1_EN.md | 31 +++++++- techage/manuals/toc_DE.md | 5 ++ techage/manuals/toc_EN.md | 4 + techage/ta1_watermill/millboard.lua | 4 +- techage/ta1_watermill/sluice.lua | 94 +++++++--------------- techage/ta1_watermill/ta1_axle.lua | 2 +- techage/ta1_watermill/water.lua | 117 ---------------------------- techage/ta1_watermill/watermill.lua | 23 +++++- 15 files changed, 215 insertions(+), 206 deletions(-) delete mode 100644 techage/ta1_watermill/water.lua diff --git a/techage/doc/items.lua b/techage/doc/items.lua index 2db617d..f3e7161 100644 --- a/techage/doc/items.lua +++ b/techage/doc/items.lua @@ -29,6 +29,10 @@ techage.Items = { wlanchip = "techage:ta4_wlanchip", tube = "techage:tubeS", concentrator = "techage:concentrator27", + ta1_sluice = "techage:ta1_sluice_closed", + ta1_sluice_handle = "techage:ta1_sluice_handle_closed", + ta1_board1 = "techage:ta1_board1_apple", + ta1_board2 = "techage:ta1_board2_apple", ---------------- techage_ta2 = "techage_ta2.png", ta2_firebox = "techage:firebox", diff --git a/techage/doc/manual_DE.lua b/techage/doc/manual_DE.lua index 2ca99e3..83b2414 100644 --- a/techage/doc/manual_DE.lua +++ b/techage/doc/manual_DE.lua @@ -17,6 +17,11 @@ techage.manual_DE.aTitel = { "2,Kohlebrenner / Coal Burner", "2,Wassermühle", "3,TA1 Mühle", + "3,TA1 Schleusenschieber / TA1 Sluice Gate", + "3,TA1 Schleusengriff / TA1 Sluice Handle", + "3,TA1 Apfelholzbrett / TA1 Apple Wood Board", + "3,TA1 Apfel Mühlbachbrett / TA1 Apple Millrace Board", + "2, ", "2,Erze und Werkzeuge", "3,Hammer", "3,Kiessieb / Gravel Sieve", @@ -342,19 +347,39 @@ techage.manual_DE.aText = { "\n".. "\n", "Mit der Wassermühle können Weizen und andere Getreide zu Mehl gemahlen und dann im Ofen zu Brot gebacken werden. Die Mühle wird mit\n".. - "Wasserkraft angetrieben. Dazu muss ein Mühlbach über einen Kanal zum Mühlrad geführt werden. Für den Mühlbach muss oberhalb des Mühlrades\n".. - "ein Teich angelegt werden. Der Teich und damit die Wassermenge muss mindestens 8 x 8 Blöcke groß und 2 Blöcke tief sein. An den Rand des Teiches wird eine Schleuse gesetzt. Über die Schleuse kann das Wasserfluss und damit das Mühlrad gesteuert werden. Die Schleuse bestehend aus Schleusenschieber und Schleusengriff.\n".. + "Wasserkraft angetrieben. Dazu muss ein Mühlbach über einen Kanal zum Mühlrad geführt werden.\n".. + "Über eine Schleuse kann das Wasserfluss und damit das Mühlrad gesteuert werden.\n".. + "Die Schleuse bestehend aus Schleusenschieber und Schleusengriff.\n".. "\n".. "Die Abbildung rechts (auf \"Plan\" klicken) zeigt den Aufbau der Wassermühle.\n".. "\n".. "\n".. "\n", - "Mit der Wassermühle können Weizen und andere Getreide zu Mehl gemahlen und dann im Ofen zu Brot gebacken werden. Die Mühle muss mit einer TA1 Achse mit dem Mühlrad verbunden werden. Die Kraft des Mühlrades reicht nur für eine Mühle.\n".. + "Mit der Wassermühle können Weizen und andere Getreide zu Mehl gemahlen und dann im Ofen zu Brot gebacken werden.\n".. + "Die Mühle muss mit einer TA1 Achse mit dem Mühlrad verbunden werden. Die Kraft des Mühlrades reicht nur für eine Mühle.\n".. "\n".. "Die Mühle kann mit Hilfe eines Minecart Hoppers automatisiert werden\\, so dass das Mehl bspw. direkt von der Mühle in einen Ofen befördert wird\\, um daraus Brot zu backen.\n".. "\n".. "\n".. "\n", + "Der Schleusenschieber muss auf gleicher Höhe wie die Wasseroberfläche direkt an einen Teich oder in einen Bach gesetzt werden.\n".. + "Wird die Schleuse geöffnet\\, so fließt Wasser durch den Schieber. Dieses Wasser muss dann zum Mühlrad geleitet werden und treibt dort die Mühle an.\n".. + "\n".. + "\n".. + "\n", + "Der TA1 Schleusengriff muss auf den Schleusenschieber gesetzt werden. Mit Hilfe des Schleusengriffs (Rechtsklick) kann der Schieber geöffnet werden.\n".. + "\n".. + "\n".. + "\n", + "Block in verschiedenen Holzsorten zum Bauen des Mühlbachkanals. Es kann aber auch jedes andere Material verwendet werden.\n".. + "\n".. + "\n".. + "\n", + "Block in verschiedenen Holzsorten zum Bauen des Mühlbachkanals. Dieser Block eignet sich speziell in Verbindung mit Pfosten des Holzzauns um eine Stütze des Kanals zu bauen.\n".. + "\n".. + "\n".. + "\n", + "", "TA1 hat seine eigenen Werkzeuge wie Hammer und Kiessieb\\, aber auch der Minecart Hopper kann genutzt werden.\n".. "\n".. "\n".. @@ -1741,6 +1766,11 @@ techage.manual_DE.aItemName = { "", "", "", + "ta1_sluice", + "ta1_sluice_handle", + "ta1_board1", + "ta1_board2", + "", "ta1_gravelsieve", "hammer", "ta1_gravelsieve", @@ -1954,6 +1984,11 @@ techage.manual_DE.aPlanTable = { "", "", "", + "", + "", + "", + "", + "", "hoppersieve", "", "", diff --git a/techage/doc/manual_EN.lua b/techage/doc/manual_EN.lua index ce84562..c545f12 100644 --- a/techage/doc/manual_EN.lua +++ b/techage/doc/manual_EN.lua @@ -18,6 +18,10 @@ techage.manual_EN.aTitel = { "2,Melting Furnace", "2,Watermill", "3,TA1 mill", + "3,TA1 sluice gate", + "3,TA1 sluice handle", + "3,TA1 Apple Wood Board", + "3,TA1 Apple Millrace Board", "2,Ores and Tools", "3,Hammer", "3,Gravel Sieve", @@ -351,7 +355,8 @@ techage.manual_EN.aText = { "\n".. "\n", "The watermill can be used to grind wheat and other grains into flour and then bake them in the furnace to make bread. \n".. - "The mill is powered by water power. To do this\\, a millrace must be led to the mill wheel via a canal. For the Mühlbach a pond must be created above the mill wheel. The pond and thus the amount of water must be at least 8x8 blocks large and 2 blocks deep. A sluice will be set at the edge of the pond. The water flow and thus the mill wheel can be controlled via the sluice. The sluice consists of the sluice lock and sluice handle.\n".. + "The mill is powered by water power. To do this\\, a millrace must be led to the mill wheel via a canal.\n".. + "The water flow and thus the mill wheel can be controlled via a sluice. The sluice consists of the sluice lock and sluice handle.\n".. "\n".. "The picture on the right (click on \"Plan\") shows the structure of the watermill. \n".. "\n".. @@ -363,6 +368,24 @@ techage.manual_EN.aText = { "\n".. "\n".. "\n", + "The sluice gate valve must be placed directly next to a pond or in a stream at the same height as the water surface.\n".. + "When the gate is opened\\, water flows through the slide. This water then has to be fed to the mill wheel\\, where it drives the mill.\n".. + "\n".. + "\n".. + "\n", + "The TA1 sluice handle must be placed on the sluice gate. The gate can be opened with the aid of the sluice handle (right click).\n".. + "\n".. + "\n".. + "\n", + "Block in different types of wood for building the millrace canal. However\\, any other material can also be used.\n".. + "\n".. + "\n".. + "\n", + "Block in different types of wood for building the millrace canal. This block is especially suitable in connection\n".. + "with posts of the wooden fence to build a support of the canal.\n".. + "\n".. + "\n".. + "\n", "TA1 has its own tools such as hammer and gravel sieve\\, but the Minecart Hopper can also be used.\n".. "\n".. "\n".. @@ -1743,6 +1766,10 @@ techage.manual_EN.aItemName = { "", "", "", + "ta1_sluice", + "ta1_sluice_handle", + "ta1_board1", + "ta1_board2", "ta1_gravelsieve", "hammer", "ta1_gravelsieve", @@ -1957,6 +1984,10 @@ techage.manual_EN.aPlanTable = { "", "", "", + "", + "", + "", + "", "hoppersieve", "", "", diff --git a/techage/doc/plans.lua b/techage/doc/plans.lua index da6bdbc..4eb7b64 100644 --- a/techage/doc/plans.lua +++ b/techage/doc/plans.lua @@ -86,6 +86,7 @@ techage.ConstructionPlans["hoppersieve"] = { -- local WATR1 = {"default_water.png" , "techage:water_flowing"} local WATR3 = {"techage_water_flowing.png" , "techage:water_flowing"} +local WATR4 = {"default_water.png" , "default:water_source"} local WMILL = {"default_wood.png" , "techage:ta1_board1_apple"} local SLUC1 = {"techage_sluice2_inv.png" , "techage:ta1_sluice_closed"} local SLUC2 = {"techage_sluice1_inv.png" , "techage:ta1_sluice_handle_closed"} @@ -107,15 +108,15 @@ local BRICK = {"default_stone_brick.png", "default:stonebrick"} techage.ConstructionPlans["watermill1"] = { - {false, false, false, false, false, false, false, false, false, false, false}, - {false, SLUC2, false, false, false, false, false, false, false, false, false}, - {WATR1, SLUC1, WMILL, WMILL, WMILL, WMILL, WMILL, WATR3, false, false, false}, - {WATR1, DDIRT, false, false, MIL31, MIL21, MIL11, MIL21, MIL34, false, false}, - {WATR1, DDIRT, false, false, MIL22, MIL40, MIL40, MIL40, MIL24, false, false}, - {DDIRT, DDIRT, DDIRT, false, MIL12, MIL40, BEARG, MIL40, MIL14, false, false}, - {DDIRT, DDIRT, DDIRT, false, MIL22, MIL40, BRICK, MIL40, MIL24, false, false}, - {DDIRT, DDIRT, DDIRT, DDIRT, MIL32, MIL23, BRICK, MIL23, MIL33, false, false}, - {DDIRT, DDIRT, DDIRT, DDIRT, DDIRT, DDIRT, DDIRT, WATR1, WATR1, WATR1, WATR1}, + {false, false, false, false, false, false, false, false, false, false, false, false}, + {false, false, SLUC2, false, false, false, false, false, false, false, false, false}, + {WATR4, WATR4, SLUC1, WMILL, WMILL, WMILL, WMILL, WMILL, WATR3, false, false, false}, + {WATR4, WATR4, DDIRT, false, false, MIL31, MIL21, MIL11, MIL21, MIL34, false, false}, + {WATR4, DDIRT, DDIRT, false, false, MIL22, MIL40, MIL40, MIL40, MIL24, false, false}, + {DDIRT, DDIRT, DDIRT, DDIRT, false, MIL12, MIL40, BEARG, MIL40, MIL14, false, false}, + {DDIRT, DDIRT, DDIRT, DDIRT, false, MIL22, MIL40, BRICK, MIL40, MIL24, false, false}, + {DDIRT, DDIRT, DDIRT, DDIRT, DDIRT, MIL32, MIL23, BRICK, MIL23, MIL33, false, false}, + {DDIRT, DDIRT, DDIRT, DDIRT, DDIRT, DDIRT, DDIRT, DDIRT, WATR1, WATR1, WATR1, WATR1}, } diff --git a/techage/init.lua b/techage/init.lua index c4cd9af..53e0ca4 100644 --- a/techage/init.lua +++ b/techage/init.lua @@ -137,7 +137,6 @@ end -- TA1 Watermill dofile(MP.."/ta1_watermill/ta1_axle.lua") dofile(MP.."/ta1_watermill/watermill.lua") -dofile(MP.."/ta1_watermill/water.lua") dofile(MP.."/ta1_watermill/sluice.lua") dofile(MP.."/ta1_watermill/millboard.lua") dofile(MP.."/ta1_watermill/mill.lua") diff --git a/techage/locale/techage.de.tr b/techage/locale/techage.de.tr index 694716a..61684c3 100644 --- a/techage/locale/techage.de.tr +++ b/techage/locale/techage.de.tr @@ -902,7 +902,7 @@ TA Lamp=TA Lampe TA1 Sluice Gate=TA1 Schleusenschieber TA1 Sluice Handle=TA1 Schleusengriff -Your pond is too small!=ein Teich ist zu klein! +Your pond is too small!=Der Teich ist zu klein! ### solarcell.lua ### diff --git a/techage/manuals/manual_ta1_DE.md b/techage/manuals/manual_ta1_DE.md index 889abd8..e602081 100644 --- a/techage/manuals/manual_ta1_DE.md +++ b/techage/manuals/manual_ta1_DE.md @@ -53,11 +53,13 @@ Der Schmelztiegel hat ein eigenes Menü mit Rezepten und ein Inventar, wo du die [coalburner|plan] + ## Wassermühle Mit der Wassermühle können Weizen und andere Getreide zu Mehl gemahlen und dann im Ofen zu Brot gebacken werden. Die Mühle wird mit -Wasserkraft angetrieben. Dazu muss ein Mühlbach über einen Kanal zum Mühlrad geführt werden. Für den Mühlbach muss oberhalb des Mühlrades -ein Teich angelegt werden. Der Teich und damit die Wassermenge muss mindestens 8 x 8 Blöcke groß und 2 Blöcke tief sein. An den Rand des Teiches wird eine Schleuse gesetzt. Über die Schleuse kann das Wasserfluss und damit das Mühlrad gesteuert werden. Die Schleuse bestehend aus Schleusenschieber und Schleusengriff. +Wasserkraft angetrieben. Dazu muss ein Mühlbach über einen Kanal zum Mühlrad geführt werden. +Über eine Schleuse kann das Wasserfluss und damit das Mühlrad gesteuert werden. +Die Schleuse bestehend aus Schleusenschieber und Schleusengriff. Die Abbildung rechts (auf "Plan" klicken) zeigt den Aufbau der Wassermühle. @@ -65,12 +67,45 @@ Die Abbildung rechts (auf "Plan" klicken) zeigt den Aufbau der Wassermühle. ### TA1 Mühle -Mit der Wassermühle können Weizen und andere Getreide zu Mehl gemahlen und dann im Ofen zu Brot gebacken werden. Die Mühle muss mit einer TA1 Achse mit dem Mühlrad verbunden werden. Die Kraft des Mühlrades reicht nur für eine Mühle. +Mit der Wassermühle können Weizen und andere Getreide zu Mehl gemahlen und dann im Ofen zu Brot gebacken werden. +Die Mühle muss mit einer TA1 Achse mit dem Mühlrad verbunden werden. Die Kraft des Mühlrades reicht nur für eine Mühle. Die Mühle kann mit Hilfe eines Minecart Hoppers automatisiert werden, so dass das Mehl bspw. direkt von der Mühle in einen Ofen befördert wird, um daraus Brot zu backen. [watermill2|plan] +### TA1 Schleusenschieber / TA1 Sluice Gate + +Der Schleusenschieber muss auf gleicher Höhe wie die Wasseroberfläche direkt an einen Teich oder in einen Bach gesetzt werden. +Wird die Schleuse geöffnet, so fließt Wasser durch den Schieber. Dieses Wasser muss dann zum Mühlrad geleitet werden und treibt dort die Mühle an. + +[ta1_sluice|image] + +### TA1 Schleusengriff / TA1 Sluice Handle + +Der TA1 Schleusengriff muss auf den Schleusenschieber gesetzt werden. Mit Hilfe des Schleusengriffs (Rechtsklick) kann der Schieber geöffnet werden. + +[ta1_sluice_handle|image] + +### TA1 Apfelholzbrett / TA1 Apple Wood Board + +Block in verschiedenen Holzsorten zum Bauen des Mühlbachkanals. Es kann aber auch jedes andere Material verwendet werden. + +[ta1_board1|image] + +### TA1 Apfel Mühlbachbrett / TA1 Apple Millrace Board + +Block in verschiedenen Holzsorten zum Bauen des Mühlbachkanals. Dieser Block eignet sich speziell in Verbindung mit Pfosten des Holzzauns um eine Stütze des Kanals zu bauen. + +[ta1_board2|image] + + + + +## + + + ## Erze und Werkzeuge diff --git a/techage/manuals/manual_ta1_EN.md b/techage/manuals/manual_ta1_EN.md index ecac06e..79e2ccf 100644 --- a/techage/manuals/manual_ta1_EN.md +++ b/techage/manuals/manual_ta1_EN.md @@ -53,10 +53,12 @@ The melting pot has its own menu of recipes and an inventory where you have to p [coalburner|plan] + ## Watermill The watermill can be used to grind wheat and other grains into flour and then bake them in the furnace to make bread. -The mill is powered by water power. To do this, a millrace must be led to the mill wheel via a canal. For the Mühlbach a pond must be created above the mill wheel. The pond and thus the amount of water must be at least 8x8 blocks large and 2 blocks deep. A sluice will be set at the edge of the pond. The water flow and thus the mill wheel can be controlled via the sluice. The sluice consists of the sluice lock and sluice handle. +The mill is powered by water power. To do this, a millrace must be led to the mill wheel via a canal. +The water flow and thus the mill wheel can be controlled via a sluice. The sluice consists of the sluice lock and sluice handle. The picture on the right (click on "Plan") shows the structure of the watermill. @@ -71,6 +73,33 @@ The mill can be automated with the help of a Minecart Hopper, so that the flour, [watermill2|plan] +### TA1 sluice gate + +The sluice gate valve must be placed directly next to a pond or in a stream at the same height as the water surface. +When the gate is opened, water flows through the slide. This water then has to be fed to the mill wheel, where it drives the mill. + +[ta1_sluice|image] + +### TA1 sluice handle + +The TA1 sluice handle must be placed on the sluice gate. The gate can be opened with the aid of the sluice handle (right click). + +[ta1_sluice_handle|image] + +### TA1 Apple Wood Board + +Block in different types of wood for building the millrace canal. However, any other material can also be used. + +[ta1_board1|image] + +### TA1 Apple Millrace Board + +Block in different types of wood for building the millrace canal. This block is especially suitable in connection +with posts of the wooden fence to build a support of the canal. + +[ta1_board2|image] + + ## Ores and Tools diff --git a/techage/manuals/toc_DE.md b/techage/manuals/toc_DE.md index 16e584a..6f95b60 100644 --- a/techage/manuals/toc_DE.md +++ b/techage/manuals/toc_DE.md @@ -16,6 +16,11 @@ - [Kohlebrenner / Coal Burner](./manual_ta1_DE.md#kohlebrenner--coal-burner) - [Wassermühle](./manual_ta1_DE.md#wassermühle) - [TA1 Mühle](./manual_ta1_DE.md#ta1-mühle) + - [TA1 Schleusenschieber / TA1 Sluice Gate](./manual_ta1_DE.md#ta1-schleusenschieber--ta1-sluice-gate) + - [TA1 Schleusengriff / TA1 Sluice Handle](./manual_ta1_DE.md#ta1-schleusengriff--ta1-sluice-handle) + - [TA1 Apfelholzbrett / TA1 Apple Wood Board](./manual_ta1_DE.md#ta1-apfelholzbrett--ta1-apple-wood-board) + - [TA1 Apfel Mühlbachbrett / TA1 Apple Millrace Board](./manual_ta1_DE.md#ta1-apfel-mühlbachbrett--ta1-apple-millrace-board) + - [ ](./manual_ta1_DE.md#-) - [Erze und Werkzeuge](./manual_ta1_DE.md#erze-und-werkzeuge) - [Hammer](./manual_ta1_DE.md#hammer) - [Kiessieb / Gravel Sieve](./manual_ta1_DE.md#kiessieb--gravel-sieve) diff --git a/techage/manuals/toc_EN.md b/techage/manuals/toc_EN.md index 7d124a5..6c27745 100644 --- a/techage/manuals/toc_EN.md +++ b/techage/manuals/toc_EN.md @@ -17,6 +17,10 @@ - [Melting Furnace](./manual_ta1_EN.md#melting-furnace) - [Watermill](./manual_ta1_EN.md#watermill) - [TA1 mill](./manual_ta1_EN.md#ta1-mill) + - [TA1 sluice gate](./manual_ta1_EN.md#ta1-sluice-gate) + - [TA1 sluice handle](./manual_ta1_EN.md#ta1-sluice-handle) + - [TA1 Apple Wood Board](./manual_ta1_EN.md#ta1-apple-wood-board) + - [TA1 Apple Millrace Board](./manual_ta1_EN.md#ta1-apple-millrace-board) - [Ores and Tools](./manual_ta1_EN.md#ores-and-tools) - [Hammer](./manual_ta1_EN.md#hammer) - [Gravel Sieve](./manual_ta1_EN.md#gravel-sieve) diff --git a/techage/ta1_watermill/millboard.lua b/techage/ta1_watermill/millboard.lua index b70c5c1..a50a912 100644 --- a/techage/ta1_watermill/millboard.lua +++ b/techage/ta1_watermill/millboard.lua @@ -31,7 +31,7 @@ local function register_board1(output, description, tiles, input) use_texture_alpha = techage.CLIP, sunlight_propagates = true, is_ground_content = false, - groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1}, + groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, sounds = default.node_sound_wood_defaults(), }) @@ -64,7 +64,7 @@ local function register_board2(output, description, tiles, input1, input2) use_texture_alpha = techage.CLIP, sunlight_propagates = true, is_ground_content = false, - groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1}, + groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, fence = 1}, sounds = default.node_sound_wood_defaults(), }) diff --git a/techage/ta1_watermill/sluice.lua b/techage/ta1_watermill/sluice.lua index c4d796f..1ea0245 100644 --- a/techage/ta1_watermill/sluice.lua +++ b/techage/ta1_watermill/sluice.lua @@ -12,98 +12,62 @@ ]]-- -local M = minetest.get_meta local S = techage.S -local RADIUS = 8 -local DEPTH = 2 -local AMOUNT = RADIUS * RADIUS * 1.5 +local M = minetest.get_meta +local P2S = function(pos) if pos then return minetest.pos_to_string(pos) end end +local S2P = minetest.string_to_pos local function check_position(pos, facedir) local dir = minetest.facedir_to_dir(facedir) local pos_ = vector.add(pos, dir) local node = minetest.get_node(pos_) - - if node.name ~= "default:water_source" then - return - end - - dir = vector.multiply(dir, RADIUS) - local center = vector.add(pos, dir) - local pos1 = {x = center.x - RADIUS, y = center.y - DEPTH, z = center.z - RADIUS} - local pos2 = {x = center.x + RADIUS, y = center.y + 0, z = center.z + RADIUS} - local _, nodes = minetest.find_nodes_in_area(pos1, pos2, {"default:water_source"}) - return (nodes["default:water_source"] and nodes["default:water_source"] > AMOUNT) or false + return (node.name == "default:water_source" or node.name == "default:water_flowing"), pos_ end --- Function checks if a millpond is avaliable and --- returns the pos for the new water block, and the type of block. -local function has_water(pos, facedir, player) - local facedir2, res, dir, pos2 +-- Function checks if water is avaliable and +-- returns the pos for the new water block, and the result (true/false). +local function has_water(pos, facedir) + local res1, pos1 = check_position(pos, (facedir + 1) % 4) + local res2, pos2 = check_position(pos, (facedir + 3) % 4) - -- check left side - facedir2 = (facedir + 3) % 4 - res = check_position(pos, facedir2) - facedir2 = (facedir + 1) % 4 - dir = minetest.facedir_to_dir(facedir2) - pos2 = vector.add(pos, dir) - - if res == nil then - return pos2, "air" - elseif res == true then - return pos2, "water" - else - minetest.chat_send_player(player:get_player_name(), S("Your pond is too small!")) - return pos2, "air" + if res1 and not res2 then + M(pos):set_string("millrace_pos", P2S(pos2)) + return pos2, true end - -- check right side - facedir2 = (facedir + 1) % 4 - res = check_position(pos, facedir2) - facedir2 = (facedir + 3) % 4 - dir = minetest.facedir_to_dir(facedir2) - pos2 = vector.add(pos, dir) - - if res == nil then - return pos2, "air" - elseif res == true then - return pos2, "water" - else - minetest.chat_send_player(player:get_player_name(), S("Your pond is too small!")) - return pos2, "air" + if not res1 and res2 then + M(pos):set_string("millrace_pos", P2S(pos1)) + return pos1, true end + + local pos3 = S2P(M(pos):get_string("millrace_pos")) + if pos3 then + return pos3, true + end + return pos1, false end local function on_rightclick(pos, node, clicker, itemstack, pointed_thing) local pos2 = vector.add(pos, {x = 0, y = -1, z = 0}) local node2 = minetest.get_node(pos2) - local pos3, res = has_water(pos2, node2.param2, clicker) + local pos3, res = has_water(pos2, node2.param2) local node3 = minetest.get_node(pos3) if node2.name == "techage:ta1_sluice_closed" then minetest.swap_node(pos, {name = "techage:ta1_sluice_handle_open", param2 = node.param2}) minetest.swap_node(pos2, {name = "techage:ta1_sluice_open", param2 = node.param2}) - if res == "water" then - if node3.name == "air" or node3.name == "techage:water_flowing" then - minetest.add_node(pos3, {name = "techage:water_source"}) - minetest.get_node_timer(pos3):start(2) - end - else - minetest.add_node(pos3, {name = "air"}) + if res then + minetest.add_node(pos3, {name = "default:water_source"}) + minetest.get_node_timer(pos3):start(2) end minetest.sound_play("doors_door_open", {gain = 0.5, pos = pos, max_hear_distance = 10}, true) elseif node2.name == "techage:ta1_sluice_open" then minetest.swap_node(pos, {name = "techage:ta1_sluice_handle_closed", param2 = node.param2}) minetest.swap_node(pos2, {name = "techage:ta1_sluice_closed", param2 = node.param2}) - if res == "water" then - if node3.name == "techage:water_source" then - minetest.add_node(pos3, {name = "techage:water_flowing"}) - end - else - if node3.name == "techage:water_flowing" then - minetest.add_node(pos3, {name = "air"}) - end + if res then + minetest.add_node(pos3, {name = "air"}) end minetest.sound_play("doors_door_close", {gain = 0.5, pos = pos, max_hear_distance = 10}, true) @@ -160,7 +124,7 @@ minetest.register_node("techage:ta1_sluice_open", { is_ground_content = false, groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1, not_in_creative_inventory = 1}, sounds = default.node_sound_wood_defaults(), - drop = "techage:sluice_closed", + drop = "techage:ta1_sluice_closed", }) minetest.register_node("techage:ta1_sluice_handle_closed", { @@ -205,7 +169,7 @@ minetest.register_node("techage:ta1_sluice_handle_open", { is_ground_content = false, groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1, not_in_creative_inventory = 1}, sounds = default.node_sound_wood_defaults(), - drop = "techage:sluice_handle_closed", + drop = "techage:ta1_sluice_handle_closed", }) minetest.register_craft({ diff --git a/techage/ta1_watermill/ta1_axle.lua b/techage/ta1_watermill/ta1_axle.lua index bd22a15..69c8e22 100644 --- a/techage/ta1_watermill/ta1_axle.lua +++ b/techage/ta1_watermill/ta1_axle.lua @@ -19,7 +19,7 @@ local S = techage.S local Axle = tubelib2.Tube:new({ dirs_to_check = {1,2,3,4,5,6}, - max_tube_length = 5, + max_tube_length = 10, show_infotext = false, tube_type = "axle1", primary_node_names = {"techage:ta1_axle"}, diff --git a/techage/ta1_watermill/water.lua b/techage/ta1_watermill/water.lua deleted file mode 100644 index 64670ea..0000000 --- a/techage/ta1_watermill/water.lua +++ /dev/null @@ -1,117 +0,0 @@ --- Based on and derived from minetest_game.default --- License: LGPL v2.1 - --- support for MT game translation. -local S = default.get_translator - -minetest.register_node("techage:water_flowing", { - description = S("Flowing Water"), - drawtype = "flowingliquid", - waving = 0, - tiles = {"default_water.png"}, - special_tiles = { - { - name = "default_water_flowing_animated.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 16, - aspect_h = 16, - length = 0.5, - }, - }, - { - name = "default_water_flowing_animated.png", - backface_culling = true, - animation = { - type = "vertical_frames", - aspect_w = 16, - aspect_h = 16, - length = 0.5, - }, - }, - }, - use_texture_alpha = "blend", - paramtype = "light", - paramtype2 = "flowingliquid", - walkable = false, - pointable = false, - diggable = false, - buildable_to = true, - is_ground_content = false, - drop = "", - drowning = 1, - liquidtype = "flowing", - liquid_alternative_flowing = "techage:water_flowing", - liquid_alternative_source = "techage:water_source", - liquid_viscosity = 1, - post_effect_color = {a = 103, r = 30, g = 60, b = 90}, - groups = {water = 3, liquid = 3, cools_lava = 1, not_in_creative_inventory = 1}, - sounds = default.node_sound_water_defaults(), -}) - -minetest.register_node("techage:water_source", { - description = S("Water Source"), - drawtype = "flowingliquid", - waving = 0, - tiles = {"default_water.png"}, - special_tiles = { - { - name = "default_water_flowing_animated.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 16, - aspect_h = 16, - length = 0.5, - }, - }, - { - name = "default_water_flowing_animated.png", - backface_culling = true, - animation = { - type = "vertical_frames", - aspect_w = 16, - aspect_h = 16, - length = 0.5, - }, - }, - }, - - use_texture_alpha = "blend", - paramtype = "light", - paramtype2 = "flowingliquid", - walkable = false, - pointable = false, - diggable = false, - buildable_to = true, - is_ground_content = false, - drop = "", - drowning = 1, - liquidtype = "source", - liquid_alternative_flowing = "techage:water_flowing", - liquid_alternative_source = "techage:water_source", - liquid_viscosity = 1, - post_effect_color = {a = 103, r = 30, g = 60, b = 90}, - groups = {water = 3, liquid = 3, cools_lava = 1, not_in_creative_inventory = 1}, - sounds = default.node_sound_water_defaults(), -}) - -minetest.register_node("techage:water_stop", { - description = "Water Stop", - drawtype = "glasslike_framed_optional", - tiles = {"techage_invisible.png"}, - inventory_image = 'techage_invisible_inv.png', - - use_texture_alpha = "blend", - paramtype = "light", - walkable = false, - pointable = false, - diggable = false, - buildable_to = true, - sunlight_propagates = true, - is_ground_content = false, - groups = {cracky = 3, oddly_breakable_by_hand = 3}, - sounds = default.node_sound_glass_defaults(), - drop = "", -}) diff --git a/techage/ta1_watermill/watermill.lua b/techage/ta1_watermill/watermill.lua index 644dfb1..d9b04a3 100644 --- a/techage/ta1_watermill/watermill.lua +++ b/techage/ta1_watermill/watermill.lua @@ -49,7 +49,7 @@ local function water_flowing(pos, facedir, tRes) local pos2 = vector.add(pos, dir) pos2.y = pos2.y + 1 local node = minetest.get_node(pos2) - if node.name == "techage:water_flowing" then + if node.name == "default:water_flowing" then tRes.backward = false return true end @@ -57,7 +57,7 @@ local function water_flowing(pos, facedir, tRes) pos2 = vector.subtract(pos, dir) pos2.y = pos2.y + 1 node = minetest.get_node(pos2) - if node.name == "techage:water_flowing" then + if node.name == "default:water_flowing" then tRes.backward = true return true end @@ -290,6 +290,25 @@ minetest.register_entity("techage:ta1_watermill_entity", { end, }) +minetest.register_node("techage:water_stop", { + description = "Water Stop", + drawtype = "glasslike_framed_optional", + tiles = {"techage_invisible.png"}, + inventory_image = 'techage_invisible_inv.png', + + use_texture_alpha = "blend", + paramtype = "light", + walkable = false, + pointable = false, + diggable = false, + buildable_to = true, + sunlight_propagates = true, + is_ground_content = false, + groups = {cracky = 3, oddly_breakable_by_hand = 3}, + sounds = default.node_sound_glass_defaults(), + drop = "", +}) + minetest.register_craft({ output = "techage:ta1_watermill_inv", recipe = {