Skip to content

Commit 9802833

Browse files
committed
Merge remote-tracking branch 'origin/master' into beta
# Conflicts: # src/main/java/com/vltno/timeloop/Commands.java # src/main/java/com/vltno/timeloop/TimeLoop.java
2 parents 5ac35d6 + 5392deb commit 9802833

6 files changed

Lines changed: 180 additions & 63 deletions

File tree

README.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,23 @@ Simply use commands to configure the loop.
2828
- `displayTimeInTicks [false]` - Displays the ticks instead of HH:MM:SS on the Progress bar.
2929

3030
# LoopType Options
31-
- `TICK` (Loops every `setTicks` ticks)
32-
- `TIME_OF_DAY` (Loops when the time reaches `setTimeOfDay`)
33-
- `SLEEP` (Loops when you sleep)
34-
- `DEATH` (Loops when you die)
31+
- `TICK` (Loops every `setLength` ticks)
32+
- `TIME_OF_DAY` (Loops when the time reaches `setTimeOfDay`)
33+
- `SLEEP` (Loops when you sleep)
34+
- `DEATH` (Loops when you die)
35+
36+
# Known Issues
37+
- Dying stops the player from looping
38+
- Skins are broken in multiplayer
39+
- Spectators don't appear as invisible in the loop
40+
- If the loop starts before a player joins, they cannot see the loops
41+
- Loops don't work through dimensions
42+
43+
### Issue Links
44+
https://github.com/mt1006/mc-mocap-mod/issues/52
45+
https://github.com/mt1006/mc-mocap-mod/issues/53
46+
https://github.com/mt1006/mc-mocap-mod/issues/56
47+
https://github.com/mt1006/mc-mocap-mod/issues/57
3548

3649
# Support
3750
If you need help or encounter an issue, don't hesitate to ask someone in the discord: https://discord.gg/nzDETZhqur

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ yarn_mappings=1.21.1+build.3
99
loader_version=0.16.10
1010

1111
# Mod Properties
12-
mod_version=1.7.0
12+
mod_version=1.7.1
1313
maven_group=com.vltno.timeloop
1414
archives_base_name=time-loop
1515

src/main/java/com/vltno/timeloop/Commands.java

Lines changed: 37 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)