package me.nallar.tickthreading.minecraft.commands;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommandSender;

public abstract class Command extends CommandBase {
	public static void sendChat(ICommandSender commandSender, String message) {
		while (message != null) {
			int nlIndex = message.indexOf('\n');
			String sent;
			if (nlIndex == -1) {
				sent = message;
				message = null;
			} else {
				sent = message.substring(0, nlIndex);
				message = message.substring(nlIndex + 1);
			}
			commandSender.sendChatToPlayer(sent);
		}
	}

	@Override
	public final void processCommand(ICommandSender commandSender, String... argumentsArray) {
		processCommand(commandSender, new ArrayList<String>(Arrays.asList(argumentsArray)));
	}

	protected abstract void processCommand(ICommandSender commandSender, List<String> arguments);
}

@@ -125,24 +125,61 @@
 il.List;%0D%0A%0D%0A
+import me.nallar.tickthreading.Log;%0D%0A
 import net.m
@@ -254,16 +254,62 @@
 Sender;%0D
+%0Aimport net.minecraft.server.MinecraftServer;%0D
 %0A%0D%0Apubli
@@ -434,16 +434,118 @@
 age) %7B%0D%0A
+%09%09if (commandSender == MinecraftServer.getServer()) %7B%0D%0A%09%09%09Log.info('%5Cn' + message);%0D%0A%09%09%09return;%0D%0A%09%09%7D%0D%0A
 %09%09while 

Include console command output in logs.