Add clean command
This commit is contained in:
@@ -69,6 +69,7 @@ public class CmdFactions extends FactionsCommand
|
||||
public CmdFactionsPowerBoost cmdFactionsPowerBoost = new CmdFactionsPowerBoost();
|
||||
public CmdFactionsSetpower cmdFactionsSetpower = new CmdFactionsSetpower();
|
||||
public CmdFactionsConfig cmdFactionsConfig = new CmdFactionsConfig();
|
||||
public CmdFactionsClean cmdFactionsClean = new CmdFactionsClean();
|
||||
public MassiveCommandVersion cmdFactionsVersion = new MassiveCommandVersion(Factions.get()).setAliases("v", "version").addRequirements(RequirementHasPerm.get(Perm.VERSION));
|
||||
|
||||
// -------------------------------------------- //
|
||||
@@ -125,6 +126,7 @@ public class CmdFactions extends FactionsCommand
|
||||
this.addChild(this.cmdFactionsPowerBoost);
|
||||
this.addChild(this.cmdFactionsSetpower);
|
||||
this.addChild(this.cmdFactionsConfig);
|
||||
this.addChild(this.cmdFactionsClean);
|
||||
this.addChild(this.cmdFactionsVersion);
|
||||
|
||||
// Deprecated Commands
|
||||
|
||||
36
src/com/massivecraft/factions/cmd/CmdFactionsClean.java
Normal file
36
src/com/massivecraft/factions/cmd/CmdFactionsClean.java
Normal file
@@ -0,0 +1,36 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.entity.BoardColl;
|
||||
import com.massivecraft.factions.entity.MPlayerColl;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.util.Txt;
|
||||
|
||||
public class CmdFactionsClean extends FactionsCommand
|
||||
{
|
||||
// -------------------------------------------- //
|
||||
// OVERRIDE
|
||||
// -------------------------------------------- //
|
||||
|
||||
@Override
|
||||
public void perform() throws MassiveException
|
||||
{
|
||||
Object message;
|
||||
|
||||
// Apply
|
||||
int chunks = BoardColl.get().clean();
|
||||
int players = MPlayerColl.get().clean();
|
||||
|
||||
// Title
|
||||
message = Txt.titleize("Factions Cleaner Results");
|
||||
message(message);
|
||||
|
||||
// Chunks
|
||||
message = Txt.parse("<h>%d<i> chunks were cleaned.", chunks);
|
||||
message(message);
|
||||
|
||||
// Players
|
||||
message = Txt.parse("<h>%d<i> players were cleaned.", players);
|
||||
message(message);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user