diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/other/TimeCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/other/TimeCommand.java index 27995703..66e916b5 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/other/TimeCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/other/TimeCommand.java @@ -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 intTypeMapper() { return SWCommandUtils.createMapper(s -> {