@GrubsCommandHandler(
		command = "timelock",
		desc = "Toggle freezing time to current value, or to the specified time value or preset.",
		usage = "/<command> off|on|day|night|<0-24000>"
	)
	public void onTimeLockCommand(GrubsCommandInfo cmd) {
		CommandSender sender = cmd.sender;
		String[] args = cmd.args;

		if (args.length > 0) {
			String argVal = args[0];
			if (argVal.equalsIgnoreCase("off")) {
				this.gtModule.unlockTime();
				GrubsMessager.sendMessage(sender, GrubsMessager.MessageLevel.INFO, "Time lock is off.");
			}
			else {
				World world;
				int timecode;

				if (sender instanceof Player) {
					Player executingPlayer = (Player) sender;
					world = executingPlayer.getWorld();
				}
				else {
					world = Bukkit.getServer().getWorlds().get(0);
				}

				if (argVal.equalsIgnoreCase("on")) {
					timecode = (int) world.getTime();
				}
				else if (argVal.equalsIgnoreCase("day")) {
					timecode = 6000;
				}
				else if (argVal.equalsIgnoreCase("night")) {
					timecode = 18000;
				}
				else {
					try {
						timecode = Integer.parseInt(argVal);
						if (timecode < 0 || timecode > 24000) {
							GrubsMessager.sendMessage(sender, GrubsMessager.MessageLevel.ERROR, "Invalid time.");
							return;
						}
					}
					catch (Exception e) {
						GrubsMessager.sendMessage(sender, GrubsMessager.MessageLevel.ERROR, "Invalid argument.");
						return;
					}
				}

				this.gtModule.lockTime(world, timecode);
				GrubsMessager.sendMessage(sender, GrubsMessager.MessageLevel.INFO, "Time locked at " + timecode);
			}
		}
		else {
			GrubsMessager.sendMessage(sender, GrubsMessager.MessageLevel.ERROR, "Missing command argument.");
		}
	}