Add /DeleteAllUSERClaimsInWorld.
This commit is contained in:
parent
3e245897a6
commit
305978810d
|
|
@ -72,6 +72,11 @@ commands:
|
|||
usage: /DeleteClaimsInWorld <world>
|
||||
aliases: [deleteallclaimsinworld, clearclaimsinworld, clearallclaimsinworld]
|
||||
permission: griefprevention.deleteclaimsinworld
|
||||
deleteuserclaimsinworld:
|
||||
description: Deletes all the non-admin claims in a world. Only usable at the server console.
|
||||
usage: /DeleteUserClaimsInWorld <world>
|
||||
aliases: [deletealluserclaimsinworld, clearuserclaimsinworld, clearalluserclaimsinworld]
|
||||
permission: griefprevention.deleteclaimsinworld
|
||||
adminclaims:
|
||||
description: Switches the shovel tool to administrative claims mode.
|
||||
usage: /AdminClaims
|
||||
|
|
|
|||
|
|
@ -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"))
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user