2019-06-29 23:07:48 +02:00
|
|
|
package com.massivecraft.factions.cmd;
|
|
|
|
|
2019-09-14 21:13:01 +02:00
|
|
|
import com.massivecraft.factions.struct.Permission;
|
2019-06-29 23:07:48 +02:00
|
|
|
import com.massivecraft.factions.zcore.util.TL;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.UUID;
|
|
|
|
|
|
|
|
public class CmdFGlobal extends FCommand {
|
|
|
|
|
2019-09-15 11:02:53 +02:00
|
|
|
public static List<UUID> toggled = new ArrayList<>();
|
|
|
|
|
|
|
|
public CmdFGlobal() {
|
|
|
|
super();
|
|
|
|
this.aliases.add("gchat");
|
|
|
|
this.aliases.add("global");
|
|
|
|
this.aliases.add("globalchat");
|
|
|
|
|
|
|
|
this.requirements = new CommandRequirements.Builder(Permission.GLOBALCHAT)
|
|
|
|
.playerOnly()
|
|
|
|
.memberOnly()
|
|
|
|
.build();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void perform(CommandContext context) {
|
|
|
|
// /f global
|
|
|
|
|
|
|
|
if (toggled.contains(context.player.getUniqueId())) {
|
|
|
|
toggled.remove(context.player.getUniqueId());
|
|
|
|
} else {
|
|
|
|
toggled.add(context.player.getUniqueId());
|
|
|
|
}
|
|
|
|
|
|
|
|
context.msg(TL.COMMAND_F_GLOBAL_TOGGLE, toggled.contains(context.player.getUniqueId()) ? "disabled" : "enabled");
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public TL getUsageTranslation() {
|
|
|
|
return TL.COMMAND_F_GLOBAL_DESCRIPTION;
|
|
|
|
}
|
2019-06-29 23:07:48 +02:00
|
|
|
|
|
|
|
}
|