-
-
Save GreenXenith/37c00bf410e1c0338e76c09d20d7843d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local second = tonumber(os.date("%S")) | |
local minute = tonumber(os.date("%M")) | |
--Inside the node | |
on_construct = function(pos, itemstack, pointed_thing) | |
local meta = minetest.get_meta(pos) | |
if second > 10 then | |
meta:set_int("next_min", minute + 1) | |
minetest.log("none", "second is " ..second.. " which is greater than 10, setting fill date to next minute (" .. minute + 1 ..") from current minute (" .. minute .. ")") | |
elseif second <= 10 then | |
meta:set_int("next_min", minute) | |
minetest.log("none", "second is " ..second.. " which is less than 10, setting fill date to current minute (" .. minute ..")") | |
end | |
end, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment