remove bloat
This commit is contained in:
parent
448f81baec
commit
e9eb96eb73
|
|
@ -51,32 +51,8 @@ class CleanupUnusedClaimTask implements Runnable
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
//determine area of the default chest claim
|
|
||||||
int areaOfDefaultClaim = 0;
|
|
||||||
if (GriefPrevention.instance.config_claims_automaticClaimsForNewPlayersRadius >= 0)
|
|
||||||
{
|
|
||||||
areaOfDefaultClaim = (int) Math.pow(GriefPrevention.instance.config_claims_automaticClaimsForNewPlayersRadius * 2 + 1, 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
//if this claim is a chest claim and those are set to expire
|
|
||||||
if (ownerData.getClaims().size() == 1 && claim.getArea() <= areaOfDefaultClaim && GriefPrevention.instance.config_claims_chestClaimExpirationDays > 0)
|
|
||||||
{
|
|
||||||
//if the owner has been gone at least a week, and if he has ONLY the new player claim, it will be removed
|
|
||||||
Calendar sevenDaysAgo = Calendar.getInstance();
|
|
||||||
sevenDaysAgo.add(Calendar.DATE, -GriefPrevention.instance.config_claims_chestClaimExpirationDays);
|
|
||||||
if (sevenDaysAgo.getTime().after(new Date(ownerInfo.getLastPlayed())))
|
|
||||||
{
|
|
||||||
if (expireEventCanceled())
|
|
||||||
return;
|
|
||||||
GriefPrevention.instance.dataStore.deleteClaim(claim, true, true);
|
|
||||||
|
|
||||||
GriefPrevention.AddLogEntry(" " + claim.getOwnerName() + "'s new player claim expired.", CustomLogEntryTypes.AdminActivity);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//if configured to always remove claims after some inactivity period without exceptions...
|
//if configured to always remove claims after some inactivity period without exceptions...
|
||||||
else if (GriefPrevention.instance.config_claims_expirationDays > 0)
|
if (GriefPrevention.instance.config_claims_expirationDays > 0)
|
||||||
{
|
{
|
||||||
Calendar earliestPermissibleLastLogin = Calendar.getInstance();
|
Calendar earliestPermissibleLastLogin = Calendar.getInstance();
|
||||||
earliestPermissibleLastLogin.add(Calendar.DATE, -GriefPrevention.instance.config_claims_expirationDays);
|
earliestPermissibleLastLogin.add(Calendar.DATE, -GriefPrevention.instance.config_claims_expirationDays);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user