diff --git a/.metadata/.log b/.metadata/.log
index 75d9c6c..b369e0f 100644
--- a/.metadata/.log
+++ b/.metadata/.log
@@ -1555,3 +1555,91 @@ 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-09-05 20:05:26.954 -----------------------------------------------
+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-09-05 20:06:04.350
+!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-09-05 20:06:04.444
+!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.
+!SESSION 2015-09-05 22:11:43.331 -----------------------------------------------
+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-09-05 22:12:41.008
+!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-09-05 22:12:41.084
+!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.
+!SESSION 2015-09-06 18:49:03.989 -----------------------------------------------
+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-09-06 18:49:40.216
+!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-09-06 18:49:40.334
+!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.
+!SESSION 2015-09-08 20:18:08.446 -----------------------------------------------
+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-09-08 20:18:46.444
+!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-09-08 20:18:46.484
+!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 febf5b2..11904c8 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 9f20593..ea52a30 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 2c53ab5..24b9ec4 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/.indexes/history.index b/.metadata/.plugins/org.eclipse.core.resources/.projects/TheButtonAutoFlair/.indexes/history.index
deleted file mode 100644
index 0867e8a..0000000
Binary files a/.metadata/.plugins/org.eclipse.core.resources/.projects/TheButtonAutoFlair/.indexes/history.index and /dev/null differ
diff --git a/.metadata/.plugins/org.eclipse.core.resources/.projects/TheButtonAutoFlair/.markers b/.metadata/.plugins/org.eclipse.core.resources/.projects/TheButtonAutoFlair/.markers
index 22571f3..0c982e8 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 aeebc20..2c4ee38 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 b6ce10a..8b08f03 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
@@ -196,13 +196,13 @@
-
+
newtablook
org.eclipse.e4.secondaryDataStack
-
+
@@ -235,7 +235,7 @@
categoryTag:Help
-
+
newtablook
org.eclipse.e4.primaryDataStack
EditorStack
@@ -246,14 +246,13 @@
removeOnHide
-
+
Editor
org.eclipse.jdt.ui.CompilationUnitEditor
removeOnHide
- activeOnClose
-
+
Editor
org.eclipse.jdt.ui.CompilationUnitEditor
removeOnHide
@@ -329,8 +328,8 @@
View
categoryTag:General
-
-
+
+
View
categoryTag:General
@@ -356,7 +355,7 @@
categoryTag:General
-
+
View
categoryTag:General
@@ -389,6 +388,7 @@
View
categoryTag:Java
+ activeOnClose
ViewMenu
menuContribution:menu
@@ -432,18 +432,18 @@
Draggable
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
toolbarSeparator
@@ -451,38 +451,38 @@
Draggable
-
-
-
+
+
+
Draggable
-
-
+
+
Draggable
-
-
+
+
Draggable
-
-
+
+
Draggable
-
-
-
-
+
+
+
+
Draggable
-
-
-
-
+
+
+
+
Draggable
@@ -492,20 +492,20 @@
Draggable
-
-
-
-
+
+
+
+
Draggable
-
-
-
-
-
-
-
+
+
+
+
+
+
+
Draggable
@@ -523,15 +523,15 @@
Draggable
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
toolbarSeparator
@@ -543,8 +543,8 @@
Draggable
-
-
+
+
stretch
diff --git a/.metadata/.plugins/org.eclipse.jdt.core/1508644233.index b/.metadata/.plugins/org.eclipse.jdt.core/1508644233.index
index 4583e4b..02cb95b 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 9244d53..dabf227 100644
--- a/.metadata/.plugins/org.eclipse.jdt.core/savedIndexNames.txt
+++ b/.metadata/.plugins/org.eclipse.jdt.core/savedIndexNames.txt
@@ -11,8 +11,8 @@ INDEX VERSION 1.126+D:\Z - Norbi cucca\0 Projektek\TheButtonMCAutoFlairProto\Spi
533208796.index
1337478678.index
1528680760.index
-1737447423.index
1467104569.index
+1737447423.index
4187470955.index
2535676096.index
1787405673.index
@@ -21,5 +21,5 @@ INDEX VERSION 1.126+D:\Z - Norbi cucca\0 Projektek\TheButtonMCAutoFlairProto\Spi
3954291735.index
994834796.index
3604769962.index
-1508644233.index
3045053200.index
+1508644233.index
diff --git a/.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml b/.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml
index 933d7bf..1ed3c9f 100644
--- a/.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml
+++ b/.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml
@@ -55,9 +55,9 @@
-
+
diff --git a/.metadata/.plugins/org.eclipse.ui.workbench.texteditor/dialog_settings.xml b/.metadata/.plugins/org.eclipse.ui.workbench.texteditor/dialog_settings.xml
index 4d933b6..f2ebea0 100644
--- a/.metadata/.plugins/org.eclipse.ui.workbench.texteditor/dialog_settings.xml
+++ b/.metadata/.plugins/org.eclipse.ui.workbench.texteditor/dialog_settings.xml
@@ -6,12 +6,13 @@
-
+
+
diff --git a/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml b/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml
index a11aa95..cea0be9 100644
--- a/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml
+++ b/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml
@@ -34,4 +34,8 @@
+
+
+
+
\ No newline at end of file
diff --git a/TheButtonAutoFlair.jar b/TheButtonAutoFlair.jar
index 05a813e..7f7344b 100644
Binary files a/TheButtonAutoFlair.jar and b/TheButtonAutoFlair.jar differ
diff --git a/TheButtonAutoFlair/bin/tk/sznp/thebuttonautoflair/PlayerListener.class b/TheButtonAutoFlair/bin/tk/sznp/thebuttonautoflair/PlayerListener.class
index 30f7142..6b75a1e 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/plugin.yml b/TheButtonAutoFlair/plugin.yml
index 9626fec..53f5fc7 100644
--- a/TheButtonAutoFlair/plugin.yml
+++ b/TheButtonAutoFlair/plugin.yml
@@ -12,4 +12,4 @@ commands:
description: Send message in Out-of-Character
usage: "&cUsage: /ooc &r"
author: NorbiPeti
-depend: [Essentials, Towny]
+depend: [Essentials, Towny, TownyChat]
diff --git a/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/PlayerListener.java b/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/PlayerListener.java
index 2080467..3a9c880 100644
--- a/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/PlayerListener.java
+++ b/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/PlayerListener.java
@@ -14,6 +14,7 @@ import org.bukkit.event.player.PlayerQuitEvent;
import java.io.File;
import java.io.IOException;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.UUID;
@@ -133,6 +134,26 @@ public class PlayerListener implements Listener { // 2015.07.16.
for (Player p : PluginMain.GetPlayers()) { // 2015.08.12.
String color = ""; // 2015.08.17.
if (message.contains(p.getName())) {
+ ArrayList NamePositions = new ArrayList<>();
+ for (String n : nicknames.keySet()) {
+ String nwithoutformatting = new String(n);
+ int index;
+ while ((index = nwithoutformatting.indexOf("§k")) != -1)
+ nwithoutformatting = nwithoutformatting.replaceAll("§k"
+ + nwithoutformatting.charAt(index + 2), ""); // Support
+ // for
+ // one
+ // random
+ // char
+ while ((index = nwithoutformatting.indexOf('§')) != -1)
+ nwithoutformatting = nwithoutformatting.replaceAll("§"
+ + nwithoutformatting.charAt(index + 1), "");
+ /*
+ * if (nwithoutformatting.contains(p.getName())) { HasName =
+ * true; break; }
+ */
+ }
+ // if (!HasName) {
if (NotificationSound == null)
p.playSound(p.getLocation(), Sound.ORB_PICKUP, 1.0f, 0.5f); // 2015.08.12.
else
@@ -142,25 +163,32 @@ public class PlayerListener implements Listener { // 2015.07.16.
.getName()); // 2015.08.17.
if (mp.Flair.length() > 1)
color = mp.Flair.substring(0, 2);
+ // }
}
+ // if (!HasName)
message = message.replaceAll(p.getName(), color + p.getName()
+ "§r");
}
for (String n : nicknames.keySet()) {
Player p = null;
+ //event.getPlayer().sendMessage("n before: " + n); // TMP
String nwithoutformatting = new String(n);
int index;
- // System.out.println("n: " + n);
+ while ((index = nwithoutformatting.indexOf("§k")) != -1)
+ nwithoutformatting = nwithoutformatting.replaceAll("§k"
+ + nwithoutformatting.charAt(index + 2), ""); // Support
+ // for
+ // one
+ // random
+ // char
while ((index = nwithoutformatting.indexOf('§')) != -1)
- // if ((index = nwithoutformatting.indexOf('§')) != -1)
- // {
nwithoutformatting = nwithoutformatting.replaceAll("§"
+ nwithoutformatting.charAt(index + 1), "");
- // System.out.println("Index: "+index+" "+"CharAt(index+1): "+nwithoutformatting.charAt(index+1));
- // }
- // System.out.println("nwithoutformatting: " + nwithoutformatting);
+ //event.getPlayer().sendMessage(nwithoutformatting); // TMP
if (message.contains(nwithoutformatting)) {
+ //event.getPlayer().sendMessage("Yep"); // TMP
+ //event.getPlayer().sendMessage(n); // TMP
p = Bukkit.getPlayer(nicknames.get(n));
if (NotificationSound == null)
p.playSound(p.getLocation(), Sound.ORB_PICKUP, 1.0f, 0.5f); // 2015.08.12.
@@ -170,19 +198,12 @@ public class PlayerListener implements Listener { // 2015.07.16.
MaybeOfflinePlayer.AddPlayerIfNeeded(p.getName()); // 2015.08.17.
}
if (p != null) {
- message = message.replaceAll(nwithoutformatting, n);
+ message = message.replaceAll(nwithoutformatting, n + "§r");
}
}
- /*
- * event.setFormat("<" + (player.RPMode ? (ShowRPTag ? "§2[RP]§r" : "")
- * : "§8[OOC]§r") + event.getFormat().substring(
- * event.getFormat().indexOf("<") + 1, event.getFormat().indexOf(">")) +
- * flair + "> " + message); // 2015.08.08.
- */
-
- event.setMessage(message); //2015.09.05.
-
+ event.setMessage(message); // 2015.09.05.
+
event.setFormat(event
.getFormat()
.replace(
@@ -191,30 +212,19 @@ public class PlayerListener implements Listener { // 2015.07.16.
: "§8[OOC]§r")).replace("{buttonflair}", flair)); // 2015.09.04.
}
- /*
- * private static Class> nmsChatSerializer = Reflection
- * .getNMSClass("IChatBaseComponent$ChatSerializer"); private static
- * Class> nmsPacketPlayOutChat = Reflection
- * .getNMSClass("PacketPlayOutChat");
- *
- * public static void sendRawMessage(Player player, String message) { try {
- * Object handle = Reflection.getHandle(player); Object connection =
- * Reflection.getField(handle.getClass(), "playerConnection").get(handle);
- * Object serialized = Reflection.getMethod(nmsChatSerializer, "a",
- * String.class).invoke(null, message); Object packet =
- * nmsPacketPlayOutChat.getConstructor(
- * Reflection.getNMSClass("IChatBaseComponent")).newInstance( serialized);
- * Reflection.getMethod(connection.getClass(), "sendPacket").invoke(
- * connection, packet); } catch (Exception e) { e.printStackTrace();
- * PluginMain.LastException = e; // 2015.08.09. } }
- */
-
@EventHandler
public void onTabComplete(PlayerChatTabCompleteEvent e) {
String name = e.getLastToken();
for (String nickname : nicknames.keySet()) {
String nwithoutformatting = nickname;
int index;
+ while ((index = nwithoutformatting.indexOf("§k")) != -1)
+ nwithoutformatting = nwithoutformatting.replaceAll("§k"
+ + nwithoutformatting.charAt(index + 2), ""); // Support
+ // for
+ // one
+ // random
+ // char
while ((index = nwithoutformatting.indexOf('§')) != -1)
nwithoutformatting = nwithoutformatting.replaceAll("§"
+ nwithoutformatting.charAt(index + 1), "");