Fixed server freeze on timespecs like "1day"

This commit is contained in:
Robin Kupper
2011-06-16 15:41:16 +02:00
parent fce128ccab
commit d770e4ccf9
2 changed files with 3 additions and 3 deletions

View File

@@ -147,7 +147,7 @@ public class LogBlock extends JavaPlugin
timer.scheduleAtFixedRate(consumer, config.delayBetweenRuns * 1000, config.delayBetweenRuns * 1000); timer.scheduleAtFixedRate(consumer, config.delayBetweenRuns * 1000, config.delayBetweenRuns * 1000);
log.info("[LogBlock] Scheduled consumer with timer."); log.info("[LogBlock] Scheduled consumer with timer.");
} }
log.info("Logblock v" + getDescription().getVersion() + " enabled."); log.info("Logblock v" + getDescription().getVersion() + " by DiddiZ enabled.");
} }
@Override @Override

View File

@@ -94,10 +94,10 @@ public class Utils
hours = Integer.parseInt(spec[0].substring(lastIndex, currIndex - 1)); hours = Integer.parseInt(spec[0].substring(lastIndex, currIndex - 1));
else if (param.equals("m")) else if (param.equals("m"))
minutes = Integer.parseInt(spec[0].substring(lastIndex, currIndex - 1)); minutes = Integer.parseInt(spec[0].substring(lastIndex, currIndex - 1));
}
lastIndex = currIndex; lastIndex = currIndex;
currIndex++; currIndex++;
} }
}
if (days == 0 && hours == 0 && minutes == 0) if (days == 0 && hours == 0 && minutes == 0)
return -1; return -1;
return minutes + hours * 60 + days * 1440; return minutes + hours * 60 + days * 1440;