Showing Dropping Anvil Something (Ignore)
This commit is contained in:
@@ -7,43 +7,43 @@ import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
|
||||
public class CmdFocus extends FCommand {
|
||||
public CmdFocus() {
|
||||
aliases.add("focus");
|
||||
public CmdFocus() {
|
||||
aliases.add("focus");
|
||||
|
||||
requiredArgs.add("player");
|
||||
requiredArgs.add("player");
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.FOCUS)
|
||||
.playerOnly()
|
||||
.memberOnly()
|
||||
.build();
|
||||
}
|
||||
this.requirements = new CommandRequirements.Builder(Permission.FOCUS)
|
||||
.playerOnly()
|
||||
.memberOnly()
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void perform(CommandContext context) {
|
||||
if (!FactionsPlugin.getInstance().getConfig().getBoolean("ffocus.Enabled")) {
|
||||
context.msg(TL.GENERIC_DISABLED);
|
||||
return;
|
||||
}
|
||||
FPlayer target = context.argAsFPlayer(0);
|
||||
if (target == null) {
|
||||
return;
|
||||
}
|
||||
if (target.getFaction().getId().equalsIgnoreCase(context.faction.getId())) {
|
||||
context.msg(TL.COMMAND_FOCUS_SAMEFACTION);
|
||||
return;
|
||||
}
|
||||
if ((context.faction.getFocused() != null) && (context.faction.getFocused().equalsIgnoreCase(target.getName()))) {
|
||||
context.faction.setFocused(null);
|
||||
context.faction.msg(TL.COMMAND_FOCUS_NO_LONGER, target.getName());
|
||||
FTeamWrapper.updatePrefixes(target.getFaction());
|
||||
return;
|
||||
}
|
||||
context.faction.msg(TL.COMMAND_FOCUS_FOCUSING, target.getName());
|
||||
context.faction.setFocused(target.getName());
|
||||
FTeamWrapper.updatePrefixes(target.getFaction());
|
||||
}
|
||||
@Override
|
||||
public void perform(CommandContext context) {
|
||||
if (!FactionsPlugin.getInstance().getConfig().getBoolean("ffocus.Enabled")) {
|
||||
context.msg(TL.GENERIC_DISABLED);
|
||||
return;
|
||||
}
|
||||
FPlayer target = context.argAsFPlayer(0);
|
||||
if (target == null) {
|
||||
return;
|
||||
}
|
||||
if (target.getFaction().getId().equalsIgnoreCase(context.faction.getId())) {
|
||||
context.msg(TL.COMMAND_FOCUS_SAMEFACTION);
|
||||
return;
|
||||
}
|
||||
if ((context.faction.getFocused() != null) && (context.faction.getFocused().equalsIgnoreCase(target.getName()))) {
|
||||
context.faction.setFocused(null);
|
||||
context.faction.msg(TL.COMMAND_FOCUS_NO_LONGER, target.getName());
|
||||
FTeamWrapper.updatePrefixes(target.getFaction());
|
||||
return;
|
||||
}
|
||||
context.faction.msg(TL.COMMAND_FOCUS_FOCUSING, target.getName());
|
||||
context.faction.setFocused(target.getName());
|
||||
FTeamWrapper.updatePrefixes(target.getFaction());
|
||||
}
|
||||
|
||||
public TL getUsageTranslation() {
|
||||
return TL.COMMAND_FOCUS_DESCRIPTION;
|
||||
}
|
||||
public TL getUsageTranslation() {
|
||||
return TL.COMMAND_FOCUS_DESCRIPTION;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user