sorcery  Check-in [b79f4e8611]

Overview
Comment:tweak interval
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: b79f4e8611dfe089aa3872d6d87e89b16c52dc0e01892a435de11ac5918cbf33
User & Date: lexi on 2021-07-07 07:56:28
Other Links: manifest | tags
Context
2021-07-07
08:23
bug fixes check-in: 612f10a00d user: lexi tags: trunk
07:56
tweak interval check-in: b79f4e8611 user: lexi tags: trunk
2021-07-06
22:21
correct recipe check-in: 99e19cc14f user: lexi tags: trunk
Changes

Modified tap.lua from [c0cf444eb7] to [4e48d35701].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
..
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
local log = sorcery.logger('tap')
local sap_interval = 50;

local function tapdrip(liq, pos)
	return sorcery.vfx.drip(liq, vector.offset(pos, 0, -0.3, 0), math.random(5,12), sap_interval, 2)
end

minetest.register_node('sorcery:tap',{
	description = 'Tree Tap';
	drawtype = 'mesh';
	mesh = 'sorcery-tap.obj';
	inventory_image = 'sorcery_tap_inv.png';
	tiles = {
		'default_copper_block.png';
		'default_steel_block.png';
	};
................................................................................
local abm_cache
local abm_cache_time
minetest.register_abm {
	label = 'Sap drip';
	nodenames = {'sorcery:tap'};
	neighbors = {'group:tree'};
	interval = sap_interval;
	chance = 4;
	catch_up = true;
	action = function(pos, node)
		local now = os.time()
		if abm_cache_time == nil or now > abm_cache_time + (sap_interval-1) then
			abm_cache = { treehash = {} }
			abm_cache_time = now
		end

|






|







 







|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
..
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
local log = sorcery.logger('tap')
local sap_interval = 60;

local function tapdrip(liq, pos)
	return sorcery.vfx.drip(liq, vector.offset(pos, 0, -0.3, 0), math.random(5,12), sap_interval, 2)
end

minetest.register_node('sorcery:tap',{
	description = 'Tap';
	drawtype = 'mesh';
	mesh = 'sorcery-tap.obj';
	inventory_image = 'sorcery_tap_inv.png';
	tiles = {
		'default_copper_block.png';
		'default_steel_block.png';
	};
................................................................................
local abm_cache
local abm_cache_time
minetest.register_abm {
	label = 'Sap drip';
	nodenames = {'sorcery:tap'};
	neighbors = {'group:tree'};
	interval = sap_interval;
	chance = 5;
	catch_up = true;
	action = function(pos, node)
		local now = os.time()
		if abm_cache_time == nil or now > abm_cache_time + (sap_interval-1) then
			abm_cache = { treehash = {} }
			abm_cache_time = now
		end