mirror of
https://github.com/joe7575/techpack.git
synced 2024-11-26 17:13:49 +01:00
V1.01, Support for Ethereal added
This commit is contained in:
parent
dca97e08c7
commit
3a5d87ed5e
@ -51,6 +51,13 @@ TechPack provides:
|
|||||||
- a Signal Tower node showing machine states
|
- a Signal Tower node showing machine states
|
||||||
- a Display node for text outputs of the Controller
|
- a Display node for text outputs of the Controller
|
||||||
|
|
||||||
|
TechPack supports the following mods:
|
||||||
|
- Farming Redo (Harvester, Fermenter)
|
||||||
|
- Ethereal (Harvester, Quarry, Fermenter)
|
||||||
|
- Pipeworks (Gravel Sieve)
|
||||||
|
- Hopper (Gravel Sieve)
|
||||||
|
- Mesecon (Mesecon Converter)
|
||||||
|
|
||||||
### License
|
### License
|
||||||
Copyright (C) 2017-2018 Joachim Stolberg
|
Copyright (C) 2017-2018 Joachim Stolberg
|
||||||
Code: Licensed under the GNU LGPL version 2.1 or later. See LICENSE.txt
|
Code: Licensed under the GNU LGPL version 2.1 or later. See LICENSE.txt
|
||||||
|
@ -22,16 +22,6 @@ local STANDBY_STATE = -1
|
|||||||
local FAULT_STATE = -3
|
local FAULT_STATE = -3
|
||||||
|
|
||||||
|
|
||||||
local leaves = {
|
|
||||||
["default:leaves"] = true,
|
|
||||||
["default:aspen_leaves"] = true,
|
|
||||||
["default:pine_needles"] = true,
|
|
||||||
["default:acacia_leaves"] = true,
|
|
||||||
["default:jungleleaves"] = true,
|
|
||||||
["default:bush_leaves"] = true,
|
|
||||||
["default:acacia_bush_leaves"] = true,
|
|
||||||
}
|
|
||||||
|
|
||||||
local function formspec(state)
|
local function formspec(state)
|
||||||
return "size[8,8]"..
|
return "size[8,8]"..
|
||||||
default.gui_bg..
|
default.gui_bg..
|
||||||
@ -50,13 +40,18 @@ local function formspec(state)
|
|||||||
"listring[current_player;main]"
|
"listring[current_player;main]"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function is_leaves(name)
|
||||||
|
return tubelib_addons1.FarmingNodes[name] ~= nil and
|
||||||
|
tubelib_addons1.FarmingNodes[name].leaves == true
|
||||||
|
end
|
||||||
|
|
||||||
local function allow_metadata_inventory_put(pos, listname, index, stack, player)
|
local function allow_metadata_inventory_put(pos, listname, index, stack, player)
|
||||||
if minetest.is_protected(pos, player:get_player_name()) then
|
if minetest.is_protected(pos, player:get_player_name()) then
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
if listname == "src" and leaves[stack:get_name()] then
|
if listname == "src" and is_leaves(stack:get_name()) then
|
||||||
return stack:get_count()
|
return stack:get_count()
|
||||||
elseif listname == "dst" then
|
elseif listname == "dst" then
|
||||||
return stack:get_count()
|
return stack:get_count()
|
||||||
@ -97,7 +92,7 @@ local function convert_leaves_to_biogas(meta)
|
|||||||
if inv:room_for_item("dst", biogas) then -- enough output space?
|
if inv:room_for_item("dst", biogas) then -- enough output space?
|
||||||
local items = tubelib.get_num_items(meta, "src", 2)
|
local items = tubelib.get_num_items(meta, "src", 2)
|
||||||
if items then -- input available?
|
if items then -- input available?
|
||||||
if leaves[items:get_name()] then -- valid input?
|
if is_leaves(items:get_name()) then
|
||||||
inv:add_item("dst", biogas)
|
inv:add_item("dst", biogas)
|
||||||
return true
|
return true
|
||||||
else
|
else
|
||||||
|
@ -32,6 +32,7 @@ end
|
|||||||
-- farming nodes with ABM
|
-- farming nodes with ABM
|
||||||
function tubelib_addons1.register_farming_node(name, drop, plant)
|
function tubelib_addons1.register_farming_node(name, drop, plant)
|
||||||
tubelib_addons1.FarmingNodes[name] = {drop = drop or name, plant = plant}
|
tubelib_addons1.FarmingNodes[name] = {drop = drop or name, plant = plant}
|
||||||
|
tubelib_addons1.FarmingNodes[name].leaves = string.find(name, "leaves") ~= nil
|
||||||
end
|
end
|
||||||
|
|
||||||
function tubelib_addons1.register_ground_node(name, drop)
|
function tubelib_addons1.register_ground_node(name, drop)
|
||||||
@ -55,6 +56,7 @@ tn("default:jungletree", "default:jungletree", "default:junglesapling")
|
|||||||
fn("default:leaves")
|
fn("default:leaves")
|
||||||
fn("default:aspen_leaves")
|
fn("default:aspen_leaves")
|
||||||
fn("default:pine_needles")
|
fn("default:pine_needles")
|
||||||
|
tubelib_addons1.FarmingNodes["default:pine_needles"].leaves = true -- accepted as leaves
|
||||||
fn("default:acacia_leaves")
|
fn("default:acacia_leaves")
|
||||||
fn("default:jungleleaves")
|
fn("default:jungleleaves")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user