From a8fbfaac02cebed72477b7e11444256eb48fc4e7 Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Mon, 6 Nov 2017 19:53:57 -0500 Subject: update biome lib and pipeworks --- biome_lib/API.txt | 6 ++++++ biome_lib/init.lua | 7 +++++-- pipeworks/pressure_logic/flowable_node_registry_install.lua | 10 ++++++++-- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/biome_lib/API.txt b/biome_lib/API.txt index 73e310f..6aab582 100644 --- a/biome_lib/API.txt +++ b/biome_lib/API.txt @@ -481,6 +481,12 @@ Set this to true if you want the mod to spam your console with debug info :-) plantlife_debug = false +To slow down the playback of the queue (e.g. for really slow machines where +the 0.2 second max limiter isn't enough), set: + + biome_lib_queue_run_ratio = + +Default is 100 (basically percent of maximum runtime) ====================== Fertile Ground Mapping diff --git a/biome_lib/init.lua b/biome_lib/init.lua index cb23eb7..761a57e 100644 --- a/biome_lib/init.lua +++ b/biome_lib/init.lua @@ -31,6 +31,8 @@ biome_lib.modpath = minetest.get_modpath("biome_lib") biome_lib.total_no_aircheck_calls = 0 +biome_lib.queue_run_ratio = tonumber(minetest.settings:get("biome_lib_queue_run_ratio")) or 100 + -- Boilerplate to support localized strings if intllib mod is installed. local S if minetest.get_modpath("intllib") then @@ -427,8 +429,9 @@ end) -- "Play" them back, populating them with new stuff in the process minetest.register_globalstep(function(dtime) - if dtime < 0.2 and -- don't attempt to populate if lag is already too high - (#biome_lib.blocklist_aircheck > 0 or #biome_lib.blocklist_no_aircheck > 0) then + if dtime < 0.2 -- don't attempt to populate if lag is already too high + and math.random(100) <= biome_lib.queue_run_ratio + and (#biome_lib.blocklist_aircheck > 0 or #biome_lib.blocklist_no_aircheck > 0) then biome_lib.globalstep_start_time = minetest.get_us_time() biome_lib.globalstep_runtime = 0 while (#biome_lib.blocklist_aircheck > 0 or #biome_lib.blocklist_no_aircheck > 0) diff --git a/pipeworks/pressure_logic/flowable_node_registry_install.lua b/pipeworks/pressure_logic/flowable_node_registry_install.lua index 5cf1941..0ad00a6 100644 --- a/pipeworks/pressure_logic/flowable_node_registry_install.lua +++ b/pipeworks/pressure_logic/flowable_node_registry_install.lua @@ -67,8 +67,8 @@ register.directional_vertical_fixed = function(nodename, topside) end -- register a node as a directional flowable whose accepting sides depends upon param2 rotation. --- used for entry panels, valves, flow sensors and spigots, --- whose facing axis is always upwards and can only rotate horizontally. +-- used for entry panels, valves, flow sensors and spigots. +-- this is mostly for legacy reasons and SHOULD NOT BE USED IN NEW CODE. register.directional_horizonal_rotate = function(nodename, doubleended) local rotations = { {x= 0,y= 0,z= 1}, @@ -79,6 +79,12 @@ register.directional_horizonal_rotate = function(nodename, doubleended) local getends = function(node) --local dname = "horizontal rotate getends() " local param2 = node.param2 + -- the pipeworks nodes use a fixed value for vertical facing nodes + -- if that is detected, just return that directly. + if param2 == 17 then + return {{x=0,y=1,z=0}, {x=0,y=-1,z=0}} + end + -- the sole end of the spigot points in the direction the rotation bits suggest -- also note to self: lua arrays start at one... local mainend = (param2 % 4) + 1 -- cgit v1.2.3