From 0824922879b5f335b147d6f068fa11d5a175b213 Mon Sep 17 00:00:00 2001 From: Evert Prants Date: Thu, 30 Aug 2018 23:14:50 +0300 Subject: [PATCH] fluid transfer node model, file changes --- elepower_dynamics/conduits.lua | 11 +- elepower_dynamics/crafting.lua | 6 +- elepower_dynamics/{liquids.lua => fluids.lua} | 5 +- elepower_dynamics/init.lua | 2 +- .../models/elepower_transport_node.obj | 185 ++++++++++++++++++ .../textures/elepower_fluid_transporter.png | Bin 0 -> 4825 bytes elepower_farming/{machines => }/fluids.lua | 0 elepower_farming/init.lua | 1 + elepower_farming/machines/init.lua | 1 - elepower_machines/machines/electrolyzer.lua | 17 +- elepower_wireless/machines/dialler.lua | 4 +- .../machines/matter_receiver.lua | 2 +- .../machines/matter_transmitter.lua | 4 +- 13 files changed, 222 insertions(+), 16 deletions(-) rename elepower_dynamics/{liquids.lua => fluids.lua} (98%) create mode 100644 elepower_dynamics/models/elepower_transport_node.obj create mode 100644 elepower_dynamics/textures/elepower_fluid_transporter.png rename elepower_farming/{machines => }/fluids.lua (100%) diff --git a/elepower_dynamics/conduits.lua b/elepower_dynamics/conduits.lua index d2988d6..dc7776f 100644 --- a/elepower_dynamics/conduits.lua +++ b/elepower_dynamics/conduits.lua @@ -6,13 +6,22 @@ ele.register_conduit("elepower_dynamics:conduit", { groups = {oddly_breakable_by_hand = 1, cracky = 1} }) --- Fluids +--[[ Fluids elefluid.register_transfer_node("elepower_dynamics:fluid_transfer_node", { description = "Fluid Transfer Node", tiles = {"elepower_fluid_transporter_side.png", "elepower_fluid_transporter_side.png^[transformR180", "elepower_fluid_transporter_side.png^[transformR270", "elepower_fluid_transporter_side.png^[transformFXR90", "elepower_fluid_transporter_back.png", "elepower_fluid_transporter_front.png"}, groups = {oddly_breakable_by_hand = 1, cracky = 1} +})--]] + +elefluid.register_transfer_node("elepower_dynamics:fluid_transfer_node", { + description = "Fluid Transfer Node", + tiles = {"elepower_fluid_transporter.png"}, + drawtype = "mesh", + mesh = "elepower_transport_node.obj", + groups = {oddly_breakable_by_hand = 1, cracky = 1}, + paramtype = "light", }) elefluid.register_transfer_duct("elepower_dynamics:fluid_duct", { diff --git a/elepower_dynamics/crafting.lua b/elepower_dynamics/crafting.lua index d2d6380..4d0b527 100644 --- a/elepower_dynamics/crafting.lua +++ b/elepower_dynamics/crafting.lua @@ -119,7 +119,7 @@ minetest.register_craft({ -- Conduit minetest.register_craft({ - output = "elepower_dynamics:conduit 6", + output = "elepower_dynamics:conduit 8", recipe = { {"elepower_dynamics:lead_ingot", "elepower_dynamics:lead_ingot", "elepower_dynamics:lead_ingot"}, {"elepower_dynamics:copper_wire", "elepower_dynamics:copper_wire", "elepower_dynamics:copper_wire"}, @@ -129,7 +129,7 @@ minetest.register_craft({ -- Duct minetest.register_craft({ - output = "elepower_dynamics:fluid_duct 6", + output = "elepower_dynamics:fluid_duct 8", recipe = { {"group:glass", "group:glass", "group:glass"}, {"elepower_dynamics:lead_ingot", "elepower_dynamics:lead_ingot", "elepower_dynamics:lead_ingot"}, @@ -236,7 +236,7 @@ if easycrafting then -- Fluid Transfer Node minetest.register_craft({ - output = "elepower_dynamics:fluid_transfer_node", + output = "elepower_dynamics:fluid_transfer_node 3", recipe = { {"group:stone", "elepower_dynamics:control_circuit", "group:stone"}, {"elepower_dynamics:electrum_gear", "elepower_dynamics:servo_valve", "elepower_dynamics:electrum_gear"}, diff --git a/elepower_dynamics/liquids.lua b/elepower_dynamics/fluids.lua similarity index 98% rename from elepower_dynamics/liquids.lua rename to elepower_dynamics/fluids.lua index d566307..a5e010a 100644 --- a/elepower_dynamics/liquids.lua +++ b/elepower_dynamics/fluids.lua @@ -90,7 +90,10 @@ minetest.register_node("elepower_dynamics:etching_acid_flowing", { bucket.register_liquid("elepower_dynamics:etching_acid_source", "elepower_dynamics:etching_acid_flowing", "elepower_dynamics:bucket_etching_acid", "#410800", "Etching Acid Bucket") --- Virtual "fluid" +----------- +-- Gases -- +----------- + minetest.register_node("elepower_dynamics:steam", { description = "Steam", groups = {not_in_creative_inventory = 1, gas = 1}, diff --git a/elepower_dynamics/init.lua b/elepower_dynamics/init.lua index b1eaa72..5610a86 100644 --- a/elepower_dynamics/init.lua +++ b/elepower_dynamics/init.lua @@ -11,7 +11,7 @@ dofile(modpath.."/craftitems.lua") dofile(modpath.."/compat/init.lua") dofile(modpath.."/tools.lua") dofile(modpath.."/nodes.lua") -dofile(modpath.."/liquids.lua") +dofile(modpath.."/fluids.lua") dofile(modpath.."/gas_container.lua") dofile(modpath.."/tanks.lua") dofile(modpath.."/components.lua") diff --git a/elepower_dynamics/models/elepower_transport_node.obj b/elepower_dynamics/models/elepower_transport_node.obj new file mode 100644 index 0000000..c328332 --- /dev/null +++ b/elepower_dynamics/models/elepower_transport_node.obj @@ -0,0 +1,185 @@ +o Node +v 0.400000 0.400000 -0.370263 +v 0.400000 0.400000 -0.497499 +v -0.400000 0.400000 -0.497499 +v -0.400000 0.400000 -0.370263 +v 0.400000 -0.400000 -0.370263 +v 0.400000 -0.400000 -0.497499 +v -0.400000 -0.400000 -0.497499 +v -0.400000 -0.400000 -0.370263 +v 0.320000 0.320000 -0.243027 +v 0.320000 0.320000 -0.370263 +v -0.320000 0.320000 -0.370263 +v -0.320000 0.320000 -0.243027 +v 0.320000 -0.320000 -0.243027 +v 0.320000 -0.320000 -0.370263 +v -0.320000 -0.320000 -0.370263 +v -0.320000 -0.320000 -0.243027 +v 0.256000 0.256000 -0.115790 +v 0.256000 0.256000 -0.243027 +v -0.256000 0.256000 -0.243027 +v -0.256000 0.256000 -0.115790 +v 0.256000 -0.256000 -0.115790 +v 0.256000 -0.256000 -0.243026 +v -0.256000 -0.256000 -0.243026 +v -0.256000 -0.256000 -0.115790 +v 0.204800 0.204800 0.008210 +v 0.204800 0.204800 -0.119027 +v -0.204800 0.204800 -0.119027 +v -0.204800 0.204800 0.008210 +v 0.204800 -0.204800 0.008210 +v 0.204800 -0.204800 -0.119026 +v -0.204800 -0.204800 -0.119026 +v -0.204800 -0.204800 0.008210 +v 0.146894 0.146894 0.503596 +v 0.146894 0.146894 -0.002413 +v -0.146894 0.146894 -0.002413 +v -0.146894 0.146894 0.503596 +v 0.146894 -0.146894 0.503596 +v 0.146894 -0.146894 -0.002413 +v -0.146894 -0.146894 -0.002413 +v -0.146894 -0.146894 0.503596 +v 0.320665 0.320665 -0.497499 +v -0.320665 0.320665 -0.497499 +v 0.320664 -0.320665 -0.497499 +v -0.320665 -0.320665 -0.497499 +vt 0.712514 0.681510 +vt 0.975774 0.681510 +vt 0.975774 0.944770 +vt 0.712514 0.944770 +vt 0.712514 0.681510 +vt 0.975774 0.681510 +vt 0.975774 0.944770 +vt 0.712514 0.944770 +vt 0.975774 0.681510 +vt 0.975774 0.944770 +vt 0.712514 0.944770 +vt 0.315390 0.302988 +vt 0.315390 0.039728 +vt 0.315390 0.039728 +vt 0.315390 0.302988 +vt 0.712514 0.681510 +vt 0.975774 0.681510 +vt 0.975774 0.944770 +vt 0.052130 0.039728 +vt 0.315390 0.039728 +vt 0.315390 0.302988 +vt 0.052130 0.302988 +vt 0.052130 0.039728 +vt 0.315390 0.039728 +vt 0.315390 0.302988 +vt 0.052130 0.302988 +vt 0.052130 0.039728 +vt 0.315390 0.039728 +vt 0.315390 0.302988 +vt 0.052130 0.302988 +vt 0.315390 0.039728 +vt 0.315390 0.302988 +vt 0.052130 0.302988 +vt 0.052130 0.039728 +vt 0.315390 0.039728 +vt 0.052130 0.302988 +vt 0.052130 0.039728 +vt 0.315390 0.039728 +vt 0.315390 0.302988 +vt 0.315390 0.039728 +vt 0.315390 0.302988 +vt 0.052130 0.302988 +vt 0.052130 0.039728 +vt 0.315390 0.039728 +vt 0.315390 0.302988 +vt 0.052130 0.302988 +vt 0.052130 0.039728 +vt 0.315390 0.039728 +vt 0.315390 0.302988 +vt 0.052130 0.302988 +vt 0.315390 0.039728 +vt 0.315390 0.302988 +vt 0.052130 0.302988 +vt 0.052130 0.039728 +vt 0.315390 0.039728 +vt 0.052130 0.302988 +vt 0.052130 0.039728 +vt 0.315390 0.039728 +vt 0.315390 0.302988 +vt 0.315390 0.039728 +vt 0.315390 0.302988 +vt 0.052130 0.302988 +vt 0.113358 0.155808 +vt 0.139491 0.183677 +vt 0.052150 0.175815 +vt 0.070263 0.158170 +vt 0.118317 0.113646 +vt 0.075071 0.114371 +vt 0.052211 0.096257 +vt 0.139491 0.086694 +vt 0.975306 0.069495 +vt 0.371324 0.069495 +vt 0.371324 0.276848 +vt 0.975306 0.276848 +vt 0.975306 0.069495 +vt 0.975306 0.276848 +vt 0.371324 0.276849 +vt 0.371324 0.069495 +vt 0.975125 0.070933 +vt 0.975125 0.278286 +vt 0.371143 0.278286 +vt 0.371143 0.070933 +vt 0.371143 0.070933 +vt 0.371143 0.278286 +vt 0.975125 0.278286 +vt 0.975125 0.070933 +vt 0.043937 0.339371 +vt 0.658425 0.339371 +vt 0.658425 0.953858 +vt 0.043937 0.953858 +vt 0.052130 0.302988 +vt 0.315390 0.302988 +vt 0.315390 0.302988 +vt 0.052130 0.302988 +vt 0.315390 0.039728 +vt 0.052130 0.039728 +vt 0.052130 0.039728 +vt 0.315390 0.039728 +vt 0.052130 0.302988 +vt 0.315390 0.302988 +vt 0.315390 0.302988 +vt 0.052130 0.302988 +vn 0.0000 1.0000 -0.0000 +vn 0.0000 -1.0000 0.0000 +vn 1.0000 -0.0000 -0.0000 +vn 0.0000 0.0000 -1.0000 +vn -1.0000 0.0000 0.0000 +vn 0.0000 0.0000 1.0000 +s off +f 1/1/1 2/2/1 3/3/1 4/4/1 +f 5/5/2 8/6/2 7/7/2 6/8/2 +f 1/1/3 5/9/3 6/10/3 2/11/3 +f 3/12/4 2/13/4 41/14/4 42/15/4 +f 3/16/5 7/17/5 8/18/5 4/4/5 +f 5/19/6 1/20/6 4/21/6 8/22/6 +f 9/23/1 10/24/1 11/25/1 12/26/1 +f 13/27/2 16/28/2 15/29/2 14/30/2 +f 9/23/3 13/31/3 14/32/3 10/33/3 +f 10/34/4 14/35/4 15/29/4 11/36/4 +f 11/37/5 15/38/5 16/39/5 12/26/5 +f 13/27/6 9/40/6 12/41/6 16/42/6 +f 17/43/1 18/44/1 19/45/1 20/46/1 +f 21/47/2 24/48/2 23/49/2 22/50/2 +f 17/43/3 21/51/3 22/52/3 18/53/3 +f 18/54/4 22/55/4 23/49/4 19/56/4 +f 19/57/5 23/58/5 24/59/5 20/46/5 +f 21/47/6 17/60/6 20/61/6 24/62/6 +f 25/63/1 26/64/1 27/65/1 28/66/1 +f 29/67/2 32/68/2 31/69/2 30/70/2 +f 25/63/3 29/67/3 30/70/3 26/64/3 +f 27/65/5 31/69/5 32/68/5 28/66/5 +f 29/67/6 25/63/6 28/66/6 32/68/6 +f 33/71/1 34/72/1 35/73/1 36/74/1 +f 37/75/2 40/76/2 39/77/2 38/78/2 +f 33/79/3 37/80/3 38/81/3 34/82/3 +f 35/83/5 39/84/5 40/85/5 36/86/5 +f 41/87/4 43/88/4 44/89/4 42/90/4 +f 6/91/4 7/92/4 44/93/4 43/94/4 +f 7/95/4 3/96/4 42/97/4 44/98/4 +f 2/99/4 6/100/4 43/101/4 41/102/4 diff --git a/elepower_dynamics/textures/elepower_fluid_transporter.png b/elepower_dynamics/textures/elepower_fluid_transporter.png new file mode 100644 index 0000000000000000000000000000000000000000..92617c740ab69e69e1b765141cccd7fde846b562 GIT binary patch literal 4825 zcmeHJcU)6h7Jl^5yA%-u(h)>Jq$x#OXptrakfuOF2>}x65(pxo6zL*m5F#~HDN>{t zslw2tD=?r445$KK7ym#+A=f3ZJ=R5bEccZQu>Cn?~(*OWK57E^$ z0RU3sloS9_5{FNIqhA1kCNsdy5^dt(3r2Z+IwRbjz-WJz6WGZQ;S2zNQv?{o`=fN} z*CEq>W>6S7Y7s?9Ki#+p#U-RF+)oY~Dz%gupisLc-#Ku6u<3o=Dq$ier6&b3-S*Rp z;TA_mtJ-!a2hC*HS}5qKK4>^#B)R%Pf=@Ni-=@&fhL_e`rF**DEA_zNK=D$2W)QOH zcI6q&pu~zc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w!AKaBzX895&N|L z{)*Q`z@V2C>U(wCdZ8kV24gl;mh=P5W|H)lKRItTj z7_@LKfp0wIBwWNjJI{%xH`Qw>qgGrQV3AIo3zVj?7Zk(KZZ2OT1+dh_OuwP}e{wAl z@zV_52AHrpqgI(jiHR)tBI1CwVP|qI@qbAa{-3(bxA~VtdlU~4W&nza@n7omZ~0+~ j_`jp70sqU7G;KtrGC(uQ;yKifhzLNmj5JF%?8E*71F8_V literal 0 HcmV?d00001 diff --git a/elepower_farming/machines/fluids.lua b/elepower_farming/fluids.lua similarity index 100% rename from elepower_farming/machines/fluids.lua rename to elepower_farming/fluids.lua diff --git a/elepower_farming/init.lua b/elepower_farming/init.lua index 01e024c..ec9e9ff 100644 --- a/elepower_farming/init.lua +++ b/elepower_farming/init.lua @@ -9,5 +9,6 @@ elefarm.modpath = modpath dofile(modpath.."/treecutter.lua") dofile(modpath.."/craftitems.lua") dofile(modpath.."/nodes.lua") +dofile(modpath.."/fluids.lua") dofile(modpath.."/machines/init.lua") dofile(modpath.."/crafting.lua") diff --git a/elepower_farming/machines/init.lua b/elepower_farming/machines/init.lua index 8a28743..0dd544c 100644 --- a/elepower_farming/machines/init.lua +++ b/elepower_farming/machines/init.lua @@ -1,7 +1,6 @@ local mp = elefarm.modpath.."/machines/" -dofile(mp.."fluids.lua") dofile(mp.."planter.lua") dofile(mp.."harvester.lua") dofile(mp.."tree_extractor.lua") diff --git a/elepower_machines/machines/electrolyzer.lua b/elepower_machines/machines/electrolyzer.lua index c5075b4..dc4a08f 100644 --- a/elepower_machines/machines/electrolyzer.lua +++ b/elepower_machines/machines/electrolyzer.lua @@ -8,6 +8,14 @@ elepm.electrolyzer_recipes = { }, time = 20 }, + { + recipe = "elepower_nuclear:heavy_water 1000", + output = { + "elepower_nuclear:deuterium 600", + "elepower_dynamics:oxygen 400", + }, + time = 20, + }, { recipe = "elepower_farming:biomass_source 1000", output = { @@ -15,7 +23,7 @@ elepm.electrolyzer_recipes = { "elepower_dynamics:oxygen 600", }, time = 16, - } + }, } local function get_formspec(time, power, input, out1, out2, state) @@ -159,17 +167,18 @@ ele.register_machine("elepower_machines:electrolyzer", { on_timer = electrolyzer_timer, fluid_buffers = { input = { - accepts = {"default:water_source", "elepower_nuclear:heavy_water", "group:biomass"}, + accepts = {"default:water_source", "elepower_nuclear:heavy_water", + "group:biomass", "group:electrolysis_recipe"}, drainable = false, capacity = 8000, }, out1 = { - accepts = {"group:gas"}, + accepts = {"group:gas", "group:electrolysis_result"}, drainable = true, capacity = 8000, }, out2 = { - accepts = {"group:gas"}, + accepts = {"group:gas", "group:electrolysis_result"}, drainable = true, capacity = 8000, }, diff --git a/elepower_wireless/machines/dialler.lua b/elepower_wireless/machines/dialler.lua index 2547b93..604b27f 100644 --- a/elepower_wireless/machines/dialler.lua +++ b/elepower_wireless/machines/dialler.lua @@ -110,7 +110,7 @@ local function dialler_timer(pos) local usage = ele.helpers.get_node_property(meta, pos, "usage") local transmitter = minetest.string_to_pos(meta:get_string("transmitter")) - local pow_percent = math.floor((storage / capacity) * 100) + local pow_buffer = {capacity = capacity, storage = storage, usage = usage} if storage >= usage then ele.helpers.swap_node(pos, "elepower_wireless:dialler_active") @@ -124,7 +124,7 @@ local function dialler_timer(pos) receivers = get_player_receivers(player) end - meta:set_string("formspec", get_formspec(pow_percent, player, transmitters, receivers)) + meta:set_string("formspec", get_formspec(pow_buffer, player, transmitters, receivers)) meta:set_string("infotext", "Dialler\n" .. ele.capacity_text(capacity, storage)) return false diff --git a/elepower_wireless/machines/matter_receiver.lua b/elepower_wireless/machines/matter_receiver.lua index 3d111b1..72ed318 100644 --- a/elepower_wireless/machines/matter_receiver.lua +++ b/elepower_wireless/machines/matter_receiver.lua @@ -29,7 +29,7 @@ local function matter_receiver_timer(pos) local storage = ele.helpers.get_node_property(meta, pos, "storage") local usage = ele.helpers.get_node_property(meta, pos, "usage") - local pow_percent = math.floor((storage / capacity) * 100) + local pow_percent = {capacity = capacity, storage = storage, usage = usage} if storage >= usage then ele.helpers.swap_node(pos, "elepower_wireless:matter_receiver_active") diff --git a/elepower_wireless/machines/matter_transmitter.lua b/elepower_wireless/machines/matter_transmitter.lua index a8ecccc..538909b 100644 --- a/elepower_wireless/machines/matter_transmitter.lua +++ b/elepower_wireless/machines/matter_transmitter.lua @@ -30,7 +30,7 @@ local function matter_transmitter_timer(pos) local storage = ele.helpers.get_node_property(meta, pos, "storage") local usage = ele.helpers.get_node_property(meta, pos, "usage") - local pow_percent = math.floor((storage / capacity) * 100) + local pow_buffer = {capacity = capacity, storage = storage, usage = usage} local tpos = minetest.string_to_pos(target) if storage >= usage and tpos then @@ -44,7 +44,7 @@ local function matter_transmitter_timer(pos) extra = "\nDialled to " .. target end - meta:set_string("formspec", get_formspec(pow_percent, name, player, target)) + meta:set_string("formspec", get_formspec(pow_buffer, name, player, target)) meta:set_string("infotext", name .. "\n" .. ele.capacity_text(capacity, storage) .. extra) return false