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) + } +}