1
0
mirror of https://codeberg.org/tenplus1/farming.git synced 2025-06-29 23:01:00 +02:00

add api.txt and tidy code

This commit is contained in:
TenPlus1
2018-05-17 09:25:16 +01:00
parent 82104e68a7
commit 6e52f96703
2 changed files with 45 additions and 4 deletions

View File

@ -7,7 +7,7 @@
farming = {}
farming.mod = "redo"
farming.version = "1.33"
farming.version = "20180506"
farming.path = minetest.get_modpath("farming")
farming.select = {
type = "fixed",
@ -22,16 +22,16 @@ function farming.is_creative(name)
end
local statistics = dofile(farming.path.."/statistics.lua")
local statistics = dofile(farming.path .. "/statistics.lua")
-- Intllib
local S = dofile(farming.path.."/intllib.lua")
local S = dofile(farming.path .. "/intllib.lua")
farming.intllib = S
-- Utility Function
local time_speed = tonumber(minetest.settings:get("time_speed")) or 72
local SECS_PER_CYCLE = (time_speed > 0 and 24 * 60 * 60 / time_speed) or 0
local SECS_PER_CYCLE = (time_speed > 0 and (24 * 60 * 60) / time_speed) or 0
local function clamp(x, min, max)
return (x < min and min) or (x > max and max) or x
end