Renamed to ChatPlayer
This commit is contained in:
parent
fc2267d43f
commit
13ec4e43ad
25 changed files with 129 additions and 89 deletions
|
@ -11,7 +11,7 @@ import org.bukkit.configuration.ConfigurationSection;
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
public class TBMCPlayer {
|
public class ChatPlayer {
|
||||||
public String PlayerName;
|
public String PlayerName;
|
||||||
public String UserName;
|
public String UserName;
|
||||||
public List<String> UserNames;
|
public List<String> UserNames;
|
||||||
|
@ -37,11 +37,11 @@ public class TBMCPlayer {
|
||||||
|
|
||||||
public UUID UUID;
|
public UUID UUID;
|
||||||
|
|
||||||
public static HashMap<UUID, TBMCPlayer> AllPlayers = new HashMap<>();
|
public static HashMap<UUID, ChatPlayer> AllPlayers = new HashMap<>();
|
||||||
|
|
||||||
public static TBMCPlayer AddPlayerIfNeeded(UUID uuid) {
|
public static ChatPlayer AddPlayerIfNeeded(UUID uuid) {
|
||||||
if (!AllPlayers.containsKey(uuid)) {
|
if (!AllPlayers.containsKey(uuid)) {
|
||||||
TBMCPlayer player = new TBMCPlayer();
|
ChatPlayer player = new ChatPlayer();
|
||||||
player.UUID = uuid;
|
player.UUID = uuid;
|
||||||
player.FlairTime = FlairTimeNone;
|
player.FlairTime = FlairTimeNone;
|
||||||
player.FlairState = FlairStates.NoComment;
|
player.FlairState = FlairStates.NoComment;
|
||||||
|
@ -59,7 +59,7 @@ public class TBMCPlayer {
|
||||||
ConfigurationSection cs = yc.getConfigurationSection("players");
|
ConfigurationSection cs = yc.getConfigurationSection("players");
|
||||||
for (String key : cs.getKeys(false)) {
|
for (String key : cs.getKeys(false)) {
|
||||||
ConfigurationSection cs2 = cs.getConfigurationSection(key);
|
ConfigurationSection cs2 = cs.getConfigurationSection(key);
|
||||||
TBMCPlayer mp = AddPlayerIfNeeded(java.util.UUID
|
ChatPlayer mp = AddPlayerIfNeeded(java.util.UUID
|
||||||
.fromString(cs2.getString("uuid")));
|
.fromString(cs2.getString("uuid")));
|
||||||
mp.UserName = cs2.getString("username");
|
mp.UserName = cs2.getString("username");
|
||||||
String tmp = cs2.getString("flairtime");
|
String tmp = cs2.getString("flairtime");
|
||||||
|
@ -84,7 +84,7 @@ public class TBMCPlayer {
|
||||||
|
|
||||||
public static void Save(YamlConfiguration yc) {
|
public static void Save(YamlConfiguration yc) {
|
||||||
ConfigurationSection cs = yc.createSection("players");
|
ConfigurationSection cs = yc.createSection("players");
|
||||||
for (TBMCPlayer mp : TBMCPlayer.AllPlayers.values()) {
|
for (ChatPlayer mp : ChatPlayer.AllPlayers.values()) {
|
||||||
ConfigurationSection cs2 = cs.createSection(mp.UUID.toString());
|
ConfigurationSection cs2 = cs.createSection(mp.UUID.toString());
|
||||||
cs2.set("playername", mp.PlayerName);
|
cs2.set("playername", mp.PlayerName);
|
||||||
cs2.set("username", mp.UserName);
|
cs2.set("username", mp.UserName);
|
||||||
|
@ -98,7 +98,7 @@ public class TBMCPlayer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TBMCPlayer GetFromName(String name) {
|
public static ChatPlayer GetFromName(String name) {
|
||||||
Player p = Bukkit.getPlayer(name);
|
Player p = Bukkit.getPlayer(name);
|
||||||
if (p != null)
|
if (p != null)
|
||||||
return AllPlayers.get(p.getUniqueId());
|
return AllPlayers.get(p.getUniqueId());
|
||||||
|
@ -162,7 +162,7 @@ public class TBMCPlayer {
|
||||||
return FlairTime;
|
return FlairTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TBMCPlayer GetFromPlayer(Player p) {
|
public static ChatPlayer GetFromPlayer(Player p) {
|
||||||
return TBMCPlayer.AllPlayers.get(p.getUniqueId());
|
return ChatPlayer.AllPlayers.get(p.getUniqueId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,9 +30,9 @@ public class ChatProcessing {
|
||||||
if (player != null && PlayerListener.essentials.getUser(player).isMuted())
|
if (player != null && PlayerListener.essentials.getUser(player).isMuted())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
TBMCPlayer mp = null;
|
ChatPlayer mp = null;
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
mp = TBMCPlayer.AllPlayers.get(player.getUniqueId());
|
mp = ChatPlayer.AllPlayers.get(player.getUniqueId());
|
||||||
if (message.equalsIgnoreCase("F")) {
|
if (message.equalsIgnoreCase("F")) {
|
||||||
if (!mp.PressedF && PlayerListener.ActiveF) {
|
if (!mp.PressedF && PlayerListener.ActiveF) {
|
||||||
PlayerListener.FCount++;
|
PlayerListener.FCount++;
|
||||||
|
@ -109,7 +109,7 @@ public class ChatProcessing {
|
||||||
System.out.println("Error: Can't find player " + match + " but it was reported as online.");
|
System.out.println("Error: Can't find player " + match + " but it was reported as online.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
TBMCPlayer mpp = TBMCPlayer.AddPlayerIfNeeded(p.getUniqueId());
|
ChatPlayer mpp = ChatPlayer.AddPlayerIfNeeded(p.getUniqueId());
|
||||||
if (PlayerListener.NotificationSound == null)
|
if (PlayerListener.NotificationSound == null)
|
||||||
p.playSound(p.getLocation(), Sound.ENTITY_ARROW_HIT_PLAYER, 1.0f, 0.5f); // TODO:
|
p.playSound(p.getLocation(), Sound.ENTITY_ARROW_HIT_PLAYER, 1.0f, 0.5f); // TODO:
|
||||||
// Airhorn
|
// Airhorn
|
||||||
|
@ -143,7 +143,7 @@ public class ChatProcessing {
|
||||||
"Error: Can't find player " + match + " but it was reported as online.");
|
"Error: Can't find player " + match + " but it was reported as online.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
TBMCPlayer mpp = TBMCPlayer.AddPlayerIfNeeded(p.getUniqueId());
|
ChatPlayer mpp = ChatPlayer.AddPlayerIfNeeded(p.getUniqueId());
|
||||||
if (PlayerListener.NotificationSound == null)
|
if (PlayerListener.NotificationSound == null)
|
||||||
p.playSound(p.getLocation(), Sound.ENTITY_ARROW_HIT_PLAYER, 1.0f, 0.5f); // TODO:
|
p.playSound(p.getLocation(), Sound.ENTITY_ARROW_HIT_PLAYER, 1.0f, 0.5f); // TODO:
|
||||||
// Airhorn
|
// Airhorn
|
||||||
|
|
|
@ -7,6 +7,6 @@ public abstract class PlayerJoinTimerTask extends TimerTask {
|
||||||
@Override
|
@Override
|
||||||
public abstract void run();
|
public abstract void run();
|
||||||
|
|
||||||
public TBMCPlayer mp;
|
public ChatPlayer mp;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,7 @@ public class PlayerListener implements Listener {
|
||||||
if (essentials == null)
|
if (essentials == null)
|
||||||
essentials = ((Essentials) Bukkit.getPluginManager().getPlugin("Essentials"));
|
essentials = ((Essentials) Bukkit.getPluginManager().getPlugin("Essentials"));
|
||||||
final Player p = event.getPlayer();
|
final Player p = event.getPlayer();
|
||||||
TBMCPlayer mp = TBMCPlayer.AddPlayerIfNeeded(p.getUniqueId());
|
ChatPlayer mp = ChatPlayer.AddPlayerIfNeeded(p.getUniqueId());
|
||||||
if (!mp.FlairState.equals(FlairStates.NoComment)) {
|
if (!mp.FlairState.equals(FlairStates.NoComment)) {
|
||||||
PluginMain.ConfirmUserMessage(mp);
|
PluginMain.ConfirmUserMessage(mp);
|
||||||
Timer timer = new Timer();
|
Timer timer = new Timer();
|
||||||
|
@ -80,7 +80,7 @@ public class PlayerListener implements Listener {
|
||||||
timer.schedule(tt, 1000);
|
timer.schedule(tt, 1000);
|
||||||
} else {
|
} else {
|
||||||
if (mp.GetFlairTime() == 0x00)
|
if (mp.GetFlairTime() == 0x00)
|
||||||
mp.SetFlair(TBMCPlayer.FlairTimeNone);
|
mp.SetFlair(ChatPlayer.FlairTimeNone);
|
||||||
Timer timer = new Timer();
|
Timer timer = new Timer();
|
||||||
PlayerJoinTimerTask tt = new PlayerJoinTimerTask() {
|
PlayerJoinTimerTask tt = new PlayerJoinTimerTask() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -227,7 +227,7 @@ public class PlayerListener implements Listener {
|
||||||
if (event.getMessage().length() < 2)
|
if (event.getMessage().length() < 2)
|
||||||
return;
|
return;
|
||||||
int index = event.getMessage().indexOf(" ");
|
int index = event.getMessage().indexOf(" ");
|
||||||
TBMCPlayer mp = TBMCPlayer.AllPlayers.get(event.getPlayer().getUniqueId());
|
ChatPlayer mp = ChatPlayer.AllPlayers.get(event.getPlayer().getUniqueId());
|
||||||
String cmd = "";
|
String cmd = "";
|
||||||
if (index == -1) {
|
if (index == -1) {
|
||||||
cmd = event.getMessage().substring(1);
|
cmd = event.getMessage().substring(1);
|
||||||
|
@ -468,7 +468,7 @@ public class PlayerListener implements Listener {
|
||||||
|
|
||||||
static boolean ActiveF = false;
|
static boolean ActiveF = false;
|
||||||
static int FCount = 0;
|
static int FCount = 0;
|
||||||
static TBMCPlayer FPlayer = null;
|
static ChatPlayer FPlayer = null;
|
||||||
private Timer Ftimer;
|
private Timer Ftimer;
|
||||||
public static int AlphaDeaths;
|
public static int AlphaDeaths;
|
||||||
|
|
||||||
|
@ -486,10 +486,10 @@ public class PlayerListener implements Listener {
|
||||||
Ftimer.cancel();
|
Ftimer.cancel();
|
||||||
ActiveF = true;
|
ActiveF = true;
|
||||||
FCount = 0;
|
FCount = 0;
|
||||||
FPlayer = TBMCPlayer.AllPlayers.get(e.getEntity().getUniqueId());
|
FPlayer = ChatPlayer.AllPlayers.get(e.getEntity().getUniqueId());
|
||||||
FPlayer.FDeaths++;
|
FPlayer.FDeaths++;
|
||||||
for (Player p : PluginMain.GetPlayers()) {
|
for (Player p : PluginMain.GetPlayers()) {
|
||||||
TBMCPlayer mp = TBMCPlayer.AllPlayers.get(p.getUniqueId());
|
ChatPlayer mp = ChatPlayer.AllPlayers.get(p.getUniqueId());
|
||||||
mp.PressedF = false;
|
mp.PressedF = false;
|
||||||
p.sendMessage("§bPress F to pay respects.§r");
|
p.sendMessage("§bPress F to pay respects.§r");
|
||||||
}
|
}
|
||||||
|
@ -579,7 +579,7 @@ public class PlayerListener implements Listener {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
TBMCPlayer mp = TBMCPlayer.GetFromPlayer(e.getPlayer());
|
ChatPlayer mp = ChatPlayer.GetFromPlayer(e.getPlayer());
|
||||||
if (mp.ChatOnly)
|
if (mp.ChatOnly)
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
@ -603,7 +603,7 @@ public class PlayerListener implements Listener {
|
||||||
* "§cYou are not allowed to teleport to/from No Mans Land."); }
|
* "§cYou are not allowed to teleport to/from No Mans Land."); }
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (TBMCPlayer.GetFromPlayer(e.getPlayer()).ChatOnly) {
|
if (ChatPlayer.GetFromPlayer(e.getPlayer()).ChatOnly) {
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
e.getPlayer().sendMessage("§cYou are not allowed to teleport while in chat-only mode.");
|
e.getPlayer().sendMessage("§cYou are not allowed to teleport while in chat-only mode.");
|
||||||
}
|
}
|
||||||
|
|
|
@ -156,7 +156,7 @@ public class PluginMain extends JavaPlugin { // Translated to Java: 2015.07.15.
|
||||||
else
|
else
|
||||||
ign = ign.substring(start, end);
|
ign = ign.substring(start, end);
|
||||||
ign = ign.trim();
|
ign = ign.trim();
|
||||||
TBMCPlayer mp = TBMCPlayer.GetFromName(ign);
|
ChatPlayer mp = ChatPlayer.GetFromName(ign);
|
||||||
if (mp == null)
|
if (mp == null)
|
||||||
continue;
|
continue;
|
||||||
if (!JoinedBefore(mp, 2015, 6, 5))
|
if (!JoinedBefore(mp, 2015, 6, 5))
|
||||||
|
@ -185,7 +185,7 @@ public class PluginMain extends JavaPlugin { // Translated to Java: 2015.07.15.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DownloadFlair(TBMCPlayer mp)
|
public void DownloadFlair(ChatPlayer mp)
|
||||||
throws MalformedURLException, IOException {
|
throws MalformedURLException, IOException {
|
||||||
String[] flairdata = DownloadString(
|
String[] flairdata = DownloadString(
|
||||||
"http://karmadecay.com/thebutton-data.php?users=" + mp.UserName)
|
"http://karmadecay.com/thebutton-data.php?users=" + mp.UserName)
|
||||||
|
@ -218,7 +218,7 @@ public class PluginMain extends JavaPlugin { // Translated to Java: 2015.07.15.
|
||||||
return body;
|
return body;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetFlair(TBMCPlayer p, String text, String flairclass,
|
private void SetFlair(ChatPlayer p, String text, String flairclass,
|
||||||
String username) {
|
String username) {
|
||||||
p.UserName = username;
|
p.UserName = username;
|
||||||
p.FlairState = FlairStates.Recognised;
|
p.FlairState = FlairStates.Recognised;
|
||||||
|
@ -233,26 +233,26 @@ public class PluginMain extends JavaPlugin { // Translated to Java: 2015.07.15.
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
if (CheckForJoinDate(p)) {
|
if (CheckForJoinDate(p)) {
|
||||||
p.SetFlair(TBMCPlayer.FlairTimeNonPresser);
|
p.SetFlair(ChatPlayer.FlairTimeNonPresser);
|
||||||
} else {
|
} else {
|
||||||
p.SetFlair(TBMCPlayer.FlairTimeCantPress);
|
p.SetFlair(ChatPlayer.FlairTimeCantPress);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
p.FlairState = FlairStates.Commented; // Flair unknown
|
p.FlairState = FlairStates.Commented; // Flair unknown
|
||||||
p.SetFlair(TBMCPlayer.FlairTimeNone);
|
p.SetFlair(ChatPlayer.FlairTimeNone);
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
if (CheckForJoinDate(p)) {
|
if (CheckForJoinDate(p)) {
|
||||||
p.FlairState = FlairStates.Commented; // Flair unknown
|
p.FlairState = FlairStates.Commented; // Flair unknown
|
||||||
p.SetFlair(TBMCPlayer.FlairTimeNone);
|
p.SetFlair(ChatPlayer.FlairTimeNone);
|
||||||
} else {
|
} else {
|
||||||
p.SetFlair(TBMCPlayer.FlairTimeCantPress);
|
p.SetFlair(ChatPlayer.FlairTimeCantPress);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
p.FlairState = FlairStates.Commented; // Flair unknown
|
p.FlairState = FlairStates.Commented; // Flair unknown
|
||||||
p.SetFlair(TBMCPlayer.FlairTimeNone);
|
p.SetFlair(ChatPlayer.FlairTimeNone);
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -263,12 +263,12 @@ public class PluginMain extends JavaPlugin { // Translated to Java: 2015.07.15.
|
||||||
p.SetFlair(Short.parseShort(text));
|
p.SetFlair(Short.parseShort(text));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean CheckForJoinDate(TBMCPlayer mp)
|
public static boolean CheckForJoinDate(ChatPlayer mp)
|
||||||
throws Exception {
|
throws Exception {
|
||||||
return JoinedBefore(mp, 2015, 4, 1);
|
return JoinedBefore(mp, 2015, 4, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean JoinedBefore(TBMCPlayer mp, int year,
|
public static boolean JoinedBefore(ChatPlayer mp, int year,
|
||||||
int month, int day) throws Exception {
|
int month, int day) throws Exception {
|
||||||
URL url = new URL("https://www.reddit.com/u/" + mp.UserName);
|
URL url = new URL("https://www.reddit.com/u/" + mp.UserName);
|
||||||
URLConnection con = url.openConnection();
|
URLConnection con = url.openConnection();
|
||||||
|
@ -288,7 +288,7 @@ public class PluginMain extends JavaPlugin { // Translated to Java: 2015.07.15.
|
||||||
.setDate(year, month, day).build().getTime());
|
.setDate(year, month, day).build().getTime());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void ConfirmUserMessage(TBMCPlayer mp) {
|
public static void ConfirmUserMessage(ChatPlayer mp) {
|
||||||
Player p = Bukkit.getPlayer(mp.UUID);
|
Player p = Bukkit.getPlayer(mp.UUID);
|
||||||
if (mp.FlairState.equals(FlairStates.Commented) && p != null)
|
if (mp.FlairState.equals(FlairStates.Commented) && p != null)
|
||||||
if (mp.UserNames.size() > 1)
|
if (mp.UserNames.size() > 1)
|
||||||
|
@ -307,7 +307,7 @@ public class PluginMain extends JavaPlugin { // Translated to Java: 2015.07.15.
|
||||||
public static void LoadFiles(boolean reload) {
|
public static void LoadFiles(boolean reload) {
|
||||||
if (reload) {
|
if (reload) {
|
||||||
System.out.println("TBMC chat plugin cleanup for reloading...");
|
System.out.println("TBMC chat plugin cleanup for reloading...");
|
||||||
TBMCPlayer.AllPlayers.clear();
|
ChatPlayer.AllPlayers.clear();
|
||||||
AnnounceMessages.clear();
|
AnnounceMessages.clear();
|
||||||
}
|
}
|
||||||
System.out.println("Loading files for TBMC chat plugin...");
|
System.out.println("Loading files for TBMC chat plugin...");
|
||||||
|
@ -316,7 +316,7 @@ public class PluginMain extends JavaPlugin { // Translated to Java: 2015.07.15.
|
||||||
if (file.exists()) {
|
if (file.exists()) {
|
||||||
YamlConfiguration yc = new YamlConfiguration();
|
YamlConfiguration yc = new YamlConfiguration();
|
||||||
yc.load(file);
|
yc.load(file);
|
||||||
TBMCPlayer.Load(yc);
|
ChatPlayer.Load(yc);
|
||||||
PlayerListener.NotificationSound = yc
|
PlayerListener.NotificationSound = yc
|
||||||
.getString("notificationsound");
|
.getString("notificationsound");
|
||||||
PlayerListener.NotificationPitch = yc
|
PlayerListener.NotificationPitch = yc
|
||||||
|
@ -340,7 +340,7 @@ public class PluginMain extends JavaPlugin { // Translated to Java: 2015.07.15.
|
||||||
try {
|
try {
|
||||||
File file = new File("thebuttonmc.yml");
|
File file = new File("thebuttonmc.yml");
|
||||||
YamlConfiguration yc = new YamlConfiguration();
|
YamlConfiguration yc = new YamlConfiguration();
|
||||||
TBMCPlayer.Save(yc);
|
ChatPlayer.Save(yc);
|
||||||
yc.set("notificationsound", PlayerListener.NotificationSound);
|
yc.set("notificationsound", PlayerListener.NotificationSound);
|
||||||
yc.set("notificationpitch", PlayerListener.NotificationPitch);
|
yc.set("notificationpitch", PlayerListener.NotificationPitch);
|
||||||
yc.set("announcetime", AnnounceTime);
|
yc.set("announcetime", AnnounceTime);
|
||||||
|
|
|
@ -35,7 +35,7 @@ public class TBMCChatAPI {
|
||||||
* @param player
|
* @param player
|
||||||
* @param infoline
|
* @param infoline
|
||||||
*/
|
*/
|
||||||
public void AddPlayerInfoForMods(TBMCPlayer player, String infoline) {
|
public void AddPlayerInfoForMods(ChatPlayer player, String infoline) {
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,12 +48,7 @@ public class TBMCChatAPI {
|
||||||
* @param player
|
* @param player
|
||||||
* @param infoline
|
* @param infoline
|
||||||
*/
|
*/
|
||||||
public void AddPlayerInfoForHover(TBMCPlayer player, String infoline) {
|
public void AddPlayerInfoForHover(ChatPlayer player, String infoline) {
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
public TBMCPlayer GetPlayer(Player player) //TODO: Move to the bucket
|
|
||||||
{ //TODO: Enable offline playerinfo
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@ import org.bukkit.GameMode;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import buttondevteam.thebuttonmcchat.TBMCPlayer;
|
import buttondevteam.thebuttonmcchat.ChatPlayer;
|
||||||
|
|
||||||
public final class ChatonlyCommand extends TBMCCommandBase {
|
public final class ChatonlyCommand extends TBMCCommandBase {
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ public final class ChatonlyCommand extends TBMCCommandBase {
|
||||||
@Override
|
@Override
|
||||||
public boolean OnCommand(CommandSender sender, String alias, String[] args) {
|
public boolean OnCommand(CommandSender sender, String alias, String[] args) {
|
||||||
Player player=(Player)sender;
|
Player player=(Player)sender;
|
||||||
TBMCPlayer p = TBMCPlayer.AllPlayers.get(player
|
ChatPlayer p = ChatPlayer.AllPlayers.get(player
|
||||||
.getUniqueId());
|
.getUniqueId());
|
||||||
p.ChatOnly = true;
|
p.ChatOnly = true;
|
||||||
player.setGameMode(GameMode.SPECTATOR);
|
player.setGameMode(GameMode.SPECTATOR);
|
||||||
|
@ -39,4 +39,9 @@ public final class ChatonlyCommand extends TBMCCommandBase {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean GetModOnly() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@ import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandExecutor;
|
import org.bukkit.command.CommandExecutor;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.command.PluginCommand;
|
import org.bukkit.command.PluginCommand;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
import org.reflections.Reflections;
|
import org.reflections.Reflections;
|
||||||
|
@ -101,7 +102,11 @@ public class CommandCaller implements CommandExecutor {
|
||||||
Bukkit.getConsoleSender().sendMessage("§cInternal error: Command not registered to CommandCaller");
|
Bukkit.getConsoleSender().sendMessage("§cInternal error: Command not registered to CommandCaller");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (cmd.GetPlayerOnly() && sender == Bukkit.getConsoleSender()) {
|
if (cmd.GetModOnly() && PluginMain.permission.has(sender, "tbmc.admin")) {
|
||||||
|
sender.sendMessage("§cYou need to be a mod to use this command.");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (cmd.GetPlayerOnly() && !(sender instanceof Player)) {
|
||||||
sender.sendMessage("§cOnly ingame players can use this command.");
|
sender.sendMessage("§cOnly ingame players can use this command.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,4 +39,9 @@ public class MWikiCommand extends TBMCCommandBase {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean GetModOnly() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@ package buttondevteam.thebuttonmcchat.commands;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import buttondevteam.thebuttonmcchat.TBMCPlayer;
|
import buttondevteam.thebuttonmcchat.ChatPlayer;
|
||||||
|
|
||||||
public final class OOCCommand extends TBMCCommandBase {
|
public final class OOCCommand extends TBMCCommandBase {
|
||||||
|
|
||||||
|
@ -21,12 +21,12 @@ public final class OOCCommand extends TBMCCommandBase {
|
||||||
if (args.length == 0) {
|
if (args.length == 0) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
TBMCPlayer.AddPlayerIfNeeded(player.getUniqueId()).RPMode = false;
|
ChatPlayer.AddPlayerIfNeeded(player.getUniqueId()).RPMode = false;
|
||||||
String message = "";
|
String message = "";
|
||||||
for (String arg : args)
|
for (String arg : args)
|
||||||
message += arg + " ";
|
message += arg + " ";
|
||||||
player.chat(message.substring(0, message.length() - 1));
|
player.chat(message.substring(0, message.length() - 1));
|
||||||
TBMCPlayer.AddPlayerIfNeeded(player.getUniqueId()).RPMode = true;
|
ChatPlayer.AddPlayerIfNeeded(player.getUniqueId()).RPMode = true;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -41,4 +41,9 @@ public final class OOCCommand extends TBMCCommandBase {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean GetModOnly() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,10 +9,11 @@ public abstract class TBMCCommandBase {
|
||||||
|
|
||||||
public abstract String[] GetHelpText(String alias);
|
public abstract String[] GetHelpText(String alias);
|
||||||
|
|
||||||
public abstract boolean OnCommand(CommandSender sender, String alias,
|
public abstract boolean OnCommand(CommandSender sender, String alias, String[] args);
|
||||||
String[] args);
|
|
||||||
|
|
||||||
public abstract String GetCommandPath();
|
public abstract String GetCommandPath();
|
||||||
|
|
||||||
public abstract boolean GetPlayerOnly();
|
public abstract boolean GetPlayerOnly();
|
||||||
|
|
||||||
|
public abstract boolean GetModOnly();
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,8 +15,7 @@ public final class UnlolCommand extends TBMCCommandBase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String[] GetHelpText(String alias) {
|
public String[] GetHelpText(String alias) {
|
||||||
return new String[] {
|
return new String[] { "§6---- Unlol/unlaugh ----",
|
||||||
"§6---- Unlol/unlaugh ----",
|
|
||||||
"This command is based on a joke between NorbiPeti and Ghostise",
|
"This command is based on a joke between NorbiPeti and Ghostise",
|
||||||
"It will make anyone saying one of the recognized laugh strings blind for a few seconds",
|
"It will make anyone saying one of the recognized laugh strings blind for a few seconds",
|
||||||
"Note that you can only unlaugh laughs that weren't unlaughed before" };
|
"Note that you can only unlaugh laughs that weren't unlaughed before" };
|
||||||
|
@ -26,13 +25,11 @@ public final class UnlolCommand extends TBMCCommandBase {
|
||||||
public boolean OnCommand(CommandSender sender, String alias, String[] args) {
|
public boolean OnCommand(CommandSender sender, String alias, String[] args) {
|
||||||
if (Lastlol != null) {
|
if (Lastlol != null) {
|
||||||
if (Lastlol instanceof Player)
|
if (Lastlol instanceof Player)
|
||||||
((Player) Lastlol).addPotionEffect(new PotionEffect(
|
((Player) Lastlol)
|
||||||
PotionEffectType.BLINDNESS, 10 * 20, 5, false, false));
|
.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, 10 * 20, 5, false, false));
|
||||||
String msg = (sender instanceof Player ? ((Player) sender)
|
String msg = (sender instanceof Player ? ((Player) sender).getDisplayName() : sender.getName())
|
||||||
.getDisplayName() : sender.getName())
|
|
||||||
+ (Lastlolornot ? " unlolled " : " unlaughed ")
|
+ (Lastlolornot ? " unlolled " : " unlaughed ")
|
||||||
+ (Lastlol instanceof Player ? ((Player) Lastlol)
|
+ (Lastlol instanceof Player ? ((Player) Lastlol).getDisplayName() : Lastlol.getName());
|
||||||
.getDisplayName() : Lastlol.getName());
|
|
||||||
for (Player pl : PluginMain.GetPlayers())
|
for (Player pl : PluginMain.GetPlayers())
|
||||||
pl.sendMessage(msg);
|
pl.sendMessage(msg);
|
||||||
Bukkit.getServer().getConsoleSender().sendMessage(msg);
|
Bukkit.getServer().getConsoleSender().sendMessage(msg);
|
||||||
|
@ -51,4 +48,8 @@ public final class UnlolCommand extends TBMCCommandBase {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean GetModOnly() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,4 +34,8 @@ public class YeehawCommand extends TBMCCommandBase {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean GetModOnly() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,4 +25,8 @@ public abstract class AppendTextCommandBase extends TBMCCommandBase {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean GetModOnly() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@ import org.bukkit.entity.Player;
|
||||||
import buttondevteam.thebuttonmcchat.FlairStates;
|
import buttondevteam.thebuttonmcchat.FlairStates;
|
||||||
import buttondevteam.thebuttonmcchat.PlayerJoinTimerTask;
|
import buttondevteam.thebuttonmcchat.PlayerJoinTimerTask;
|
||||||
import buttondevteam.thebuttonmcchat.PluginMain;
|
import buttondevteam.thebuttonmcchat.PluginMain;
|
||||||
import buttondevteam.thebuttonmcchat.TBMCPlayer;
|
import buttondevteam.thebuttonmcchat.ChatPlayer;
|
||||||
|
|
||||||
public class AcceptCommand extends UCommandBase {
|
public class AcceptCommand extends UCommandBase {
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ public class AcceptCommand extends UCommandBase {
|
||||||
@Override
|
@Override
|
||||||
public boolean OnCommand(CommandSender sender, String alias, String[] args) {
|
public boolean OnCommand(CommandSender sender, String alias, String[] args) {
|
||||||
final Player player = (Player) sender;
|
final Player player = (Player) sender;
|
||||||
TBMCPlayer p = TBMCPlayer.GetFromPlayer(player);
|
ChatPlayer p = ChatPlayer.GetFromPlayer(player);
|
||||||
if (args.length < 1 && p.UserNames.size() > 1) {
|
if (args.length < 1 && p.UserNames.size() > 1) {
|
||||||
player.sendMessage("§9Multiple users commented your name. §bPlease pick one using /u accept <username>");
|
player.sendMessage("§9Multiple users commented your name. §bPlease pick one using /u accept <username>");
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|
|
@ -5,7 +5,7 @@ import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import buttondevteam.thebuttonmcchat.ChatFormatter;
|
import buttondevteam.thebuttonmcchat.ChatFormatter;
|
||||||
import buttondevteam.thebuttonmcchat.PluginMain;
|
import buttondevteam.thebuttonmcchat.PluginMain;
|
||||||
import buttondevteam.thebuttonmcchat.TBMCPlayer;
|
import buttondevteam.thebuttonmcchat.ChatPlayer;
|
||||||
|
|
||||||
public class CCommand extends UCommandBase {
|
public class CCommand extends UCommandBase {
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ public class CCommand extends UCommandBase {
|
||||||
@Override
|
@Override
|
||||||
public boolean OnCommand(CommandSender sender, String alias, String[] args) {
|
public boolean OnCommand(CommandSender sender, String alias, String[] args) {
|
||||||
Player player = (Player) sender;
|
Player player = (Player) sender;
|
||||||
TBMCPlayer p = TBMCPlayer.AddPlayerIfNeeded(player
|
ChatPlayer p = ChatPlayer.AddPlayerIfNeeded(player
|
||||||
.getUniqueId());
|
.getUniqueId());
|
||||||
if (args.length < 1) {
|
if (args.length < 1) {
|
||||||
if (PluginMain.permission.has(player, "tbmc.rainbow")) {
|
if (PluginMain.permission.has(player, "tbmc.rainbow")) {
|
||||||
|
|
|
@ -4,7 +4,7 @@ import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import buttondevteam.thebuttonmcchat.FlairStates;
|
import buttondevteam.thebuttonmcchat.FlairStates;
|
||||||
import buttondevteam.thebuttonmcchat.TBMCPlayer;
|
import buttondevteam.thebuttonmcchat.ChatPlayer;
|
||||||
|
|
||||||
public final class IgnoreCommand extends UCommandBase {
|
public final class IgnoreCommand extends UCommandBase {
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ public final class IgnoreCommand extends UCommandBase {
|
||||||
@Override
|
@Override
|
||||||
public boolean OnCommand(CommandSender sender, String alias, String[] args) {
|
public boolean OnCommand(CommandSender sender, String alias, String[] args) {
|
||||||
final Player player = (Player) sender;
|
final Player player = (Player) sender;
|
||||||
TBMCPlayer p = TBMCPlayer.GetFromPlayer(player);
|
ChatPlayer p = ChatPlayer.GetFromPlayer(player);
|
||||||
if (p.FlairState.equals(FlairStates.Accepted)) {
|
if (p.FlairState.equals(FlairStates.Accepted)) {
|
||||||
player.sendMessage("§cYou can only ignore the \"write yoőu rname in the thread\" message.");
|
player.sendMessage("§cYou can only ignore the \"write yoőu rname in the thread\" message.");
|
||||||
return true;
|
return true;
|
||||||
|
@ -30,7 +30,7 @@ public final class IgnoreCommand extends UCommandBase {
|
||||||
}
|
}
|
||||||
if (!p.FlairState.equals(FlairStates.Ignored)) {
|
if (!p.FlairState.equals(FlairStates.Ignored)) {
|
||||||
p.FlairState = FlairStates.Ignored;
|
p.FlairState = FlairStates.Ignored;
|
||||||
p.SetFlair(TBMCPlayer.FlairTimeNone);
|
p.SetFlair(ChatPlayer.FlairTimeNone);
|
||||||
p.UserName = "";
|
p.UserName = "";
|
||||||
player.sendMessage("§bYou have ignored the message. You can still use /u accept to get a flair.§r");
|
player.sendMessage("§bYou have ignored the message. You can still use /u accept to get a flair.§r");
|
||||||
} else
|
} else
|
||||||
|
|
|
@ -2,7 +2,7 @@ package buttondevteam.thebuttonmcchat.commands.ucmds;
|
||||||
|
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
||||||
import buttondevteam.thebuttonmcchat.TBMCPlayer;
|
import buttondevteam.thebuttonmcchat.ChatPlayer;
|
||||||
|
|
||||||
public class NameCommand extends UCommandBase {
|
public class NameCommand extends UCommandBase {
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ public class NameCommand extends UCommandBase {
|
||||||
if (args.length == 1) {
|
if (args.length == 1) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
TBMCPlayer mp = TBMCPlayer.GetFromName(args[1]);
|
ChatPlayer mp = ChatPlayer.GetFromName(args[1]);
|
||||||
if (mp == null) {
|
if (mp == null) {
|
||||||
sender.sendMessage("§cUnknown user (player has to be online): "
|
sender.sendMessage("§cUnknown user (player has to be online): "
|
||||||
+ args[1]);
|
+ args[1]);
|
||||||
|
|
|
@ -27,4 +27,8 @@ public final class UCommand extends TBMCCommandBase {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean GetModOnly() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,4 +17,9 @@ public abstract class UCommandBase extends TBMCCommandBase {
|
||||||
public boolean GetPlayerOnly() {
|
public boolean GetPlayerOnly() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean GetModOnly() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,4 +26,9 @@ public final class AdminCommand extends UCommandBase {
|
||||||
public boolean GetPlayerOnly() {
|
public boolean GetPlayerOnly() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean GetModOnly() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,8 @@ import buttondevteam.thebuttonmcchat.commands.ucmds.UCommandBase;
|
||||||
|
|
||||||
public abstract class AdminCommandBase extends UCommandBase {
|
public abstract class AdminCommandBase extends UCommandBase {
|
||||||
|
|
||||||
public abstract String[] GetHelpText(String alias); //TODO: Require permission
|
public abstract String[] GetHelpText(String alias); // TODO: Require
|
||||||
|
// permission
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String GetUCommandPath() {
|
public String GetUCommandPath() {
|
||||||
|
@ -18,4 +19,8 @@ public abstract class AdminCommandBase extends UCommandBase {
|
||||||
|
|
||||||
public abstract String GetAdminCommandPath();
|
public abstract String GetAdminCommandPath();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean GetModOnly() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@ import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import buttondevteam.thebuttonmcchat.PluginMain;
|
import buttondevteam.thebuttonmcchat.PluginMain;
|
||||||
import buttondevteam.thebuttonmcchat.TBMCPlayer;
|
import buttondevteam.thebuttonmcchat.ChatPlayer;
|
||||||
|
|
||||||
public class ConfirmCommand extends AdminCommandBase {
|
public class ConfirmCommand extends AdminCommandBase {
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ public class ConfirmCommand extends AdminCommandBase {
|
||||||
PluginMain.LoadFiles(true);
|
PluginMain.LoadFiles(true);
|
||||||
// TODO: Add players online
|
// TODO: Add players online
|
||||||
for (Player p : PluginMain.GetPlayers())
|
for (Player p : PluginMain.GetPlayers())
|
||||||
TBMCPlayer.AddPlayerIfNeeded(p.getUniqueId());
|
ChatPlayer.AddPlayerIfNeeded(p.getUniqueId());
|
||||||
if (sender != PluginMain.Console)
|
if (sender != PluginMain.Console)
|
||||||
PluginMain.Console.sendMessage("§6-- Reloading done!§r");
|
PluginMain.Console.sendMessage("§6-- Reloading done!§r");
|
||||||
sender.sendMessage("§6-- Reloading done!§r");
|
sender.sendMessage("§6-- Reloading done!§r");
|
||||||
|
|
|
@ -2,38 +2,34 @@ package buttondevteam.thebuttonmcchat.commands.ucmds.admin;
|
||||||
|
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
||||||
import buttondevteam.thebuttonmcchat.TBMCPlayer;
|
import buttondevteam.thebuttonmcchat.ChatPlayer;
|
||||||
|
|
||||||
public class PlayerInfoCommand extends AdminCommandBase {
|
public class PlayerInfoCommand extends AdminCommandBase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String[] GetHelpText(String alias) {
|
public String[] GetHelpText(String alias) {
|
||||||
return new String[] {
|
return new String[] { "§6---- Player info ----",
|
||||||
"§6---- Player info ----",
|
|
||||||
"Shows some info about the player's flair, Reddit username(s) and other data known by the plugin",
|
"Shows some info about the player's flair, Reddit username(s) and other data known by the plugin",
|
||||||
"Usage: /u admin playerinfo <player>" };
|
"Usage: /u admin playerinfo <player>" };
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean OnCommand(CommandSender sender, String alias,
|
public boolean OnCommand(CommandSender sender, String alias, String[] args) {
|
||||||
String[] args) {
|
|
||||||
if (args.length == 0) {
|
if (args.length == 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
TBMCPlayer p = TBMCPlayer.GetFromName(args[0]);
|
ChatPlayer p = ChatPlayer.GetFromName(args[0]);
|
||||||
if (p == null) {
|
if (p == null) {
|
||||||
sender.sendMessage("§cPlayer not found: " + args[0]
|
sender.sendMessage("§cPlayer not found: " + args[0] + "§r");
|
||||||
+ " - Currently only online players can be viewed§r");
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append("§6Usernames:");
|
sb.append("§6Usernames:");
|
||||||
for (String username : p.UserNames)
|
for (String username : p.UserNames)
|
||||||
sb.append(" ").append(username);
|
sb.append(" ").append(username);
|
||||||
sender.sendMessage(new String[] { "Player name: " + p.PlayerName,
|
sender.sendMessage(new String[] { "Player name: " + p.PlayerName, "User flair: " + p.GetFormattedFlair(),
|
||||||
"User flair: " + p.GetFormattedFlair(),
|
"Username: " + p.UserName, "Flair state: " + p.FlairState, sb.toString(), "FCount: " + p.FCount,
|
||||||
"Username: " + p.UserName, "Flair state: " + p.FlairState,
|
"FDeaths: " + p.FDeaths });
|
||||||
sb.toString(), "FCount: " + p.FCount, "FDeaths: " + p.FDeaths });
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import buttondevteam.thebuttonmcchat.FlairStates;
|
import buttondevteam.thebuttonmcchat.FlairStates;
|
||||||
import buttondevteam.thebuttonmcchat.TBMCPlayer;
|
import buttondevteam.thebuttonmcchat.ChatPlayer;
|
||||||
|
|
||||||
public class SetFlairCommand extends AdminCommandBase {
|
public class SetFlairCommand extends AdminCommandBase {
|
||||||
|
|
||||||
|
@ -32,11 +32,11 @@ public class SetFlairCommand extends AdminCommandBase {
|
||||||
}
|
}
|
||||||
short flairtime = 0x00;
|
short flairtime = 0x00;
|
||||||
if (args[1].equalsIgnoreCase("non-presser"))
|
if (args[1].equalsIgnoreCase("non-presser"))
|
||||||
flairtime = TBMCPlayer.FlairTimeNonPresser;
|
flairtime = ChatPlayer.FlairTimeNonPresser;
|
||||||
else if (args[1].equalsIgnoreCase("cant-press"))
|
else if (args[1].equalsIgnoreCase("cant-press"))
|
||||||
flairtime = TBMCPlayer.FlairTimeCantPress;
|
flairtime = ChatPlayer.FlairTimeCantPress;
|
||||||
else if (args[1].equalsIgnoreCase("none"))
|
else if (args[1].equalsIgnoreCase("none"))
|
||||||
flairtime = TBMCPlayer.FlairTimeNone;
|
flairtime = ChatPlayer.FlairTimeNone;
|
||||||
else {
|
else {
|
||||||
try {
|
try {
|
||||||
flairtime = Short.parseShort(args[1]);
|
flairtime = Short.parseShort(args[1]);
|
||||||
|
@ -54,7 +54,7 @@ public class SetFlairCommand extends AdminCommandBase {
|
||||||
sender.sendMessage("§cUnknown value for cheater parameter. Run without args to see usage.");
|
sender.sendMessage("§cUnknown value for cheater parameter. Run without args to see usage.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
TBMCPlayer mp = TBMCPlayer.AddPlayerIfNeeded(p
|
ChatPlayer mp = ChatPlayer.AddPlayerIfNeeded(p
|
||||||
.getUniqueId());
|
.getUniqueId());
|
||||||
mp.SetFlair(flairtime, cheater);
|
mp.SetFlair(flairtime, cheater);
|
||||||
mp.FlairState = FlairStates.Accepted;
|
mp.FlairState = FlairStates.Accepted;
|
||||||
|
|
Loading…
Reference in a new issue