Solved Cooldown help

Discussion in 'Plugin Development' started by ItsMas_, Jan 30, 2016.

Thread Status:
Not open for further replies.
  1. Offline

    ItsMas_

    I am using the following thread for makign ability cooldowns:
    https://bukkit.org/threads/tutorial-better-cooldowns.165811/

    However, I am getting an error in the Cooldown class.
    Error: "The method convert(long, utilTime.TimeUnit, int) in the type utilTime is not applicable for the arguments (long, TimeUnit, int)"
    On this line of code:
    Code:
    return utilTime.convert((cooldownPlayers.get(player).cooldownMap.get(ability).seconds + cooldownPlayers.get(player).cooldownMap.get(ability).systime) - System.currentTimeMillis(), TimeUnit.SECONDS, 1);
    The method 'convert' is in the utilTime class, and this is what it does:
    Code:
        public static double convert(long time, TimeUnit unit, int decPoint) {
            if(unit == TimeUnit.BEST){
                if(time < 60000L) unit = TimeUnit.UNIT;
                else if(time < 3600000L) unit = TimeUnit.MINUTES;
                else if(time < 86400000L) unit = TimeUnit.HOURS;
                else unit = TimeUnit.DAYS;
            }
            if(unit == TimeUnit.UNIT) return utilMath.trim(time / 1000.0D, decPoint);
            if(unit == TimeUnit.MINUTES) return utilMath.trim(time / 60000.0D, decPoint);
            if(unit == TimeUnit.HOURS) return utilMath.trim(time / 3600000.0D, decPoint);
            if(unit == TimeUnit.DAYS) return utilMath.trim(time / 86400000.0D, decPoint);
            return utilMath.trim(time, decPoint);
        }
    I know this would be a big favour to ask, but could someone more experienced go through the thread mentioned at the top of this post and tell me a fix for this?

    Thanks :)
     
Thread Status:
Not open for further replies.

Share This Page