Added F Global
This commit is contained in:
52
src/main/java/com/massivecraft/factions/cmd/CmdFGlobal.java
Normal file
52
src/main/java/com/massivecraft/factions/cmd/CmdFGlobal.java
Normal 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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
@@ -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")) {
|
||||
|
||||
Reference in New Issue
Block a user