* added command to disband a faction (/f disband <tag>)
This commit is contained in:
35
src/org/mcteam/factions/commands/FCommandDisband.java
Normal file
35
src/org/mcteam/factions/commands/FCommandDisband.java
Normal file
@ -0,0 +1,35 @@
|
||||
package org.mcteam.factions.commands;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.mcteam.factions.Faction;
|
||||
import org.mcteam.factions.Factions;
|
||||
|
||||
public class FCommandDisband extends FBaseCommand {
|
||||
|
||||
public FCommandDisband() {
|
||||
aliases.add("disband");
|
||||
|
||||
requiredParameters.add("faction tag");
|
||||
|
||||
helpDescription = "Disband a faction";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasPermission(CommandSender sender) {
|
||||
return Factions.hasPermDisband(sender);
|
||||
}
|
||||
|
||||
public void perform() {
|
||||
if( parameters.size() > 0) {
|
||||
Faction faction = Faction.findByTag(parameters.get(0));
|
||||
|
||||
if( faction.getId() > 0 ) {
|
||||
me.sendMessage("Faction " + faction.getTag() + " got disbanded");
|
||||
Faction.delete( faction.getId() );
|
||||
} else {
|
||||
me.sendMessage("Faction " + parameters.get(0) + "not found");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user