2011-04-08 15:51:07 +02:00
|
|
|
package org.mcteam.factions.commands;
|
2011-03-23 17:39:56 +01:00
|
|
|
|
2011-04-08 15:51:07 +02:00
|
|
|
import org.mcteam.factions.Conf;
|
|
|
|
import org.mcteam.factions.Faction;
|
|
|
|
import org.mcteam.factions.struct.Role;
|
2011-03-23 17:39:56 +01:00
|
|
|
|
|
|
|
public class FCommandSethome extends FBaseCommand {
|
|
|
|
|
|
|
|
public FCommandSethome() {
|
|
|
|
aliases.add("sethome");
|
|
|
|
|
|
|
|
helpDescription = "Set the faction home";
|
|
|
|
}
|
|
|
|
|
|
|
|
public void perform() {
|
|
|
|
if ( ! assertHasFaction()) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2011-05-08 17:16:43 +02:00
|
|
|
if( isLocked() ) {
|
|
|
|
sendLockMessage();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2011-03-23 17:39:56 +01:00
|
|
|
if ( ! assertMinRole(Role.MODERATOR)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( ! Conf.homesEnabled) {
|
|
|
|
me.sendMessage("Sorry, Faction homes are disabled on this server.");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// TODO may only be inside faction territory
|
|
|
|
|
|
|
|
Faction myFaction = me.getFaction();
|
|
|
|
myFaction.setHome(player.getLocation());
|
|
|
|
|
|
|
|
myFaction.sendMessage(me.getNameAndRelevant(myFaction)+Conf.colorSystem+" set the home for your faction. You can now use:");
|
2011-04-08 16:03:04 +02:00
|
|
|
myFaction.sendMessage(new FCommandHome().getUseageTemplate());
|
2011-03-23 17:39:56 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|