diff options
-rw-r--r-- | extranodes/extratubes.lua | 102 | ||||
-rw-r--r-- | extranodes/init.lua | 50 | ||||
-rw-r--r-- | extranodes/textures/pipeworks_straight_tube_side.png | bin | 1703 -> 925 bytes | |||
-rw-r--r-- | extranodes/textures/pipeworks_tube_valve_side_off.png | bin | 0 -> 1053 bytes | |||
-rw-r--r-- | extranodes/textures/pipeworks_tube_valve_side_on.png | bin | 0 -> 1058 bytes | |||
-rw-r--r-- | extranodes/textures/technic_cottonseed_oil.png | bin | 0 -> 363 bytes | |||
-rw-r--r-- | technic/machines/register/extractor_recipes.lua | 6 |
7 files changed, 158 insertions, 0 deletions
diff --git a/extranodes/extratubes.lua b/extranodes/extratubes.lua index 67be208..e624c87 100644 --- a/extranodes/extratubes.lua +++ b/extranodes/extratubes.lua @@ -5,10 +5,12 @@ local S = rawget(_G, "intllib") and intllib.Getter() or function(s) return s end if minetest.get_modpath("pipeworks") then + --------------------------------------------------------------------- -- straight-only pipe -- does not connect side-wise, allows items in both directions -- a counterpart to straight-only pipe, and a cheap alternative -- to one-way tube for long segments of parallel pipes + --------------------------------------------------------------------- minetest.register_node(":pipeworks:straight_tube", { description = S("Straight-only Tube"), @@ -48,7 +50,11 @@ if minetest.get_modpath("pipeworks") then }, }) + + --------------------------------------------------------------------- -- conducting one-way tube - to stop making those ugly shunting wires + --------------------------------------------------------------------- + if pipeworks.enable_one_way_tube and pipeworks.enable_conductor_tube then minetest.register_node(":pipeworks:conductor_one_way_tube_on", { @@ -135,5 +141,101 @@ if minetest.get_modpath("pipeworks") then }) end + --------------------------------------------------------------------- + -- mesecon-controlled valve (bidirectional) + --------------------------------------------------------------------- + + minetest.register_node(":pipeworks:tube_valve_on", { + description = S("Tube Valve"), + tiles = {"pipeworks_tube_valve_side_on.png", + "pipeworks_tube_valve_side_on.png", + "pipeworks_straight_tube_output.png", + "pipeworks_straight_tube_input.png", + "pipeworks_tube_valve_side_on.png", + "pipeworks_tube_valve_side_on.png"}, + paramtype2 = "facedir", + drawtype = "nodebox", + paramtype = "light", + node_box = {type = "fixed", + fixed = {{-1/2, -9/64, -9/64, 1/2, 9/64, 9/64}}}, + groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, tubedevice = 1, mesecon = 2, not_in_creative_inventory = 1}, + sounds = default.node_sound_wood_defaults(), + tube = { + connect_sides = {left = 1, right = 1}, + can_go = function(pos, node, velocity, stack) + return {velocity} + end, + can_insert = function(pos, node, stack, direction) + local dir = pipeworks.facedir_to_right_dir(node.param2) + local opdir = vector.multiply(dir, -1) + return vector.equals(dir, direction) or vector.equals(opdir, direction) + end, + priority = 50 -- regular tube + }, + after_place_node = pipeworks.after_place, + after_dig_node = pipeworks.after_dig, + mesecons = { + effector = { + rules = pipeworks.mesecons_rules, + action_on = function (pos, node) + minetest.swap_node(pos, {name = "pipeworks:tube_valve_on", param2 = node.param2 }) + end, + action_off = function (pos, node) + minetest.swap_node(pos, {name = "pipeworks:tube_valve_off", param2 = node.param2 }) + end, + } + }, + drop = "pipeworks:tube_valve_off", + }) + + minetest.register_node(":pipeworks:tube_valve_off", { + description = S("Tube Valve"), + tiles = {"pipeworks_tube_valve_side_off.png", + "pipeworks_tube_valve_side_off.png", + "pipeworks_straight_tube_output.png", + "pipeworks_straight_tube_input.png", + "pipeworks_tube_valve_side_off.png", + "pipeworks_tube_valve_side_off.png"}, + paramtype2 = "facedir", + drawtype = "nodebox", + paramtype = "light", + node_box = {type = "fixed", + fixed = {{-1/2, -9/64, -9/64, 1/2, 9/64, 9/64}}}, + groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, tubedevice = 1, mesecon = 2}, + sounds = default.node_sound_wood_defaults(), + tube = { + connect_sides = {left = 1, right = 1}, + can_go = function(pos, node, velocity, stack) + return {velocity} + end, + can_insert = function(pos, node, stack, direction) + return false + end, + priority = 50 -- regular tube + }, + after_place_node = pipeworks.after_place, + after_dig_node = pipeworks.after_dig, + mesecons = { + effector = { + rules = pipeworks.mesecons_rules, + action_on = function (pos, node) + minetest.swap_node(pos, {name = "pipeworks:tube_valve_on", param2 = node.param2 }) + end, + action_off = function (pos, node) + minetest.swap_node(pos, {name = "pipeworks:tube_valve_off", param2 = node.param2 }) + end, + } + }, + drop = "pipeworks:tube_valve_off", + }) + + minetest.register_craft({ + output = "pipeworks:tube_valve_off 2", + recipe = { + { "pipeworks:tube_1", "homedecor:plastic_sheeting", "pipeworks:tube_1"}, + { "", "mesecons:wire_00000000_off", ""} + }, + }) + end
\ No newline at end of file diff --git a/extranodes/init.lua b/extranodes/init.lua index 0ae99c8..8ef074d 100644 --- a/extranodes/init.lua +++ b/extranodes/init.lua @@ -206,5 +206,55 @@ minetest.register_craft({ recipe = "technic:graphite" }) +-- Cotton seed oil: fuel and fertilizer + +if minetest.get_modpath("farming") then + if minetest.get_modpath("bonemeal") then + minetest.register_craftitem(":technic:cottonseed_oil", { + description = S("Cottonseed Oil"), + inventory_image = "technic_cottonseed_oil.png", + on_use = function(itemstack, user, pointed_thing) + if pointed_thing.type ~= "node" then + return + end + if minetest.is_protected(pointed_thing.under, user:get_player_name()) then + return + end + if not is_creative(user:get_player_name()) then + itemstack:take_item() + end + bonemeal:on_use(pointed_thing.under, 4) + return itemstack + end, + }) + else + minetest.register_craftitem(":technic:cottonseed_oil", { + description = S("Cottonseed Oil"), + inventory_image = "technic_cottonseed_oil.png", + }) + end + + minetest.register_craft({ + type = "fuel", + recipe = "technic:cottonseed_oil", + burntime = 20, + }) + +end + + +-- -- Additional recipe for straw blocks out of straw mat from cottages (if present) +-- -- not to let the centifuge output go to waste, since farming:straw can be used with a saw... +-- +-- if minetest.get_modpath("cottages") and minetest.get_modpath("farming") then +-- minetest.register_craft({ +-- output = "farming:straw 2", +-- recipe = { +-- { "cottages:straw_mat", "cottages:straw_mat", "cottages:straw_mat" }, +-- { "cottages:straw_mat", "cottages:straw_mat", "cottages:straw_mat" }, +-- { "cottages:straw_mat", "cottages:straw_mat", "cottages:straw_mat" }, +-- } +-- }) +-- end diff --git a/extranodes/textures/pipeworks_straight_tube_side.png b/extranodes/textures/pipeworks_straight_tube_side.png Binary files differindex b746911..4e03b3d 100644 --- a/extranodes/textures/pipeworks_straight_tube_side.png +++ b/extranodes/textures/pipeworks_straight_tube_side.png diff --git a/extranodes/textures/pipeworks_tube_valve_side_off.png b/extranodes/textures/pipeworks_tube_valve_side_off.png Binary files differnew file mode 100644 index 0000000..56186e6 --- /dev/null +++ b/extranodes/textures/pipeworks_tube_valve_side_off.png diff --git a/extranodes/textures/pipeworks_tube_valve_side_on.png b/extranodes/textures/pipeworks_tube_valve_side_on.png Binary files differnew file mode 100644 index 0000000..f25ad9c --- /dev/null +++ b/extranodes/textures/pipeworks_tube_valve_side_on.png diff --git a/extranodes/textures/technic_cottonseed_oil.png b/extranodes/textures/technic_cottonseed_oil.png Binary files differnew file mode 100644 index 0000000..be4550e --- /dev/null +++ b/extranodes/textures/technic_cottonseed_oil.png diff --git a/technic/machines/register/extractor_recipes.lua b/technic/machines/register/extractor_recipes.lua index d957787..c05f049 100644 --- a/technic/machines/register/extractor_recipes.lua +++ b/technic/machines/register/extractor_recipes.lua @@ -33,6 +33,12 @@ if minetest.get_modpath("dye") then table.insert(dye_recipes, {"ethereal:willow_twig 12", "technic:aspirin_pill"}) end + if minetest.get_modpath("farming") then + -- cottonseed oil: a fuel and a potent fertilizer (irl: pesticide) + -- hemp oil calls for 8 seeds, but extractor recipes are normally twice as potent + table.insert(dye_recipes, {"farming:seed_cotton 4", "technic:cottonseed_oil"}) + end + for _, data in ipairs(dye_recipes) do technic.register_extractor_recipe({input = {data[1]}, output = data[2]}) end |