diff options
author | Äkwav <16632490+Ekwav@users.noreply.github.com> | 2022-04-12 00:02:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-12 00:02:21 +0200 |
commit | e3aedc3ffea344fbdda63aeb8a3fae8af9b1e681 (patch) | |
tree | a70fabbbaadacd370dba53058a078bbc0c7284e0 /src/main/java/de/torui/coflsky/WSCommandHandler.java | |
parent | 507b9c2768ed6dafff82460fbe743a48f6fa631a (diff) | |
download | COFL-e3aedc3ffea344fbdda63aeb8a3fae8af9b1e681.tar.gz COFL-e3aedc3ffea344fbdda63aeb8a3fae8af9b1e681.tar.bz2 COFL-e3aedc3ffea344fbdda63aeb8a3fae8af9b1e681.zip |
Feature/countdown (#54)
* v1
* fixes #20
* code review comments
* update version
* fix aliases
Diffstat (limited to 'src/main/java/de/torui/coflsky/WSCommandHandler.java')
-rw-r--r-- | src/main/java/de/torui/coflsky/WSCommandHandler.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/main/java/de/torui/coflsky/WSCommandHandler.java b/src/main/java/de/torui/coflsky/WSCommandHandler.java index 0fc834f..616f860 100644 --- a/src/main/java/de/torui/coflsky/WSCommandHandler.java +++ b/src/main/java/de/torui/coflsky/WSCommandHandler.java @@ -8,6 +8,7 @@ import de.torui.coflsky.commands.JsonStringCommand; import de.torui.coflsky.commands.models.ChatMessageData; import de.torui.coflsky.commands.models.FlipData; import de.torui.coflsky.commands.models.SoundData; +import de.torui.coflsky.commands.models.TimerData; import de.torui.coflsky.network.WSClient; import net.minecraft.client.Minecraft; import net.minecraft.client.audio.PositionedSoundRecord; @@ -46,6 +47,10 @@ public class WSCommandHandler { break; case Flip: Flip(cmd.GetAs(new TypeToken<FlipData>() {})); + break; + case Countdown: + StartTimer(cmd.GetAs(new TypeToken<TimerData>() {})); + break; default: break; } @@ -83,9 +88,15 @@ public class WSCommandHandler { Execute(cmd.getData(),sender); } + /** + * Starts a countdown + */ + private static void StartTimer(Command<TimerData> cmd) { + CountdownTimer.startCountdown(cmd.getData()); + } + public static void Execute(String cmd, Entity sender) { - if(cmd.startsWith("/viewauction")){ String[] args = cmd.split(" "); |