Showing Dropping Anvil Something (Ignore)
This commit is contained in:
@@ -7,54 +7,54 @@ import com.massivecraft.factions.zcore.util.TL;
|
||||
|
||||
public class CmdSethome extends FCommand {
|
||||
|
||||
public CmdSethome() {
|
||||
this.aliases.add("sethome");
|
||||
this.optionalArgs.put("faction tag", "mine");
|
||||
public CmdSethome() {
|
||||
this.aliases.add("sethome");
|
||||
this.optionalArgs.put("faction tag", "mine");
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.SETHOME)
|
||||
.playerOnly()
|
||||
.memberOnly()
|
||||
.withAction(PermissableAction.SETHOME)
|
||||
.build();
|
||||
}
|
||||
this.requirements = new CommandRequirements.Builder(Permission.SETHOME)
|
||||
.playerOnly()
|
||||
.memberOnly()
|
||||
.withAction(PermissableAction.SETHOME)
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void perform(CommandContext context) {
|
||||
if (!Conf.homesEnabled) {
|
||||
context.msg(TL.COMMAND_SETHOME_DISABLED);
|
||||
return;
|
||||
}
|
||||
@Override
|
||||
public void perform(CommandContext context) {
|
||||
if (!Conf.homesEnabled) {
|
||||
context.msg(TL.COMMAND_SETHOME_DISABLED);
|
||||
return;
|
||||
}
|
||||
|
||||
Faction faction = context.argAsFaction(0, context.faction);
|
||||
if (faction == null) {
|
||||
return;
|
||||
}
|
||||
Faction faction = context.argAsFaction(0, context.faction);
|
||||
if (faction == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Can the player set the faction home HERE?
|
||||
if (!Permission.BYPASS.has(context.player) &&
|
||||
Conf.homesMustBeInClaimedTerritory &&
|
||||
Board.getInstance().getFactionAt(new FLocation(context.player)) != faction) {
|
||||
context.msg(TL.COMMAND_SETHOME_NOTCLAIMED);
|
||||
return;
|
||||
}
|
||||
// Can the player set the faction home HERE?
|
||||
if (!Permission.BYPASS.has(context.player) &&
|
||||
Conf.homesMustBeInClaimedTerritory &&
|
||||
Board.getInstance().getFactionAt(new FLocation(context.player)) != faction) {
|
||||
context.msg(TL.COMMAND_SETHOME_NOTCLAIMED);
|
||||
return;
|
||||
}
|
||||
|
||||
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay
|
||||
if (!context.payForCommand(Conf.econCostSethome, TL.COMMAND_SETHOME_TOSET, TL.COMMAND_SETHOME_FORSET)) {
|
||||
return;
|
||||
}
|
||||
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay
|
||||
if (!context.payForCommand(Conf.econCostSethome, TL.COMMAND_SETHOME_TOSET, TL.COMMAND_SETHOME_FORSET)) {
|
||||
return;
|
||||
}
|
||||
|
||||
faction.setHome(context.player.getLocation());
|
||||
faction.setHome(context.player.getLocation());
|
||||
|
||||
faction.msg(TL.COMMAND_SETHOME_SET, context.fPlayer.describeTo(context.faction, true));
|
||||
faction.sendMessage(FactionsPlugin.getInstance().cmdBase.cmdHome.getUseageTemplate(context));
|
||||
if (faction != context.faction) {
|
||||
context.msg(TL.COMMAND_SETHOME_SETOTHER, faction.getTag(context.fPlayer));
|
||||
}
|
||||
}
|
||||
faction.msg(TL.COMMAND_SETHOME_SET, context.fPlayer.describeTo(context.faction, true));
|
||||
faction.sendMessage(FactionsPlugin.getInstance().cmdBase.cmdHome.getUseageTemplate(context));
|
||||
if (faction != context.faction) {
|
||||
context.msg(TL.COMMAND_SETHOME_SETOTHER, faction.getTag(context.fPlayer));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TL getUsageTranslation() {
|
||||
return TL.COMMAND_SETHOME_DESCRIPTION;
|
||||
}
|
||||
@Override
|
||||
public TL getUsageTranslation() {
|
||||
return TL.COMMAND_SETHOME_DESCRIPTION;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user