package net.izenith.Commands;

import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.permissions.Permission;

import net.izenith.Main.Util;
import net.md_5.bungee.api.ChatColor;

public class PlayTime implements HubCommand{

	@Override
	public String getName() {
		return "playtime";
	}

	@Override
	public String[] getAliases() {
		return new String[]{"play","givemearimjobandbitemyear"};
	}

	@Override
	public void onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
		Long time = Util.getOnlineTime(Bukkit.getPlayer(args[0]));
		Double timeHours = new Double(time)/(1000*60*60);
		sender.sendMessage(ChatColor.BLUE + args[0] + " has played for " + ChatColor.GREEN + timeHours + " hours");
	}

	@Override
	public boolean onlyPlayers() {
		return false;
	}

	@Override
	public boolean hasPermission() {
		return false;
	}

	@Override
	public Permission getPermission() {
		return null;
	}

}
	
@@ -24,16 +24,49 @@
 mands;%0A%0A
+import java.text.DecimalFormat;%0A%0A
 import o
@@ -706,16 +706,107 @@
 60*60);%0A
+%09%09DecimalFormat df = new DecimalFormat(%22#.##%22);%0A%09%09String shortTime = df.format(timeHours);%0A
 %09%09sender
@@ -884,25 +884,25 @@
 GREEN + 
-timeHours
+shortTime
  + %22 hou

Fix to long decimal places