From d40b08a492610becaaa99fafe0eced10af32f6de Mon Sep 17 00:00:00 2001 From: Evert Prants Date: Thu, 21 Jun 2018 11:09:01 +0300 Subject: [PATCH] More crafting recipes --- README.md | 2 +- elepower_dynamics/crafting.lua | 36 +++++++++++ elepower_dynamics/craftitems.lua | 16 ++++- elepower_dynamics/init.lua | 1 + elepower_dynamics/mod.conf | 2 +- elepower_dynamics/plastic.lua | 61 ++++++++++++++++++ .../textures/elepower_oil_extract.png | Bin 0 -> 1524 bytes .../textures/elepower_paraffin.png | Bin 0 -> 1811 bytes .../textures/elepower_plastic_sheeting.png | Bin 0 -> 1624 bytes .../textures/elepower_servo_valve.png | Bin 0 -> 1753 bytes .../textures/elepower_tree_tap.png | Bin 0 -> 362 bytes elepower_farming/crafting.lua | 44 +++++++++++++ elepower_farming/formspec.lua | 5 +- elepower_farming/init.lua | 1 + elepower_farming/mod.conf | 3 +- elepower_farming/nodes/harvester.lua | 25 +++++-- elepower_farming/nodes/init.lua | 11 +++- elepower_farming/nodes/planter.lua | 23 +++++-- elepower_farming/nodes/tree_extractor.lua | 2 +- elepower_farming/nodes/tree_processor.lua | 13 ++-- elepower_machines/nodes.lua | 2 +- elepower_machines/register.lua | 10 +++ elepower_machines/special/accumulator.lua | 2 +- 23 files changed, 229 insertions(+), 30 deletions(-) create mode 100644 elepower_dynamics/plastic.lua create mode 100644 elepower_dynamics/textures/elepower_oil_extract.png create mode 100644 elepower_dynamics/textures/elepower_paraffin.png create mode 100644 elepower_dynamics/textures/elepower_plastic_sheeting.png create mode 100644 elepower_dynamics/textures/elepower_servo_valve.png create mode 100644 elepower_dynamics/textures/elepower_tree_tap.png create mode 100644 elepower_farming/crafting.lua diff --git a/README.md b/README.md index cb26141..e7e14c1 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ A new *powerful* modpack for [Minetest](http://minetest.net) 5.0.0+! **I do not recommend using this modpack with technic, as this modpack aims to become an all new technology mod. However, compatibility might be added at a later date.** -**Depends on [fluid_lib](/evert/fluid_lib)!** +**Depends on [fluid_lib](https://gitlab.icynet.eu/evert/fluid_lib)!** ## Features diff --git a/elepower_dynamics/crafting.lua b/elepower_dynamics/crafting.lua index 3017cf9..f40d1ec 100644 --- a/elepower_dynamics/crafting.lua +++ b/elepower_dynamics/crafting.lua @@ -114,6 +114,26 @@ minetest.register_craft({ } }) +-- Duct +minetest.register_craft({ + output = "elepower_dynamics:fluid_duct 6", + recipe = { + {"group:glass", "group:glass", "group:glass"}, + {"elepower_dynamics:lead_ingot", "elepower_dynamics:lead_ingot", "elepower_dynamics:lead_ingot"}, + {"group:glass", "group:glass", "group:glass"}, + } +}) + +-- Fluid Transfer Node +minetest.register_craft({ + output = "elepower_dynamics:fluid_transfer_node", + recipe = { + {"group:stone", "elepower_dynamics:fluid_duct", "group:stone"}, + {"elepower_dynamics:steel_gear", "elepower_dynamics:servo_valve", "elepower_dynamics:steel_gear"}, + {"group:stone", "elepower_dynamics:fluid_duct", "group:stone"}, + } +}) + ----------- -- Items -- ----------- @@ -136,6 +156,22 @@ minetest.register_craft({ } }) +minetest.register_craft({ + output = "elepower_dynamics:servo_valve 3", + recipe = { + {"", "elepower_dynamics:wound_copper_coil", ""}, + {"elepower_dynamics:fluid_duct", "elepower_dynamics:fluid_duct", "elepower_dynamics:fluid_duct"}, + } +}) + +minetest.register_craft({ + output = "elepower_dynamics:tree_tap", + recipe = { + {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"}, + {"", "", "default:steel_ingot"}, + } +}) + -------------- -- Smelting -- -------------- diff --git a/elepower_dynamics/craftitems.lua b/elepower_dynamics/craftitems.lua index 7277e26..20db472 100644 --- a/elepower_dynamics/craftitems.lua +++ b/elepower_dynamics/craftitems.lua @@ -42,13 +42,25 @@ minetest.register_craftitem("elepower_dynamics:carbon_sheet", { minetest.register_craftitem("elepower_dynamics:wound_copper_coil", { description = "Wound Copper Coil", inventory_image = "elepower_copper_coil.png", - groups = {copper = 1, coil = 1} + groups = {copper = 1, coil = 1, component = 1} }) minetest.register_craftitem("elepower_dynamics:copper_wire", { description = "Copper Wire", inventory_image = "elepower_copper_wire.png", - groups = {copper = 1, wire = 1} + groups = {copper = 1, wire = 1, component = 1} +}) + +minetest.register_craftitem("elepower_dynamics:servo_valve", { + description = "Servo Valve", + inventory_image = "elepower_servo_valve.png", + groups = {servo_valve = 1, component = 1} +}) + +minetest.register_craftitem("elepower_dynamics:tree_tap", { + description = "Steel Treetap", + inventory_image = "elepower_tree_tap.png", + groups = {treetap = 1, component = 1} }) --------------- diff --git a/elepower_dynamics/init.lua b/elepower_dynamics/init.lua index 318ce0c..a4f1dd2 100644 --- a/elepower_dynamics/init.lua +++ b/elepower_dynamics/init.lua @@ -8,6 +8,7 @@ elepd.modpath = modpath dofile(modpath.."/conduits.lua") dofile(modpath.."/craftitems.lua") +dofile(modpath.."/plastic.lua") dofile(modpath.."/tools.lua") dofile(modpath.."/nodes.lua") dofile(modpath.."/dusts.lua") diff --git a/elepower_dynamics/mod.conf b/elepower_dynamics/mod.conf index 22fdbe4..27f4dab 100644 --- a/elepower_dynamics/mod.conf +++ b/elepower_dynamics/mod.conf @@ -1,4 +1,4 @@ name = elepower_dynamics description = Elepower Dynamics. Conduits and materials! depends = elepower_papi,elepower_fapi,default -optional_depends = moreores +optional_depends = moreores,pipeworks,homedecor diff --git a/elepower_dynamics/plastic.lua b/elepower_dynamics/plastic.lua new file mode 100644 index 0000000..25f687e --- /dev/null +++ b/elepower_dynamics/plastic.lua @@ -0,0 +1,61 @@ +if minetest.get_modpath("homedecor") == nil and minetest.get_modpath("pipeworks") == nil then + minetest.register_craftitem(":homedecor:oil_extract", { + description = "Oil Extract", + inventory_image = "elepower_oil_extract.png", + }) + + minetest.register_craftitem(":homedecor:paraffin", { + description = "Unprocessed Paraffin", + inventory_image = "elepower_paraffin.png", + }) + + minetest.register_alias("homedecor:plastic_base", "homedecor:paraffin") + + minetest.register_craftitem(":homedecor:plastic_sheeting", { + description = "Plastic Sheet", + inventory_image = "elepower_plastic_sheeting.png", + }) + + minetest.register_craft({ + type = "shapeless", + 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:paraffin", + recipe = "homedecor:oil_extract", + }) + + minetest.register_craft({ + type = "cooking", + output = "homedecor:plastic_sheeting", + recipe = "homedecor:paraffin", + }) + + minetest.register_craft({ + 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 diff --git a/elepower_dynamics/textures/elepower_oil_extract.png b/elepower_dynamics/textures/elepower_oil_extract.png new file mode 100644 index 0000000000000000000000000000000000000000..fa1383c6dc7b8a40fea8834fbcca8956978b9fe0 GIT binary patch literal 1524 zcmV zaB^>EX>4U6ba`-PAZ2)IW&i+q+O1bvlI$o9{O1&N1SAm4aabef26OyLFvhiXbyvN9 zc9eyMEG0?_yHxw{->&|_!K8z-;)9FMX&g4%$O(g>k0Z@1X*;j$MxTQ_z1kBDm4P(J zZE#E9pl8_g(wF5YK`%FsVp|jWej+VL99Doc;tFKw2%wi^m6jvJE3!TA^RX=LV(_<1 zD9gUD`I!d%)VNsV*@+`>akZ?ycM;>j+Ir-z4xq-*_&dLC@yzS@$9Krp34Kw1N9i8X3;hk#Y9{oYFb@p5Ex**0 zTzYj&>E!JuvU5A~oxb!PVl$^s`g*US_jar9*sf&K?9;kk6)| z91OI)vCs?~XShNEfhz@t>LEBIJo2kky<^n-Xeh#Fv2z7nJSrO~26IG86U@K}^_5ha z2|mxqWAJLgpv*J}EHLRjJb?ZzbQPDGL>m|ivDh;0f7Jv88Dz786ij7Gb>Mo zLdMI5Fy4X)N+2@dBPK8x5#TF^9_!3Gisd6(luGYqVJ7$<#3Pn>A>?KV8t+PGoQf#@G@F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+yqc|5N=8Y|FB>5J_P?u|u;MBWAp|}-9OSdu9yj3e6G80LaiOH6WqBsqs zkNJg{?2I7#VqW2KTdkN~lW7C?b9b@JP50Ohe8)SkIW=A5?h*zg{-#W$R2$}2MdiicU+k2|-y-#4eL zXp;4Bb!2FhBTML3%!Fdu*|3+k8NU*ECl_92rf$Pqx!#_(+oPFyGfw?2PDa~azJ#(P z9d_(veyjg_i;3AC!Crn$|M6kJs4SZ~yd&q5NRzUw>gq>5xAvNgk5Xa1*9_mcEOStl zcHD05;VCAxOXCRV9(-2gRkq_CX>@2HM@dakSAh-}0005fNklNwSO}@o7=vUXMKHU2_ujcP zXT~BB6#UcbX%BpU2hKV0-+6%h0woD)eYUx= zIROxWgM)*?yl$Q>_50f)gi19LLSV6&({&xw*^K#Yj=>m;c~~u1Zx0U-R{fvBD2P zI}0Iv?0R8M#1dmfMDX5YjJZHHgA_~=R5dUA{^=!R5W@YG^zLA=A^@Rj5$AzCch0}w+IqD6 z$4dm*+uM8L`|df)?U?gf4B?aaes??`zyEih={vuv`lgadgl+%;002ovPDHLkV1m0u BSYQAE literal 0 HcmV?d00001 diff --git a/elepower_dynamics/textures/elepower_plastic_sheeting.png b/elepower_dynamics/textures/elepower_plastic_sheeting.png new file mode 100644 index 0000000000000000000000000000000000000000..5d95e822efae6ed56ce5f6ee489dddec29e4bb99 GIT binary patch literal 1624 zcmV-e2B-OnP) zaB^>EX>4U6ba`-PAZ2)IW&i+q+O=10a^xxu{Ld-&2uL6h$H8E#-VNUIxA}5rlFVdM z$(o9hg)B8{Ay3Tt|9{Q=!Np{)@e(zp5G*dAeBum2?Y#21ll9}i9_$wG^yXS%s2pZD zA2lrf2|dG}m%c1N8G5;Kl+Lwq+%M$ih;;?n5mz8bGk{%=Om%}3J5U!#{43D=XR}QinD}($EbiP9I>2}8 zGUk9gJEWlt#hp)bnsD7_?lpub_-jD+q5_l}`(&7bN? z-t^{{(!twJ;twO)~5DWh6KB#XKTC_FuGH*+LPT! z!cZK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Bs%Fsj=xOX3RPR6^In#wsYR6~piF;`3URqlw2dF01o{_Nq7D)F2 zE$MG=1jEXD*?kqBCr}Sy9;{32p4H8+U8C*jb;4hdAZhGwuOr{Q$tk&O80VdZIH+pN z{jL?OJ6Rr5s~t~P_qF+*_O_;T7YUwlY@P12>og)Zg1i-l^58c#SvStS#$DyUhv8(5 z=ZrqOJ@p{DybP`JN$cY`R`+D?{j>-k;M(oWju z!^lZ$yiTQY=$$&(?)<2AkLssndwcoG|K|Vz010qN zS#tmY3ljhU3ljkVnw%H_000McNliru;szB4I1q7qk_i9+02y>eSad^gZEa<4bO1wg zWnpw>WFU8GbZ8()Nlj2!fese{00B8kL_t(I%dL~aO2a@9hQE=5b`Q2iRC4vS;xV*G z@#rZCzDVAnx4uALK>_3xlXJ%*Nk4tRg za5%(uU7{#50Iusw6h(w#*of`4fXg2%d)t9lz{B+$cb6gGCpYvIY!Fdh=h)tA(MM3Y}w*a7!WQl7;iF1B#Zfaf$gL6@8Vo7R>LV0FMhJw4NZ$Nk>pEyv_ z6Hgb%5R21qC)(yUI|#Jy-@f}Hk4#IGS$Q#Z$3m^}U@z*G&~! zl6q!H-m6aPv3PDFr#|UPW1>V}^o!rTMUS5TJo(O%p=;5FP`29rhL#`eDx8aENKTrO z&fJqZ%VScDMEbYi*Nva#ByOz|aky;qY>uBe%d<*0h0{jI3jbI(>xYJxel{+>8!_*B z&tvv`zf usage then + if storage > usage and sludge.amount + SLUDGE_PRODUCED < sludge.capacity then if work == HARVESTER_TICK then local harvested = {} @@ -89,6 +93,7 @@ local function on_timer(pos, elapsed) work = 0 if #harvested > 0 then storage = storage - usage + sludge.amount = sludge.amount + SLUDGE_PRODUCED for _,itm in ipairs(harvested) do local stack = ItemStack(itm) if inv:room_for_item("dst", stack) then @@ -109,10 +114,13 @@ local function on_timer(pos, elapsed) local power_percent = math.floor((storage / capacity)*100) local work_percent = math.floor((work / HARVESTER_TICK)*100) - meta:set_string("formspec", elefarm.formspec.harvester_formspec(work_percent, power_percent)) + meta:set_string("formspec", elefarm.formspec.harvester_formspec(work_percent, power_percent, sludge)) meta:set_int("storage", storage) meta:set_int("src_time", work) + meta:set_string("sludge_fluid", "elepower_farming:sludge_source") + meta:set_int("sludge_fluid_storage", sludge.amount) + return refresh end @@ -131,16 +139,23 @@ ele.register_machine("elepower_farming:harvester", { ele_user = 1, cracky = 1, tubedevice = 1, + fluid_container = 1, + }, + fluid_buffers = { + sludge = { + capacity = 8000, + drainable = true, + } }, on_construct = function (pos) local meta = minetest.get_meta(pos) local inv = meta:get_inventory() inv:set_size("layout", 9) - inv:set_size("dst", 12) + inv:set_size("dst", 15) meta:set_int("src_time", 0) - meta:set_string("formspec", elefarm.formspec.harvester_formspec(0,0)) + meta:set_string("formspec", elefarm.formspec.harvester_formspec(0, 0)) local node = minetest.get_node(pos) end, diff --git a/elepower_farming/nodes/init.lua b/elepower_farming/nodes/init.lua index 83b5415..e638016 100644 --- a/elepower_farming/nodes/init.lua +++ b/elepower_farming/nodes/init.lua @@ -1,6 +1,15 @@ +minetest.register_node("elepower_farming:device_frame", { + description = "Plastic Device Frame\nSafe for decoration", + tiles = { + "elefarming_machine_base.png", "elefarming_machine_base.png", "elefarming_machine_side.png", + "elefarming_machine_side.png", "elefarming_machine_side.png", "elefarming_machine_side.png", + }, + groups = {oddly_breakable_by_hand = 1, cracky = 1} +}) + +dofile(elefarm.modpath.."/nodes/fluids.lua") dofile(elefarm.modpath.."/nodes/planter.lua") dofile(elefarm.modpath.."/nodes/harvester.lua") -dofile(elefarm.modpath.."/nodes/fluids.lua") dofile(elefarm.modpath.."/nodes/tree_extractor.lua") dofile(elefarm.modpath.."/nodes/tree_processor.lua") diff --git a/elepower_farming/nodes/planter.lua b/elepower_farming/nodes/planter.lua index 030118a..447afd7 100644 --- a/elepower_farming/nodes/planter.lua +++ b/elepower_farming/nodes/planter.lua @@ -115,8 +115,8 @@ local function plant(pos, range, stack, inv) local to_plant = stack:get_name() local to_place = nil - local amount = 0 - local till = false + local amount = 0 + local till = true for _,stack in ipairs(inv:get_list("src")) do if stack:get_name() == to_plant then amount = amount + stack:get_count() @@ -127,9 +127,9 @@ local function plant(pos, range, stack, inv) if ele.helpers.get_item_group(to_plant, "sapling") then to_place = to_plant to_plant = nil + till = false elseif ele.helpers.get_item_group(to_plant, "seed") then to_place = nil - till = true end if (to_plant or to_place) and amount > 0 then @@ -161,9 +161,22 @@ local function plant(pos, range, stack, inv) }) local soil = regN[base_node.name].soil - if soil then soil = soil.dry else soil = "farming:soil" end + local wet_soil = "farming:soil_wet" - minetest.set_node(base_pos, {name = soil}) + -- Determine soil name + -- Make sure we don't replace wet soil + if soil then + wet_soil = soil.wet or "farming:soil_wet" + soil = soil.dry + else + soil = "farming:soil" + end + + print(dump(base_node), soil,wet_soil) + + if base_node.name ~= soil and base_node.name ~= wet_soil then + minetest.set_node(base_pos, {name = soil}) + end end end diff --git a/elepower_farming/nodes/tree_extractor.lua b/elepower_farming/nodes/tree_extractor.lua index 5fc628f..7ff5707 100644 --- a/elepower_farming/nodes/tree_extractor.lua +++ b/elepower_farming/nodes/tree_extractor.lua @@ -65,6 +65,6 @@ minetest.register_abm({ meta:set_int("tree_fluid_storage", fluid_c) meta:set_string("tree_fluid", ftype) - meta:set_string("infotext", ("%s: %d/%d %s"):format(fname, fluid_c, CAPACITY, elefluid.unit)) + meta:set_string("infotext", ("%s: %d/%d %s"):format(fname, fluid_c, CAPACITY, fluid_lib.unit)) end }) diff --git a/elepower_farming/nodes/tree_processor.lua b/elepower_farming/nodes/tree_processor.lua index 6f22abe..6baceaa 100644 --- a/elepower_farming/nodes/tree_processor.lua +++ b/elepower_farming/nodes/tree_processor.lua @@ -5,7 +5,7 @@ local tree_fluid_recipes = { amount = 100, time = 5, output = { - fluid = "elepower_farming:biofuel_source", + fluid = "elepower_farming:biomass_source", amount = 80, }, }, @@ -15,7 +15,7 @@ local tree_fluid_recipes = { time = 5, output = { fluid = "elepower_farming:biomass_source", - amount = 80, + amount = 20, item = "elepower_farming:resin" }, }, @@ -26,9 +26,9 @@ local function on_timer(pos, elapsed) local meta = minetest.get_meta(pos) local inv = meta:get_inventory() - local tree_buffer = elefluid.get_buffer_data(pos, "tree") - local water_buffer = elefluid.get_buffer_data(pos, "water") - local out_buffer = elefluid.get_buffer_data(pos, "output") + local tree_buffer = fluid_lib.get_buffer_data(pos, "tree") + local water_buffer = fluid_lib.get_buffer_data(pos, "water") + local out_buffer = fluid_lib.get_buffer_data(pos, "output") local capacity = ele.helpers.get_node_property(meta, pos, "capacity") local storage = ele.helpers.get_node_property(meta, pos, "storage") @@ -150,9 +150,6 @@ ele.register_machine("elepower_farming:tree_processor", { inv:set_size("dst", 1) meta:set_string("formspec", elefarm.formspec.tree_processor(0, 0)) - - meta:set_string("tree_fluid", "elepower_farming:resin_source") - meta:set_int("tree_fluid_storage", 2000) end, tiles = { "elefarming_machine_tree_processor.png", "elefarming_machine_base.png", "elefarming_machine_side.png", diff --git a/elepower_machines/nodes.lua b/elepower_machines/nodes.lua index e90cd19..9395743 100644 --- a/elepower_machines/nodes.lua +++ b/elepower_machines/nodes.lua @@ -2,7 +2,7 @@ -- Machines are registered in `register.lua`! minetest.register_node("elepower_machines:machine_block", { - description = "Machine Block", + description = "Machine Block\nSafe for decoration", tiles = {"elepower_machine_top.png", "elepower_machine_base.png", "elepower_machine_side.png"}, groups = {oddly_breakable_by_hand = 1, cracky = 1}, }) diff --git a/elepower_machines/register.lua b/elepower_machines/register.lua index a7c12e6..e4a2857 100644 --- a/elepower_machines/register.lua +++ b/elepower_machines/register.lua @@ -270,3 +270,13 @@ minetest.register_craft({ {"elepower_dynamics:lead_ingot", "elepower_dynamics:diamond_gear", "elepower_dynamics:lead_ingot"}, } }) + +-- Water Accumulator +minetest.register_craft({ + output = "elepower_machines:accumulator", + recipe = { + {"", "elepower_dynamics:fluid_duct", ""}, + {"group:glass", "elepower_machines:machine_block", "group:glass"}, + {"elepower_dynamics:steel_gear", "elepower_dynamics:servo_valve", "elepower_dynamics:steel_gear"}, + } +}) diff --git a/elepower_machines/special/accumulator.lua b/elepower_machines/special/accumulator.lua index 31d9ec2..4a31986 100644 --- a/elepower_machines/special/accumulator.lua +++ b/elepower_machines/special/accumulator.lua @@ -59,6 +59,6 @@ minetest.register_abm({ water_c = water_c + give meta:set_int("water_fluid_storage", water_c) - meta:set_string("infotext", ("Water: %d/%d %s"):format(water_c, CAPACITY, elefluid.unit)) + meta:set_string("infotext", ("Water: %d/%d %s"):format(water_c, CAPACITY, fluid_lib.unit)) end })