@@ -24,9 +24,11 @@ public void register(CommandDispatcher<ServerCommandSource> dispatcher, CommandR
2424 .requires (source -> source .hasPermissionLevel (2 ))
2525 .executes (context -> {
2626 if (!mod .isLooping ) {
27+ mod .startTimeOfDay = mod .serverWorld .getTimeOfDay ();
28+ mod .config .startTimeOfDay = mod .startTimeOfDay ;
2729 mod .startLoop ();
2830 context .getSource ().sendMessage (Text .literal ("Loop started!" ));
29- LOGGER .info ("Loop started" );
31+ LOGGER .info ("loop started" );
3032 return 1 ;
3133 }
3234 context .getSource ().sendMessage (Text .literal ("Loop already running!" ));
@@ -58,7 +60,7 @@ public void register(CommandDispatcher<ServerCommandSource> dispatcher, CommandR
5860 LOGGER .info ("Status requested: {}" , status );
5961 return 1 ;
6062 }))
61-
63+
6264 // SETTINGS
6365 .then (CommandManager .literal ("settings" )
6466
@@ -74,7 +76,7 @@ public void register(CommandDispatcher<ServerCommandSource> dispatcher, CommandR
7476 mod .loopType = newLoopType ;
7577 mod .config .loopType = newLoopType ;
7678 mod .config .save ();
77-
79+
7880 context .getSource ().sendMessage (Text .literal ("Looping type is set to: " + newLoopType .asString ()));
7981 LOGGER .info ("Loop type set to {}" , newLoopType .asString ());
8082 return 1 ;
@@ -96,15 +98,16 @@ public void register(CommandDispatcher<ServerCommandSource> dispatcher, CommandR
9698 mod .config .ticksLeft = newTicks ;
9799
98100 mod .config .save ();
99- context .getSource ().sendMessage (Text .literal ("Loop ticks is set to: " + newTicks + " ticks" ));
101+
102+ context .getSource ().sendMessage (Text .literal ("Loop length is set to: " + newTicks + " ticks" ));
100103 LOGGER .info ("Loop length set to {} ticks" , newTicks );
101104 return 1 ;
102105 })))
103-
106+
104107 .then (CommandManager .literal ("maxLoops" )
105108 .requires (source -> source .hasPermissionLevel (2 ))
106109 .executes (context -> {
107- context .getSource ().sendMessage (Text .literal ("maxLoops is currently set to: " + mod .maxLoops ));
110+ context .getSource ().sendMessage (Text .literal ("Max loops is set to: " + mod .maxLoops ));
108111 return 1 ;
109112 })
110113 .then (CommandManager .argument ("value" , IntegerArgumentType .integer (0 ))
@@ -113,34 +116,34 @@ public void register(CommandDispatcher<ServerCommandSource> dispatcher, CommandR
113116 mod .maxLoops = maxLoops ;
114117 mod .config .maxLoops = maxLoops ;
115118 mod .config .save ();
116- context .getSource ().sendMessage (Text .literal ("maxLoops is currently set to: " + maxLoops ));
117- LOGGER .info ("Max Loops set to {}" , maxLoops );
119+ context .getSource ().sendMessage (Text .literal ("Max loops is set to: " + maxLoops ));
120+ LOGGER .info ("Max loops set to {}" , maxLoops );
118121 return 1 ;
119122 })))
120-
123+
121124 .then (CommandManager .literal ("setTimeOfDay" )
122125 .requires (source -> source .hasPermissionLevel (2 ))
123126 .executes (context -> {
124- context .getSource ().sendMessage (Text .literal ("Time is set to: " + mod .timeSetting ));
127+ context .getSource ().sendMessage (Text .literal ("Time of day is set to: " + mod .timeSetting ));
125128 return 1 ;
126129 })
127- .then (CommandManager .argument ("time" , IntegerArgumentType .integer (0 ))
130+ .then (CommandManager .argument ("time" , IntegerArgumentType .integer (0 , 24000 ))
128131 .executes (context -> {
129132 int newTime = IntegerArgumentType .getInteger (context , "time" );
130133 mod .timeSetting = newTime ;
131134 mod .config .timeSetting = newTime ;
132135 mod .config .save ();
133- context .getSource ().sendMessage (Text .literal ("Time is set to: " + newTime ));
134- LOGGER .info ("Time set to {}" , newTime );
136+ context .getSource ().sendMessage (Text .literal ("Time of day is set to: " + newTime ));
137+ LOGGER .info ("Time of day set to {}" , newTime );
135138 return 1 ;
136139 })))
137-
140+
138141 // TOGGLES
139142 .then (CommandManager .literal ("toggles" )
140143 .then (CommandManager .literal ("trackTimeOfDay" )
141144 .requires (source -> source .hasPermissionLevel (2 ))
142145 .executes (context -> {
143- context .getSource ().sendMessage (Text .literal ("Tracking time of day is set to: " + mod .trackTimeOfDay ));
146+ context .getSource ().sendMessage (Text .literal ("Track time of day is set to: " + mod .trackTimeOfDay ));
144147 return 1 ;
145148 })
146149 .then (CommandManager .argument ("value" , BoolArgumentType .bool ())
@@ -149,16 +152,16 @@ public void register(CommandDispatcher<ServerCommandSource> dispatcher, CommandR
149152 mod .trackTimeOfDay = newTrackTimeOfDay ;
150153 mod .config .trackTimeOfDay = newTrackTimeOfDay ;
151154 mod .config .save ();
152-
153- context .getSource ().sendMessage (Text .literal ("Tracking time of day is set to: " + newTrackTimeOfDay ));
154- LOGGER .info ("Tracking time of day set to {}" , newTrackTimeOfDay );
155+
156+ context .getSource ().sendMessage (Text .literal ("Track time of day is set to: " + newTrackTimeOfDay ));
157+ LOGGER .info ("Track time of day set to {}" , newTrackTimeOfDay );
155158 return 1 ;
156159 })))
157160
158161 .then (CommandManager .literal ("trackItems" )
159162 .requires (source -> source .hasPermissionLevel (2 ))
160163 .executes (context -> {
161- context .getSource ().sendMessage (Text .literal ("Tracking items is set to: " + mod .trackItems ));
164+ context .getSource ().sendMessage (Text .literal ("Track items is set to: " + mod .trackItems ));
162165 return 1 ;
163166 })
164167 .then (CommandManager .argument ("value" , BoolArgumentType .bool ())
@@ -167,18 +170,18 @@ public void register(CommandDispatcher<ServerCommandSource> dispatcher, CommandR
167170 mod .trackItems = newTrackItems ;
168171 mod .config .trackItems = newTrackItems ;
169172 mod .config .save ();
170-
173+
171174 mod .updateEntitiesToTrack (newTrackItems );
172-
173- context .getSource ().sendMessage (Text .literal ("Tracking items is set to: " + newTrackItems ));
174- LOGGER .info ("Tracking items set to {}" , newTrackItems );
175+
176+ context .getSource ().sendMessage (Text .literal ("Track items is set to: " + newTrackItems ));
177+ LOGGER .info ("Track items set to {}" , newTrackItems );
175178 return 1 ;
176179 })))
177180
178181 .then (CommandManager .literal ("displayTimeInTicks" )
179182 .requires (source -> source .hasPermissionLevel (2 ))
180183 .executes (context -> {
181- context .getSource ().sendMessage (Text .literal ("Display Time in ticks is set to: " + mod .displayTimeInTicks ));
184+ context .getSource ().sendMessage (Text .literal ("Display time in ticks is set to: " + mod .displayTimeInTicks ));
182185 return 1 ;
183186 })
184187 .then (CommandManager .argument ("value" , BoolArgumentType .bool ())
@@ -188,8 +191,8 @@ public void register(CommandDispatcher<ServerCommandSource> dispatcher, CommandR
188191 mod .config .displayTimeInTicks = newDisplayTimeInTicks ;
189192 mod .config .save ();
190193
191- context .getSource ().sendMessage (Text .literal ("Display Time in ticks is set to: " + newDisplayTimeInTicks ));
192- LOGGER .info ("Display Time in ticks set to {}" , newDisplayTimeInTicks );
194+ context .getSource ().sendMessage (Text .literal ("Display time in ticks is set to: " + newDisplayTimeInTicks ));
195+ LOGGER .info ("Display time in ticks set to {}" , newDisplayTimeInTicks );
193196 return 1 ;
194197 })))
195198
@@ -205,13 +208,13 @@ public void register(CommandDispatcher<ServerCommandSource> dispatcher, CommandR
205208 mod .showLoopInfo = newShowLoopInfo ;
206209 mod .config .showLoopInfo = newShowLoopInfo ;
207210 mod .config .save ();
208-
211+
209212 mod .loopBossBar .visible (newShowLoopInfo );
210-
213+
211214 context .getSource ().sendMessage (Text .literal ("Showing loop info is set to: " + newShowLoopInfo ));
212215 LOGGER .info ("Show loop info set to {}" , newShowLoopInfo );
213216 return 1 ;
214- })))))
217+ }))))
215218
216219 .then (CommandManager .literal ("reset" )
217220 .requires (source -> source .hasPermissionLevel (2 ))
@@ -221,7 +224,7 @@ public void register(CommandDispatcher<ServerCommandSource> dispatcher, CommandR
221224 mod .startTimeOfDay = 0 ;
222225 mod .config .startTimeOfDay = 0 ;
223226
224- mod .timeSetting = 0 ;
227+ mod .timeSetting = 13000 ;
225228 mod .config .timeSetting = 0 ;
226229
227230 mod .ticksLeft = mod .loopLengthTicks ;
@@ -233,6 +236,9 @@ public void register(CommandDispatcher<ServerCommandSource> dispatcher, CommandR
233236 mod .loopType = LoopTypes .TICKS ;
234237 mod .config .loopType = LoopTypes .TICKS ;
235238
239+ mod .displayTimeInTicks = false ;
240+ mod .config .displayTimeInTicks = false ;
241+
236242 mod .executeCommand ("mocap playback stop_all" );
237243 mod .executeCommand (String .format ("mocap scenes remove %s" , mod .sceneName ));
238244 mod .executeCommand (String .format ("mocap scenes add %s" , mod .sceneName ));
@@ -241,6 +247,6 @@ public void register(CommandDispatcher<ServerCommandSource> dispatcher, CommandR
241247 mod .config .save ();
242248 context .getSource ().sendMessage (Text .literal ("Loop reset!" ));
243249 return 1 ;
244- })));
250+ })))) ;
245251 }
246252}
0 commit comments