-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.lua
42 lines (38 loc) · 821 Bytes
/
init.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
minetest.register_on_joinplayer(function(player)
player:set_sun({
texture = "sun.png",
scale = 4
})
player:set_moon({
texture = "moon.png^[transformR180",
scale = 4
})
end)
minetest.register_on_placenode(function(_)
local t = minetest.get_timeofday()
minetest.set_timeofday((t+.1) < 1 and (t+.1) or 0)
end)
minetest.register_globalstep(function(dtime)
local t = minetest.get_timeofday()
for _,player in ipairs(minetest.get_connected_players()) do
if t > .50 then
player:set_sun({
texture = "sun.png^[transformR180",
scale = 2.7
})
player:set_moon({
texture = "moon.png^[transformR180",
scale = 4
})
elseif t > 0 then
player:set_sun({
texture = "sun.png",
scale = 2.7
})
player:set_moon({
texture = "moon.png",
scale = 4
})
end
end
end)