Skip to content
This repository was archived by the owner on Aug 29, 2018. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package me.bariahq.bariahqmod.command;

import me.bariahq.bariahqmod.player.FPlayer;
import me.bariahq.bariahqmod.player.PlayerData;
import me.bariahq.bariahqmod.rank.Rank;
import net.md_5.bungee.api.ChatColor;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

org.bukkit.ChatColor please.

import org.apache.commons.lang3.StringUtils;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
Expand All @@ -13,12 +16,24 @@ public class Command_staffchat extends FreedomCommand

@Override
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
{
{FPlayer player = plugin.pl.getPlayer(playerSender);
if (args.length > 0)
{
plugin.cm.adminChat(sender, StringUtils.join(args, " "));
return true;
} else {
if (!player.inAdminChat()){
player.setAdminChat(true);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the boolean exist in FPlayer class?

playerSender.sendMessage(ChatColor.AQUA + "Staff chat enabled.");
return true;
} else if (player.inAdminChat()){
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can use else statement or something similar to msg(!adminChatToggled ? “Disabled” : “Enabled”);
On my phone atm.

player.setAdminChat(false);
playerSender.sendMessage(ChatColor.AQUA + "Staff chat disabled.");
return true;
}
}


return false;
}
}