add gfx.weather library & add weather.set command
This commit is contained in:
+16
-1
@@ -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",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user