From 66280aa506f88c567bc7b05eea4514e8f5a3639b Mon Sep 17 00:00:00 2001 From: Noah <70314622+NoahTheNerd@users.noreply.github.com> Date: Fri, 7 Jun 2024 12:07:11 +0200 Subject: [PATCH] Starting with the CommandQueue --- .../ixnoah/tapactions/commands/CommandQueue.kt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/main/kotlin/live/ixnoah/tapactions/commands/CommandQueue.kt diff --git a/src/main/kotlin/live/ixnoah/tapactions/commands/CommandQueue.kt b/src/main/kotlin/live/ixnoah/tapactions/commands/CommandQueue.kt new file mode 100644 index 0000000..f075824 --- /dev/null +++ b/src/main/kotlin/live/ixnoah/tapactions/commands/CommandQueue.kt @@ -0,0 +1,18 @@ +import net.minecraft.client.Minecraft + +object CommandQueue { + private var queue = mutableListOf() + + fun pushCommand(command: String) { + queue.add(command) + } + + fun runNextCommand() { + if (queue.size == 0) return + + val command = queue.first() + queue.drop(1) + + Minecraft.getMinecraft().thePlayer.sendChatMessage("/" + command) + } +}