From 5302f5842e150b641dcca7afc71294e9e67558cb Mon Sep 17 00:00:00 2001 From: MihailRis Date: Sat, 2 Nov 2024 13:29:43 +0300 Subject: [PATCH] add 'time.daycycle' command --- res/scripts/stdcmd.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/res/scripts/stdcmd.lua b/res/scripts/stdcmd.lua index f99f04c2..437c2460 100644 --- a/res/scripts/stdcmd.lua +++ b/res/scripts/stdcmd.lua @@ -110,6 +110,22 @@ console.add_command( return "Time set to " .. args[1] end ) + +console.add_command( + "time.daycycle operation:[stop|reset]", + "Control time.daycycle", + function(args, kwargs) + local operation = args[1] + if operation == "stop" then + world.set_day_time_speed(0) + return "Daily cycle has stopped" + else + world.set_day_time_speed(1.0 / 60.0 / 24.0) + return "Daily cycle has started" + end + end +) + console.add_command( "blocks.fill id:str x1:int~pos.x y1:int~pos.y z1:int~pos.z ".. "x2:int~pos.x y2:int~pos.y z2:int~pos.z",