mirror of
https://github.com/joe7575/techpack.git
synced 2025-01-13 00:07:38 +01:00
V2.03, Piston/WorldEdit/replacer detection added, farming and grinder recipes added
This commit is contained in:
parent
a5e18c3d79
commit
a7a6b50492
@ -150,6 +150,7 @@ tubelib_addons1 optional: unified_inventory
|
||||
- 2019-01-12 V2.00 * release
|
||||
- 2019-01-27 V2.01 * SaferLua Controller Terminal added
|
||||
- 2019-01-28 V2.02 * Logic Not added, output reduction on Harvester, Fermenter, and Gravel Sieve
|
||||
- 2019-04-23 V2.03 * Piston/WorldEdit/replacer detection added, farming and grinder recipes added
|
||||
|
||||
|
||||
## New in v2 (from players point of view)
|
||||
|
@ -1,5 +1,21 @@
|
||||
# Release Notes for ModPack TechPack [techpack]
|
||||
|
||||
2019-04-23 V2.03 * ,
|
||||
|
||||
## V2.03 (2019-04-23)
|
||||
|
||||
### Additions
|
||||
- Farming and Grinder recipes added (thanks to obl3pplifp)
|
||||
- Support for Signs Bot chest and Box added
|
||||
|
||||
### Removals
|
||||
|
||||
### Changes
|
||||
|
||||
### Fixes
|
||||
- Piston/WorldEdit/Replacer tool detection added. If node is replaced/removed/copied,
|
||||
it will switch to a "defect" dummy node.
|
||||
|
||||
|
||||
## V2.02.06 (2019-03-23)
|
||||
|
||||
|
@ -33,11 +33,14 @@ end
|
||||
|
||||
|
||||
local function on_time(pos, elasped)
|
||||
if tubelib.data_not_corrupted(pos) then
|
||||
local meta = minetest.get_meta(pos)
|
||||
local number = meta:get_string("number")
|
||||
local mem = tubelib.get_data(number, "memory") or table.copy(DEFAULT_MEM)
|
||||
meta:set_string("infotext", "Server "..number..": ("..(mem.size or 0).."/"..SERVER_CAPA..")")
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
minetest.register_node("sl_controller:server", {
|
||||
|
@ -15,6 +15,7 @@
|
||||
|
||||
|
||||
local function switch_on(pos, node)
|
||||
if tubelib.data_not_corrupted(pos) then
|
||||
node.name = "smartline:button_active"
|
||||
minetest.swap_node(pos, node)
|
||||
minetest.sound_play("button", {
|
||||
@ -35,9 +36,11 @@ local function switch_on(pos, node)
|
||||
clicker_name = meta:get_string("clicker_name")
|
||||
end
|
||||
tubelib.send_message(numbers, placer_name, clicker_name, "on", own_num)
|
||||
end
|
||||
end
|
||||
|
||||
local function switch_off(pos)
|
||||
if tubelib.data_not_corrupted(pos) then
|
||||
local node = minetest.get_node(pos)
|
||||
node.name = "smartline:button"
|
||||
minetest.swap_node(pos, node)
|
||||
@ -56,6 +59,7 @@ local function switch_off(pos)
|
||||
clicker_name = meta:get_string("clicker_name")
|
||||
end
|
||||
tubelib.send_message(numbers, placer_name, clicker_name, "off", own_num)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
@ -67,6 +67,7 @@ end
|
||||
|
||||
|
||||
local function on_timer(pos,elapsed)
|
||||
if tubelib.data_not_corrupted(pos) then
|
||||
local meta = minetest.get_meta(pos)
|
||||
local poll_numbers = meta:get_string("poll_numbers")
|
||||
local idx = meta:get_int("index") + 1
|
||||
@ -88,6 +89,8 @@ local function on_timer(pos,elapsed)
|
||||
request_state(meta, poll_numbers, idx)
|
||||
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
minetest.register_node("smartline:collector", {
|
||||
|
@ -578,6 +578,7 @@ local function execute(meta, number, debug)
|
||||
end
|
||||
|
||||
local function check_rules(pos, elapsed)
|
||||
if tubelib.data_not_corrupted(pos) then
|
||||
--local t = minetest.get_us_time()
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_int("runtime", (meta:get_int("runtime") or 1) + 1)
|
||||
@ -588,6 +589,8 @@ local function check_rules(pos, elapsed)
|
||||
end
|
||||
--print("time", minetest.get_us_time() - t)
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
local function switch_state(pos, state, fs_data)
|
||||
|
@ -28,9 +28,12 @@ local function display_update(pos, objref)
|
||||
end
|
||||
|
||||
local function on_timer(pos)
|
||||
if tubelib.data_not_corrupted(pos) then
|
||||
local meta = minetest.get_meta(pos)
|
||||
lcdlib.update_entities(pos)
|
||||
return false
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
local lcd_box = {
|
||||
|
@ -139,12 +139,15 @@ minetest.register_node("smartline:playerdetector", {
|
||||
end,
|
||||
|
||||
on_timer = function (pos, elapsed)
|
||||
if tubelib.data_not_corrupted(pos) then
|
||||
if scan_for_player(pos) then
|
||||
switch_on(pos)
|
||||
minetest.get_node_timer(pos):start(1)
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end,
|
||||
|
||||
paramtype = "light",
|
||||
|
@ -75,9 +75,12 @@ minetest.register_node("smartline:repeater", {
|
||||
end,
|
||||
|
||||
on_timer = function(pos,elapsed)
|
||||
if tubelib.data_not_corrupted(pos) then
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_int("overload_cnt", 0)
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end,
|
||||
|
||||
after_dig_node = function(pos)
|
||||
|
@ -98,6 +98,7 @@ local function restart_timer(pos, time)
|
||||
end
|
||||
|
||||
local function check_rules(pos, elapsed)
|
||||
if tubelib.data_not_corrupted(pos) then
|
||||
local meta = minetest.get_meta(pos)
|
||||
local rules = minetest.deserialize(meta:get_string("rules"))
|
||||
if rules then
|
||||
@ -131,6 +132,8 @@ local function check_rules(pos, elapsed)
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
local function start_the_sequencer(pos)
|
||||
|
@ -86,6 +86,7 @@ local function formspec_help()
|
||||
end
|
||||
|
||||
local function check_rules(pos,elapsed)
|
||||
if tubelib.data_not_corrupted(pos) then
|
||||
local hour = math.floor(minetest.get_timeofday() * 24)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local events = minetest.deserialize(meta:get_string("events"))
|
||||
@ -121,6 +122,8 @@ local function check_rules(pos,elapsed)
|
||||
meta:set_string("done", minetest.serialize(done))
|
||||
meta:set_string("infotext","SmartLine Timer ("..own_num..")"..hour..":00")
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
|
@ -268,6 +268,7 @@ function techpack_warehouse.after_place_node(self, pos, placer, itemstack)
|
||||
end
|
||||
|
||||
function techpack_warehouse.on_timer(self, pos, elapsed)
|
||||
if tubelib.data_not_corrupted(pos) then
|
||||
local meta = M(pos)
|
||||
local inv = meta:get_inventory()
|
||||
if not inv:is_empty("shift") then
|
||||
@ -300,6 +301,8 @@ function techpack_warehouse.on_timer(self, pos, elapsed)
|
||||
end
|
||||
|
||||
return self.State:is_active(meta)
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
function techpack_warehouse.can_dig(self, pos)
|
||||
|
@ -16,6 +16,7 @@
|
||||
|
||||
|
||||
local function switch_on(pos, node)
|
||||
if tubelib.data_not_corrupted(pos) then
|
||||
node.name = "tubelib:button_active"
|
||||
minetest.swap_node(pos, node)
|
||||
minetest.sound_play("button", {
|
||||
@ -36,9 +37,11 @@ local function switch_on(pos, node)
|
||||
clicker_name = meta:get_string("clicker_name")
|
||||
end
|
||||
tubelib.send_message(numbers, placer_name, clicker_name, "on", own_num) -- <<=== tubelib
|
||||
end
|
||||
end
|
||||
|
||||
local function switch_off(pos)
|
||||
if tubelib.data_not_corrupted(pos) then
|
||||
local node = minetest.get_node(pos)
|
||||
node.name = "tubelib:button"
|
||||
minetest.swap_node(pos, node)
|
||||
@ -57,6 +60,7 @@ local function switch_off(pos)
|
||||
clicker_name = meta:get_string("clicker_name")
|
||||
end
|
||||
tubelib.send_message(numbers, placer_name, clicker_name, "off", own_num) -- <<=== tubelib
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
48
tubelib/defect.lua
Normal file
48
tubelib/defect.lua
Normal file
@ -0,0 +1,48 @@
|
||||
minetest.register_node("tubelib:defect_dummy", {
|
||||
description = "Corrupted Tubelib Node",
|
||||
tiles = {
|
||||
"tubelib_front.png",
|
||||
"tubelib_front.png",
|
||||
"tubelib_front.png^tubelib_defect.png",
|
||||
"tubelib_front.png^tubelib_defect.png",
|
||||
"tubelib_front.png^tubelib_defect.png",
|
||||
"tubelib_front.png^tubelib_defect.png",
|
||||
},
|
||||
drop = "",
|
||||
groups = {cracky=3, crumbly=3, choppy=3, not_in_creative_inventory=1},
|
||||
is_ground_content = false,
|
||||
})
|
||||
|
||||
|
||||
function tubelib.data_not_corrupted(pos)
|
||||
if minetest.pos_to_string(pos) ~= minetest.get_meta(pos):get_string("my_pos") then
|
||||
-- node number corrupt?
|
||||
local meta = minetest.get_meta(pos)
|
||||
local number = meta:get_string("tubelib_number")
|
||||
if number == "" then
|
||||
number = meta:get_string("number")
|
||||
end
|
||||
if number == "" then
|
||||
number = meta:get_string("own_num")
|
||||
end
|
||||
if number == "" then
|
||||
number = meta:get_string("own_number")
|
||||
end
|
||||
if number == "" then
|
||||
tubelib.remove_node(pos)
|
||||
minetest.set_node(pos, {name = "tubelib:defect_dummy"})
|
||||
meta:from_table(nil)
|
||||
return false
|
||||
end
|
||||
-- node moved?
|
||||
local info = tubelib.get_node_info(number)
|
||||
if not info or not vector.equals(info.pos, pos) then
|
||||
tubelib.remove_node(pos)
|
||||
minetest.set_node(pos, {name = "tubelib:defect_dummy"})
|
||||
meta:from_table(nil)
|
||||
return false
|
||||
end
|
||||
minetest.get_meta(pos):get_string("my_pos", minetest.pos_to_string(pos))
|
||||
end
|
||||
return true
|
||||
end
|
@ -270,9 +270,12 @@ end
|
||||
|
||||
-- move items to the output slots
|
||||
local function keep_running(pos, elapsed)
|
||||
if tubelib.data_not_corrupted(pos) then
|
||||
local meta = M(pos)
|
||||
distributing(pos, meta)
|
||||
return State:is_active(meta)
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
local function on_receive_fields(pos, formname, fields, player)
|
||||
|
@ -101,6 +101,7 @@ else
|
||||
-- conversion from v1.16 to v2.00
|
||||
dofile(minetest.get_modpath("tubelib") .. "/migrate.lua")
|
||||
dofile(minetest.get_modpath("tubelib") .. "/states.lua")
|
||||
dofile(minetest.get_modpath("tubelib") .. "/defect.lua")
|
||||
dofile(minetest.get_modpath("tubelib") .. "/node_states.lua")
|
||||
dofile(minetest.get_modpath("tubelib") .. "/pusher.lua")
|
||||
dofile(minetest.get_modpath("tubelib") .. "/blackhole.lua")
|
||||
|
@ -104,4 +104,32 @@ tubelib.register_node("shop:shop", {}, {
|
||||
end,
|
||||
})
|
||||
|
||||
tubelib.register_node("signs_bot:box", {}, {
|
||||
on_pull_item = function(pos, side)
|
||||
local meta = minetest.get_meta(pos)
|
||||
return tubelib.get_item(meta, "main")
|
||||
end,
|
||||
on_push_item = function(pos, side, item)
|
||||
local meta = minetest.get_meta(pos)
|
||||
return tubelib.put_item(meta, "main", item)
|
||||
end,
|
||||
on_unpull_item = function(pos, side, item)
|
||||
local meta = minetest.get_meta(pos)
|
||||
return tubelib.put_item(meta, "main", item)
|
||||
end,
|
||||
})
|
||||
|
||||
tubelib.register_node("signs_bot:chest", {}, {
|
||||
on_pull_item = function(pos, side)
|
||||
local meta = minetest.get_meta(pos)
|
||||
return tubelib.get_item(meta, "main")
|
||||
end,
|
||||
on_push_item = function(pos, side, item)
|
||||
local meta = minetest.get_meta(pos)
|
||||
return tubelib.put_item(meta, "main", item)
|
||||
end,
|
||||
on_unpull_item = function(pos, side, item)
|
||||
local meta = minetest.get_meta(pos)
|
||||
return tubelib.put_item(meta, "main", item)
|
||||
end,
|
||||
})
|
||||
|
@ -376,17 +376,9 @@ function NodeStates:on_node_load(pos, not_start_timer)
|
||||
meta:set_int("counter", 0)
|
||||
end
|
||||
|
||||
-- node number corrupt?
|
||||
number = meta:get_string("tubelib_number")
|
||||
if number == "" then
|
||||
number = tubelib.get_new_number(pos, self.node_name_passive)
|
||||
meta:set_string("tubelib_number", number)
|
||||
else
|
||||
local info = tubelib.get_node_info(number)
|
||||
if not info or info.pos ~= pos then
|
||||
number = tubelib.get_new_number(pos, self.node_name_passive)
|
||||
meta:set_string("tubelib_number", number)
|
||||
end
|
||||
-- node corrupt?
|
||||
if not tubelib.data_not_corrupted(pos) then
|
||||
return
|
||||
end
|
||||
|
||||
-- state corrupt?
|
||||
|
@ -66,9 +66,12 @@ local function pushing(pos, meta)
|
||||
end
|
||||
|
||||
local function keep_running(pos, elapsed)
|
||||
if tubelib.data_not_corrupted(pos) then
|
||||
local meta = M(pos)
|
||||
pushing(pos, meta)
|
||||
return State:is_active(meta)
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
minetest.register_node("tubelib:pusher", {
|
||||
|
@ -6,6 +6,12 @@ the automated mining, farming, and crafting.
|
||||
A Tutorial to this Mod is available as ![Wiki](https://github.com/joe7575/techpack/wiki)
|
||||
|
||||
|
||||
With contributions from:
|
||||
* obl3pplifp, https://github.com/obl3pplifp/techpack_compat and as pull requests
|
||||
* realmicu, as pull requests
|
||||
* theFox6, as pull request
|
||||
|
||||
|
||||
## Dependencies
|
||||
tubelib, default
|
||||
opt. unified_inventory
|
||||
|
@ -127,12 +127,15 @@ end
|
||||
|
||||
|
||||
local function keep_running(pos, elapsed)
|
||||
if tubelib.data_not_corrupted(pos) then
|
||||
local meta = M(pos)
|
||||
local inv = meta:get_inventory()
|
||||
local craft = get_craft(pos, inv)
|
||||
local output_item = craft.output.item
|
||||
autocraft(pos, meta, inv, craft)
|
||||
return State:is_active(meta)
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
-- note, that this function assumes allready being updated to virtual items
|
||||
|
@ -14,6 +14,7 @@
|
||||
|
||||
|
||||
local function switch_on(pos)
|
||||
if tubelib.data_not_corrupted(pos) then
|
||||
local node = minetest.get_node(pos)
|
||||
node.name = "tubelib_addons1:detector_active"
|
||||
minetest.swap_node(pos, node)
|
||||
@ -23,9 +24,11 @@ local function switch_on(pos)
|
||||
local numbers = meta:get_string("numbers")
|
||||
local placer_name = meta:get_string("placer_name")
|
||||
tubelib.send_message(numbers, placer_name, nil, "on", own_num)
|
||||
end
|
||||
end
|
||||
|
||||
local function switch_off(pos)
|
||||
if tubelib.data_not_corrupted(pos) then
|
||||
local node = minetest.get_node(pos)
|
||||
node.name = "tubelib_addons1:detector"
|
||||
minetest.swap_node(pos, node)
|
||||
@ -34,6 +37,7 @@ local function switch_off(pos)
|
||||
local numbers = meta:get_string("numbers")
|
||||
local placer_name = meta:get_string("placer_name")
|
||||
tubelib.send_message(numbers, placer_name, nil, "off", own_num)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
@ -144,9 +144,12 @@ local function convert_leaves_to_biogas(pos, meta)
|
||||
end
|
||||
|
||||
local function keep_running(pos, elapsed)
|
||||
if tubelib.data_not_corrupted(pos) then
|
||||
local meta = M(pos)
|
||||
convert_leaves_to_biogas(pos, meta)
|
||||
return State:is_active(meta)
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
local function on_receive_fields(pos, formname, fields, player)
|
||||
|
@ -103,10 +103,13 @@ local function grinding(pos, meta, inv)
|
||||
end
|
||||
|
||||
local function keep_running(pos, elapsed)
|
||||
if tubelib.data_not_corrupted(pos) then
|
||||
local meta = M(pos)
|
||||
local inv = meta:get_inventory()
|
||||
grinding(pos, meta, inv)
|
||||
return State:is_active(meta)
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
local function on_receive_fields(pos, formname, fields, player)
|
||||
|
@ -243,6 +243,7 @@ end
|
||||
|
||||
-- move the "harvesting copter" to the next pos and harvest the field below
|
||||
local function keep_running(pos, elapsed)
|
||||
if tubelib.data_not_corrupted(pos) then
|
||||
local meta = M(pos)
|
||||
local this = minetest.deserialize(meta:get_string("this"))
|
||||
this.num_items = 0
|
||||
@ -267,6 +268,8 @@ local function keep_running(pos, elapsed)
|
||||
end
|
||||
end
|
||||
return State:is_active(meta)
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
|
@ -112,9 +112,12 @@ local function allow_metadata_inventory_take(pos, listname, index, stack, player
|
||||
end
|
||||
|
||||
local function keep_running(pos, elapsed)
|
||||
if tubelib.data_not_corrupted(pos) then
|
||||
local meta = M(pos)
|
||||
sample_liquid(pos, meta)
|
||||
return State:is_active(meta)
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
local function on_receive_fields(pos, formname, fields, player)
|
||||
|
@ -48,6 +48,7 @@ local tn = tubelib_addons1.register_tree_node
|
||||
local dn = tubelib_addons1.register_default_farming_node
|
||||
local fn = tubelib_addons1.register_farming_node
|
||||
local gn = tubelib_addons1.register_ground_node
|
||||
local gr = tubelib.add_grinder_recipe
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
-- Default Farming
|
||||
@ -103,6 +104,13 @@ if farming.mod == "redo" then
|
||||
fn("farming:oat_8", "farming:oat", "farming:oat_1")
|
||||
fn("farming:rye_8", "farming:rye", "farming:rye_1")
|
||||
fn("farming:rice_8", "farming:rice", "farming:rice_1")
|
||||
fn('farming:beetroot_5', 'farming:beetroot 2', 'farming:beetroot_1')
|
||||
fn('farming:cocoa_4', 'farming:cocoa_beans 2', 'farming:cocoa_1')
|
||||
fn('farming:garlic_5', 'farming:garlic 2', 'farming:garlic_1')
|
||||
fn('farming:onion_5', 'farming:onion 2', 'farming:onion_1')
|
||||
fn('farming:pea_5', 'farming:pea_pod 3', 'farming:pea_1')
|
||||
fn('farming:pepper_5', 'farming:pepper 2', 'farming:pepper_1')
|
||||
fn('farming:pineapple_8', 'farming:pineapple 1', 'farming:pineapple_1')
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
@ -246,3 +254,55 @@ end
|
||||
|
||||
minetest.after(10, register_flowers)
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
-- moretrees
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
if minetest.global_exists("moretrees") then
|
||||
local function register_tree(treename)
|
||||
local trunk_name = 'moretrees:' .. treename .. '_trunk'
|
||||
local sappling_name = 'moretrees:' .. treename .. '_sapling'
|
||||
local leaves_name = 'moretrees:' .. treename .. '_leaves'
|
||||
|
||||
tn(trunk_name, trunk_name, sappling_name)
|
||||
fn(leaves_name)
|
||||
gr({input=trunk_name, output=leaves_name .. ' 8'})
|
||||
end
|
||||
|
||||
-- "ordinary" moretrees blocks
|
||||
for i in ipairs(moretrees.treelist) do
|
||||
local treename = moretrees.treelist[i][1]
|
||||
|
||||
if treename ~= 'jungletree' then
|
||||
register_tree(treename)
|
||||
end
|
||||
end
|
||||
|
||||
-- "weird" moretrees trunks
|
||||
tn('moretrees:date_palm_fruit_trunk', 'moretrees:date_palm_trunk', 'moretrees:date_palm_sapling')
|
||||
gr({input='moretrees:date_palm_fruit_trunk', output='moretrees:date_palm_leaves 8'})
|
||||
tn('moretrees:date_palm_ffruit_trunk', 'moretrees:date_palm_trunk', 'moretrees:date_palm_sapling')
|
||||
gr({input='moretrees:date_palm_ffruit_trunk', output='moretrees:date_palm_leaves 8'})
|
||||
tn('moretrees:date_palm_mfruit_trunk', 'moretrees:date_palm_trunk', 'moretrees:date_palm_sapling')
|
||||
gr({input='moretrees:date_palm_mfruit_trunk', output='moretrees:date_palm_leaves 8'})
|
||||
tn('moretrees:jungletree_trunk', 'default:jungletree', 'default:junglesapling')
|
||||
gr({input='moretrees:jungletree_trunk', output='default:jungleleaves 8'})
|
||||
tn('moretrees:palm_fruit_trunk', 'moretrees:palm_trunk', 'moretrees:palm_sapling')
|
||||
gr({input='moretrees:palm_fruit_trunk', output='moretrees:palm_leaves 8'})
|
||||
tn('moretrees:palm_fruit_trunk_gen', 'moretrees:palm_trunk', 'moretrees:palm_sapling')
|
||||
gr({input='moretrees:palm_fruit_trunk_gen', output='moretrees:palm_leaves 8'})
|
||||
tn('moretrees:rubber_tree_trunk_empty', 'moretrees:rubber_tree_trunk_empty', 'moretrees:rubber_tree_sapling')
|
||||
gr({input='moretrees:rubber_tree_trunk_empty', output='moretrees:rubber_tree_leaves 8'})
|
||||
|
||||
-- moretrees fruit and leaves
|
||||
fn('moretrees:acorn')
|
||||
fn('moretrees:cedar_cone')
|
||||
fn('moretrees:coconut_3', 'moretrees:coconut')
|
||||
fn('moretrees:dates_f4', 'moretrees:date 16')
|
||||
fn('moretrees:fir_cone')
|
||||
fn('moretrees:fir_leaves_bright')
|
||||
fn('moretrees:jungletree_leaves_red')
|
||||
fn('moretrees:jungletree_leaves_yellow')
|
||||
fn('moretrees:spruce_cone')
|
||||
end
|
||||
|
||||
|
@ -66,9 +66,12 @@ local function pushing(pos, meta)
|
||||
end
|
||||
|
||||
local function keep_running(pos, elapsed)
|
||||
if tubelib.data_not_corrupted(pos) then
|
||||
local meta = M(pos)
|
||||
pushing(pos, meta)
|
||||
return State:is_active(meta)
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
minetest.register_node("tubelib_addons1:pusher_fast", {
|
||||
|
@ -238,9 +238,12 @@ local function quarry_next_node(pos, meta)
|
||||
end
|
||||
|
||||
local function keep_running(pos, elapsed)
|
||||
if tubelib.data_not_corrupted(pos) then
|
||||
local meta = M(pos)
|
||||
quarry_next_node(pos, meta)
|
||||
return State:is_active(meta)
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
local function on_receive_fields(pos, formname, fields, player)
|
||||
|
@ -139,9 +139,12 @@ end
|
||||
|
||||
|
||||
local function keep_running(pos, elapsed)
|
||||
if tubelib.data_not_corrupted(pos) then
|
||||
local meta = M(pos)
|
||||
convert_biogas_to_biofuel(pos, meta)
|
||||
return State:is_active(meta)
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
local function on_receive_fields(pos, formname, fields, player)
|
||||
|
@ -13,6 +13,7 @@
|
||||
]]--
|
||||
|
||||
local function switch_on(pos, meta)
|
||||
if tubelib.data_not_corrupted(pos) then
|
||||
minetest.sound_play("tubelib_addons2_door", {
|
||||
pos = pos,
|
||||
gain = 0.5,
|
||||
@ -23,9 +24,11 @@ local function switch_on(pos, meta)
|
||||
local placer_name = meta:get_string("placer_name")
|
||||
tubelib.send_message(numbers, placer_name, nil, "on", number)
|
||||
minetest.get_node_timer(pos):start(4)
|
||||
end
|
||||
end
|
||||
|
||||
local function switch_off(pos)
|
||||
if tubelib.data_not_corrupted(pos) then
|
||||
minetest.sound_play("tubelib_addons2_door", {
|
||||
pos = pos,
|
||||
gain = 0.5,
|
||||
@ -36,6 +39,7 @@ local function switch_off(pos)
|
||||
local number = meta:get_string("number")
|
||||
local placer_name = meta:get_string("placer_name")
|
||||
tubelib.send_message(numbers, placer_name, nil, "off", number)
|
||||
end
|
||||
end
|
||||
|
||||
local function formspec1(numbers)
|
||||
|
@ -76,6 +76,7 @@ minetest.register_craft({
|
||||
|
||||
tubelib.register_node("tubelib_addons2:logic_not", {}, {
|
||||
on_recv_message = function(pos, topic, payload)
|
||||
if tubelib.data_not_corrupted(pos) then
|
||||
local meta = minetest.get_meta(pos)
|
||||
local owner = meta:get_string("owner")
|
||||
local numbers = meta:get_string("numbers")
|
||||
@ -90,5 +91,6 @@ tubelib.register_node("tubelib_addons2:logic_not", {}, {
|
||||
elseif topic == "off" then
|
||||
return tubelib.send_message(numbers, owner, nil, "on", payload)
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
@ -108,9 +108,12 @@ minetest.register_node("tubelib_addons2:mesecons_converter", {
|
||||
},
|
||||
|
||||
on_timer = function(pos,elapsed)
|
||||
if tubelib.data_not_corrupted(pos) then
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_int("overload_cnt", 0)
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end,
|
||||
|
||||
after_dig_node = function(pos)
|
||||
|
@ -62,9 +62,12 @@ minetest.register_node("tubelib_addons2:repeater", {
|
||||
end,
|
||||
|
||||
on_timer = function(pos,elapsed)
|
||||
if tubelib.data_not_corrupted(pos) then
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_int("overload_cnt", 0)
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end,
|
||||
|
||||
after_dig_node = function(pos)
|
||||
|
@ -89,6 +89,7 @@ local function restart_timer(pos, time)
|
||||
end
|
||||
|
||||
local function check_rules(pos, elapsed)
|
||||
if tubelib.data_not_corrupted(pos) then
|
||||
local meta = minetest.get_meta(pos)
|
||||
local rules = minetest.deserialize(meta:get_string("rules"))
|
||||
if rules then
|
||||
@ -122,6 +123,8 @@ local function check_rules(pos, elapsed)
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
local function start_the_sequencer(pos)
|
||||
@ -139,6 +142,7 @@ local function start_the_sequencer(pos)
|
||||
end
|
||||
|
||||
local function on_receive_fields(pos, formname, fields, player)
|
||||
if tubelib.data_not_corrupted(pos) then
|
||||
local meta = minetest.get_meta(pos)
|
||||
local running = meta:get_int("running")
|
||||
if minetest.is_protected(pos, player:get_player_name()) then
|
||||
@ -188,6 +192,7 @@ local function on_receive_fields(pos, formname, fields, player)
|
||||
local endless = meta:get_int("endless") or 0
|
||||
meta:set_string("formspec", formspec(tubelib.state(running), rules, endless))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_node("tubelib_addons2:sequencer", {
|
||||
|
@ -67,6 +67,7 @@ end
|
||||
|
||||
|
||||
local function check_rules(pos,elapsed)
|
||||
if tubelib.data_not_corrupted(pos) then
|
||||
local hour = math.floor(minetest.get_timeofday() * 24)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local events = minetest.deserialize(meta:get_string("events"))
|
||||
@ -98,6 +99,8 @@ local function check_rules(pos,elapsed)
|
||||
meta:set_string("done", minetest.serialize(done))
|
||||
meta:set_string("infotext","Tubelib Timer "..hour..":00")
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
|
@ -254,9 +254,12 @@ end
|
||||
|
||||
-- move items to the output slots
|
||||
local function keep_running(pos, elapsed)
|
||||
if tubelib.data_not_corrupted(pos) then
|
||||
local meta = M(pos)
|
||||
distributing(pos, meta)
|
||||
return State:is_active(meta)
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
local function on_receive_fields(pos, formname, fields, player)
|
||||
|
@ -51,9 +51,12 @@ local function pushing(pos, meta)
|
||||
end
|
||||
|
||||
local function keep_running(pos, elapsed)
|
||||
if tubelib.data_not_corrupted(pos) then
|
||||
local meta = M(pos)
|
||||
pushing(pos, meta)
|
||||
return State:is_active(meta)
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
minetest.register_node("tubelib_addons3:pusher", {
|
||||
|
@ -90,6 +90,7 @@ local function configured(pos, item)
|
||||
end
|
||||
|
||||
local function shift_items(pos, elapsed)
|
||||
if tubelib.data_not_corrupted(pos) then
|
||||
local meta = minetest.get_meta(pos)
|
||||
local inv = meta:get_inventory()
|
||||
if not inv:is_empty("shift") then
|
||||
@ -117,6 +118,8 @@ local function shift_items(pos, elapsed)
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
local function formspec()
|
||||
|
Loading…
Reference in New Issue
Block a user