Showing Dropping Anvil Something (Ignore)
This commit is contained in:
@@ -10,47 +10,47 @@ import com.massivecraft.factions.zcore.util.TL;
|
||||
|
||||
public class CmdPermanent extends FCommand {
|
||||
|
||||
public CmdPermanent() {
|
||||
super();
|
||||
this.aliases.add("permanent");
|
||||
this.requiredArgs.add("faction tag");
|
||||
public CmdPermanent() {
|
||||
super();
|
||||
this.aliases.add("permanent");
|
||||
this.requiredArgs.add("faction tag");
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.SET_PERMANENT)
|
||||
.build();
|
||||
}
|
||||
this.requirements = new CommandRequirements.Builder(Permission.SET_PERMANENT)
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void perform(CommandContext context) {
|
||||
Faction faction = context.argAsFaction(0);
|
||||
if (faction == null) {
|
||||
return;
|
||||
}
|
||||
@Override
|
||||
public void perform(CommandContext context) {
|
||||
Faction faction = context.argAsFaction(0);
|
||||
if (faction == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
String change;
|
||||
if (faction.isPermanent()) {
|
||||
change = TL.COMMAND_PERMANENT_REVOKE.toString();
|
||||
faction.setPermanent(false);
|
||||
} else {
|
||||
change = TL.COMMAND_PERMANENT_GRANT.toString();
|
||||
faction.setPermanent(true);
|
||||
}
|
||||
String change;
|
||||
if (faction.isPermanent()) {
|
||||
change = TL.COMMAND_PERMANENT_REVOKE.toString();
|
||||
faction.setPermanent(false);
|
||||
} else {
|
||||
change = TL.COMMAND_PERMANENT_GRANT.toString();
|
||||
faction.setPermanent(true);
|
||||
}
|
||||
|
||||
FactionsPlugin.getInstance().log((context.fPlayer == null ? "A server admin" : context.fPlayer.getName()) + " " + change + " the faction \"" + faction.getTag() + "\".");
|
||||
FactionsPlugin.getInstance().log((context.fPlayer == null ? "A server admin" : context.fPlayer.getName()) + " " + change + " the faction \"" + faction.getTag() + "\".");
|
||||
|
||||
// Inform all players
|
||||
for (FPlayer fplayer : FPlayers.getInstance().getOnlinePlayers()) {
|
||||
String blame = (context.fPlayer == null ? TL.GENERIC_SERVERADMIN.toString() : context.fPlayer.describeTo(fplayer, true));
|
||||
if (fplayer.getFaction() == faction) {
|
||||
fplayer.msg(TL.COMMAND_PERMANENT_YOURS, blame, change);
|
||||
} else {
|
||||
fplayer.msg(TL.COMMAND_PERMANENT_OTHER, blame, change, faction.getTag(fplayer));
|
||||
}
|
||||
}
|
||||
}
|
||||
// Inform all players
|
||||
for (FPlayer fplayer : FPlayers.getInstance().getOnlinePlayers()) {
|
||||
String blame = (context.fPlayer == null ? TL.GENERIC_SERVERADMIN.toString() : context.fPlayer.describeTo(fplayer, true));
|
||||
if (fplayer.getFaction() == faction) {
|
||||
fplayer.msg(TL.COMMAND_PERMANENT_YOURS, blame, change);
|
||||
} else {
|
||||
fplayer.msg(TL.COMMAND_PERMANENT_OTHER, blame, change, faction.getTag(fplayer));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TL getUsageTranslation() {
|
||||
return TL.COMMAND_PERMANENT_DESCRIPTION;
|
||||
}
|
||||
@Override
|
||||
public TL getUsageTranslation() {
|
||||
return TL.COMMAND_PERMANENT_DESCRIPTION;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user