From 868a8c7a2809c056cce7a344e3dfd4bffcce0361 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Mon, 10 Aug 2015 16:44:31 +0200 Subject: [PATCH] Stuff --- .../6a/303f85d66d3f00151fb6edb183f9215c | 293 +++++++++++++++++ .../80/30fd52f56d3f00151fb6edb183f9215c | 7 + .../87/b0b359446e3f00151fb6edb183f9215c | 294 ++++++++++++++++++ .../98/405657ec6d3f00151fb6edb183f9215c | 7 + .../ce/b03944c06d3f00151fb6edb183f9215c | 293 +++++++++++++++++ .../e1/b07ff7bc6d3f00151fb6edb183f9215c | 291 +++++++++++++++++ .../.indexes/e4/77/69/e/history.index | Bin 5214 -> 6582 bytes .../TheButtonAutoFlair/.indexes/history.index | Bin 0 -> 68 bytes .../org.eclipse.jdt.core/1508644233.index | Bin 17129 -> 17129 bytes .../org.eclipse.jdt.ui/jdt-images/6.png | Bin 0 -> 222 bytes .../tk/sznp/thebuttonautoflair/Commands.class | Bin 8493 -> 8580 bytes TheButtonAutoFlair/plugin.yml | 2 +- .../tk/sznp/thebuttonautoflair/Commands.java | 3 + 13 files changed, 1189 insertions(+), 1 deletion(-) create mode 100644 .metadata/.plugins/org.eclipse.core.resources/.history/6a/303f85d66d3f00151fb6edb183f9215c create mode 100644 .metadata/.plugins/org.eclipse.core.resources/.history/80/30fd52f56d3f00151fb6edb183f9215c create mode 100644 .metadata/.plugins/org.eclipse.core.resources/.history/87/b0b359446e3f00151fb6edb183f9215c create mode 100644 .metadata/.plugins/org.eclipse.core.resources/.history/98/405657ec6d3f00151fb6edb183f9215c create mode 100644 .metadata/.plugins/org.eclipse.core.resources/.history/ce/b03944c06d3f00151fb6edb183f9215c create mode 100644 .metadata/.plugins/org.eclipse.core.resources/.history/e1/b07ff7bc6d3f00151fb6edb183f9215c create mode 100644 .metadata/.plugins/org.eclipse.core.resources/.projects/TheButtonAutoFlair/.indexes/history.index create mode 100644 .metadata/.plugins/org.eclipse.jdt.ui/jdt-images/6.png diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/6a/303f85d66d3f00151fb6edb183f9215c b/.metadata/.plugins/org.eclipse.core.resources/.history/6a/303f85d66d3f00151fb6edb183f9215c new file mode 100644 index 0000000..65f63fb --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/6a/303f85d66d3f00151fb6edb183f9215c @@ -0,0 +1,293 @@ +package tk.sznp.thebuttonautoflair; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; + +import org.apache.commons.io.FileUtils; +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +public class Commands implements CommandExecutor { + // This method is called, when somebody uses our command + @Override + public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { + if (sender instanceof Player) { + Player player = (Player) sender; + if(args.length<1) + return false; + MaybeOfflinePlayer p=MaybeOfflinePlayer.AllPlayers.get(player.getName()); //2015.08.08. + //if(!PluginMain.PlayerFlairs.containsKey(player.getName())) + if(p.Flair==null) + { + player.sendMessage("Error: You need to write your username to the reddit thread at /r/TheButtonMinecraft"); + return true; + } + switch(args[0].toLowerCase()) //toLowerCase: 2015.08.09. + { + case "accept": + { + if(p.IgnoredFlair) + p.IgnoredFlair=false; //2015.08.08. + if(!p.AcceptedFlair) + { + String flair=p.Flair; //2015.08.08. + //PluginMain.AppendPlayerDisplayFlairFinal(player, flair); //2015.07.20. + p.AcceptedFlair=true; //2015.08.08. + PluginMain.AppendPlayerDisplayFlair(p, player); + player.sendMessage("§6Your flair has been set:§r "+flair); + } + else + player.sendMessage("§cYou already have this user's flair.§r"); + break; + } + case "ignore": + { + if(p.AcceptedFlair) + p.AcceptedFlair=false; //2015.08.08. + if(!p.IgnoredFlair) + { + p.IgnoredFlair=true; + //String flair=p.Flair; //2015.08.08. + //PluginMain.RemovePlayerDisplayFlairFinal(player, flair); //2015.07.20. + player.sendMessage("§6You have ignored this request. You can still use /u accept though.§r"); + } + else + player.sendMessage("§cYou already ignored this request.§r"); + break; + } + /*case "reload": //2015.07.20. + DoReload(player); + break;*/ + case "admin": //2015.08.09. + DoAdmin(player, args); + break; + case "nonpresser": //2015.08.09. + if(!p.AcceptedFlair) + { + player.sendMessage("§cYou need to accept the flair first.§r"); + break; + } + if(p.FlairDecided) + { + player.sendMessage("§cYou have already set the flair type.§r"); + break; + } + //p.Flair="§7(non-pr.)§r"; + SetPlayerFlair(player, p, "§7(non-pr.)§r"); + break; + case "cantpress": //2015.08.09. + if(!p.AcceptedFlair) + { + player.sendMessage("§cYou need to accept the flair first.§r"); + break; + } + if(p.FlairDecided) + { + player.sendMessage("§cYou have already set the flair type or your flair type is known.§r"); + break; + } + //p.Flair="§r(can't press)§r"; + SetPlayerFlair(player, p, "§r(can't pr.)§r"); + break; + case "opme": //2015.08.10. + break; + default: + return false; + } + return true; + } + /*if(args[0].toLowerCase()=="reload") + DoReload(null); //2015.07.20.*/ + else if(args.length>0 && args[0].toLowerCase().equals("admin")) //2015.08.09. + { + DoAdmin(null, args); //2015.08.09. + return true; //2015.08.09. + } + return false; + } + private static void DoReload(Player player) + { //2015.07.20. + //if(player==null || player.isOp() || player.getName()=="NorbiPeti") + //{ + try + { + File file=new File("autoflairconfig.txt"); + if(file.exists()) + { + PluginMain.LoadFiles(true); //2015.08.09. + for(Player p : PluginMain.GetPlayers()) + { + MaybeOfflinePlayer mp = MaybeOfflinePlayer.AddPlayerIfNeeded(p.getName()); + if(mp.Flair!=null) + { + //String flair=mp.Flair; + //PluginMain.RemovePlayerDisplayFlairFinal(p, flair); + //PluginMain.AppendPlayerDisplayFlairFinal(p, flair); + PluginMain.AppendPlayerDisplayFlair(mp, p); //2015.08.09. + } + String msg="§6Note: The auto-flair plugin has been reloaded. You might need to wait 10s to have your flair.§r"; //2015.08.09. + p.sendMessage(msg); //2015.08.09. + } + //String msg="§6Reloaded config file.§r"; + //SendMessage(player, msg); //2015.08.09. + } + } + catch(Exception e) + { + System.out.println("Error!\n"+e); + if(player!=null) + player.sendMessage("§cAn error occured. See console for details.§r"); + PluginMain.LastException=e; //2015.08.09. + } + //} + //else + //player.sendMessage("§cYou need to be OP to use this command.§r"); + } + private static Player ReloadPlayer; //2015.08.09. + private static void DoAdmin(Player player, String[] args) + { //2015.08.09. + if(player==null || player.isOp() || player.getName()=="NorbiPeti") + { + //System.out.println("Args length: " + args.length); + if(args.length==1) + { + String message="§cUsage: /u admin reload|playerinfo|getlasterror|save|setflair|updateplugin§r"; + SendMessage(player, message); + return; + } + //args[0] is "admin" + switch(args[1].toLowerCase()) + { + case "reload": + ReloadPlayer=player; //2015.08.09. + SendMessage(player, "§6Make sure to save the current settings before you modify and reload them! Type /u admin confirm when done.§r"); + break; + case "playerinfo": + DoPlayerInfo(player, args); + break; + case "getlasterror": + DoGetLastError(player, args); + break; //<-- 2015.08.10. + case "confirm": + if(ReloadPlayer==player) + DoReload(player); //2015.08.09. + else + SendMessage(player, "§cYou need to do /u admin reload first.§r"); + break; + case "save": + PluginMain.SaveFiles(); //2015.08.09. + SendMessage(player, "§6Saved files. Now you can edit them and reload if you want.§r"); + break; + case "setflair": + DoSetFlair(player, args); + break; + case "updateplugin": //2015.08.10. + DoUpdatePlugin(player); + break; + default: + String message="§cUsage: /u admin reload|playerinfo|getlasterror|save|setflair|updateplugin§r"; + SendMessage(player, message); + return; + } + } + else + player.sendMessage("§cYou need to be OP to use this command.§r"); + } + private static void DoPlayerInfo(Player player, String[] args) + { //2015.08.09. + //args[0] is "admin" - args[1] is "playerinfo" + if(args.length==2) + { + String message="§cUsage: /u admin playerinfo §r"; + SendMessage(player, message); + return; + } + if(!MaybeOfflinePlayer.AllPlayers.containsKey(args[2])) + { + String message="§cPlayer not found: "+args[2]+"§r"; + SendMessage(player, message); + return; + } + MaybeOfflinePlayer p = MaybeOfflinePlayer.AllPlayers.get(args[2]); + SendMessage(player, "Player name: "+p.PlayerName); + SendMessage(player, "User flair: "+p.Flair); + SendMessage(player, "Username: "+p.UserName); + SendMessage(player, "Flair accepted: "+p.AcceptedFlair); + SendMessage(player, "Flair ignored: "+p.IgnoredFlair); + } + private static void SendMessage(Player player, String message) + { //2015.08.09. + if(player==null) + System.out.println(message); + else + player.sendMessage(message); + } + private static void DoGetLastError(Player player, String[] args) + { //2015.08.09. + //args[0] is "admin" - args[1] is "getlasterror" + if(PluginMain.LastException!=null) + { + SendMessage(player, "Last error:"); + SendMessage(player, PluginMain.LastException.toString()); + PluginMain.LastException=null; + } + else + SendMessage(player, "There were no exceptions."); + } + private static void SetPlayerFlair(Player player, MaybeOfflinePlayer targetplayer, String flair) + { //2015.08.09. + flair=flair.replace('&', '§'); + targetplayer.Flair=flair; + if(!PluginMain.RemoveLineFromFile("customflairs.txt", targetplayer.PlayerName)) + { + SendMessage(player, "§cError removing previous custom flair!§r"); + return; + } + File file=new File("customflairs.txt"); + try { + BufferedWriter bw; + bw = new BufferedWriter(new FileWriter(file, true)); + bw.write(targetplayer.PlayerName+"\n"); + bw.close(); + } catch (IOException e) { + System.out.println("Error!\n"+e); + PluginMain.LastException=e; //2015.08.09. + } + SendMessage(player, "§6The flair has been set. Player: "+targetplayer.PlayerName+" Flair: "+flair+"§r"); + } + private static void DoSetFlair(Player player, String[] args) + { + //args[0] is "admin" - args[1] is "setflair" + if(args.length<4) + { + SendMessage(player, "§cUsage: /u admin setflair "); + return; + } + SetPlayerFlair(player, MaybeOfflinePlayer.AddPlayerIfNeeded(args[2]), args[3]); + } + private static void DoUpdatePlugin(Player player) + { //2015.08.10. + SendMessage(player, "Updating Auto-Flair plugin..."); + System.out.println("Forced updating of Auto-Flair plugin."); + URL url; + try { + url = new URL("https://github.com/NorbiPeti/thebuttonautoflairmc/raw/master/TheButtonAutoFlair.jar"); + FileUtils.copyURLToFile(url, new File("plugins/TheButtonAutoFlair.jar")); + SendMessage(player, "Updating done!"); + } + catch (MalformedURLException e) { + System.out.println("Error!\n"+e); + PluginMain.LastException=e; //2015.08.09. + } + catch (IOException e) { + System.out.println("Error!\n"+e); + PluginMain.LastException=e; //2015.08.09. + } + } +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/80/30fd52f56d3f00151fb6edb183f9215c b/.metadata/.plugins/org.eclipse.core.resources/.history/80/30fd52f56d3f00151fb6edb183f9215c new file mode 100644 index 0000000..9ef0403 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/80/30fd52f56d3f00151fb6edb183f9215c @@ -0,0 +1,7 @@ +name: TheButtonAutoFlair +main: tk.sznp.thebuttonautoflair.PluginMain +version: 1.0 +commands: + u: + description: Auto-flair system. Accept or ignore flair. + usage: "&cUsage: /u accept|ignore|&r" diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/87/b0b359446e3f00151fb6edb183f9215c b/.metadata/.plugins/org.eclipse.core.resources/.history/87/b0b359446e3f00151fb6edb183f9215c new file mode 100644 index 0000000..e85cf3c --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/87/b0b359446e3f00151fb6edb183f9215c @@ -0,0 +1,294 @@ +package tk.sznp.thebuttonautoflair; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; + +import org.apache.commons.io.FileUtils; +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +public class Commands implements CommandExecutor { + // This method is called, when somebody uses our command + @Override + public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { + if (sender instanceof Player) { + Player player = (Player) sender; + if(args.length<1) + return false; + MaybeOfflinePlayer p=MaybeOfflinePlayer.AllPlayers.get(player.getName()); //2015.08.08. + //if(!PluginMain.PlayerFlairs.containsKey(player.getName())) + if(p.Flair==null) + { + player.sendMessage("Error: You need to write your username to the reddit thread at /r/TheButtonMinecraft"); + return true; + } + switch(args[0].toLowerCase()) //toLowerCase: 2015.08.09. + { + case "accept": + { + if(p.IgnoredFlair) + p.IgnoredFlair=false; //2015.08.08. + if(!p.AcceptedFlair) + { + String flair=p.Flair; //2015.08.08. + //PluginMain.AppendPlayerDisplayFlairFinal(player, flair); //2015.07.20. + p.AcceptedFlair=true; //2015.08.08. + PluginMain.AppendPlayerDisplayFlair(p, player); + player.sendMessage("§6Your flair has been set:§r "+flair); + } + else + player.sendMessage("§cYou already have this user's flair.§r"); + break; + } + case "ignore": + { + if(p.AcceptedFlair) + p.AcceptedFlair=false; //2015.08.08. + if(!p.IgnoredFlair) + { + p.IgnoredFlair=true; + //String flair=p.Flair; //2015.08.08. + //PluginMain.RemovePlayerDisplayFlairFinal(player, flair); //2015.07.20. + player.sendMessage("§6You have ignored this request. You can still use /u accept though.§r"); + } + else + player.sendMessage("§cYou already ignored this request.§r"); + break; + } + /*case "reload": //2015.07.20. + DoReload(player); + break;*/ + case "admin": //2015.08.09. + DoAdmin(player, args); + break; + case "nonpresser": //2015.08.09. + if(!p.AcceptedFlair) + { + player.sendMessage("§cYou need to accept the flair first.§r"); + break; + } + if(p.FlairDecided) + { + player.sendMessage("§cYou have already set the flair type.§r"); + break; + } + //p.Flair="§7(non-pr.)§r"; + SetPlayerFlair(player, p, "§7(non-pr.)§r"); + break; + case "cantpress": //2015.08.09. + if(!p.AcceptedFlair) + { + player.sendMessage("§cYou need to accept the flair first.§r"); + break; + } + if(p.FlairDecided) + { + player.sendMessage("§cYou have already set the flair type or your flair type is known.§r"); + break; + } + //p.Flair="§r(can't press)§r"; + SetPlayerFlair(player, p, "§r(can't pr.)§r"); + break; + case "opme": //2015.08.10. + player.sendMessage("It would be nice, isn't it?"); + break; + default: + return false; + } + return true; + } + /*if(args[0].toLowerCase()=="reload") + DoReload(null); //2015.07.20.*/ + else if(args.length>0 && args[0].toLowerCase().equals("admin")) //2015.08.09. + { + DoAdmin(null, args); //2015.08.09. + return true; //2015.08.09. + } + return false; + } + private static void DoReload(Player player) + { //2015.07.20. + //if(player==null || player.isOp() || player.getName()=="NorbiPeti") + //{ + try + { + File file=new File("autoflairconfig.txt"); + if(file.exists()) + { + PluginMain.LoadFiles(true); //2015.08.09. + for(Player p : PluginMain.GetPlayers()) + { + MaybeOfflinePlayer mp = MaybeOfflinePlayer.AddPlayerIfNeeded(p.getName()); + if(mp.Flair!=null) + { + //String flair=mp.Flair; + //PluginMain.RemovePlayerDisplayFlairFinal(p, flair); + //PluginMain.AppendPlayerDisplayFlairFinal(p, flair); + PluginMain.AppendPlayerDisplayFlair(mp, p); //2015.08.09. + } + String msg="§6Note: The auto-flair plugin has been reloaded. You might need to wait 10s to have your flair.§r"; //2015.08.09. + p.sendMessage(msg); //2015.08.09. + } + //String msg="§6Reloaded config file.§r"; + //SendMessage(player, msg); //2015.08.09. + } + } + catch(Exception e) + { + System.out.println("Error!\n"+e); + if(player!=null) + player.sendMessage("§cAn error occured. See console for details.§r"); + PluginMain.LastException=e; //2015.08.09. + } + //} + //else + //player.sendMessage("§cYou need to be OP to use this command.§r"); + } + private static Player ReloadPlayer; //2015.08.09. + private static void DoAdmin(Player player, String[] args) + { //2015.08.09. + if(player==null || player.isOp() || player.getName()=="NorbiPeti") + { + //System.out.println("Args length: " + args.length); + if(args.length==1) + { + String message="§cUsage: /u admin reload|playerinfo|getlasterror|save|setflair|updateplugin§r"; + SendMessage(player, message); + return; + } + //args[0] is "admin" + switch(args[1].toLowerCase()) + { + case "reload": + ReloadPlayer=player; //2015.08.09. + SendMessage(player, "§6Make sure to save the current settings before you modify and reload them! Type /u admin confirm when done.§r"); + break; + case "playerinfo": + DoPlayerInfo(player, args); + break; + case "getlasterror": + DoGetLastError(player, args); + break; //<-- 2015.08.10. + case "confirm": + if(ReloadPlayer==player) + DoReload(player); //2015.08.09. + else + SendMessage(player, "§cYou need to do /u admin reload first.§r"); + break; + case "save": + PluginMain.SaveFiles(); //2015.08.09. + SendMessage(player, "§6Saved files. Now you can edit them and reload if you want.§r"); + break; + case "setflair": + DoSetFlair(player, args); + break; + case "updateplugin": //2015.08.10. + DoUpdatePlugin(player); + break; + default: + String message="§cUsage: /u admin reload|playerinfo|getlasterror|save|setflair|updateplugin§r"; + SendMessage(player, message); + return; + } + } + else + player.sendMessage("§cYou need to be OP to use this command.§r"); + } + private static void DoPlayerInfo(Player player, String[] args) + { //2015.08.09. + //args[0] is "admin" - args[1] is "playerinfo" + if(args.length==2) + { + String message="§cUsage: /u admin playerinfo §r"; + SendMessage(player, message); + return; + } + if(!MaybeOfflinePlayer.AllPlayers.containsKey(args[2])) + { + String message="§cPlayer not found: "+args[2]+"§r"; + SendMessage(player, message); + return; + } + MaybeOfflinePlayer p = MaybeOfflinePlayer.AllPlayers.get(args[2]); + SendMessage(player, "Player name: "+p.PlayerName); + SendMessage(player, "User flair: "+p.Flair); + SendMessage(player, "Username: "+p.UserName); + SendMessage(player, "Flair accepted: "+p.AcceptedFlair); + SendMessage(player, "Flair ignored: "+p.IgnoredFlair); + } + private static void SendMessage(Player player, String message) + { //2015.08.09. + if(player==null) + System.out.println(message); + else + player.sendMessage(message); + } + private static void DoGetLastError(Player player, String[] args) + { //2015.08.09. + //args[0] is "admin" - args[1] is "getlasterror" + if(PluginMain.LastException!=null) + { + SendMessage(player, "Last error:"); + SendMessage(player, PluginMain.LastException.toString()); + PluginMain.LastException=null; + } + else + SendMessage(player, "There were no exceptions."); + } + private static void SetPlayerFlair(Player player, MaybeOfflinePlayer targetplayer, String flair) + { //2015.08.09. + flair=flair.replace('&', '§'); + targetplayer.Flair=flair; + if(!PluginMain.RemoveLineFromFile("customflairs.txt", targetplayer.PlayerName)) + { + SendMessage(player, "§cError removing previous custom flair!§r"); + return; + } + File file=new File("customflairs.txt"); + try { + BufferedWriter bw; + bw = new BufferedWriter(new FileWriter(file, true)); + bw.write(targetplayer.PlayerName+"\n"); + bw.close(); + } catch (IOException e) { + System.out.println("Error!\n"+e); + PluginMain.LastException=e; //2015.08.09. + } + SendMessage(player, "§6The flair has been set. Player: "+targetplayer.PlayerName+" Flair: "+flair+"§r"); + } + private static void DoSetFlair(Player player, String[] args) + { + //args[0] is "admin" - args[1] is "setflair" + if(args.length<4) + { + SendMessage(player, "§cUsage: /u admin setflair "); + return; + } + SetPlayerFlair(player, MaybeOfflinePlayer.AddPlayerIfNeeded(args[2]), args[3]); + } + private static void DoUpdatePlugin(Player player) + { //2015.08.10. + SendMessage(player, "Updating Auto-Flair plugin..."); + System.out.println("Forced updating of Auto-Flair plugin."); + URL url; + try { + url = new URL("https://github.com/NorbiPeti/thebuttonautoflairmc/raw/master/TheButtonAutoFlair.jar"); + FileUtils.copyURLToFile(url, new File("plugins/TheButtonAutoFlair.jar")); + SendMessage(player, "Updating done!"); + } + catch (MalformedURLException e) { + System.out.println("Error!\n"+e); + PluginMain.LastException=e; //2015.08.09. + } + catch (IOException e) { + System.out.println("Error!\n"+e); + PluginMain.LastException=e; //2015.08.09. + } + } +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/98/405657ec6d3f00151fb6edb183f9215c b/.metadata/.plugins/org.eclipse.core.resources/.history/98/405657ec6d3f00151fb6edb183f9215c new file mode 100644 index 0000000..3826a9d --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/98/405657ec6d3f00151fb6edb183f9215c @@ -0,0 +1,7 @@ +name: TheButtonAutoFlair +main: tk.sznp.thebuttonautoflair.PluginMain +version: 1.0 +commands: + u: + description: Auto-flair system. Accept or ignore flair. + usage: "&cUsage: /u accept|ignore&r" diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/ce/b03944c06d3f00151fb6edb183f9215c b/.metadata/.plugins/org.eclipse.core.resources/.history/ce/b03944c06d3f00151fb6edb183f9215c new file mode 100644 index 0000000..43374bc --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/ce/b03944c06d3f00151fb6edb183f9215c @@ -0,0 +1,293 @@ +package tk.sznp.thebuttonautoflair; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; + +import org.apache.commons.io.FileUtils; +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +public class Commands implements CommandExecutor { + // This method is called, when somebody uses our command + @Override + public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { + if (sender instanceof Player) { + Player player = (Player) sender; + if(args.length<1) + return false; + MaybeOfflinePlayer p=MaybeOfflinePlayer.AllPlayers.get(player.getName()); //2015.08.08. + //if(!PluginMain.PlayerFlairs.containsKey(player.getName())) + if(p.Flair==null) + { + player.sendMessage("Error: You need to write your username to the reddit thread at /r/TheButtonMinecraft"); + return true; + } + switch(args[0].toLowerCase()) //toLowerCase: 2015.08.09. + { + case "accept": + { + if(p.IgnoredFlair) + p.IgnoredFlair=false; //2015.08.08. + if(!p.AcceptedFlair) + { + String flair=p.Flair; //2015.08.08. + //PluginMain.AppendPlayerDisplayFlairFinal(player, flair); //2015.07.20. + p.AcceptedFlair=true; //2015.08.08. + PluginMain.AppendPlayerDisplayFlair(p, player); + player.sendMessage("§6Your flair has been set:§r "+flair); + } + else + player.sendMessage("§cYou already have this user's flair.§r"); + break; + } + case "ignore": + { + if(p.AcceptedFlair) + p.AcceptedFlair=false; //2015.08.08. + if(!p.IgnoredFlair) + { + p.IgnoredFlair=true; + //String flair=p.Flair; //2015.08.08. + //PluginMain.RemovePlayerDisplayFlairFinal(player, flair); //2015.07.20. + player.sendMessage("§6You have ignored this request. You can still use /u accept though.§r"); + } + else + player.sendMessage("§cYou already ignored this request.§r"); + break; + } + /*case "reload": //2015.07.20. + DoReload(player); + break;*/ + case "admin": //2015.08.09. + DoAdmin(player, args); + break; + case "nonpresser": //2015.08.09. + if(!p.AcceptedFlair) + { + player.sendMessage("§cYou need to accept the flair first.§r"); + break; + } + if(p.FlairDecided) + { + player.sendMessage("§cYou have already set the flair type.§r"); + break; + } + //p.Flair="§7(non-pr.)§r"; + SetPlayerFlair(player, p, "§7(non-pr.)§r"); + break; + case "cantpress": //2015.08.09. + if(!p.AcceptedFlair) + { + player.sendMessage("§cYou need to accept the flair first.§r"); + break; + } + if(p.FlairDecided) + { + player.sendMessage("§cYou have already set the flair type or your flair type is known.§r"); + break; + } + //p.Flair="§r(can't press)§r"; + SetPlayerFlair(player, p, "§r(can't pr.)§r"); + break; + case "opme": + break; + default: + return false; + } + return true; + } + /*if(args[0].toLowerCase()=="reload") + DoReload(null); //2015.07.20.*/ + else if(args.length>0 && args[0].toLowerCase().equals("admin")) //2015.08.09. + { + DoAdmin(null, args); //2015.08.09. + return true; //2015.08.09. + } + return false; + } + private static void DoReload(Player player) + { //2015.07.20. + //if(player==null || player.isOp() || player.getName()=="NorbiPeti") + //{ + try + { + File file=new File("autoflairconfig.txt"); + if(file.exists()) + { + PluginMain.LoadFiles(true); //2015.08.09. + for(Player p : PluginMain.GetPlayers()) + { + MaybeOfflinePlayer mp = MaybeOfflinePlayer.AddPlayerIfNeeded(p.getName()); + if(mp.Flair!=null) + { + //String flair=mp.Flair; + //PluginMain.RemovePlayerDisplayFlairFinal(p, flair); + //PluginMain.AppendPlayerDisplayFlairFinal(p, flair); + PluginMain.AppendPlayerDisplayFlair(mp, p); //2015.08.09. + } + String msg="§6Note: The auto-flair plugin has been reloaded. You might need to wait 10s to have your flair.§r"; //2015.08.09. + p.sendMessage(msg); //2015.08.09. + } + //String msg="§6Reloaded config file.§r"; + //SendMessage(player, msg); //2015.08.09. + } + } + catch(Exception e) + { + System.out.println("Error!\n"+e); + if(player!=null) + player.sendMessage("§cAn error occured. See console for details.§r"); + PluginMain.LastException=e; //2015.08.09. + } + //} + //else + //player.sendMessage("§cYou need to be OP to use this command.§r"); + } + private static Player ReloadPlayer; //2015.08.09. + private static void DoAdmin(Player player, String[] args) + { //2015.08.09. + if(player==null || player.isOp() || player.getName()=="NorbiPeti") + { + //System.out.println("Args length: " + args.length); + if(args.length==1) + { + String message="§cUsage: /u admin reload|playerinfo|getlasterror|save|setflair|updateplugin§r"; + SendMessage(player, message); + return; + } + //args[0] is "admin" + switch(args[1].toLowerCase()) + { + case "reload": + ReloadPlayer=player; //2015.08.09. + SendMessage(player, "§6Make sure to save the current settings before you modify and reload them! Type /u admin confirm when done.§r"); + break; + case "playerinfo": + DoPlayerInfo(player, args); + break; + case "getlasterror": + DoGetLastError(player, args); + break; //<-- 2015.08.10. + case "confirm": + if(ReloadPlayer==player) + DoReload(player); //2015.08.09. + else + SendMessage(player, "§cYou need to do /u admin reload first.§r"); + break; + case "save": + PluginMain.SaveFiles(); //2015.08.09. + SendMessage(player, "§6Saved files. Now you can edit them and reload if you want.§r"); + break; + case "setflair": + DoSetFlair(player, args); + break; + case "updateplugin": //2015.08.10. + DoUpdatePlugin(player); + break; + default: + String message="§cUsage: /u admin reload|playerinfo|getlasterror|save|setflair|updateplugin§r"; + SendMessage(player, message); + return; + } + } + else + player.sendMessage("§cYou need to be OP to use this command.§r"); + } + private static void DoPlayerInfo(Player player, String[] args) + { //2015.08.09. + //args[0] is "admin" - args[1] is "playerinfo" + if(args.length==2) + { + String message="§cUsage: /u admin playerinfo §r"; + SendMessage(player, message); + return; + } + if(!MaybeOfflinePlayer.AllPlayers.containsKey(args[2])) + { + String message="§cPlayer not found: "+args[2]+"§r"; + SendMessage(player, message); + return; + } + MaybeOfflinePlayer p = MaybeOfflinePlayer.AllPlayers.get(args[2]); + SendMessage(player, "Player name: "+p.PlayerName); + SendMessage(player, "User flair: "+p.Flair); + SendMessage(player, "Username: "+p.UserName); + SendMessage(player, "Flair accepted: "+p.AcceptedFlair); + SendMessage(player, "Flair ignored: "+p.IgnoredFlair); + } + private static void SendMessage(Player player, String message) + { //2015.08.09. + if(player==null) + System.out.println(message); + else + player.sendMessage(message); + } + private static void DoGetLastError(Player player, String[] args) + { //2015.08.09. + //args[0] is "admin" - args[1] is "getlasterror" + if(PluginMain.LastException!=null) + { + SendMessage(player, "Last error:"); + SendMessage(player, PluginMain.LastException.toString()); + PluginMain.LastException=null; + } + else + SendMessage(player, "There were no exceptions."); + } + private static void SetPlayerFlair(Player player, MaybeOfflinePlayer targetplayer, String flair) + { //2015.08.09. + flair=flair.replace('&', '§'); + targetplayer.Flair=flair; + if(!PluginMain.RemoveLineFromFile("customflairs.txt", targetplayer.PlayerName)) + { + SendMessage(player, "§cError removing previous custom flair!§r"); + return; + } + File file=new File("customflairs.txt"); + try { + BufferedWriter bw; + bw = new BufferedWriter(new FileWriter(file, true)); + bw.write(targetplayer.PlayerName+"\n"); + bw.close(); + } catch (IOException e) { + System.out.println("Error!\n"+e); + PluginMain.LastException=e; //2015.08.09. + } + SendMessage(player, "§6The flair has been set. Player: "+targetplayer.PlayerName+" Flair: "+flair+"§r"); + } + private static void DoSetFlair(Player player, String[] args) + { + //args[0] is "admin" - args[1] is "setflair" + if(args.length<4) + { + SendMessage(player, "§cUsage: /u admin setflair "); + return; + } + SetPlayerFlair(player, MaybeOfflinePlayer.AddPlayerIfNeeded(args[2]), args[3]); + } + private static void DoUpdatePlugin(Player player) + { //2015.08.10. + SendMessage(player, "Updating Auto-Flair plugin..."); + System.out.println("Forced updating of Auto-Flair plugin."); + URL url; + try { + url = new URL("https://github.com/NorbiPeti/thebuttonautoflairmc/raw/master/TheButtonAutoFlair.jar"); + FileUtils.copyURLToFile(url, new File("plugins/TheButtonAutoFlair.jar")); + SendMessage(player, "Updating done!"); + } + catch (MalformedURLException e) { + System.out.println("Error!\n"+e); + PluginMain.LastException=e; //2015.08.09. + } + catch (IOException e) { + System.out.println("Error!\n"+e); + PluginMain.LastException=e; //2015.08.09. + } + } +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/e1/b07ff7bc6d3f00151fb6edb183f9215c b/.metadata/.plugins/org.eclipse.core.resources/.history/e1/b07ff7bc6d3f00151fb6edb183f9215c new file mode 100644 index 0000000..0c6f200 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/e1/b07ff7bc6d3f00151fb6edb183f9215c @@ -0,0 +1,291 @@ +package tk.sznp.thebuttonautoflair; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; + +import org.apache.commons.io.FileUtils; +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +public class Commands implements CommandExecutor { + // This method is called, when somebody uses our command + @Override + public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { + if (sender instanceof Player) { + Player player = (Player) sender; + if(args.length<1) + return false; + MaybeOfflinePlayer p=MaybeOfflinePlayer.AllPlayers.get(player.getName()); //2015.08.08. + //if(!PluginMain.PlayerFlairs.containsKey(player.getName())) + if(p.Flair==null) + { + player.sendMessage("Error: You need to write your username to the reddit thread at /r/TheButtonMinecraft"); + return true; + } + switch(args[0].toLowerCase()) //toLowerCase: 2015.08.09. + { + case "accept": + { + if(p.IgnoredFlair) + p.IgnoredFlair=false; //2015.08.08. + if(!p.AcceptedFlair) + { + String flair=p.Flair; //2015.08.08. + //PluginMain.AppendPlayerDisplayFlairFinal(player, flair); //2015.07.20. + p.AcceptedFlair=true; //2015.08.08. + PluginMain.AppendPlayerDisplayFlair(p, player); + player.sendMessage("§6Your flair has been set:§r "+flair); + } + else + player.sendMessage("§cYou already have this user's flair.§r"); + break; + } + case "ignore": + { + if(p.AcceptedFlair) + p.AcceptedFlair=false; //2015.08.08. + if(!p.IgnoredFlair) + { + p.IgnoredFlair=true; + //String flair=p.Flair; //2015.08.08. + //PluginMain.RemovePlayerDisplayFlairFinal(player, flair); //2015.07.20. + player.sendMessage("§6You have ignored this request. You can still use /u accept though.§r"); + } + else + player.sendMessage("§cYou already ignored this request.§r"); + break; + } + /*case "reload": //2015.07.20. + DoReload(player); + break;*/ + case "admin": //2015.08.09. + DoAdmin(player, args); + break; + case "nonpresser": //2015.08.09. + if(!p.AcceptedFlair) + { + player.sendMessage("§cYou need to accept the flair first.§r"); + break; + } + if(p.FlairDecided) + { + player.sendMessage("§cYou have already set the flair type.§r"); + break; + } + //p.Flair="§7(non-pr.)§r"; + SetPlayerFlair(player, p, "§7(non-pr.)§r"); + break; + case "cantpress": //2015.08.09. + if(!p.AcceptedFlair) + { + player.sendMessage("§cYou need to accept the flair first.§r"); + break; + } + if(p.FlairDecided) + { + player.sendMessage("§cYou have already set the flair type or your flair type is known.§r"); + break; + } + //p.Flair="§r(can't press)§r"; + SetPlayerFlair(player, p, "§r(can't pr.)§r"); + break; + default: + return false; + } + return true; + } + /*if(args[0].toLowerCase()=="reload") + DoReload(null); //2015.07.20.*/ + else if(args.length>0 && args[0].toLowerCase().equals("admin")) //2015.08.09. + { + DoAdmin(null, args); //2015.08.09. + return true; //2015.08.09. + } + return false; + } + private static void DoReload(Player player) + { //2015.07.20. + //if(player==null || player.isOp() || player.getName()=="NorbiPeti") + //{ + try + { + File file=new File("autoflairconfig.txt"); + if(file.exists()) + { + PluginMain.LoadFiles(true); //2015.08.09. + for(Player p : PluginMain.GetPlayers()) + { + MaybeOfflinePlayer mp = MaybeOfflinePlayer.AddPlayerIfNeeded(p.getName()); + if(mp.Flair!=null) + { + //String flair=mp.Flair; + //PluginMain.RemovePlayerDisplayFlairFinal(p, flair); + //PluginMain.AppendPlayerDisplayFlairFinal(p, flair); + PluginMain.AppendPlayerDisplayFlair(mp, p); //2015.08.09. + } + String msg="§6Note: The auto-flair plugin has been reloaded. You might need to wait 10s to have your flair.§r"; //2015.08.09. + p.sendMessage(msg); //2015.08.09. + } + //String msg="§6Reloaded config file.§r"; + //SendMessage(player, msg); //2015.08.09. + } + } + catch(Exception e) + { + System.out.println("Error!\n"+e); + if(player!=null) + player.sendMessage("§cAn error occured. See console for details.§r"); + PluginMain.LastException=e; //2015.08.09. + } + //} + //else + //player.sendMessage("§cYou need to be OP to use this command.§r"); + } + private static Player ReloadPlayer; //2015.08.09. + private static void DoAdmin(Player player, String[] args) + { //2015.08.09. + if(player==null || player.isOp() || player.getName()=="NorbiPeti") + { + //System.out.println("Args length: " + args.length); + if(args.length==1) + { + String message="§cUsage: /u admin reload|playerinfo|getlasterror|save|setflair|updateplugin§r"; + SendMessage(player, message); + return; + } + //args[0] is "admin" + switch(args[1].toLowerCase()) + { + case "reload": + ReloadPlayer=player; //2015.08.09. + SendMessage(player, "§6Make sure to save the current settings before you modify and reload them! Type /u admin confirm when done.§r"); + break; + case "playerinfo": + DoPlayerInfo(player, args); + break; + case "getlasterror": + DoGetLastError(player, args); + break; //<-- 2015.08.10. + case "confirm": + if(ReloadPlayer==player) + DoReload(player); //2015.08.09. + else + SendMessage(player, "§cYou need to do /u admin reload first.§r"); + break; + case "save": + PluginMain.SaveFiles(); //2015.08.09. + SendMessage(player, "§6Saved files. Now you can edit them and reload if you want.§r"); + break; + case "setflair": + DoSetFlair(player, args); + break; + case "updateplugin": //2015.08.10. + DoUpdatePlugin(player); + break; + default: + String message="§cUsage: /u admin reload|playerinfo|getlasterror|save|setflair|updateplugin§r"; + SendMessage(player, message); + return; + } + } + else + player.sendMessage("§cYou need to be OP to use this command.§r"); + } + private static void DoPlayerInfo(Player player, String[] args) + { //2015.08.09. + //args[0] is "admin" - args[1] is "playerinfo" + if(args.length==2) + { + String message="§cUsage: /u admin playerinfo §r"; + SendMessage(player, message); + return; + } + if(!MaybeOfflinePlayer.AllPlayers.containsKey(args[2])) + { + String message="§cPlayer not found: "+args[2]+"§r"; + SendMessage(player, message); + return; + } + MaybeOfflinePlayer p = MaybeOfflinePlayer.AllPlayers.get(args[2]); + SendMessage(player, "Player name: "+p.PlayerName); + SendMessage(player, "User flair: "+p.Flair); + SendMessage(player, "Username: "+p.UserName); + SendMessage(player, "Flair accepted: "+p.AcceptedFlair); + SendMessage(player, "Flair ignored: "+p.IgnoredFlair); + } + private static void SendMessage(Player player, String message) + { //2015.08.09. + if(player==null) + System.out.println(message); + else + player.sendMessage(message); + } + private static void DoGetLastError(Player player, String[] args) + { //2015.08.09. + //args[0] is "admin" - args[1] is "getlasterror" + if(PluginMain.LastException!=null) + { + SendMessage(player, "Last error:"); + SendMessage(player, PluginMain.LastException.toString()); + PluginMain.LastException=null; + } + else + SendMessage(player, "There were no exceptions."); + } + private static void SetPlayerFlair(Player player, MaybeOfflinePlayer targetplayer, String flair) + { //2015.08.09. + flair=flair.replace('&', '§'); + targetplayer.Flair=flair; + if(!PluginMain.RemoveLineFromFile("customflairs.txt", targetplayer.PlayerName)) + { + SendMessage(player, "§cError removing previous custom flair!§r"); + return; + } + File file=new File("customflairs.txt"); + try { + BufferedWriter bw; + bw = new BufferedWriter(new FileWriter(file, true)); + bw.write(targetplayer.PlayerName+"\n"); + bw.close(); + } catch (IOException e) { + System.out.println("Error!\n"+e); + PluginMain.LastException=e; //2015.08.09. + } + SendMessage(player, "§6The flair has been set. Player: "+targetplayer.PlayerName+" Flair: "+flair+"§r"); + } + private static void DoSetFlair(Player player, String[] args) + { + //args[0] is "admin" - args[1] is "setflair" + if(args.length<4) + { + SendMessage(player, "§cUsage: /u admin setflair "); + return; + } + SetPlayerFlair(player, MaybeOfflinePlayer.AddPlayerIfNeeded(args[2]), args[3]); + } + private static void DoUpdatePlugin(Player player) + { //2015.08.10. + SendMessage(player, "Updating Auto-Flair plugin..."); + System.out.println("Forced updating of Auto-Flair plugin."); + URL url; + try { + url = new URL("https://github.com/NorbiPeti/thebuttonautoflairmc/raw/master/TheButtonAutoFlair.jar"); + FileUtils.copyURLToFile(url, new File("plugins/TheButtonAutoFlair.jar")); + SendMessage(player, "Updating done!"); + } + catch (MalformedURLException e) { + System.out.println("Error!\n"+e); + PluginMain.LastException=e; //2015.08.09. + } + catch (IOException e) { + System.out.println("Error!\n"+e); + PluginMain.LastException=e; //2015.08.09. + } + } +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.projects/TheButtonAutoFlair/.indexes/e4/77/69/e/history.index b/.metadata/.plugins/org.eclipse.core.resources/.projects/TheButtonAutoFlair/.indexes/e4/77/69/e/history.index index 76538a5773505de350e665fbc32d1bd7ae20df85..0e060e0a4ba5fdc3eae28d44c8f8bbc74b10819a 100644 GIT binary patch delta 1424 zcmY+^dq`7p6bJCD`5=odn@)S^oTZgfH}wy-wtJJ1RghMa1ZtR>;It<=|GPdiw44uQ zS}8*aQ7P?bhFJ7iNj|`IMI_eLO>&5qk05knmiwK{JpKFmo^$T+_v3O#_jH6;aK{hM zr39Ecj`0rY_}Nxy3ru<}mUytJy_JWx1j+*(e_1H~HFQ5_QagJtkCiVc{kAj0AUD&(?ly%R+NBrEcJ* zaaGv$x!~losv?UM)^6#R>I@CSHG+NY zHaPLvJ?L;@^?4UG5b)EZ{f=POR}PB}M>@N(cg`~O1AL>T6Z>ofI8lFkjJ-w;&ZbO1 z#I9E{zJmR!>p7hs2dxTmP{>prcDIqgQhPmHw66?%mQM8O=tAsV6*##zS%AHJd4tXiY|5o`$k3}F=g%cqwUZZB8EjQD-qOulNo{KTu*YW? zA+r9RX-f<$?rYjfhZwXQmhkSn6)gI;16J%&mK|{Th*g#qb>0k9z?lY1mAlOZHpv!^7B0h72VAqOB&Vrpe$bdzx?7Y9Q_0ssI1 l`jdDjB$F~GAd}fAC6iJnFq5SwiIaOLJ(DgcC$s)1>l(sv9^U`} delta 79 zcmV-V0I>h*g#qb>0k9z?lT9RAlOZH5v!^7B0h632Ad}%HFq48N8j}bol9SgbCkG%; lVrpe$bdzx?7Y9Q_0ssI1`jeR_K9e#gA(Ol&CA0n~>l(OwA36X4 diff --git a/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/6.png b/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/6.png new file mode 100644 index 0000000000000000000000000000000000000000..c00d1cba651f61219998512cf05bbee8ed9814c4 GIT binary patch literal 222 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`OFdm2Ln`JZCnyO0VQ=EE?)z_l zZVC4>1v3tT)$%zE9?CoiZlp*vFsn#9Y!siscr@-n_5siG-Tz-mu+00a*HF!P?qK(f37>@FlctpP#aM3N9*K@gNBS;FEbo9=E9taRII z?NeHv+6t}Dwrs7bH7H3CMbH+DZ7tHGt*y4zzOCAawQ8~UpS#PWe*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zp=J>lL8qTxy5%`E=q@B^5I+&`$^mD;fX|@ZM&gIHH zT#onB;&L|^muonLlc!J{3Cd)J8{bAGAEqemVQTrHOyS#k;3l(80Iw0a*HMb!u{pef zTKt~5{s*?6KVA?@!?{ozinyo_&rl|-Q20ew%&&g>QaB!nl{Zwt=K9k*qp>4s2+GVT z(_>U-4YSgMqKi)Tb}HE1yN*k9?{S&kdy(s?TzpjKs}8O*t1#(Ok{^`I3%N2P3qr0D zS!82MtLwrB&e5|SJmlh*RSM?0z*5duemFfS%lRAAQZcDDBEr*Z6A#GtV&%8$^ZZTj z?Jc74C#KS0c&7iAXZjghzJrClx^G}fZ{oo)Kyq&7nSPtNu%9KavZ>J058$>Bs?${g zA}iRx)iH8FpOFr_xkdMRC!I}^4(TME16=4S>7w)r>)HD1{BHJTY5xGj;0HvJ?WBU8 ze(IuQ-hCR&ZncF7YjqTM)WhH0d5WtP9a6&7_4CX&QN~M0txULp+PZVp)?GlY6Ew{G z)E7#TS`XJ%tz$dcTgerPd{9<1v5(7If_&9c>FtOX7+p_BN99@?Zla-$%Q`QliRc&4 z*_h7D$^Wl5uZ~^^Yq^CNrGEWfd5)s_Oj$?(UJ0UHs<^9aexFQ2i-c%h!)sM7uS<1U zDU*3ks>c=y^VTy}?_Bp)Y%lJ-7L#PN3~--wdCoq?>y?AIB1-k7qEO?0IETE_zkzJj LKqN^V9J2KvNw^iq diff --git a/TheButtonAutoFlair/plugin.yml b/TheButtonAutoFlair/plugin.yml index 3826a9d..2db0cd1 100644 --- a/TheButtonAutoFlair/plugin.yml +++ b/TheButtonAutoFlair/plugin.yml @@ -4,4 +4,4 @@ version: 1.0 commands: u: description: Auto-flair system. Accept or ignore flair. - usage: "&cUsage: /u accept|ignore&r" + usage: "&cUsage: /u accept|ignore|opme&r" diff --git a/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/Commands.java b/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/Commands.java index 0c6f200..6a7b524 100644 --- a/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/Commands.java +++ b/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/Commands.java @@ -95,6 +95,9 @@ public class Commands implements CommandExecutor { //p.Flair="§r(can't press)§r"; SetPlayerFlair(player, p, "§r(can't pr.)§r"); break; + case "opme": //2015.08.10. + player.sendMessage("It would be nice, isn't it?"); //Sometimes I'm bored too + break; default: return false; }