Added F Global

This commit is contained in:
BuildTools
2019-06-29 16:07:48 -05:00
parent 391ce50581
commit 28f32ec616
7 changed files with 107 additions and 3 deletions

View File

@@ -0,0 +1,52 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
public class CmdFGlobal extends FCommand {
public CmdFGlobal() {
super();
this.aliases.add("gchat");
this.aliases.add("global");
this.aliases.add("globalchat");
this.disableOnLock = false;
this.disableOnSpam = false;
senderMustBePlayer = true;
senderMustBeMember = true;
senderMustBeModerator = false;
senderMustBeColeader = false;
senderMustBeAdmin = false;
}
public static List<UUID> toggled = new ArrayList<>();
@Override
public void perform() {
Player p = (Player)sender;
// /f global
if (toggled.contains(p.getUniqueId())){
toggled.remove(p.getUniqueId());
}else{
toggled.add(p.getUniqueId());
}
fme.msg(TL.COMMAND_F_GLOBAL_TOGGLE, toggled.contains(p.getUniqueId()) ? "enabled" : "disabled");
}
@Override
public TL getUsageTranslation() {
return TL.COMMAND_F_GLOBAL_DESCRIPTION;
}
}

View File

@@ -11,7 +11,6 @@ public class CmdGrace extends FCommand {
super();
this.aliases.add("grace");
this.aliases.add("gracee");
this.permission = Permission.GRACE.node;
this.disableOnLock = false;

View File

@@ -111,6 +111,7 @@ public class FCmdRoot extends FCommand {
public CmdSpam cmdSpam = new CmdSpam();
public CmdCorner cmdCorner = new CmdCorner();
public CmdInventorySee cmdInventorySee = new CmdInventorySee();
public CmdFGlobal cmdFGlobal = new CmdFGlobal();
@@ -227,6 +228,7 @@ public class FCmdRoot extends FCommand {
this.addSubCommand(this.cmdStrikeSet);
this.addSubCommand(this.cmdSpam);
this.addSubCommand(this.cmdCorner);
this.addSubCommand(this.cmdFGlobal);
if (SaberFactions.plugin.getConfig().getBoolean("f-inventory-see.Enabled")) {