mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-12 04:20:41 +00:00
Catch all values greater than 10 years to avoid exploits.
This commit is contained in:
parent
eeea16a99a
commit
2b99ed9a2a
1 changed files with 6 additions and 4 deletions
|
@ -187,10 +187,6 @@ public class Util
|
|||
throw new Exception(_("illegalDate"));
|
||||
}
|
||||
Calendar c = new GregorianCalendar();
|
||||
if (years > 10)
|
||||
{
|
||||
years = 10;
|
||||
}
|
||||
if (years > 0)
|
||||
{
|
||||
c.add(Calendar.YEAR, years * (future ? 1 : -1));
|
||||
|
@ -219,6 +215,12 @@ public class Util
|
|||
{
|
||||
c.add(Calendar.SECOND, seconds * (future ? 1 : -1));
|
||||
}
|
||||
|
||||
Calendar max = new GregorianCalendar();
|
||||
max.add(Calendar.YEAR, 10);
|
||||
if (c.after(max)) {
|
||||
return max.getTimeInMillis();
|
||||
}
|
||||
return c.getTimeInMillis();
|
||||
}
|
||||
// The player can stand inside these materials
|
||||
|
|
Loading…
Reference in a new issue