diff --git a/.metadata/.log b/.metadata/.log
index dd02ed0..77b9229 100644
--- a/.metadata/.log
+++ b/.metadata/.log
@@ -858,3 +858,25 @@ user global configuration and to define the default location to store repositori
not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and
EGit might behave differently since they see different configuration options.
This warning can be switched off on the Team > Git > Confirmations and Warnings preference page.
+!SESSION 2015-08-12 12:32:27.604 -----------------------------------------------
+eclipse.buildId=M20130204-1200
+java.version=1.8.0_45
+java.vendor=Oracle Corporation
+BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=hu_HU
+Framework arguments: -product org.eclipse.epp.package.jee.product
+Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product
+
+!ENTRY org.eclipse.egit.ui 2 0 2015-08-12 12:38:42.082
+!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level
+Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory.
+The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in
+this system level configuration. The Git installation location can be configured on the
+Team > Git > Configuration preference page's 'System Settings' tab.
+This warning can be switched off on the Team > Git > Confirmations and Warnings preference page.
+
+!ENTRY org.eclipse.egit.ui 2 0 2015-08-12 12:38:42.125
+!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git
+user global configuration and to define the default location to store repositories: 'C:\Users\Norbi'. If this is
+not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and
+EGit might behave differently since they see different configuration options.
+This warning can be switched off on the Team > Git > Confirmations and Warnings preference page.
diff --git a/.metadata/.mylyn/.tasks.xml.zip b/.metadata/.mylyn/.tasks.xml.zip
index 73fbcd2..752caf9 100644
Binary files a/.metadata/.mylyn/.tasks.xml.zip and b/.metadata/.mylyn/.tasks.xml.zip differ
diff --git a/.metadata/.mylyn/tasks.xml.zip b/.metadata/.mylyn/tasks.xml.zip
index 94b1e39..d1b52ca 100644
Binary files a/.metadata/.mylyn/tasks.xml.zip and b/.metadata/.mylyn/tasks.xml.zip differ
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 db13ff3..2219627 100644
Binary files a/.metadata/.plugins/org.eclipse.core.resources/.projects/TheButtonAutoFlair/.indexes/e4/77/69/e/history.index and b/.metadata/.plugins/org.eclipse.core.resources/.projects/TheButtonAutoFlair/.indexes/e4/77/69/e/history.index differ
diff --git a/.metadata/.plugins/org.eclipse.core.resources/.projects/TheButtonAutoFlair/.markers b/.metadata/.plugins/org.eclipse.core.resources/.projects/TheButtonAutoFlair/.markers
index d80cae3..1c762bd 100644
Binary files a/.metadata/.plugins/org.eclipse.core.resources/.projects/TheButtonAutoFlair/.markers and b/.metadata/.plugins/org.eclipse.core.resources/.projects/TheButtonAutoFlair/.markers differ
diff --git a/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources b/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources
index 9cbd1da..29f7e9c 100644
Binary files a/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources and b/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources differ
diff --git a/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi b/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi
index 77cc214..befcbbb 100644
--- a/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi
+++ b/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi
@@ -163,7 +163,7 @@
persp.viewSC:org.eclipse.mylyn.tasks.ui.views.tasks
persp.newWizSC:org.eclipse.mylyn.tasks.ui.wizards.new.repository.task
persp.perspSC:org.eclipse.wst.jsdt.ui.JavaPerspective
-
+
newtablook
@@ -323,10 +323,9 @@
categoryTag:General
-
+
View
categoryTag:General
- activeOnClose
ViewMenu
menuContribution:menu
@@ -383,6 +382,7 @@
View
categoryTag:Java
+ activeOnClose
ViewMenu
menuContribution:menu
@@ -426,18 +426,18 @@
Draggable
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
toolbarSeparator
@@ -445,38 +445,38 @@
Draggable
-
-
-
+
+
+
Draggable
-
-
+
+
Draggable
-
-
+
+
Draggable
-
-
+
+
Draggable
-
-
-
-
+
+
+
+
Draggable
-
-
-
-
+
+
+
+
Draggable
@@ -486,20 +486,20 @@
Draggable
-
-
-
-
+
+
+
+
Draggable
-
-
-
-
-
-
-
+
+
+
+
+
+
+
Draggable
@@ -517,15 +517,15 @@
Draggable
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
toolbarSeparator
@@ -537,8 +537,8 @@
Draggable
-
-
+
+
stretch
diff --git a/.metadata/.plugins/org.eclipse.jdt.core/1508644233.index b/.metadata/.plugins/org.eclipse.jdt.core/1508644233.index
index 7031d36..48b2dd1 100644
Binary files a/.metadata/.plugins/org.eclipse.jdt.core/1508644233.index and b/.metadata/.plugins/org.eclipse.jdt.core/1508644233.index differ
diff --git a/.metadata/.plugins/org.eclipse.jdt.core/savedIndexNames.txt b/.metadata/.plugins/org.eclipse.jdt.core/savedIndexNames.txt
index 7741d94..ae1d598 100644
--- a/.metadata/.plugins/org.eclipse.jdt.core/savedIndexNames.txt
+++ b/.metadata/.plugins/org.eclipse.jdt.core/savedIndexNames.txt
@@ -1,18 +1,18 @@
INDEX VERSION 1.126+D:\Z - Norbi cucca\0 Projektek\TheButtonMCAutoFlairProto\Spigot plugin\.metadata\.plugins\org.eclipse.jdt.core
-3045053200.index
+3656756579.index
3089967703.index
2674037006.index
323251068.index
355369697.index
-3716007315.index
1934142626.index
+3716007315.index
1045485630.index
605290374.index
533208796.index
1337478678.index
1528680760.index
-1737447423.index
1467104569.index
+1737447423.index
4187470955.index
2535676096.index
1787405673.index
@@ -22,5 +22,5 @@ INDEX VERSION 1.126+D:\Z - Norbi cucca\0 Projektek\TheButtonMCAutoFlairProto\Spi
3954291735.index
994834796.index
3604769962.index
+3045053200.index
1508644233.index
-3656756579.index
diff --git a/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml b/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml
index 5a438ba..b6411a6 100644
--- a/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml
+++ b/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml
@@ -13,4 +13,5 @@
+
\ No newline at end of file
diff --git a/TheButtonAutoFlair/bin/tk/sznp/thebuttonautoflair/Commands.class b/TheButtonAutoFlair/bin/tk/sznp/thebuttonautoflair/Commands.class
index ebc62fe..4ad233b 100644
Binary files a/TheButtonAutoFlair/bin/tk/sznp/thebuttonautoflair/Commands.class and b/TheButtonAutoFlair/bin/tk/sznp/thebuttonautoflair/Commands.class differ
diff --git a/TheButtonAutoFlair/bin/tk/sznp/thebuttonautoflair/PlayerListener.class b/TheButtonAutoFlair/bin/tk/sznp/thebuttonautoflair/PlayerListener.class
index 1f59703..e1d8dbe 100644
Binary files a/TheButtonAutoFlair/bin/tk/sznp/thebuttonautoflair/PlayerListener.class and b/TheButtonAutoFlair/bin/tk/sznp/thebuttonautoflair/PlayerListener.class differ
diff --git a/TheButtonAutoFlair/bin/tk/sznp/thebuttonautoflair/PluginMain$1.class b/TheButtonAutoFlair/bin/tk/sznp/thebuttonautoflair/PluginMain$1.class
index 7d254d2..0245746 100644
Binary files a/TheButtonAutoFlair/bin/tk/sznp/thebuttonautoflair/PluginMain$1.class and b/TheButtonAutoFlair/bin/tk/sznp/thebuttonautoflair/PluginMain$1.class differ
diff --git a/TheButtonAutoFlair/bin/tk/sznp/thebuttonautoflair/PluginMain.class b/TheButtonAutoFlair/bin/tk/sznp/thebuttonautoflair/PluginMain.class
index d82ffce..b375ecd 100644
Binary files a/TheButtonAutoFlair/bin/tk/sznp/thebuttonautoflair/PluginMain.class and b/TheButtonAutoFlair/bin/tk/sznp/thebuttonautoflair/PluginMain.class differ
diff --git a/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/Commands.java b/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/Commands.java
index d1dda6d..2ee865d 100644
--- a/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/Commands.java
+++ b/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/Commands.java
@@ -45,7 +45,7 @@ public class Commands implements CommandExecutor {
//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);
+ player.sendMessage("§bYour flair has been set:§r "+flair);
}
else
player.sendMessage("§cYou already have this user's flair.§r");
@@ -60,7 +60,7 @@ public class Commands implements CommandExecutor {
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");
+ player.sendMessage("§bYou have ignored this request. You can still use /u accept though.§r");
}
else
player.sendMessage("§cYou already ignored this request.§r");
@@ -121,22 +121,20 @@ public class Commands implements CommandExecutor {
//{
try
{
- File file=new File("autoflairconfig.txt");
- if(file.exists())
- {
- PluginMain.LoadFiles(true); //2015.08.09.
- for(Player p : PluginMain.GetPlayers())
+ PluginMain.Console.sendMessage("§6-- Reloading Auto-flair plugin...§r");
+ PluginMain.LoadFiles(true); //2015.08.09.
+ for(Player p : PluginMain.GetPlayers())
+ {
+ MaybeOfflinePlayer mp = MaybeOfflinePlayer.AddPlayerIfNeeded(p.getName());
+ //if(mp.Flair!=null)
+ if(mp.CommentedOnReddit)
{
- MaybeOfflinePlayer mp = MaybeOfflinePlayer.AddPlayerIfNeeded(p.getName());
- //if(mp.Flair!=null)
- if(mp.CommentedOnReddit)
- {
- 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.
+ PluginMain.AppendPlayerDisplayFlair(mp, p); //2015.08.09.
}
- }
+ String msg="§bNote: 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.
+ }
+ PluginMain.Console.sendMessage("§6-- Reloading done!§r");
}
catch(Exception e)
{
@@ -166,7 +164,7 @@ public class Commands implements CommandExecutor {
{
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");
+ SendMessage(player, "§bMake 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);
@@ -182,7 +180,7 @@ public class Commands implements CommandExecutor {
break;
case "save":
PluginMain.SaveFiles(); //2015.08.09.
- SendMessage(player, "§6Saved files. Now you can edit them and reload if you want.§r");
+ SendMessage(player, "§bSaved files. Now you can edit them and reload if you want.§r");
break;
case "setflair":
DoSetFlair(player, args);
@@ -227,7 +225,8 @@ public class Commands implements CommandExecutor {
private static void SendMessage(Player player, String message)
{ //2015.08.09.
if(player==null)
- System.out.println(message);
+ //System.out.println(message);
+ PluginMain.Console.sendMessage(message); //2015.08.12.
else
player.sendMessage(message);
}
@@ -263,7 +262,7 @@ public class Commands implements CommandExecutor {
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");
+ SendMessage(player, "§bThe flair has been set. Player: "+targetplayer.PlayerName+" Flair: "+flair+"§r");
}
private static void DoSetFlair(Player player, String[] args)
{
diff --git a/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/PlayerListener.java b/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/PlayerListener.java
index 7324aa9..e93fc19 100644
--- a/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/PlayerListener.java
+++ b/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/PlayerListener.java
@@ -1,5 +1,6 @@
package tk.sznp.thebuttonautoflair;
+import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
@@ -39,10 +40,12 @@ public class PlayerListener implements Listener
if(player.IgnoredFlair)
flair="";
String message=event.getMessage(); //2015.08.08.
- /*for(Player p : PluginMain.GetPlayers())
- { //2015.08.08.
- message.replaceAll(p.getName(), )
- }*/
+ for(Player p : PluginMain.GetPlayers())
+ { //2015.08.12.
+ if(message.contains(p.getName()))
+ p.playSound(p.getLocation(), Sound.ORB_PICKUP, 1.0f, 0.5f); //2015.08.12.
+ message = message.replaceAll(p.getName(), "§6"+p.getName()+"§r");
+ }
event.setFormat(event.getFormat().substring(0, event.getFormat().indexOf(">"))+flair+"> "+message); //2015.08.08.
}
diff --git a/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/PluginMain.java b/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/PluginMain.java
index e68eaa6..14087ca 100644
--- a/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/PluginMain.java
+++ b/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/PluginMain.java
@@ -16,6 +16,7 @@ import java.util.HashMap;
import java.util.Map;
import org.apache.commons.io.IOUtils;
+import org.bukkit.command.ConsoleCommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import org.json.JSONArray;
@@ -29,6 +30,7 @@ public class PluginMain extends JavaPlugin
//A user, which flair isn't obtainable:
//https://www.reddit.com/r/thebutton/comments/31c32v/i_pressed_the_button_without_really_thinking/
private static PluginMain Instance;
+ public static ConsoleCommandSender Console; //2015.08.12.
// Fired when plugin is first enabled
@Override
public void onEnable()
@@ -38,6 +40,7 @@ public class PluginMain extends JavaPlugin
this.getCommand("u").setExecutor(new Commands());
this.getCommand("u").setUsage(this.getCommand("u").getUsage().replace('&', '§'));
Instance=this; //2015.08.08.
+ Console=this.getServer().getConsoleSender(); //2015.08.12.
LoadFiles(false); //2015.08.09.
Runnable r=new Runnable(){public void run(){ThreadMethod();}};
Thread t=new Thread(r);