MCPcopy Create free account
hub / github.com/Teneted/Tenet / getTimeLeft

Method getTimeLeft

src/main/java/com/mohistmc/api/CooldownAPI.java:36–47  ·  view source on GitHub ↗
(String id, String cooldownName)

Source from the content-addressed store, hash-verified

34 }
35
36 public static int getTimeLeft(String id, String cooldownName) {
37 CooldownAPI cooldown = getCooldown(id, cooldownName);
38 int f = -1;
39 if (cooldown != null) {
40 long now = System.currentTimeMillis();
41 long cooldownTime = cooldown.start;
42 int totalTime = cooldown.timeInSeconds;
43 int r = (int) (now - cooldownTime) / 1000;
44 f = (r - totalTime) * -1;
45 }
46 return f;
47 }
48
49 public static double getTimeLeftDouble(String id, String cooldownName) {
50 CooldownAPI cooldown = getCooldown(id, cooldownName);

Callers 1

isInCooldownMethod · 0.95

Calls 1

getCooldownMethod · 0.95

Tested by

no test coverage detected