mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-25 02:27:33 +01:00
Throw invalid kit message on invalid delay
This commit is contained in:
parent
479dad9966
commit
a65d0db57d
@ -59,7 +59,16 @@ public class Kit
|
|||||||
final Calendar time = new GregorianCalendar();
|
final Calendar time = new GregorianCalendar();
|
||||||
|
|
||||||
// Take the current time, and remove the delay from it.
|
// Take the current time, and remove the delay from it.
|
||||||
final double delay = els.containsKey("delay") ? ((Number)els.get("delay")).doubleValue() : 0.0d;
|
double delay = 0;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Also make sure delay is valid
|
||||||
|
delay = els.containsKey("delay") ? ((Number)els.get("delay")).doubleValue() : 0.0d;
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
throw new Exception(_("kitError2"));
|
||||||
|
}
|
||||||
final Calendar earliestTime = new GregorianCalendar();
|
final Calendar earliestTime = new GregorianCalendar();
|
||||||
earliestTime.add(Calendar.SECOND, -(int)delay);
|
earliestTime.add(Calendar.SECOND, -(int)delay);
|
||||||
earliestTime.add(Calendar.MILLISECOND, -(int)((delay * 1000.0) % 1000.0));
|
earliestTime.add(Calendar.MILLISECOND, -(int)((delay * 1000.0) % 1000.0));
|
||||||
|
Loading…
Reference in New Issue
Block a user