More crafting recipes
This commit is contained in:
parent
9749faad72
commit
d40b08a492
@ -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
|
||||
|
||||
|
@ -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 --
|
||||
--------------
|
||||
|
@ -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}
|
||||
})
|
||||
|
||||
---------------
|
||||
|
@ -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")
|
||||
|
@ -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
|
||||
|
61
elepower_dynamics/plastic.lua
Normal file
61
elepower_dynamics/plastic.lua
Normal file
@ -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
|
BIN
elepower_dynamics/textures/elepower_oil_extract.png
Normal file
BIN
elepower_dynamics/textures/elepower_oil_extract.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
BIN
elepower_dynamics/textures/elepower_paraffin.png
Normal file
BIN
elepower_dynamics/textures/elepower_paraffin.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.8 KiB |
BIN
elepower_dynamics/textures/elepower_plastic_sheeting.png
Normal file
BIN
elepower_dynamics/textures/elepower_plastic_sheeting.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
BIN
elepower_dynamics/textures/elepower_servo_valve.png
Normal file
BIN
elepower_dynamics/textures/elepower_servo_valve.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.7 KiB |
BIN
elepower_dynamics/textures/elepower_tree_tap.png
Normal file
BIN
elepower_dynamics/textures/elepower_tree_tap.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 362 B |
44
elepower_farming/crafting.lua
Normal file
44
elepower_farming/crafting.lua
Normal file
@ -0,0 +1,44 @@
|
||||
|
||||
-----------
|
||||
-- Nodes --
|
||||
-----------
|
||||
|
||||
-- Device Frame
|
||||
minetest.register_craft({
|
||||
output = "elepower_farming:device_frame",
|
||||
recipe = {
|
||||
{"homedecor:plastic_sheeting", "group:glass", "homedecor:plastic_sheeting"},
|
||||
{"group:glass", "default:mese_crystal", "group:glass"},
|
||||
{"homedecor:plastic_sheeting", "group:glass", "homedecor:plastic_sheeting"},
|
||||
}
|
||||
})
|
||||
|
||||
-- Planter
|
||||
minetest.register_craft({
|
||||
output = "elepower_farming:planter",
|
||||
recipe = {
|
||||
{"homedecor:plastic_sheeting", "elepower_dynamics:copper_wire", "homedecor:plastic_sheeting"},
|
||||
{"farming:hoe_steel", "elepower_farming:device_frame", "farming:hoe_steel"},
|
||||
{"elepower_dynamics:wound_copper_coil", "elepower_dynamics:diamond_gear", "elepower_dynamics:wound_copper_coil"},
|
||||
}
|
||||
})
|
||||
|
||||
-- Harvester
|
||||
minetest.register_craft({
|
||||
output = "elepower_farming:harvester",
|
||||
recipe = {
|
||||
{"homedecor:plastic_sheeting", "elepower_dynamics:copper_wire", "homedecor:plastic_sheeting"},
|
||||
{"default:axe_steel", "elepower_farming:device_frame", "farming:hoe_steel"},
|
||||
{"elepower_dynamics:wound_copper_coil", "elepower_dynamics:diamond_gear", "elepower_dynamics:wound_copper_coil"},
|
||||
}
|
||||
})
|
||||
|
||||
-- Tree Extractor
|
||||
minetest.register_craft({
|
||||
output = "elepower_farming:tree_extractor",
|
||||
recipe = {
|
||||
{"homedecor:plastic_sheeting", "bucket:bucket_empty", "homedecor:plastic_sheeting"},
|
||||
{"elepower_dynamics:tree_tap", "elepower_farming:device_frame", "elepower_dynamics:tree_tap"},
|
||||
{"elepower_dynamics:copper_gear", "elepower_dynamics:servo_valve", "elepower_dynamics:copper_gear"},
|
||||
}
|
||||
})
|
@ -23,14 +23,15 @@ function elefarm.formspec.planter_formspec(timer, power)
|
||||
default.get_hotbar_bg(0, 5.75)
|
||||
end
|
||||
|
||||
function elefarm.formspec.harvester_formspec(timer, power)
|
||||
function elefarm.formspec.harvester_formspec(timer, power, sludge)
|
||||
return "size[8,8.5]"..
|
||||
default.gui_bg..
|
||||
default.gui_bg_img..
|
||||
default.gui_slots..
|
||||
ele.formspec.power_meter(power)..
|
||||
ele.formspec.fluid_bar(7, 0, sludge)..
|
||||
bar(1, 0, 100-timer)..
|
||||
"list[context;dst;1.5,0.25;6,2;]"..
|
||||
"list[context;dst;1.5,0;5,3;]"..
|
||||
"list[current_player;main;0,4.25;8,1;]"..
|
||||
"list[current_player;main;0,5.5;8,3;8]"..
|
||||
"listring[context;dst]"..
|
||||
|
@ -9,3 +9,4 @@ elefarm.modpath = modpath
|
||||
dofile(modpath.."/formspec.lua")
|
||||
dofile(modpath.."/craftitems.lua")
|
||||
dofile(modpath.."/nodes/init.lua")
|
||||
dofile(modpath.."/crafting.lua")
|
||||
|
@ -1,4 +1,3 @@
|
||||
name = elepower_farming
|
||||
description = Electric Farming Automation!
|
||||
depends = elepower_papi, elepower_tools, farming
|
||||
optional_depends = bucket
|
||||
depends = elepower_papi, elepower_tools, elepower_fapi, bucket, farming
|
||||
|
@ -5,6 +5,9 @@ local HARVESTER_TICK = 10
|
||||
-- How many plants we can collect in one run
|
||||
local HARVESTER_SWEEP = 9
|
||||
|
||||
-- How much sludge is generated as a by-product
|
||||
local SLUDGE_PRODUCED = 10
|
||||
|
||||
local function can_dig(pos, player)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local inv = meta:get_inventory()
|
||||
@ -79,8 +82,9 @@ local function on_timer(pos, elapsed)
|
||||
local storage = ele.helpers.get_node_property(meta, pos, "storage")
|
||||
|
||||
local work = meta:get_int("src_time")
|
||||
local sludge = fluid_lib.get_buffer_data(pos, "sludge")
|
||||
|
||||
if storage > 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,
|
||||
|
@ -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")
|
||||
|
@ -116,7 +116,7 @@ local function plant(pos, range, stack, inv)
|
||||
local to_plant = stack:get_name()
|
||||
local to_place = nil
|
||||
local amount = 0
|
||||
local till = false
|
||||
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,11 +161,24 @@ 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"
|
||||
|
||||
-- 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
|
||||
|
||||
local take = to_place
|
||||
if to_place then
|
||||
|
@ -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
|
||||
})
|
||||
|
@ -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",
|
||||
|
@ -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},
|
||||
})
|
||||
|
@ -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"},
|
||||
}
|
||||
})
|
||||
|
@ -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
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user