SteamWar/BauSystem2.0
Archiviert
12
0

Update TimeCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
yoyosource 2021-12-09 22:04:10 +01:00
Ursprung 54382c7968
Commit 2d3dc10e23

Datei anzeigen

@ -40,12 +40,20 @@ public class TimeCommand extends SWCommand {
addDefaultHelpMessage("OTHER_TIME_HELP");
}
// TODO: Add set as OptionalValue
@Register
public void genericCommand(@Guard Player p, Time time) {
Bukkit.getWorlds().get(0).setTime(time.getValue());
BauSystem.MESSAGE.send("OTHER_TIME_RESULT", p);
}
@Register
public void genericCommand(@Guard Player p, @StaticValue(value = "set") String set, Time time) {
Bukkit.getWorlds().get(0).setTime(time.getValue());
BauSystem.MESSAGE.send("OTHER_TIME_RESULT", p);
}
// TODO: Add set as OptionalValue
@Register
public void genericCommand(@Guard Player p, int time) {
if (time < 0 || time > 24000) {
@ -56,6 +64,16 @@ public class TimeCommand extends SWCommand {
BauSystem.MESSAGE.send("OTHER_TIME_RESULT", p);
}
@Register
public void genericCommand(@Guard Player p, @StaticValue(value = "set") String set, int time) {
if (time < 0 || time > 24000) {
BauSystem.MESSAGE.send("OTHER_TIME_INVALID", p);
return;
}
Bukkit.getWorlds().get(0).setTime(time);
BauSystem.MESSAGE.send("OTHER_TIME_RESULT", p);
}
@ClassMapper(value = int.class, local = true)
public TypeMapper<Integer> intTypeMapper() {
return SWCommandUtils.createMapper(s -> {