Add /DeleteAllUSERClaimsInWorld.
This commit is contained in:
@@ -1771,13 +1771,14 @@ public abstract class DataStore
|
||||
}
|
||||
|
||||
//deletes all the land claims in a specified world
|
||||
void deleteClaimsInWorld(World world)
|
||||
void deleteClaimsInWorld(World world, boolean deleteAdminClaims)
|
||||
{
|
||||
for(int i = 0; i < claims.size(); i++)
|
||||
{
|
||||
Claim claim = claims.get(i);
|
||||
if(claim.getLesserBoundaryCorner().getWorld().equals(world))
|
||||
{
|
||||
if(!deleteAdminClaims && claim.isAdminClaim()) continue;
|
||||
this.deleteClaim(claim, false, false);
|
||||
i--;
|
||||
}
|
||||
|
||||
@@ -1963,11 +1963,37 @@ public class GriefPrevention extends JavaPlugin
|
||||
}
|
||||
|
||||
//delete all claims in that world
|
||||
this.dataStore.deleteClaimsInWorld(world);
|
||||
this.dataStore.deleteClaimsInWorld(world, true);
|
||||
GriefPrevention.AddLogEntry("Deleted all claims in world: " + world.getName() + ".", CustomLogEntryTypes.AdminActivity);
|
||||
return true;
|
||||
}
|
||||
|
||||
else if(cmd.getName().equalsIgnoreCase("deleteclaimsinworld"))
|
||||
{
|
||||
//must be executed at the console
|
||||
if(player != null)
|
||||
{
|
||||
GriefPrevention.sendMessage(player, TextMode.Err, Messages.ConsoleOnlyCommand);
|
||||
return true;
|
||||
}
|
||||
|
||||
//requires exactly one parameter, the world name
|
||||
if(args.length != 1) return false;
|
||||
|
||||
//try to find the specified world
|
||||
World world = Bukkit.getServer().getWorld(args[0]);
|
||||
if(world == null)
|
||||
{
|
||||
GriefPrevention.sendMessage(player, TextMode.Err, Messages.WorldNotFound);
|
||||
return true;
|
||||
}
|
||||
|
||||
//delete all USER claims in that world
|
||||
this.dataStore.deleteClaimsInWorld(world, false);
|
||||
GriefPrevention.AddLogEntry("Deleted all user claims in world: " + world.getName() + ".", CustomLogEntryTypes.AdminActivity);
|
||||
return true;
|
||||
}
|
||||
|
||||
//claimbook
|
||||
else if(cmd.getName().equalsIgnoreCase("claimbook"))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user