add gfx.weather library & add weather.set command

This commit is contained in:
MihailRis
2025-02-27 07:30:49 +03:00
parent 02d8d8d6bf
commit 4d5b450145
8 changed files with 44 additions and 18 deletions
+1
View File
@@ -0,0 +1 @@
{}
+1 -1
View File
@@ -1,5 +1,5 @@
{
"fog_opacity": 0.99,
"fog_opacity": 0.98,
"fog_dencity": 3.6,
"fog_curve": 0.25,
"clouds": 0.8
+16 -1
View File
@@ -264,6 +264,20 @@ console.add_command(
end
)
console.add_command(
"weather.set name:str time:num=1",
"Change weather",
function (args, kwargs)
local filename = file.find("presets/weather/"..args[1]..".json")
if not filename then
return "weather preset not found"
end
local preset = json.parse(file.read(filename))
gfx.weather.change(preset, args[2])
return "weather set to "..filename.." preset ("..tostring(args[2]).." s)"
end
)
console.cheats = {
"blocks.fill",
"tp",
@@ -271,5 +285,6 @@ console.cheats = {
"time.set",
"time.daycycle",
"entity.despawn",
"player.respawn"
"player.respawn",
"weather.set",
}