Fixed creative mode claims expiring too fast.
This commit is contained in:
parent
5b48c62f6f
commit
14f2486b37
|
|
@ -93,7 +93,7 @@ class CleanupUnusedClaimsTask implements Runnable
|
||||||
cleanupChunks = true;
|
cleanupChunks = true;
|
||||||
|
|
||||||
//if configured to do so, restore the land to natural
|
//if configured to do so, restore the land to natural
|
||||||
if((GriefPrevention.instance.creativeRulesApply(claim.getLesserBoundaryCorner()) && GriefPrevention.instance.config_claims_creativeAutoNatureRestoration) || GriefPrevention.instance.config_claims_survivalAutoNatureRestoration)
|
if(GriefPrevention.instance.creativeRulesApply(claim.getLesserBoundaryCorner()) || GriefPrevention.instance.config_claims_survivalAutoNatureRestoration)
|
||||||
{
|
{
|
||||||
GriefPrevention.instance.restoreClaim(claim, 0);
|
GriefPrevention.instance.restoreClaim(claim, 0);
|
||||||
}
|
}
|
||||||
|
|
@ -125,7 +125,7 @@ class CleanupUnusedClaimsTask implements Runnable
|
||||||
for(int i = 0; i < claims.size(); i++)
|
for(int i = 0; i < claims.size(); i++)
|
||||||
{
|
{
|
||||||
//if configured to do so, restore the land to natural
|
//if configured to do so, restore the land to natural
|
||||||
if((GriefPrevention.instance.creativeRulesApply(claims.get(i).getLesserBoundaryCorner()) && GriefPrevention.instance.config_claims_creativeAutoNatureRestoration) || GriefPrevention.instance.config_claims_survivalAutoNatureRestoration)
|
if(GriefPrevention.instance.creativeRulesApply(claims.get(i).getLesserBoundaryCorner()) || GriefPrevention.instance.config_claims_survivalAutoNatureRestoration)
|
||||||
{
|
{
|
||||||
GriefPrevention.instance.restoreClaim(claims.get(i), 0);
|
GriefPrevention.instance.restoreClaim(claims.get(i), 0);
|
||||||
cleanupChunks = true;
|
cleanupChunks = true;
|
||||||
|
|
@ -147,14 +147,20 @@ class CleanupUnusedClaimsTask implements Runnable
|
||||||
|
|
||||||
if(investmentScore < minInvestment)
|
if(investmentScore < minInvestment)
|
||||||
{
|
{
|
||||||
GriefPrevention.instance.dataStore.deleteClaim(claim, true);
|
playerData = GriefPrevention.instance.dataStore.getPlayerData(claim.ownerID);
|
||||||
GriefPrevention.AddLogEntry("Removed " + claim.getOwnerName() + "'s unused claim @ " + GriefPrevention.getfriendlyLocationString(claim.getLesserBoundaryCorner()));
|
|
||||||
|
//if the owner has been gone at least a week, and if he has ONLY the new player claim, it will be removed
|
||||||
//if configured to do so, restore the claim area to natural state
|
Calendar sevenDaysAgo = Calendar.getInstance();
|
||||||
if((GriefPrevention.instance.creativeRulesApply(claim.getLesserBoundaryCorner()) && GriefPrevention.instance.config_claims_creativeAutoNatureRestoration) || GriefPrevention.instance.config_claims_survivalAutoNatureRestoration)
|
sevenDaysAgo.add(Calendar.DATE, -GriefPrevention.instance.config_claims_unusedClaimExpirationDays);
|
||||||
{
|
boolean claimExpired = sevenDaysAgo.getTime().after(playerData.getLastLogin());
|
||||||
GriefPrevention.instance.restoreClaim(claim, 0);
|
if(claimExpired)
|
||||||
}
|
{
|
||||||
|
GriefPrevention.instance.dataStore.deleteClaim(claim, true);
|
||||||
|
GriefPrevention.AddLogEntry("Removed " + claim.getOwnerName() + "'s unused claim @ " + GriefPrevention.getfriendlyLocationString(claim.getLesserBoundaryCorner()));
|
||||||
|
|
||||||
|
//restore the claim area to natural state
|
||||||
|
GriefPrevention.instance.restoreClaim(claim, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,6 @@ public class GriefPrevention extends JavaPlugin
|
||||||
public int config_claims_chestClaimExpirationDays; //number of days of inactivity before an automatic chest claim will be deleted
|
public int config_claims_chestClaimExpirationDays; //number of days of inactivity before an automatic chest claim will be deleted
|
||||||
public int config_claims_unusedClaimExpirationDays; //number of days of inactivity before an unused (nothing build) claim will be deleted
|
public int config_claims_unusedClaimExpirationDays; //number of days of inactivity before an unused (nothing build) claim will be deleted
|
||||||
public boolean config_claims_survivalAutoNatureRestoration; //whether survival claims will be automatically restored to nature when auto-deleted
|
public boolean config_claims_survivalAutoNatureRestoration; //whether survival claims will be automatically restored to nature when auto-deleted
|
||||||
public boolean config_claims_creativeAutoNatureRestoration; //whether creative claims will be automatically restored to nature when auto-deleted
|
|
||||||
|
|
||||||
public Material config_claims_investigationTool; //which material will be used to investigate claims with a right click
|
public Material config_claims_investigationTool; //which material will be used to investigate claims with a right click
|
||||||
public Material config_claims_modificationTool; //which material will be used to create/resize claims with a right click
|
public Material config_claims_modificationTool; //which material will be used to create/resize claims with a right click
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user