Showing Dropping Anvil Something (Ignore)

This commit is contained in:
Driftay
2019-09-15 05:12:52 -04:00
parent e07dc303ef
commit 2a1a8db554
285 changed files with 28746 additions and 28746 deletions

View File

@@ -8,47 +8,47 @@ import com.massivecraft.factions.zcore.util.TL;
public class CmdPeaceful extends FCommand {
public CmdPeaceful() {
super();
this.aliases.add("peaceful");
this.requiredArgs.add("faction tag");
public CmdPeaceful() {
super();
this.aliases.add("peaceful");
this.requiredArgs.add("faction tag");
this.requirements = new CommandRequirements.Builder(Permission.SET_PEACEFUL)
.build();
this.requirements = new CommandRequirements.Builder(Permission.SET_PEACEFUL)
.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.isPeaceful()) {
change = TL.COMMAND_PEACEFUL_REVOKE.toString();
faction.setPeaceful(false);
} else {
change = TL.COMMAND_PEACEFUL_GRANT.toString();
faction.setPeaceful(true);
}
String change;
if (faction.isPeaceful()) {
change = TL.COMMAND_PEACEFUL_REVOKE.toString();
faction.setPeaceful(false);
} else {
change = TL.COMMAND_PEACEFUL_GRANT.toString();
faction.setPeaceful(true);
}
// 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_PEACEFUL_YOURS, blame, change);
} else {
fplayer.msg(TL.COMMAND_PEACEFUL_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_PEACEFUL_YOURS, blame, change);
} else {
fplayer.msg(TL.COMMAND_PEACEFUL_OTHER, blame, change, faction.getTag(fplayer));
}
}
}
}
@Override
public TL getUsageTranslation() {
return TL.COMMAND_PEACEFUL_DESCRIPTION;
}
@Override
public TL getUsageTranslation() {
return TL.COMMAND_PEACEFUL_DESCRIPTION;
}
}