Renamed plugin
This commit is contained in:
parent
216e1e0a2e
commit
365027586e
31 changed files with 90 additions and 1299 deletions
|
@ -955,3 +955,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-14 14:45:00.284 -----------------------------------------------
|
||||
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-14 14:46:01.842
|
||||
!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-14 14:46:02.106
|
||||
!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.
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -1,83 +0,0 @@
|
|||
package tk.sznp.thebuttonautoflair;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
|
||||
import de.inventivegames.TellRawAutoMessage.Reflection;
|
||||
|
||||
public class PlayerListener implements Listener
|
||||
{ //2015.07.16.
|
||||
@EventHandler
|
||||
public void onPlayerJoin(PlayerJoinEvent event)
|
||||
{
|
||||
Player p=event.getPlayer();
|
||||
//PluginMain.Players.add(p);
|
||||
//event.getPlayer().setDisplayName(p.getDisplayName()+PluginMain.GetFlair(p));
|
||||
//if(PluginMain.PlayerUserNames.containsKey(p.getName())) //<-- 2015.07.20.
|
||||
MaybeOfflinePlayer.AddPlayerIfNeeded(p.getName()); //2015.08.08.
|
||||
MaybeOfflinePlayer mp = MaybeOfflinePlayer.AllPlayers.get(p.getName()); //2015.08.08.
|
||||
if(mp.Flair!=null)
|
||||
//PluginMain.AppendPlayerDisplayFlair(p, PluginMain.PlayerUserNames.get(p.getName()), PluginMain.GetFlair(p));
|
||||
PluginMain.AppendPlayerDisplayFlair(p, mp.UserName, mp.Flair);
|
||||
else
|
||||
{ //2015.07.20.
|
||||
String json="[\"\",{\"text\":\"§6Hi! If you'd like your flair displayed ingame, write your Minecraft name to \"},{\"text\":\"[this thread.]\",\"clickEvent\":{\"action\":\"open_url\",\"value\":\"https://www.reddit.com/r/TheButtonMinecraft/comments/3d25do/\"},\"hoverEvent\":{\"action\":\"show_text\",\"value\":{\"text\":\"\",\"extra\":[{\"text\":\"Click here to go to the Reddit thread§r\"}]}}}]";
|
||||
sendRawMessage(p, json);
|
||||
}
|
||||
//System.out.println("Added player "+p.getName());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerLeave(PlayerQuitEvent event)
|
||||
{
|
||||
//for(Player player : PluginMain.Players)
|
||||
/*for(int i=0; i<PluginMain.Players.size();)
|
||||
{
|
||||
Player player=PluginMain.Players.get(i);
|
||||
if(player.getName().equals(event.getPlayer().getName()))
|
||||
{
|
||||
PluginMain.Players.remove(player);
|
||||
//System.out.println("Removed player "+event.getPlayer().getName());
|
||||
}
|
||||
else
|
||||
i++; //If the player is removed, the next item will be on the same index
|
||||
}*/
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerChat(AsyncPlayerChatEvent event)
|
||||
{
|
||||
//event.setFormat(event.getFormat().substring(0, event.getFormat().indexOf(">"))+"(test)> "+event.getMessage()); //2015.08.08.
|
||||
MaybeOfflinePlayer player = MaybeOfflinePlayer.AllPlayers.get(event.getPlayer().getName());
|
||||
String flair=player.Flair; //2015.08.08.
|
||||
if(flair==null || !player.AcceptedFlair)
|
||||
flair=""; //2015.08.08.
|
||||
event.setFormat(event.getFormat().substring(0, event.getFormat().indexOf(">"))+flair+"> "+event.getMessage()); //2015.08.08.
|
||||
}
|
||||
|
||||
private static Class<?> nmsChatSerializer = Reflection.getNMSClass("IChatBaseComponent$ChatSerializer");
|
||||
private static Class<?> nmsPacketPlayOutChat = Reflection.getNMSClass("PacketPlayOutChat");
|
||||
public static void sendRawMessage(Player player, String message)
|
||||
{
|
||||
try {
|
||||
System.out.println("1");
|
||||
Object handle = Reflection.getHandle(player);
|
||||
System.out.println("2");
|
||||
Object connection = Reflection.getField(handle.getClass(), "playerConnection").get(handle);
|
||||
System.out.println("3");
|
||||
Object serialized = Reflection.getMethod(nmsChatSerializer, "a", String.class).invoke(null, message);
|
||||
System.out.println("4");
|
||||
Object packet = nmsPacketPlayOutChat.getConstructor(Reflection.getNMSClass("IChatBaseComponent")).newInstance(serialized);
|
||||
System.out.println("5");
|
||||
Reflection.getMethod(connection.getClass(), "sendPacket").invoke(connection, packet);
|
||||
System.out.println("6");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,84 +0,0 @@
|
|||
package tk.sznp.thebuttonautoflair;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
|
||||
import de.inventivegames.TellRawAutoMessage.Reflection;
|
||||
|
||||
public class PlayerListener implements Listener
|
||||
{ //2015.07.16.
|
||||
@EventHandler
|
||||
public void onPlayerJoin(PlayerJoinEvent event)
|
||||
{
|
||||
Player p=event.getPlayer();
|
||||
//PluginMain.Players.add(p);
|
||||
//event.getPlayer().setDisplayName(p.getDisplayName()+PluginMain.GetFlair(p));
|
||||
//if(PluginMain.PlayerUserNames.containsKey(p.getName())) //<-- 2015.07.20.
|
||||
if(!MaybeOfflinePlayer.AllPlayers.containsKey(p.getName())) //<-- 2015.08.08.
|
||||
MaybeOfflinePlayer.AddPlayerIfNeeded(p.getName()); //2015.08.08.
|
||||
//PluginMain.AppendPlayerDisplayFlair(p, PluginMain.PlayerUserNames.get(p.getName()), PluginMain.GetFlair(p));
|
||||
{
|
||||
MaybeOfflinePlayer mp = MaybeOfflinePlayer.AllPlayers.get(p.getName());
|
||||
PluginMain.AppendPlayerDisplayFlair(p, mp.UserName, mp.Flair);
|
||||
}
|
||||
else
|
||||
{ //2015.07.20.
|
||||
String json="[\"\",{\"text\":\"§6Hi! If you'd like your flair displayed ingame, write your Minecraft name to \"},{\"text\":\"[this thread.]\",\"clickEvent\":{\"action\":\"open_url\",\"value\":\"https://www.reddit.com/r/TheButtonMinecraft/comments/3d25do/\"},\"hoverEvent\":{\"action\":\"show_text\",\"value\":{\"text\":\"\",\"extra\":[{\"text\":\"Click here to go to the Reddit thread§r\"}]}}}]";
|
||||
sendRawMessage(p, json);
|
||||
}
|
||||
//System.out.println("Added player "+p.getName());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerLeave(PlayerQuitEvent event)
|
||||
{
|
||||
//for(Player player : PluginMain.Players)
|
||||
/*for(int i=0; i<PluginMain.Players.size();)
|
||||
{
|
||||
Player player=PluginMain.Players.get(i);
|
||||
if(player.getName().equals(event.getPlayer().getName()))
|
||||
{
|
||||
PluginMain.Players.remove(player);
|
||||
//System.out.println("Removed player "+event.getPlayer().getName());
|
||||
}
|
||||
else
|
||||
i++; //If the player is removed, the next item will be on the same index
|
||||
}*/
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerChat(AsyncPlayerChatEvent event)
|
||||
{
|
||||
//event.setFormat(event.getFormat().substring(0, event.getFormat().indexOf(">"))+"(test)> "+event.getMessage()); //2015.08.08.
|
||||
String flair=MaybeOfflinePlayer.AllPlayers.get(event.getPlayer().getName()).Flair; //2015.08.08.
|
||||
if(flair==null)
|
||||
flair=""; //2015.08.08.
|
||||
event.setFormat(event.getFormat().substring(0, event.getFormat().indexOf(">"))+flair+"> "+event.getMessage()); //2015.08.08.
|
||||
}
|
||||
|
||||
private static Class<?> nmsChatSerializer = Reflection.getNMSClass("IChatBaseComponent$ChatSerializer");
|
||||
private static Class<?> nmsPacketPlayOutChat = Reflection.getNMSClass("PacketPlayOutChat");
|
||||
public static void sendRawMessage(Player player, String message)
|
||||
{
|
||||
try {
|
||||
System.out.println("1");
|
||||
Object handle = Reflection.getHandle(player);
|
||||
System.out.println("2");
|
||||
Object connection = Reflection.getField(handle.getClass(), "playerConnection").get(handle);
|
||||
System.out.println("3");
|
||||
Object serialized = Reflection.getMethod(nmsChatSerializer, "a", String.class).invoke(null, message);
|
||||
System.out.println("4");
|
||||
Object packet = nmsPacketPlayOutChat.getConstructor(Reflection.getNMSClass("IChatBaseComponent")).newInstance(serialized);
|
||||
System.out.println("5");
|
||||
Reflection.getMethod(connection.getClass(), "sendPacket").invoke(connection, packet);
|
||||
System.out.println("6");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,83 +0,0 @@
|
|||
package tk.sznp.thebuttonautoflair;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
|
||||
import de.inventivegames.TellRawAutoMessage.Reflection;
|
||||
|
||||
public class PlayerListener implements Listener
|
||||
{ //2015.07.16.
|
||||
@EventHandler
|
||||
public void onPlayerJoin(PlayerJoinEvent event)
|
||||
{
|
||||
Player p=event.getPlayer();
|
||||
//PluginMain.Players.add(p);
|
||||
//event.getPlayer().setDisplayName(p.getDisplayName()+PluginMain.GetFlair(p));
|
||||
//if(PluginMain.PlayerUserNames.containsKey(p.getName())) //<-- 2015.07.20.
|
||||
if(!MaybeOfflinePlayer.AllPlayers.containsKey(p.getName())) //<-- 2015.08.08.
|
||||
MaybeOfflinePlayer.AddPlayerIfNeeded(p.getName()); //2015.08.08.
|
||||
MaybeOfflinePlayer mp = MaybeOfflinePlayer.AllPlayers.get(p.getName());
|
||||
if(mp.)
|
||||
//PluginMain.AppendPlayerDisplayFlair(p, PluginMain.PlayerUserNames.get(p.getName()), PluginMain.GetFlair(p));
|
||||
PluginMain.AppendPlayerDisplayFlair(p, mp.UserName, mp.Flair);
|
||||
else
|
||||
{ //2015.07.20.
|
||||
String json="[\"\",{\"text\":\"§6Hi! If you'd like your flair displayed ingame, write your Minecraft name to \"},{\"text\":\"[this thread.]\",\"clickEvent\":{\"action\":\"open_url\",\"value\":\"https://www.reddit.com/r/TheButtonMinecraft/comments/3d25do/\"},\"hoverEvent\":{\"action\":\"show_text\",\"value\":{\"text\":\"\",\"extra\":[{\"text\":\"Click here to go to the Reddit thread§r\"}]}}}]";
|
||||
sendRawMessage(p, json);
|
||||
}
|
||||
//System.out.println("Added player "+p.getName());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerLeave(PlayerQuitEvent event)
|
||||
{
|
||||
//for(Player player : PluginMain.Players)
|
||||
/*for(int i=0; i<PluginMain.Players.size();)
|
||||
{
|
||||
Player player=PluginMain.Players.get(i);
|
||||
if(player.getName().equals(event.getPlayer().getName()))
|
||||
{
|
||||
PluginMain.Players.remove(player);
|
||||
//System.out.println("Removed player "+event.getPlayer().getName());
|
||||
}
|
||||
else
|
||||
i++; //If the player is removed, the next item will be on the same index
|
||||
}*/
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerChat(AsyncPlayerChatEvent event)
|
||||
{
|
||||
//event.setFormat(event.getFormat().substring(0, event.getFormat().indexOf(">"))+"(test)> "+event.getMessage()); //2015.08.08.
|
||||
String flair=MaybeOfflinePlayer.AllPlayers.get(event.getPlayer().getName()).Flair; //2015.08.08.
|
||||
if(flair==null)
|
||||
flair=""; //2015.08.08.
|
||||
event.setFormat(event.getFormat().substring(0, event.getFormat().indexOf(">"))+flair+"> "+event.getMessage()); //2015.08.08.
|
||||
}
|
||||
|
||||
private static Class<?> nmsChatSerializer = Reflection.getNMSClass("IChatBaseComponent$ChatSerializer");
|
||||
private static Class<?> nmsPacketPlayOutChat = Reflection.getNMSClass("PacketPlayOutChat");
|
||||
public static void sendRawMessage(Player player, String message)
|
||||
{
|
||||
try {
|
||||
System.out.println("1");
|
||||
Object handle = Reflection.getHandle(player);
|
||||
System.out.println("2");
|
||||
Object connection = Reflection.getField(handle.getClass(), "playerConnection").get(handle);
|
||||
System.out.println("3");
|
||||
Object serialized = Reflection.getMethod(nmsChatSerializer, "a", String.class).invoke(null, message);
|
||||
System.out.println("4");
|
||||
Object packet = nmsPacketPlayOutChat.getConstructor(Reflection.getNMSClass("IChatBaseComponent")).newInstance(serialized);
|
||||
System.out.println("5");
|
||||
Reflection.getMethod(connection.getClass(), "sendPacket").invoke(connection, packet);
|
||||
System.out.println("6");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,83 +0,0 @@
|
|||
package tk.sznp.thebuttonautoflair;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
|
||||
import de.inventivegames.TellRawAutoMessage.Reflection;
|
||||
|
||||
public class PlayerListener implements Listener
|
||||
{ //2015.07.16.
|
||||
@EventHandler
|
||||
public void onPlayerJoin(PlayerJoinEvent event)
|
||||
{
|
||||
Player p=event.getPlayer();
|
||||
//PluginMain.Players.add(p);
|
||||
//event.getPlayer().setDisplayName(p.getDisplayName()+PluginMain.GetFlair(p));
|
||||
//if(PluginMain.PlayerUserNames.containsKey(p.getName())) //<-- 2015.07.20.
|
||||
MaybeOfflinePlayer.AddPlayerIfNeeded(p.getName()); //2015.08.08.
|
||||
MaybeOfflinePlayer mp = MaybeOfflinePlayer.AllPlayers.get(p.getName()); //2015.08.08.
|
||||
if(mp.Flair!=null)
|
||||
//PluginMain.AppendPlayerDisplayFlair(p, PluginMain.PlayerUserNames.get(p.getName()), PluginMain.GetFlair(p));
|
||||
PluginMain.AppendPlayerDisplayFlair(p, mp.UserName, mp.Flair);
|
||||
else
|
||||
{ //2015.07.20.
|
||||
String json="[\"\",{\"text\":\"§6Hi! If you'd like your flair displayed ingame, write your Minecraft name to \"},{\"text\":\"[this thread.]\",\"clickEvent\":{\"action\":\"open_url\",\"value\":\"https://www.reddit.com/r/TheButtonMinecraft/comments/3d25do/\"},\"hoverEvent\":{\"action\":\"show_text\",\"value\":{\"text\":\"\",\"extra\":[{\"text\":\"Click here to go to the Reddit thread§r\"}]}}}]";
|
||||
sendRawMessage(p, json);
|
||||
}
|
||||
//System.out.println("Added player "+p.getName());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerLeave(PlayerQuitEvent event)
|
||||
{
|
||||
//for(Player player : PluginMain.Players)
|
||||
/*for(int i=0; i<PluginMain.Players.size();)
|
||||
{
|
||||
Player player=PluginMain.Players.get(i);
|
||||
if(player.getName().equals(event.getPlayer().getName()))
|
||||
{
|
||||
PluginMain.Players.remove(player);
|
||||
//System.out.println("Removed player "+event.getPlayer().getName());
|
||||
}
|
||||
else
|
||||
i++; //If the player is removed, the next item will be on the same index
|
||||
}*/
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerChat(AsyncPlayerChatEvent event)
|
||||
{
|
||||
//event.setFormat(event.getFormat().substring(0, event.getFormat().indexOf(">"))+"(test)> "+event.getMessage()); //2015.08.08.
|
||||
MaybeOfflinePlayer player = MaybeOfflinePlayer.AllPlayers.get(event.getPlayer().getName());
|
||||
String flair=player.Flair; //2015.08.08.
|
||||
if(flair==null || !player.AcceptedFlair)
|
||||
flair=""; //2015.08.08.
|
||||
event.setFormat(event.getFormat().substring(0, event.getFormat().indexOf(">"))+flair+"> "+event.getMessage()); //2015.08.08.
|
||||
}
|
||||
|
||||
private static Class<?> nmsChatSerializer = Reflection.getNMSClass("IChatBaseComponent$ChatSerializer");
|
||||
private static Class<?> nmsPacketPlayOutChat = Reflection.getNMSClass("PacketPlayOutChat");
|
||||
public static void sendRawMessage(Player player, String message)
|
||||
{
|
||||
try {
|
||||
System.out.println("1");
|
||||
Object handle = Reflection.getHandle(player);
|
||||
System.out.println("2");
|
||||
Object connection = Reflection.getField(handle.getClass(), "playerConnection").get(handle);
|
||||
System.out.println("3");
|
||||
Object serialized = Reflection.getMethod(nmsChatSerializer, "a", String.class).invoke(null, message);
|
||||
System.out.println("4");
|
||||
Object packet = nmsPacketPlayOutChat.getConstructor(Reflection.getNMSClass("IChatBaseComponent")).newInstance(serialized);
|
||||
System.out.println("5");
|
||||
Reflection.getMethod(connection.getClass(), "sendPacket").invoke(connection, packet);
|
||||
System.out.println("6");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,83 +0,0 @@
|
|||
package tk.sznp.thebuttonautoflair;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
|
||||
import de.inventivegames.TellRawAutoMessage.Reflection;
|
||||
|
||||
public class PlayerListener implements Listener
|
||||
{ //2015.07.16.
|
||||
@EventHandler
|
||||
public void onPlayerJoin(PlayerJoinEvent event)
|
||||
{
|
||||
Player p=event.getPlayer();
|
||||
//PluginMain.Players.add(p);
|
||||
//event.getPlayer().setDisplayName(p.getDisplayName()+PluginMain.GetFlair(p));
|
||||
//if(PluginMain.PlayerUserNames.containsKey(p.getName())) //<-- 2015.07.20.
|
||||
if(!MaybeOfflinePlayer.AllPlayers.containsKey(p.getName())) //<-- 2015.08.08.
|
||||
MaybeOfflinePlayer.AddPlayerIfNeeded(p.getName()); //2015.08.08.
|
||||
MaybeOfflinePlayer mp = MaybeOfflinePlayer.AllPlayers.get(p.getName()); //2015.08.08.
|
||||
if(mp.Flair!=null)
|
||||
//PluginMain.AppendPlayerDisplayFlair(p, PluginMain.PlayerUserNames.get(p.getName()), PluginMain.GetFlair(p));
|
||||
PluginMain.AppendPlayerDisplayFlair(p, mp.UserName, mp.Flair);
|
||||
else
|
||||
{ //2015.07.20.
|
||||
String json="[\"\",{\"text\":\"§6Hi! If you'd like your flair displayed ingame, write your Minecraft name to \"},{\"text\":\"[this thread.]\",\"clickEvent\":{\"action\":\"open_url\",\"value\":\"https://www.reddit.com/r/TheButtonMinecraft/comments/3d25do/\"},\"hoverEvent\":{\"action\":\"show_text\",\"value\":{\"text\":\"\",\"extra\":[{\"text\":\"Click here to go to the Reddit thread§r\"}]}}}]";
|
||||
sendRawMessage(p, json);
|
||||
}
|
||||
//System.out.println("Added player "+p.getName());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerLeave(PlayerQuitEvent event)
|
||||
{
|
||||
//for(Player player : PluginMain.Players)
|
||||
/*for(int i=0; i<PluginMain.Players.size();)
|
||||
{
|
||||
Player player=PluginMain.Players.get(i);
|
||||
if(player.getName().equals(event.getPlayer().getName()))
|
||||
{
|
||||
PluginMain.Players.remove(player);
|
||||
//System.out.println("Removed player "+event.getPlayer().getName());
|
||||
}
|
||||
else
|
||||
i++; //If the player is removed, the next item will be on the same index
|
||||
}*/
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerChat(AsyncPlayerChatEvent event)
|
||||
{
|
||||
//event.setFormat(event.getFormat().substring(0, event.getFormat().indexOf(">"))+"(test)> "+event.getMessage()); //2015.08.08.
|
||||
String flair=MaybeOfflinePlayer.AllPlayers.get(event.getPlayer().getName()).Flair; //2015.08.08.
|
||||
if(flair==null)
|
||||
flair=""; //2015.08.08.
|
||||
event.setFormat(event.getFormat().substring(0, event.getFormat().indexOf(">"))+flair+"> "+event.getMessage()); //2015.08.08.
|
||||
}
|
||||
|
||||
private static Class<?> nmsChatSerializer = Reflection.getNMSClass("IChatBaseComponent$ChatSerializer");
|
||||
private static Class<?> nmsPacketPlayOutChat = Reflection.getNMSClass("PacketPlayOutChat");
|
||||
public static void sendRawMessage(Player player, String message)
|
||||
{
|
||||
try {
|
||||
System.out.println("1");
|
||||
Object handle = Reflection.getHandle(player);
|
||||
System.out.println("2");
|
||||
Object connection = Reflection.getField(handle.getClass(), "playerConnection").get(handle);
|
||||
System.out.println("3");
|
||||
Object serialized = Reflection.getMethod(nmsChatSerializer, "a", String.class).invoke(null, message);
|
||||
System.out.println("4");
|
||||
Object packet = nmsPacketPlayOutChat.getConstructor(Reflection.getNMSClass("IChatBaseComponent")).newInstance(serialized);
|
||||
System.out.println("5");
|
||||
Reflection.getMethod(connection.getClass(), "sendPacket").invoke(connection, packet);
|
||||
System.out.println("6");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,83 +0,0 @@
|
|||
package tk.sznp.thebuttonautoflair;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
|
||||
import de.inventivegames.TellRawAutoMessage.Reflection;
|
||||
|
||||
public class PlayerListener implements Listener
|
||||
{ //2015.07.16.
|
||||
@EventHandler
|
||||
public void onPlayerJoin(PlayerJoinEvent event)
|
||||
{
|
||||
Player p=event.getPlayer();
|
||||
//PluginMain.Players.add(p);
|
||||
//event.getPlayer().setDisplayName(p.getDisplayName()+PluginMain.GetFlair(p));
|
||||
//if(PluginMain.PlayerUserNames.containsKey(p.getName())) //<-- 2015.07.20.
|
||||
if(MaybeOfflinePlayer.AllPlayers.containsKey(p.getName())) //<-- 2015.08.08.
|
||||
//PluginMain.AppendPlayerDisplayFlair(p, PluginMain.PlayerUserNames.get(p.getName()), PluginMain.GetFlair(p));
|
||||
{
|
||||
MaybeOfflinePlayer mp = MaybeOfflinePlayer.AllPlayers.get(p.getName());
|
||||
PluginMain.AppendPlayerDisplayFlair(p, mp.UserName, mp.Flair);
|
||||
}
|
||||
else
|
||||
{ //2015.07.20.
|
||||
String json="[\"\",{\"text\":\"§6Hi! If you'd like your flair displayed ingame, write your Minecraft name to \"},{\"text\":\"[this thread.]\",\"clickEvent\":{\"action\":\"open_url\",\"value\":\"https://www.reddit.com/r/TheButtonMinecraft/comments/3d25do/\"},\"hoverEvent\":{\"action\":\"show_text\",\"value\":{\"text\":\"\",\"extra\":[{\"text\":\"Click here to go to the Reddit thread§r\"}]}}}]";
|
||||
sendRawMessage(p, json);
|
||||
}
|
||||
//System.out.println("Added player "+p.getName());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerLeave(PlayerQuitEvent event)
|
||||
{
|
||||
//for(Player player : PluginMain.Players)
|
||||
/*for(int i=0; i<PluginMain.Players.size();)
|
||||
{
|
||||
Player player=PluginMain.Players.get(i);
|
||||
if(player.getName().equals(event.getPlayer().getName()))
|
||||
{
|
||||
PluginMain.Players.remove(player);
|
||||
//System.out.println("Removed player "+event.getPlayer().getName());
|
||||
}
|
||||
else
|
||||
i++; //If the player is removed, the next item will be on the same index
|
||||
}*/
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerChat(AsyncPlayerChatEvent event)
|
||||
{
|
||||
//event.setFormat(event.getFormat().substring(0, event.getFormat().indexOf(">"))+"(test)> "+event.getMessage()); //2015.08.08.
|
||||
String flair=MaybeOfflinePlayer.AllPlayers.get(event.getPlayer().getName()).Flair; //2015.08.08.
|
||||
if(flair==null)
|
||||
flair=""; //2015.08.08.
|
||||
event.setFormat(event.getFormat().substring(0, event.getFormat().indexOf(">"))+flair+"> "+event.getMessage()); //2015.08.08.
|
||||
}
|
||||
|
||||
private static Class<?> nmsChatSerializer = Reflection.getNMSClass("IChatBaseComponent$ChatSerializer");
|
||||
private static Class<?> nmsPacketPlayOutChat = Reflection.getNMSClass("PacketPlayOutChat");
|
||||
public static void sendRawMessage(Player player, String message)
|
||||
{
|
||||
try {
|
||||
System.out.println("1");
|
||||
Object handle = Reflection.getHandle(player);
|
||||
System.out.println("2");
|
||||
Object connection = Reflection.getField(handle.getClass(), "playerConnection").get(handle);
|
||||
System.out.println("3");
|
||||
Object serialized = Reflection.getMethod(nmsChatSerializer, "a", String.class).invoke(null, message);
|
||||
System.out.println("4");
|
||||
Object packet = nmsPacketPlayOutChat.getConstructor(Reflection.getNMSClass("IChatBaseComponent")).newInstance(serialized);
|
||||
System.out.println("5");
|
||||
Reflection.getMethod(connection.getClass(), "sendPacket").invoke(connection, packet);
|
||||
System.out.println("6");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,83 +0,0 @@
|
|||
package tk.sznp.thebuttonautoflair;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
|
||||
import de.inventivegames.TellRawAutoMessage.Reflection;
|
||||
|
||||
public class PlayerListener implements Listener
|
||||
{ //2015.07.16.
|
||||
@EventHandler
|
||||
public void onPlayerJoin(PlayerJoinEvent event)
|
||||
{
|
||||
Player p=event.getPlayer();
|
||||
//PluginMain.Players.add(p);
|
||||
//event.getPlayer().setDisplayName(p.getDisplayName()+PluginMain.GetFlair(p));
|
||||
//if(PluginMain.PlayerUserNames.containsKey(p.getName())) //<-- 2015.07.20.
|
||||
if(!MaybeOfflinePlayer.AllPlayers.containsKey(p.getName())) //<-- 2015.08.08.
|
||||
MaybeOfflinePlayer.AddPlayerIfNeeded(p.getName()); //2015.08.08.
|
||||
MaybeOfflinePlayer mp = MaybeOfflinePlayer.AllPlayers.get(p.getName()); //2015.08.08.
|
||||
if(mp.)
|
||||
//PluginMain.AppendPlayerDisplayFlair(p, PluginMain.PlayerUserNames.get(p.getName()), PluginMain.GetFlair(p));
|
||||
PluginMain.AppendPlayerDisplayFlair(p, mp.UserName, mp.Flair);
|
||||
else
|
||||
{ //2015.07.20.
|
||||
String json="[\"\",{\"text\":\"§6Hi! If you'd like your flair displayed ingame, write your Minecraft name to \"},{\"text\":\"[this thread.]\",\"clickEvent\":{\"action\":\"open_url\",\"value\":\"https://www.reddit.com/r/TheButtonMinecraft/comments/3d25do/\"},\"hoverEvent\":{\"action\":\"show_text\",\"value\":{\"text\":\"\",\"extra\":[{\"text\":\"Click here to go to the Reddit thread§r\"}]}}}]";
|
||||
sendRawMessage(p, json);
|
||||
}
|
||||
//System.out.println("Added player "+p.getName());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerLeave(PlayerQuitEvent event)
|
||||
{
|
||||
//for(Player player : PluginMain.Players)
|
||||
/*for(int i=0; i<PluginMain.Players.size();)
|
||||
{
|
||||
Player player=PluginMain.Players.get(i);
|
||||
if(player.getName().equals(event.getPlayer().getName()))
|
||||
{
|
||||
PluginMain.Players.remove(player);
|
||||
//System.out.println("Removed player "+event.getPlayer().getName());
|
||||
}
|
||||
else
|
||||
i++; //If the player is removed, the next item will be on the same index
|
||||
}*/
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerChat(AsyncPlayerChatEvent event)
|
||||
{
|
||||
//event.setFormat(event.getFormat().substring(0, event.getFormat().indexOf(">"))+"(test)> "+event.getMessage()); //2015.08.08.
|
||||
String flair=MaybeOfflinePlayer.AllPlayers.get(event.getPlayer().getName()).Flair; //2015.08.08.
|
||||
if(flair==null)
|
||||
flair=""; //2015.08.08.
|
||||
event.setFormat(event.getFormat().substring(0, event.getFormat().indexOf(">"))+flair+"> "+event.getMessage()); //2015.08.08.
|
||||
}
|
||||
|
||||
private static Class<?> nmsChatSerializer = Reflection.getNMSClass("IChatBaseComponent$ChatSerializer");
|
||||
private static Class<?> nmsPacketPlayOutChat = Reflection.getNMSClass("PacketPlayOutChat");
|
||||
public static void sendRawMessage(Player player, String message)
|
||||
{
|
||||
try {
|
||||
System.out.println("1");
|
||||
Object handle = Reflection.getHandle(player);
|
||||
System.out.println("2");
|
||||
Object connection = Reflection.getField(handle.getClass(), "playerConnection").get(handle);
|
||||
System.out.println("3");
|
||||
Object serialized = Reflection.getMethod(nmsChatSerializer, "a", String.class).invoke(null, message);
|
||||
System.out.println("4");
|
||||
Object packet = nmsPacketPlayOutChat.getConstructor(Reflection.getNMSClass("IChatBaseComponent")).newInstance(serialized);
|
||||
System.out.println("5");
|
||||
Reflection.getMethod(connection.getClass(), "sendPacket").invoke(connection, packet);
|
||||
System.out.println("6");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,72 +0,0 @@
|
|||
package tk.sznp.thebuttonautoflair;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
|
||||
import de.inventivegames.TellRawAutoMessage.Reflection;
|
||||
|
||||
public class PlayerListener implements Listener
|
||||
{ //2015.07.16.
|
||||
@EventHandler
|
||||
public void onPlayerJoin(PlayerJoinEvent event)
|
||||
{
|
||||
Player p=event.getPlayer();
|
||||
//PluginMain.Players.add(p);
|
||||
//event.getPlayer().setDisplayName(p.getDisplayName()+PluginMain.GetFlair(p));
|
||||
//if(PluginMain.PlayerUserNames.containsKey(p.getName())) //<-- 2015.07.20.
|
||||
MaybeOfflinePlayer.AddPlayerIfNeeded(p.getName()); //2015.08.08.
|
||||
MaybeOfflinePlayer mp = MaybeOfflinePlayer.AllPlayers.get(p.getName()); //2015.08.08.
|
||||
if(mp.Flair!=null)
|
||||
//PluginMain.AppendPlayerDisplayFlair(p, PluginMain.PlayerUserNames.get(p.getName()), PluginMain.GetFlair(p));
|
||||
PluginMain.AppendPlayerDisplayFlair(p, mp.UserName, mp.Flair);
|
||||
else
|
||||
{ //2015.07.20.
|
||||
String json="[\"\",{\"text\":\"§6Hi! If you'd like your flair displayed ingame, write your Minecraft name to \"},{\"text\":\"[this thread.]\",\"clickEvent\":{\"action\":\"open_url\",\"value\":\"https://www.reddit.com/r/TheButtonMinecraft/comments/3d25do/\"},\"hoverEvent\":{\"action\":\"show_text\",\"value\":{\"text\":\"\",\"extra\":[{\"text\":\"Click here to go to the Reddit thread§r\"}]}}}]";
|
||||
sendRawMessage(p, json);
|
||||
}
|
||||
//System.out.println("Added player "+p.getName());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerLeave(PlayerQuitEvent event)
|
||||
{
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerChat(AsyncPlayerChatEvent event)
|
||||
{
|
||||
//event.setFormat(event.getFormat().substring(0, event.getFormat().indexOf(">"))+"(test)> "+event.getMessage()); //2015.08.08.
|
||||
MaybeOfflinePlayer player = MaybeOfflinePlayer.AllPlayers.get(event.getPlayer().getName());
|
||||
String flair=player.Flair; //2015.08.08.
|
||||
if(flair==null || !player.AcceptedFlair)
|
||||
flair=""; //2015.08.08.
|
||||
String message;
|
||||
event.setFormat(event.getFormat().substring(0, event.getFormat().indexOf(">"))+flair+"> "+event.getMessage()); //2015.08.08.
|
||||
}
|
||||
|
||||
private static Class<?> nmsChatSerializer = Reflection.getNMSClass("IChatBaseComponent$ChatSerializer");
|
||||
private static Class<?> nmsPacketPlayOutChat = Reflection.getNMSClass("PacketPlayOutChat");
|
||||
public static void sendRawMessage(Player player, String message)
|
||||
{
|
||||
try {
|
||||
System.out.println("1");
|
||||
Object handle = Reflection.getHandle(player);
|
||||
System.out.println("2");
|
||||
Object connection = Reflection.getField(handle.getClass(), "playerConnection").get(handle);
|
||||
System.out.println("3");
|
||||
Object serialized = Reflection.getMethod(nmsChatSerializer, "a", String.class).invoke(null, message);
|
||||
System.out.println("4");
|
||||
Object packet = nmsPacketPlayOutChat.getConstructor(Reflection.getNMSClass("IChatBaseComponent")).newInstance(serialized);
|
||||
System.out.println("5");
|
||||
Reflection.getMethod(connection.getClass(), "sendPacket").invoke(connection, packet);
|
||||
System.out.println("6");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,84 +0,0 @@
|
|||
package tk.sznp.thebuttonautoflair;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
|
||||
import de.inventivegames.TellRawAutoMessage.Reflection;
|
||||
|
||||
public class PlayerListener implements Listener
|
||||
{ //2015.07.16.
|
||||
@EventHandler
|
||||
public void onPlayerJoin(PlayerJoinEvent event)
|
||||
{
|
||||
Player p=event.getPlayer();
|
||||
//PluginMain.Players.add(p);
|
||||
//event.getPlayer().setDisplayName(p.getDisplayName()+PluginMain.GetFlair(p));
|
||||
//if(PluginMain.PlayerUserNames.containsKey(p.getName())) //<-- 2015.07.20.
|
||||
MaybeOfflinePlayer.AddPlayerIfNeeded(p.getName()); //2015.08.08.
|
||||
MaybeOfflinePlayer mp = MaybeOfflinePlayer.AllPlayers.get(p.getName()); //2015.08.08.
|
||||
if(mp.Flair!=null)
|
||||
//PluginMain.AppendPlayerDisplayFlair(p, PluginMain.PlayerUserNames.get(p.getName()), PluginMain.GetFlair(p));
|
||||
PluginMain.AppendPlayerDisplayFlair(p, mp.UserName, mp.Flair);
|
||||
else
|
||||
{ //2015.07.20.
|
||||
String json="[\"\",{\"text\":\"§6Hi! If you'd like your flair displayed ingame, write your Minecraft name to \"},{\"text\":\"[this thread.]\",\"clickEvent\":{\"action\":\"open_url\",\"value\":\"https://www.reddit.com/r/TheButtonMinecraft/comments/3d25do/\"},\"hoverEvent\":{\"action\":\"show_text\",\"value\":{\"text\":\"\",\"extra\":[{\"text\":\"Click here to go to the Reddit thread§r\"}]}}}]";
|
||||
sendRawMessage(p, json);
|
||||
}
|
||||
//System.out.println("Added player "+p.getName());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerLeave(PlayerQuitEvent event)
|
||||
{
|
||||
//for(Player player : PluginMain.Players)
|
||||
/*for(int i=0; i<PluginMain.Players.size();)
|
||||
{
|
||||
Player player=PluginMain.Players.get(i);
|
||||
if(player.getName().equals(event.getPlayer().getName()))
|
||||
{
|
||||
PluginMain.Players.remove(player);
|
||||
//System.out.println("Removed player "+event.getPlayer().getName());
|
||||
}
|
||||
else
|
||||
i++; //If the player is removed, the next item will be on the same index
|
||||
}*/
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerChat(AsyncPlayerChatEvent event)
|
||||
{
|
||||
//event.setFormat(event.getFormat().substring(0, event.getFormat().indexOf(">"))+"(test)> "+event.getMessage()); //2015.08.08.
|
||||
MaybeOfflinePlayer player = MaybeOfflinePlayer.AllPlayers.get(event.getPlayer().getName());
|
||||
String flair=player.Flair; //2015.08.08.
|
||||
if(flair==null || !player.AcceptedFlair)
|
||||
flair=""; //2015.08.08.
|
||||
String message;
|
||||
event.setFormat(event.getFormat().substring(0, event.getFormat().indexOf(">"))+flair+"> "+event.getMessage()); //2015.08.08.
|
||||
}
|
||||
|
||||
private static Class<?> nmsChatSerializer = Reflection.getNMSClass("IChatBaseComponent$ChatSerializer");
|
||||
private static Class<?> nmsPacketPlayOutChat = Reflection.getNMSClass("PacketPlayOutChat");
|
||||
public static void sendRawMessage(Player player, String message)
|
||||
{
|
||||
try {
|
||||
System.out.println("1");
|
||||
Object handle = Reflection.getHandle(player);
|
||||
System.out.println("2");
|
||||
Object connection = Reflection.getField(handle.getClass(), "playerConnection").get(handle);
|
||||
System.out.println("3");
|
||||
Object serialized = Reflection.getMethod(nmsChatSerializer, "a", String.class).invoke(null, message);
|
||||
System.out.println("4");
|
||||
Object packet = nmsPacketPlayOutChat.getConstructor(Reflection.getNMSClass("IChatBaseComponent")).newInstance(serialized);
|
||||
System.out.println("5");
|
||||
Reflection.getMethod(connection.getClass(), "sendPacket").invoke(connection, packet);
|
||||
System.out.println("6");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,81 +0,0 @@
|
|||
package tk.sznp.thebuttonautoflair;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
|
||||
import de.inventivegames.TellRawAutoMessage.Reflection;
|
||||
|
||||
public class PlayerListener implements Listener
|
||||
{ //2015.07.16.
|
||||
@EventHandler
|
||||
public void onPlayerJoin(PlayerJoinEvent event)
|
||||
{
|
||||
Player p=event.getPlayer();
|
||||
//PluginMain.Players.add(p);
|
||||
//event.getPlayer().setDisplayName(p.getDisplayName()+PluginMain.GetFlair(p));
|
||||
//if(PluginMain.PlayerUserNames.containsKey(p.getName())) //<-- 2015.07.20.
|
||||
if(MaybeOfflinePlayer.AllPlayers.containsKey(p.getName())) //<-- 2015.08.08.
|
||||
//PluginMain.AppendPlayerDisplayFlair(p, PluginMain.PlayerUserNames.get(p.getName()), PluginMain.GetFlair(p));
|
||||
{
|
||||
MaybeOfflinePlayer mp = MaybeOfflinePlayer.AllPlayers.get(p.getName());
|
||||
PluginMain.AppendPlayerDisplayFlair(p, mp.UserName, mp.Flair);
|
||||
}
|
||||
else
|
||||
{ //2015.07.20.
|
||||
String json="[\"\",{\"text\":\"§6Hi! If you'd like your flair displayed ingame, write your Minecraft name to \"},{\"text\":\"[this thread.]\",\"clickEvent\":{\"action\":\"open_url\",\"value\":\"https://www.reddit.com/r/TheButtonMinecraft/comments/3d25do/\"},\"hoverEvent\":{\"action\":\"show_text\",\"value\":{\"text\":\"\",\"extra\":[{\"text\":\"Click here to go to the Reddit thread§r\"}]}}}]";
|
||||
sendRawMessage(p, json);
|
||||
}
|
||||
//System.out.println("Added player "+p.getName());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerLeave(PlayerQuitEvent event)
|
||||
{
|
||||
//for(Player player : PluginMain.Players)
|
||||
/*for(int i=0; i<PluginMain.Players.size();)
|
||||
{
|
||||
Player player=PluginMain.Players.get(i);
|
||||
if(player.getName().equals(event.getPlayer().getName()))
|
||||
{
|
||||
PluginMain.Players.remove(player);
|
||||
//System.out.println("Removed player "+event.getPlayer().getName());
|
||||
}
|
||||
else
|
||||
i++; //If the player is removed, the next item will be on the same index
|
||||
}*/
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerChat(AsyncPlayerChatEvent event)
|
||||
{
|
||||
//event.setFormat(event.getFormat().substring(0, event.getFormat().indexOf(">"))+"(test)> "+event.getMessage()); //2015.08.08.
|
||||
String flair=MaybeOfflinePlayer.AllPlayers.get(event.getPlayer().getName()).Flair; //2015.08.08.
|
||||
event.setFormat(event.getFormat().substring(0, event.getFormat().indexOf(">"))+flair+"> "+event.getMessage()); //2015.08.08.
|
||||
}
|
||||
|
||||
private static Class<?> nmsChatSerializer = Reflection.getNMSClass("IChatBaseComponent$ChatSerializer");
|
||||
private static Class<?> nmsPacketPlayOutChat = Reflection.getNMSClass("PacketPlayOutChat");
|
||||
public static void sendRawMessage(Player player, String message)
|
||||
{
|
||||
try {
|
||||
System.out.println("1");
|
||||
Object handle = Reflection.getHandle(player);
|
||||
System.out.println("2");
|
||||
Object connection = Reflection.getField(handle.getClass(), "playerConnection").get(handle);
|
||||
System.out.println("3");
|
||||
Object serialized = Reflection.getMethod(nmsChatSerializer, "a", String.class).invoke(null, message);
|
||||
System.out.println("4");
|
||||
Object packet = nmsPacketPlayOutChat.getConstructor(Reflection.getNMSClass("IChatBaseComponent")).newInstance(serialized);
|
||||
System.out.println("5");
|
||||
Reflection.getMethod(connection.getClass(), "sendPacket").invoke(connection, packet);
|
||||
System.out.println("6");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,83 +0,0 @@
|
|||
package tk.sznp.thebuttonautoflair;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
|
||||
import de.inventivegames.TellRawAutoMessage.Reflection;
|
||||
|
||||
public class PlayerListener implements Listener
|
||||
{ //2015.07.16.
|
||||
@EventHandler
|
||||
public void onPlayerJoin(PlayerJoinEvent event)
|
||||
{
|
||||
Player p=event.getPlayer();
|
||||
//PluginMain.Players.add(p);
|
||||
//event.getPlayer().setDisplayName(p.getDisplayName()+PluginMain.GetFlair(p));
|
||||
//if(PluginMain.PlayerUserNames.containsKey(p.getName())) //<-- 2015.07.20.
|
||||
MaybeOfflinePlayer mp = MaybeOfflinePlayer.AllPlayers.get(p.getName());
|
||||
if(!MaybeOfflinePlayer.AllPlayers.containsKey(p.getName())) //<-- 2015.08.08.
|
||||
MaybeOfflinePlayer.AddPlayerIfNeeded(p.getName()); //2015.08.08.
|
||||
if()
|
||||
//PluginMain.AppendPlayerDisplayFlair(p, PluginMain.PlayerUserNames.get(p.getName()), PluginMain.GetFlair(p));
|
||||
PluginMain.AppendPlayerDisplayFlair(p, mp.UserName, mp.Flair);
|
||||
else
|
||||
{ //2015.07.20.
|
||||
String json="[\"\",{\"text\":\"§6Hi! If you'd like your flair displayed ingame, write your Minecraft name to \"},{\"text\":\"[this thread.]\",\"clickEvent\":{\"action\":\"open_url\",\"value\":\"https://www.reddit.com/r/TheButtonMinecraft/comments/3d25do/\"},\"hoverEvent\":{\"action\":\"show_text\",\"value\":{\"text\":\"\",\"extra\":[{\"text\":\"Click here to go to the Reddit thread§r\"}]}}}]";
|
||||
sendRawMessage(p, json);
|
||||
}
|
||||
//System.out.println("Added player "+p.getName());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerLeave(PlayerQuitEvent event)
|
||||
{
|
||||
//for(Player player : PluginMain.Players)
|
||||
/*for(int i=0; i<PluginMain.Players.size();)
|
||||
{
|
||||
Player player=PluginMain.Players.get(i);
|
||||
if(player.getName().equals(event.getPlayer().getName()))
|
||||
{
|
||||
PluginMain.Players.remove(player);
|
||||
//System.out.println("Removed player "+event.getPlayer().getName());
|
||||
}
|
||||
else
|
||||
i++; //If the player is removed, the next item will be on the same index
|
||||
}*/
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerChat(AsyncPlayerChatEvent event)
|
||||
{
|
||||
//event.setFormat(event.getFormat().substring(0, event.getFormat().indexOf(">"))+"(test)> "+event.getMessage()); //2015.08.08.
|
||||
String flair=MaybeOfflinePlayer.AllPlayers.get(event.getPlayer().getName()).Flair; //2015.08.08.
|
||||
if(flair==null)
|
||||
flair=""; //2015.08.08.
|
||||
event.setFormat(event.getFormat().substring(0, event.getFormat().indexOf(">"))+flair+"> "+event.getMessage()); //2015.08.08.
|
||||
}
|
||||
|
||||
private static Class<?> nmsChatSerializer = Reflection.getNMSClass("IChatBaseComponent$ChatSerializer");
|
||||
private static Class<?> nmsPacketPlayOutChat = Reflection.getNMSClass("PacketPlayOutChat");
|
||||
public static void sendRawMessage(Player player, String message)
|
||||
{
|
||||
try {
|
||||
System.out.println("1");
|
||||
Object handle = Reflection.getHandle(player);
|
||||
System.out.println("2");
|
||||
Object connection = Reflection.getField(handle.getClass(), "playerConnection").get(handle);
|
||||
System.out.println("3");
|
||||
Object serialized = Reflection.getMethod(nmsChatSerializer, "a", String.class).invoke(null, message);
|
||||
System.out.println("4");
|
||||
Object packet = nmsPacketPlayOutChat.getConstructor(Reflection.getNMSClass("IChatBaseComponent")).newInstance(serialized);
|
||||
System.out.println("5");
|
||||
Reflection.getMethod(connection.getClass(), "sendPacket").invoke(connection, packet);
|
||||
System.out.println("6");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,83 +0,0 @@
|
|||
package tk.sznp.thebuttonautoflair;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
|
||||
import de.inventivegames.TellRawAutoMessage.Reflection;
|
||||
|
||||
public class PlayerListener implements Listener
|
||||
{ //2015.07.16.
|
||||
@EventHandler
|
||||
public void onPlayerJoin(PlayerJoinEvent event)
|
||||
{
|
||||
Player p=event.getPlayer();
|
||||
//PluginMain.Players.add(p);
|
||||
//event.getPlayer().setDisplayName(p.getDisplayName()+PluginMain.GetFlair(p));
|
||||
//if(PluginMain.PlayerUserNames.containsKey(p.getName())) //<-- 2015.07.20.
|
||||
if(MaybeOfflinePlayer.AllPlayers.containsKey(p.getName())) //<-- 2015.08.08.
|
||||
//PluginMain.AppendPlayerDisplayFlair(p, PluginMain.PlayerUserNames.get(p.getName()), PluginMain.GetFlair(p));
|
||||
{
|
||||
MaybeOfflinePlayer mp = MaybeOfflinePlayer.AllPlayers.get(p.getName());
|
||||
PluginMain.AppendPlayerDisplayFlair(p, mp.UserName, mp.Flair);
|
||||
}
|
||||
else
|
||||
{ //2015.07.20.
|
||||
String json="[\"\",{\"text\":\"§6Hi! If you'd like your flair displayed ingame, write your Minecraft name to \"},{\"text\":\"[this thread.]\",\"clickEvent\":{\"action\":\"open_url\",\"value\":\"https://www.reddit.com/r/TheButtonMinecraft/comments/3d25do/\"},\"hoverEvent\":{\"action\":\"show_text\",\"value\":{\"text\":\"\",\"extra\":[{\"text\":\"Click here to go to the Reddit thread§r\"}]}}}]";
|
||||
sendRawMessage(p, json);
|
||||
}
|
||||
//System.out.println("Added player "+p.getName());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerLeave(PlayerQuitEvent event)
|
||||
{
|
||||
//for(Player player : PluginMain.Players)
|
||||
/*for(int i=0; i<PluginMain.Players.size();)
|
||||
{
|
||||
Player player=PluginMain.Players.get(i);
|
||||
if(player.getName().equals(event.getPlayer().getName()))
|
||||
{
|
||||
PluginMain.Players.remove(player);
|
||||
//System.out.println("Removed player "+event.getPlayer().getName());
|
||||
}
|
||||
else
|
||||
i++; //If the player is removed, the next item will be on the same index
|
||||
}*/
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerChat(AsyncPlayerChatEvent event)
|
||||
{
|
||||
//event.setFormat(event.getFormat().substring(0, event.getFormat().indexOf(">"))+"(test)> "+event.getMessage()); //2015.08.08.
|
||||
String flair=MaybeOfflinePlayer.AllPlayers.get(event.getPlayer().getName()).Flair; //2015.08.08.
|
||||
if(flair==null)
|
||||
flair="";
|
||||
event.setFormat(event.getFormat().substring(0, event.getFormat().indexOf(">"))+flair+"> "+event.getMessage()); //2015.08.08.
|
||||
}
|
||||
|
||||
private static Class<?> nmsChatSerializer = Reflection.getNMSClass("IChatBaseComponent$ChatSerializer");
|
||||
private static Class<?> nmsPacketPlayOutChat = Reflection.getNMSClass("PacketPlayOutChat");
|
||||
public static void sendRawMessage(Player player, String message)
|
||||
{
|
||||
try {
|
||||
System.out.println("1");
|
||||
Object handle = Reflection.getHandle(player);
|
||||
System.out.println("2");
|
||||
Object connection = Reflection.getField(handle.getClass(), "playerConnection").get(handle);
|
||||
System.out.println("3");
|
||||
Object serialized = Reflection.getMethod(nmsChatSerializer, "a", String.class).invoke(null, message);
|
||||
System.out.println("4");
|
||||
Object packet = nmsPacketPlayOutChat.getConstructor(Reflection.getNMSClass("IChatBaseComponent")).newInstance(serialized);
|
||||
System.out.println("5");
|
||||
Reflection.getMethod(connection.getClass(), "sendPacket").invoke(connection, packet);
|
||||
System.out.println("6");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,83 +0,0 @@
|
|||
package tk.sznp.thebuttonautoflair;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
|
||||
import de.inventivegames.TellRawAutoMessage.Reflection;
|
||||
|
||||
public class PlayerListener implements Listener
|
||||
{ //2015.07.16.
|
||||
@EventHandler
|
||||
public void onPlayerJoin(PlayerJoinEvent event)
|
||||
{
|
||||
Player p=event.getPlayer();
|
||||
//PluginMain.Players.add(p);
|
||||
//event.getPlayer().setDisplayName(p.getDisplayName()+PluginMain.GetFlair(p));
|
||||
//if(PluginMain.PlayerUserNames.containsKey(p.getName())) //<-- 2015.07.20.
|
||||
MaybeOfflinePlayer.AddPlayerIfNeeded(p.getName()); //2015.08.08.
|
||||
MaybeOfflinePlayer mp = MaybeOfflinePlayer.AllPlayers.get(p.getName()); //2015.08.08.
|
||||
if(mp.Flair!=null)
|
||||
//PluginMain.AppendPlayerDisplayFlair(p, PluginMain.PlayerUserNames.get(p.getName()), PluginMain.GetFlair(p));
|
||||
PluginMain.AppendPlayerDisplayFlair(p, mp.UserName, mp.Flair);
|
||||
else
|
||||
{ //2015.07.20.
|
||||
String json="[\"\",{\"text\":\"§6Hi! If you'd like your flair displayed ingame, write your Minecraft name to \"},{\"text\":\"[this thread.]\",\"clickEvent\":{\"action\":\"open_url\",\"value\":\"https://www.reddit.com/r/TheButtonMinecraft/comments/3d25do/\"},\"hoverEvent\":{\"action\":\"show_text\",\"value\":{\"text\":\"\",\"extra\":[{\"text\":\"Click here to go to the Reddit thread§r\"}]}}}]";
|
||||
sendRawMessage(p, json);
|
||||
}
|
||||
//System.out.println("Added player "+p.getName());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerLeave(PlayerQuitEvent event)
|
||||
{
|
||||
//for(Player player : PluginMain.Players)
|
||||
/*for(int i=0; i<PluginMain.Players.size();)
|
||||
{
|
||||
Player player=PluginMain.Players.get(i);
|
||||
if(player.getName().equals(event.getPlayer().getName()))
|
||||
{
|
||||
PluginMain.Players.remove(player);
|
||||
//System.out.println("Removed player "+event.getPlayer().getName());
|
||||
}
|
||||
else
|
||||
i++; //If the player is removed, the next item will be on the same index
|
||||
}*/
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerChat(AsyncPlayerChatEvent event)
|
||||
{
|
||||
//event.setFormat(event.getFormat().substring(0, event.getFormat().indexOf(">"))+"(test)> "+event.getMessage()); //2015.08.08.
|
||||
MaybeOfflinePlayer player = MaybeOfflinePlayer.AllPlayers.get(event.getPlayer().getName());
|
||||
String flair=player.Flair; //2015.08.08.
|
||||
if(flair==null || player.AcceptedFlair)
|
||||
flair=""; //2015.08.08.
|
||||
event.setFormat(event.getFormat().substring(0, event.getFormat().indexOf(">"))+flair+"> "+event.getMessage()); //2015.08.08.
|
||||
}
|
||||
|
||||
private static Class<?> nmsChatSerializer = Reflection.getNMSClass("IChatBaseComponent$ChatSerializer");
|
||||
private static Class<?> nmsPacketPlayOutChat = Reflection.getNMSClass("PacketPlayOutChat");
|
||||
public static void sendRawMessage(Player player, String message)
|
||||
{
|
||||
try {
|
||||
System.out.println("1");
|
||||
Object handle = Reflection.getHandle(player);
|
||||
System.out.println("2");
|
||||
Object connection = Reflection.getField(handle.getClass(), "playerConnection").get(handle);
|
||||
System.out.println("3");
|
||||
Object serialized = Reflection.getMethod(nmsChatSerializer, "a", String.class).invoke(null, message);
|
||||
System.out.println("4");
|
||||
Object packet = nmsPacketPlayOutChat.getConstructor(Reflection.getNMSClass("IChatBaseComponent")).newInstance(serialized);
|
||||
System.out.println("5");
|
||||
Reflection.getMethod(connection.getClass(), "sendPacket").invoke(connection, packet);
|
||||
System.out.println("6");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,82 +0,0 @@
|
|||
package tk.sznp.thebuttonautoflair;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
|
||||
import de.inventivegames.TellRawAutoMessage.Reflection;
|
||||
|
||||
public class PlayerListener implements Listener
|
||||
{ //2015.07.16.
|
||||
@EventHandler
|
||||
public void onPlayerJoin(PlayerJoinEvent event)
|
||||
{
|
||||
Player p=event.getPlayer();
|
||||
//PluginMain.Players.add(p);
|
||||
//event.getPlayer().setDisplayName(p.getDisplayName()+PluginMain.GetFlair(p));
|
||||
//if(PluginMain.PlayerUserNames.containsKey(p.getName())) //<-- 2015.07.20.
|
||||
MaybeOfflinePlayer.AddPlayerIfNeeded(p.getName()); //2015.08.08.
|
||||
MaybeOfflinePlayer mp = MaybeOfflinePlayer.AllPlayers.get(p.getName()); //2015.08.08.
|
||||
if(mp.Flair!=null)
|
||||
//PluginMain.AppendPlayerDisplayFlair(p, PluginMain.PlayerUserNames.get(p.getName()), PluginMain.GetFlair(p));
|
||||
PluginMain.AppendPlayerDisplayFlair(p, mp.UserName, mp.Flair);
|
||||
else
|
||||
{ //2015.07.20.
|
||||
String json="[\"\",{\"text\":\"§6Hi! If you'd like your flair displayed ingame, write your Minecraft name to \"},{\"text\":\"[this thread.]\",\"clickEvent\":{\"action\":\"open_url\",\"value\":\"https://www.reddit.com/r/TheButtonMinecraft/comments/3d25do/\"},\"hoverEvent\":{\"action\":\"show_text\",\"value\":{\"text\":\"\",\"extra\":[{\"text\":\"Click here to go to the Reddit thread§r\"}]}}}]";
|
||||
sendRawMessage(p, json);
|
||||
}
|
||||
//System.out.println("Added player "+p.getName());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerLeave(PlayerQuitEvent event)
|
||||
{
|
||||
//for(Player player : PluginMain.Players)
|
||||
/*for(int i=0; i<PluginMain.Players.size();)
|
||||
{
|
||||
Player player=PluginMain.Players.get(i);
|
||||
if(player.getName().equals(event.getPlayer().getName()))
|
||||
{
|
||||
PluginMain.Players.remove(player);
|
||||
//System.out.println("Removed player "+event.getPlayer().getName());
|
||||
}
|
||||
else
|
||||
i++; //If the player is removed, the next item will be on the same index
|
||||
}*/
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerChat(AsyncPlayerChatEvent event)
|
||||
{
|
||||
//event.setFormat(event.getFormat().substring(0, event.getFormat().indexOf(">"))+"(test)> "+event.getMessage()); //2015.08.08.
|
||||
String flair=MaybeOfflinePlayer.AllPlayers.get(event.getPlayer().getName()).Flair; //2015.08.08.
|
||||
if(flair==null)
|
||||
flair=""; //2015.08.08.
|
||||
event.setFormat(event.getFormat().substring(0, event.getFormat().indexOf(">"))+flair+"> "+event.getMessage()); //2015.08.08.
|
||||
}
|
||||
|
||||
private static Class<?> nmsChatSerializer = Reflection.getNMSClass("IChatBaseComponent$ChatSerializer");
|
||||
private static Class<?> nmsPacketPlayOutChat = Reflection.getNMSClass("PacketPlayOutChat");
|
||||
public static void sendRawMessage(Player player, String message)
|
||||
{
|
||||
try {
|
||||
System.out.println("1");
|
||||
Object handle = Reflection.getHandle(player);
|
||||
System.out.println("2");
|
||||
Object connection = Reflection.getField(handle.getClass(), "playerConnection").get(handle);
|
||||
System.out.println("3");
|
||||
Object serialized = Reflection.getMethod(nmsChatSerializer, "a", String.class).invoke(null, message);
|
||||
System.out.println("4");
|
||||
Object packet = nmsPacketPlayOutChat.getConstructor(Reflection.getNMSClass("IChatBaseComponent")).newInstance(serialized);
|
||||
System.out.println("5");
|
||||
Reflection.getMethod(connection.getClass(), "sendPacket").invoke(connection, packet);
|
||||
System.out.println("6");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,82 +0,0 @@
|
|||
package tk.sznp.thebuttonautoflair;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
|
||||
import de.inventivegames.TellRawAutoMessage.Reflection;
|
||||
|
||||
public class PlayerListener implements Listener
|
||||
{ //2015.07.16.
|
||||
@EventHandler
|
||||
public void onPlayerJoin(PlayerJoinEvent event)
|
||||
{
|
||||
Player p=event.getPlayer();
|
||||
//PluginMain.Players.add(p);
|
||||
//event.getPlayer().setDisplayName(p.getDisplayName()+PluginMain.GetFlair(p));
|
||||
//if(PluginMain.PlayerUserNames.containsKey(p.getName())) //<-- 2015.07.20.
|
||||
MaybeOfflinePlayer.AddPlayerIfNeeded(p.getName()); //2015.08.08.
|
||||
MaybeOfflinePlayer mp = MaybeOfflinePlayer.AllPlayers.get(p.getName()); //2015.08.08.
|
||||
if(mp.Flair!=null)
|
||||
//PluginMain.AppendPlayerDisplayFlair(p, PluginMain.PlayerUserNames.get(p.getName()), PluginMain.GetFlair(p));
|
||||
PluginMain.AppendPlayerDisplayFlair(p, mp.UserName, mp.Flair);
|
||||
else
|
||||
{ //2015.07.20.
|
||||
String json="[\"\",{\"text\":\"§6Hi! If you'd like your flair displayed ingame, write your Minecraft name to \"},{\"text\":\"[this thread.]\",\"clickEvent\":{\"action\":\"open_url\",\"value\":\"https://www.reddit.com/r/TheButtonMinecraft/comments/3d25do/\"},\"hoverEvent\":{\"action\":\"show_text\",\"value\":{\"text\":\"\",\"extra\":[{\"text\":\"Click here to go to the Reddit thread§r\"}]}}}]";
|
||||
sendRawMessage(p, json);
|
||||
}
|
||||
//System.out.println("Added player "+p.getName());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerLeave(PlayerQuitEvent event)
|
||||
{
|
||||
//for(Player player : PluginMain.Players)
|
||||
/*for(int i=0; i<PluginMain.Players.size();)
|
||||
{
|
||||
Player player=PluginMain.Players.get(i);
|
||||
if(player.getName().equals(event.getPlayer().getName()))
|
||||
{
|
||||
PluginMain.Players.remove(player);
|
||||
//System.out.println("Removed player "+event.getPlayer().getName());
|
||||
}
|
||||
else
|
||||
i++; //If the player is removed, the next item will be on the same index
|
||||
}*/
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerChat(AsyncPlayerChatEvent event)
|
||||
{
|
||||
//event.setFormat(event.getFormat().substring(0, event.getFormat().indexOf(">"))+"(test)> "+event.getMessage()); //2015.08.08.
|
||||
String flair=MaybeOfflinePlayer.AllPlayers.get(event.getPlayer().getName()).Flair; //2015.08.08.
|
||||
if(flair==null)
|
||||
flair=""; //2015.08.08.
|
||||
event.setFormat(event.getFormat().substring(0, event.getFormat().indexOf(">"))+flair+"> "+event.getMessage()); //2015.08.08.
|
||||
}
|
||||
|
||||
private static Class<?> nmsChatSerializer = Reflection.getNMSClass("IChatBaseComponent$ChatSerializer");
|
||||
private static Class<?> nmsPacketPlayOutChat = Reflection.getNMSClass("PacketPlayOutChat");
|
||||
public static void sendRawMessage(Player player, String message)
|
||||
{
|
||||
try {
|
||||
System.out.println("1");
|
||||
Object handle = Reflection.getHandle(player);
|
||||
System.out.println("2");
|
||||
Object connection = Reflection.getField(handle.getClass(), "playerConnection").get(handle);
|
||||
System.out.println("3");
|
||||
Object serialized = Reflection.getMethod(nmsChatSerializer, "a", String.class).invoke(null, message);
|
||||
System.out.println("4");
|
||||
Object packet = nmsPacketPlayOutChat.getConstructor(Reflection.getNMSClass("IChatBaseComponent")).newInstance(serialized);
|
||||
System.out.println("5");
|
||||
Reflection.getMethod(connection.getClass(), "sendPacket").invoke(connection, packet);
|
||||
System.out.println("6");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -163,7 +163,7 @@
|
|||
<tags>persp.viewSC:org.eclipse.mylyn.tasks.ui.views.tasks</tags>
|
||||
<tags>persp.newWizSC:org.eclipse.mylyn.tasks.ui.wizards.new.repository.task</tags>
|
||||
<tags>persp.perspSC:org.eclipse.wst.jsdt.ui.JavaPerspective</tags>
|
||||
<children xsi:type="basic:PartSashContainer" xmi:id="_c1_yESr1EeWsptewEJl0pA" selectedElement="_c1_yEir1EeWsptewEJl0pA" horizontal="true">
|
||||
<children xsi:type="basic:PartSashContainer" xmi:id="_c1_yESr1EeWsptewEJl0pA" selectedElement="_c2AZJCr1EeWsptewEJl0pA" horizontal="true">
|
||||
<children xsi:type="basic:PartSashContainer" xmi:id="_c1_yEir1EeWsptewEJl0pA" containerData="2500" selectedElement="_c1_yEyr1EeWsptewEJl0pA">
|
||||
<children xsi:type="basic:PartStack" xmi:id="_c1_yEyr1EeWsptewEJl0pA" elementId="left" containerData="6000" selectedElement="_c1_yFCr1EeWsptewEJl0pA">
|
||||
<tags>newtablook</tags>
|
||||
|
@ -179,7 +179,7 @@
|
|||
<children xsi:type="advanced:Placeholder" xmi:id="_c2AZIyr1EeWsptewEJl0pA" elementId="org.eclipse.egit.ui.RepositoriesView" toBeRendered="false" ref="_c19V0Cr1EeWsptewEJl0pA"/>
|
||||
</children>
|
||||
</children>
|
||||
<children xsi:type="basic:PartSashContainer" xmi:id="_c2AZJCr1EeWsptewEJl0pA" containerData="7500" selectedElement="_c2BAMyr1EeWsptewEJl0pA">
|
||||
<children xsi:type="basic:PartSashContainer" xmi:id="_c2AZJCr1EeWsptewEJl0pA" containerData="7500" selectedElement="_c2AZJSr1EeWsptewEJl0pA">
|
||||
<children xsi:type="basic:PartSashContainer" xmi:id="_c2AZJSr1EeWsptewEJl0pA" containerData="7500" selectedElement="_c2AZJir1EeWsptewEJl0pA" horizontal="true">
|
||||
<children xsi:type="advanced:Placeholder" xmi:id="_c2AZJir1EeWsptewEJl0pA" elementId="org.eclipse.ui.editorss" containerData="7500" ref="_7EfmcCr0EeWsptewEJl0pA"/>
|
||||
<children xsi:type="basic:PartSashContainer" xmi:id="_c2AZJyr1EeWsptewEJl0pA" containerData="2500" selectedElement="_c2AZKCr1EeWsptewEJl0pA">
|
||||
|
@ -240,19 +240,20 @@
|
|||
<tags>org.eclipse.e4.primaryDataStack</tags>
|
||||
<tags>EditorStack</tags>
|
||||
<children xsi:type="basic:Part" xmi:id="__kGwMD-LEeWprK50eVwiGQ" elementId="org.eclipse.e4.ui.compatibility.editor" contributionURI="bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor" label="PluginMain.java" iconURI="platform:/plugin/org.eclipse.jdt.ui/icons/full/obj16/jcu_obj.gif" tooltip="TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/PluginMain.java" closeable="true">
|
||||
<persistedState key="memento" value="<?xml version="1.0" encoding="UTF-8"?>
<editor id="org.eclipse.jdt.ui.CompilationUnitEditor">
<input factoryID="org.eclipse.ui.part.FileEditorInputFactory" path="/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/PluginMain.java"/>
<editorState selectionHorizontalPixel="0" selectionLength="0" selectionOffset="14617" selectionTopPixel="5898"/>
</editor>"/>
|
||||
<persistedState key="memento" value="<?xml version="1.0" encoding="UTF-8"?>
<editor id="org.eclipse.jdt.ui.CompilationUnitEditor">
<input factoryID="org.eclipse.ui.part.FileEditorInputFactory" path="/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/PluginMain.java"/>
<editorState selectionHorizontalPixel="0" selectionLength="0" selectionOffset="12375" selectionTopPixel="5250"/>
</editor>"/>
|
||||
<tags>Editor</tags>
|
||||
<tags>org.eclipse.jdt.ui.CompilationUnitEditor</tags>
|
||||
<tags>removeOnHide</tags>
|
||||
<tags>activeOnClose</tags>
|
||||
</children>
|
||||
<children xsi:type="basic:Part" xmi:id="_h4cFECuhEeWsptewEJl0pA" elementId="org.eclipse.e4.ui.compatibility.editor" contributionURI="bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor" label="Commands.java" iconURI="platform:/plugin/org.eclipse.jdt.ui/icons/full/obj16/jcu_obj.gif" tooltip="TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/Commands.java" closeable="true">
|
||||
<persistedState key="memento" value="<?xml version="1.0" encoding="UTF-8"?>
<editor id="org.eclipse.jdt.ui.CompilationUnitEditor">
<input factoryID="org.eclipse.ui.part.FileEditorInputFactory" path="/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/Commands.java"/>
<editorState selectionHorizontalPixel="0" selectionLength="0" selectionOffset="9113" selectionTopPixel="3423"/>
</editor>"/>
|
||||
<persistedState key="memento" value="<?xml version="1.0" encoding="UTF-8"?>
<editor id="org.eclipse.jdt.ui.CompilationUnitEditor">
<input factoryID="org.eclipse.ui.part.FileEditorInputFactory" path="/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/Commands.java"/>
<editorState selectionHorizontalPixel="0" selectionLength="0" selectionOffset="9113" selectionTopPixel="3290"/>
</editor>"/>
|
||||
<tags>Editor</tags>
|
||||
<tags>org.eclipse.jdt.ui.CompilationUnitEditor</tags>
|
||||
<tags>removeOnHide</tags>
|
||||
</children>
|
||||
<children xsi:type="basic:Part" xmi:id="_t4aYYD4IEeW_qLWp8BCh0w" elementId="org.eclipse.e4.ui.compatibility.editor" contributionURI="bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor" label="PlayerListener.java" iconURI="platform:/plugin/org.eclipse.jdt.ui/icons/full/obj16/jcu_obj.gif" tooltip="TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/PlayerListener.java" closeable="true">
|
||||
<persistedState key="memento" value="<?xml version="1.0" encoding="UTF-8"?>
<editor id="org.eclipse.jdt.ui.CompilationUnitEditor">
<input factoryID="org.eclipse.ui.part.FileEditorInputFactory" path="/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/PlayerListener.java"/>
<editorState selectionHorizontalPixel="0" selectionLength="0" selectionOffset="1576" selectionTopPixel="300"/>
</editor>"/>
|
||||
<persistedState key="memento" value="<?xml version="1.0" encoding="UTF-8"?>
<editor id="org.eclipse.jdt.ui.CompilationUnitEditor">
<input factoryID="org.eclipse.ui.part.FileEditorInputFactory" path="/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/PlayerListener.java"/>
<editorState selectionHorizontalPixel="0" selectionLength="0" selectionOffset="2153" selectionTopPixel="275"/>
</editor>"/>
|
||||
<tags>Editor</tags>
|
||||
<tags>org.eclipse.jdt.ui.CompilationUnitEditor</tags>
|
||||
<tags>removeOnHide</tags>
|
||||
|
@ -322,8 +323,8 @@
|
|||
<tags>View</tags>
|
||||
<tags>categoryTag:General</tags>
|
||||
</sharedElements>
|
||||
<sharedElements xsi:type="basic:Part" xmi:id="_77aAUCr0EeWsptewEJl0pA" elementId="org.eclipse.ui.views.ProblemView" contributionURI="bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.e4.compatibility.CompatibilityView" label="Problems" iconURI="platform:/plugin/org.eclipse.ui.ide/icons/full/eview16/problems_view.gif" tooltip="0 errors, 2 warnings, 0 others" closeable="true">
|
||||
<persistedState key="memento" value="<?xml version="1.0" encoding="UTF-8"?>
<view PRIMARY_SORT_FIELD="org.eclipse.ui.ide.severityAndDescriptionField" categoryGroup="org.eclipse.ui.ide.severity" markerContentGenerator="org.eclipse.ui.ide.problemsGenerator" partName="Problems">
<columnWidths org.eclipse.ui.ide.locationField="90" org.eclipse.ui.ide.markerType="90" org.eclipse.ui.ide.pathField="120" org.eclipse.ui.ide.resourceField="90" org.eclipse.ui.ide.severityAndDescriptionField="300"/>
<visible IMemento.internal.id="org.eclipse.ui.ide.severityAndDescriptionField"/>
<visible IMemento.internal.id="org.eclipse.ui.ide.resourceField"/>
<visible IMemento.internal.id="org.eclipse.ui.ide.pathField"/>
<visible IMemento.internal.id="org.eclipse.ui.ide.locationField"/>
<visible IMemento.internal.id="org.eclipse.ui.ide.markerType"/>
</view>"/>
|
||||
<sharedElements xsi:type="basic:Part" xmi:id="_77aAUCr0EeWsptewEJl0pA" elementId="org.eclipse.ui.views.ProblemView" contributionURI="bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.e4.compatibility.CompatibilityView" label="Problems" iconURI="platform:/plugin/org.eclipse.ui.ide/icons/full/eview16/problems_view.gif" tooltip="0 errors, 1 warning, 0 others" closeable="true">
|
||||
<persistedState key="memento" value="<?xml version="1.0" encoding="UTF-8"?>
<view PRIMARY_SORT_FIELD="org.eclipse.ui.ide.severityAndDescriptionField" categoryGroup="org.eclipse.ui.ide.severity" markerContentGenerator="org.eclipse.ui.ide.problemsGenerator" partName="Problems">
<expanded>
<category IMemento.internal.id="Errors"/>
<category IMemento.internal.id="Warnings"/>
<category IMemento.internal.id="Warnings (2 items)"/>
</expanded>
<columnWidths org.eclipse.ui.ide.locationField="90" org.eclipse.ui.ide.markerType="90" org.eclipse.ui.ide.pathField="120" org.eclipse.ui.ide.resourceField="90" org.eclipse.ui.ide.severityAndDescriptionField="300"/>
<visible IMemento.internal.id="org.eclipse.ui.ide.severityAndDescriptionField"/>
<visible IMemento.internal.id="org.eclipse.ui.ide.resourceField"/>
<visible IMemento.internal.id="org.eclipse.ui.ide.pathField"/>
<visible IMemento.internal.id="org.eclipse.ui.ide.locationField"/>
<visible IMemento.internal.id="org.eclipse.ui.ide.markerType"/>
</view>"/>
|
||||
<tags>View</tags>
|
||||
<tags>categoryTag:General</tags>
|
||||
<menus xmi:id="_dGEOYCr1EeWsptewEJl0pA" elementId="org.eclipse.ui.views.ProblemView">
|
||||
|
@ -382,7 +383,6 @@
|
|||
<persistedState key="memento" value="<?xml version="1.0" encoding="UTF-8"?>
<view group_libraries="1" layout="2" linkWithEditor="0" rootMode="1" workingSetName="">
<customFilters userDefinedPatternsEnabled="false">
<xmlDefinedFilters>
<child filterId="org.eclipse.jdt.ui.PackageExplorer.StaticsFilter" isEnabled="false"/>
<child filterId="org.eclipse.jdt.ui.PackageExplorer_patternFilterId_RemoteSystemsTempFiles" isEnabled="true"/>
<child filterId="org.eclipse.jdt.ui.PackageExplorer_patternFilterId_RemoteSystemsConnections" isEnabled="true"/>
<child filterId="org.eclipse.mylyn.java.ui.MembersFilter" isEnabled="false"/>
<child filterId="org.eclipse.jdt.ui.PackageExplorer.NonJavaProjectsFilter" isEnabled="false"/>
<child filterId="org.eclipse.jdt.ui.PackageExplorer_patternFilterId_.*" isEnabled="true"/>
<child filterId="org.eclipse.jdt.ui.PackageExplorer.NonSharedProjectsFilter" isEnabled="false"/>
<child filterId="org.eclipse.jdt.ui.PackageExplorer.SyntheticMembersFilter" isEnabled="true"/>
<child filterId="org.eclipse.jdt.ui.PackageExplorer.ContainedLibraryFilter" isEnabled="false"/>
<child filterId="org.eclipse.jdt.internal.ui.PackageExplorer.HideInnerClassFilesFilter" isEnabled="true"/>
<child filterId="org.eclipse.jdt.internal.ui.PackageExplorer.EmptyInnerPackageFilter" isEnabled="true"/>
<child filterId="org.eclipse.jdt.ui.PackageExplorer.ClosedProjectsFilter" isEnabled="false"/>
<child filterId="org.eclipse.jdt.ui.PackageExplorer.EmptyLibraryContainerFilter" isEnabled="true"/>
<child filterId="org.eclipse.jdt.ui.PackageExplorer.PackageDeclarationFilter" isEnabled="true"/>
<child filterId="org.eclipse.jdt.ui.PackageExplorer.ImportDeclarationFilter" isEnabled="true"/>
<child filterId="org.eclipse.jdt.ui.PackageExplorer.NonJavaElementFilter" isEnabled="false"/>
<child filterId="org.eclipse.jdt.ui.PackageExplorer.LibraryFilter" isEnabled="false"/>
<child filterId="org.eclipse.pde.ui.BinaryProjectFilter1" isEnabled="false"/>
<child filterId="org.eclipse.jdt.ui.PackageExplorer.CuAndClassFileFilter" isEnabled="false"/>
<child filterId="org.eclipse.jdt.internal.ui.PackageExplorer.EmptyPackageFilter" isEnabled="false"/>
<child filterId="org.eclipse.jdt.ui.PackageExplorer.NonPublicFilter" isEnabled="false"/>
<child filterId="org.eclipse.jdt.ui.PackageExplorer.LocalTypesFilter" isEnabled="false"/>
<child filterId="org.eclipse.pde.ui.ExternalPluginLibrariesFilter1" isEnabled="true"/>
<child filterId="org.eclipse.jdt.ui.PackageExplorer.FieldsFilter" isEnabled="false"/>
</xmlDefinedFilters>
</customFilters>
</view>"/>
|
||||
<tags>View</tags>
|
||||
<tags>categoryTag:Java</tags>
|
||||
<tags>activeOnClose</tags>
|
||||
<menus xmi:id="_c3XEACr1EeWsptewEJl0pA" elementId="org.eclipse.jdt.ui.PackageExplorer">
|
||||
<tags>ViewMenu</tags>
|
||||
<tags>menuContribution:menu</tags>
|
||||
|
@ -426,18 +426,18 @@
|
|||
</children>
|
||||
<children xsi:type="menu:ToolBar" xmi:id="_6K2osCr0EeWsptewEJl0pA" elementId="org.eclipse.ui.workbench.file">
|
||||
<tags>Draggable</tags>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_4OFi4D-hEeWQmPenPG3GHg" elementId="new.group"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_4OGxAD-hEeWQmPenPG3GHg" elementId="newWizardDropDown"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_4OGxAT-hEeWQmPenPG3GHg" elementId="new.ext" visible="false"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_4OGxAj-hEeWQmPenPG3GHg" elementId="save.group" visible="false"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_4OHYED-hEeWQmPenPG3GHg" elementId="save"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_4OHYET-hEeWQmPenPG3GHg" elementId="saveAll"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_4OHYEj-hEeWQmPenPG3GHg" elementId="save.ext" visible="false"/>
|
||||
<children xsi:type="menu:HandledToolItem" xmi:id="_4OH_ID-hEeWQmPenPG3GHg" iconURI="platform:/plugin/org.eclipse.ui/icons/full/etool16/print_edit.gif" tooltip="Print" enabled="false" command="_3_hZmSr0EeWsptewEJl0pA"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_4OMQkD-hEeWQmPenPG3GHg" elementId="print.ext" visible="false"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_4OM3oD-hEeWQmPenPG3GHg" elementId="build.group"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_4OM3oT-hEeWQmPenPG3GHg" elementId="build.ext" visible="false"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_4OM3oj-hEeWQmPenPG3GHg" elementId="additions"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_aq8lwEJtEeWE1OT9z6GGpw" elementId="new.group"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_aq9M0EJtEeWE1OT9z6GGpw" elementId="newWizardDropDown"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_aq9M0UJtEeWE1OT9z6GGpw" elementId="new.ext" visible="false"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_aq9M0kJtEeWE1OT9z6GGpw" elementId="save.group" visible="false"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_aq9z4EJtEeWE1OT9z6GGpw" elementId="save"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_aq9z4UJtEeWE1OT9z6GGpw" elementId="saveAll"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_aq9z4kJtEeWE1OT9z6GGpw" elementId="save.ext" visible="false"/>
|
||||
<children xsi:type="menu:HandledToolItem" xmi:id="_aq-a8EJtEeWE1OT9z6GGpw" iconURI="platform:/plugin/org.eclipse.ui/icons/full/etool16/print_edit.gif" tooltip="Print" command="_3_hZmSr0EeWsptewEJl0pA"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_arFIoEJtEeWE1OT9z6GGpw" elementId="print.ext" visible="false"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_arFIoUJtEeWE1OT9z6GGpw" elementId="build.group"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_arFIokJtEeWE1OT9z6GGpw" elementId="build.ext" visible="false"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_arFvsEJtEeWE1OT9z6GGpw" elementId="additions"/>
|
||||
</children>
|
||||
<children xsi:type="menu:ToolBar" xmi:id="_6K2osSr0EeWsptewEJl0pA" elementId="additions" toBeRendered="false">
|
||||
<tags>toolbarSeparator</tags>
|
||||
|
@ -445,38 +445,38 @@
|
|||
</children>
|
||||
<children xsi:type="menu:ToolBar" xmi:id="_dIOxkCr1EeWsptewEJl0pA" elementId="adt.actionSet.avdManager">
|
||||
<tags>Draggable</tags>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_4XIKID-hEeWQmPenPG3GHg" elementId="android_project"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_4XIxMD-hEeWQmPenPG3GHg" elementId="com.android.ide.eclipse.adt.ui.sdkmanager"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_4XIxMT-hEeWQmPenPG3GHg" elementId="com.android.ide.eclipse.adt.ui.avdmanager"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_awQjkEJtEeWE1OT9z6GGpw" elementId="android_project"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_awQjkUJtEeWE1OT9z6GGpw" elementId="com.android.ide.eclipse.adt.ui.sdkmanager"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_awQjkkJtEeWE1OT9z6GGpw" elementId="com.android.ide.eclipse.adt.ui.avdmanager"/>
|
||||
</children>
|
||||
<children xsi:type="menu:ToolBar" xmi:id="_Mv4F0C3kEeWvSKv3oe_gqg" elementId="org.eclipse.debug.ui.breakpointActionSet">
|
||||
<tags>Draggable</tags>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_4XIxMj-hEeWQmPenPG3GHg" elementId="breakpointGroup"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_4XIxMz-hEeWQmPenPG3GHg" elementId="org.eclipse.debug.ui.actions.SkipAllBreakpoints"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_awRxsEJtEeWE1OT9z6GGpw" elementId="breakpointGroup"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_awSYwEJtEeWE1OT9z6GGpw" elementId="org.eclipse.debug.ui.actions.SkipAllBreakpoints"/>
|
||||
</children>
|
||||
<children xsi:type="menu:ToolBar" xmi:id="_dI4R0Cr1EeWsptewEJl0pA" elementId="adt.actionSet.lint">
|
||||
<tags>Draggable</tags>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_4XJYQD-hEeWQmPenPG3GHg" elementId="android_project"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_4XJYQT-hEeWQmPenPG3GHg" elementId="com.android.ide.eclipse.adt.ui.lintrunner"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_awSYwUJtEeWE1OT9z6GGpw" elementId="android_project"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_awSYwkJtEeWE1OT9z6GGpw" elementId="com.android.ide.eclipse.adt.ui.lintrunner"/>
|
||||
</children>
|
||||
<children xsi:type="menu:ToolBar" xmi:id="_dIyyQCr1EeWsptewEJl0pA" elementId="adt.actionSet.wizards">
|
||||
<tags>Draggable</tags>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_4XJYQj-hEeWQmPenPG3GHg" elementId="android_project"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_4XJYQz-hEeWQmPenPG3GHg" elementId="com.android.ide.eclipse.adt.wizards.actions.NewXmlFileAction"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_awS_0EJtEeWE1OT9z6GGpw" elementId="android_project"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_awS_0UJtEeWE1OT9z6GGpw" elementId="com.android.ide.eclipse.adt.wizards.actions.NewXmlFileAction"/>
|
||||
</children>
|
||||
<children xsi:type="menu:ToolBar" xmi:id="_8zAWsCr0EeWsptewEJl0pA" elementId="org.eclipse.debug.ui.launchActionSet">
|
||||
<tags>Draggable</tags>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_4XJYRD-hEeWQmPenPG3GHg" elementId="debug"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_4XJYRT-hEeWQmPenPG3GHg" elementId="org.eclipse.debug.internal.ui.actions.DebugDropDownAction"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_4XJYRj-hEeWQmPenPG3GHg" elementId="org.eclipse.debug.internal.ui.actions.RunDropDownAction"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_4XJ_UD-hEeWQmPenPG3GHg" elementId="org.eclipse.ui.externaltools.ExternalToolMenuDelegateToolbar"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_awS_0kJtEeWE1OT9z6GGpw" elementId="debug"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_awUN8EJtEeWE1OT9z6GGpw" elementId="org.eclipse.debug.internal.ui.actions.DebugDropDownAction"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_awYfYEJtEeWE1OT9z6GGpw" elementId="org.eclipse.debug.internal.ui.actions.RunDropDownAction"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_awYfYUJtEeWE1OT9z6GGpw" elementId="org.eclipse.ui.externaltools.ExternalToolMenuDelegateToolbar"/>
|
||||
</children>
|
||||
<children xsi:type="menu:ToolBar" xmi:id="_dG7xECr1EeWsptewEJl0pA" elementId="org.eclipse.jdt.ui.JavaElementCreationActionSet">
|
||||
<tags>Draggable</tags>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_4XJ_UT-hEeWQmPenPG3GHg" elementId="JavaWizards"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_4XJ_Uj-hEeWQmPenPG3GHg" elementId="org.eclipse.jdt.ui.actions.OpenProjectWizard"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_4XJ_Uz-hEeWQmPenPG3GHg" elementId="org.eclipse.jdt.ui.actions.OpenPackageWizard"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_4XJ_VD-hEeWQmPenPG3GHg" elementId="org.eclipse.jdt.ui.actions.NewTypeDropDown"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_awZGcEJtEeWE1OT9z6GGpw" elementId="JavaWizards"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_awZtgEJtEeWE1OT9z6GGpw" elementId="org.eclipse.jdt.ui.actions.OpenProjectWizard"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_awZtgUJtEeWE1OT9z6GGpw" elementId="org.eclipse.jdt.ui.actions.OpenPackageWizard"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_awZtgkJtEeWE1OT9z6GGpw" elementId="org.eclipse.jdt.ui.actions.NewTypeDropDown"/>
|
||||
</children>
|
||||
<children xsi:type="menu:ToolBar" xmi:id="_8voSkCr0EeWsptewEJl0pA" elementId="org.eclipse.jst.j2ee.J2eeMainActionSet" visible="false">
|
||||
<tags>Draggable</tags>
|
||||
|
@ -486,20 +486,20 @@
|
|||
</children>
|
||||
<children xsi:type="menu:ToolBar" xmi:id="_8xJVgCr0EeWsptewEJl0pA" elementId="org.eclipse.search.searchActionSet">
|
||||
<tags>Draggable</tags>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_4XJ_VT-hEeWQmPenPG3GHg" elementId="Search"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_4XKmYD-hEeWQmPenPG3GHg" elementId="openType"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_4XKmYT-hEeWQmPenPG3GHg" elementId="org.eclipse.mylyn.tasks.ui.openTask"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_4XKmYj-hEeWQmPenPG3GHg" elementId="org.eclipse.search.OpenSearchDialogPage"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_awaUkEJtEeWE1OT9z6GGpw" elementId="Search"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_awaUkUJtEeWE1OT9z6GGpw" elementId="openType"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_awaUkkJtEeWE1OT9z6GGpw" elementId="org.eclipse.mylyn.tasks.ui.openTask"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_awaUk0JtEeWE1OT9z6GGpw" elementId="org.eclipse.search.OpenSearchDialogPage"/>
|
||||
</children>
|
||||
<children xsi:type="menu:ToolBar" xmi:id="_Slo_UC3kEeWvSKv3oe_gqg" elementId="org.eclipse.ui.edit.text.actionSet.presentation">
|
||||
<tags>Draggable</tags>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_6z5ukD-hEeWQmPenPG3GHg" elementId="Presentation"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_6z6VoD-hEeWQmPenPG3GHg" elementId="org.eclipse.jdt.ui.edit.text.java.toggleBreadcrumb"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_6z6VoT-hEeWQmPenPG3GHg" elementId="org.eclipse.jdt.ui.edit.text.java.toggleMarkOccurrences"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_6z6Voj-hEeWQmPenPG3GHg" elementId="org.eclipse.mylyn.java.ui.editor.folding.auto"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_6z6Voz-hEeWQmPenPG3GHg" elementId="org.eclipse.ui.edit.text.toggleBlockSelectionMode"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_6z68sD-hEeWQmPenPG3GHg" elementId="org.eclipse.ui.edit.text.toggleShowWhitespaceCharacters"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_6z68sT-hEeWQmPenPG3GHg" elementId="org.eclipse.ui.edit.text.toggleShowSelectedElementOnly"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_eR0l0EJtEeWE1OT9z6GGpw" elementId="Presentation"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_eR1M4EJtEeWE1OT9z6GGpw" elementId="org.eclipse.jdt.ui.edit.text.java.toggleBreadcrumb"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_eR2bAEJtEeWE1OT9z6GGpw" elementId="org.eclipse.jdt.ui.edit.text.java.toggleMarkOccurrences"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_eR3CEEJtEeWE1OT9z6GGpw" elementId="org.eclipse.mylyn.java.ui.editor.folding.auto"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_eR3CEUJtEeWE1OT9z6GGpw" elementId="org.eclipse.ui.edit.text.toggleBlockSelectionMode"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_eR3CEkJtEeWE1OT9z6GGpw" elementId="org.eclipse.ui.edit.text.toggleShowWhitespaceCharacters"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_eR3CE0JtEeWE1OT9z6GGpw" elementId="org.eclipse.ui.edit.text.toggleShowSelectedElementOnly"/>
|
||||
</children>
|
||||
<children xsi:type="menu:ToolBar" xmi:id="_8wdZACr0EeWsptewEJl0pA" elementId="org.eclipse.wst.server.ui.internal.webbrowser.actionSet" visible="false">
|
||||
<tags>Draggable</tags>
|
||||
|
@ -517,15 +517,15 @@
|
|||
</children>
|
||||
<children xsi:type="menu:ToolBar" xmi:id="_6LTUoCr0EeWsptewEJl0pA" elementId="org.eclipse.ui.workbench.navigate">
|
||||
<tags>Draggable</tags>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_4OM3oz-hEeWQmPenPG3GHg" elementId="history.group"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_4OM3pD-hEeWQmPenPG3GHg" elementId="group.application" visible="false"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_4OM3pT-hEeWQmPenPG3GHg" elementId="backardHistory"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_4ONesD-hEeWQmPenPG3GHg" elementId="forwardHistory"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_4ONesT-hEeWQmPenPG3GHg" elementId="pin.group"/>
|
||||
<children xsi:type="menu:HandledToolItem" xmi:id="_4ONesj-hEeWQmPenPG3GHg" iconURI="platform:/plugin/org.eclipse.ui/icons/full/etool16/pin_editor.gif" tooltip="Pin the current editor" enabled="false" command="_3_eWRCr0EeWsptewEJl0pA"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_4XKmYz-hEeWQmPenPG3GHg" elementId="org.eclipse.ui.edit.text.gotoNextAnnotation"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_4XKmZD-hEeWQmPenPG3GHg" elementId="org.eclipse.ui.edit.text.gotoPreviousAnnotation"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_4XLNcD-hEeWQmPenPG3GHg" elementId="org.eclipse.ui.edit.text.gotoLastEditPosition"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_arFvsUJtEeWE1OT9z6GGpw" elementId="history.group"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_arFvskJtEeWE1OT9z6GGpw" elementId="group.application" visible="false"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_arFvs0JtEeWE1OT9z6GGpw" elementId="backardHistory"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_arGWwEJtEeWE1OT9z6GGpw" elementId="forwardHistory"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_arGWwUJtEeWE1OT9z6GGpw" elementId="pin.group"/>
|
||||
<children xsi:type="menu:HandledToolItem" xmi:id="_arG90EJtEeWE1OT9z6GGpw" iconURI="platform:/plugin/org.eclipse.ui/icons/full/etool16/pin_editor.gif" tooltip="Pin the current editor" enabled="false" command="_3_eWRCr0EeWsptewEJl0pA"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_awaUlEJtEeWE1OT9z6GGpw" elementId="org.eclipse.ui.edit.text.gotoNextAnnotation"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_awaUlUJtEeWE1OT9z6GGpw" elementId="org.eclipse.ui.edit.text.gotoPreviousAnnotation"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_awa7oEJtEeWE1OT9z6GGpw" elementId="org.eclipse.ui.edit.text.gotoLastEditPosition"/>
|
||||
</children>
|
||||
<children xsi:type="menu:ToolBar" xmi:id="_6LTUoSr0EeWsptewEJl0pA" elementId="group.editor" toBeRendered="false">
|
||||
<tags>toolbarSeparator</tags>
|
||||
|
@ -537,8 +537,8 @@
|
|||
</children>
|
||||
<children xsi:type="menu:ToolBar" xmi:id="_6LT7sCr0EeWsptewEJl0pA" elementId="org.eclipse.ui.workbench.help" visible="false">
|
||||
<tags>Draggable</tags>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_4OOFwD-hEeWQmPenPG3GHg" elementId="group.help"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_4OOFwT-hEeWQmPenPG3GHg" elementId="group.application" visible="false"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_arHk4EJtEeWE1OT9z6GGpw" elementId="group.help"/>
|
||||
<children xsi:type="menu:OpaqueToolItem" xmi:id="_arHk4UJtEeWE1OT9z6GGpw" elementId="group.application" visible="false"/>
|
||||
</children>
|
||||
<children xsi:type="menu:ToolControl" xmi:id="_61nc8Cr0EeWsptewEJl0pA" elementId="PerspectiveSpacer" contributionURI="bundleclass://org.eclipse.e4.ui.workbench.renderers.swt/org.eclipse.e4.ui.workbench.renderers.swt.LayoutModifierToolControl">
|
||||
<tags>stretch</tags>
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -1,11 +1,11 @@
|
|||
INDEX VERSION 1.126+D:\Z - Norbi cucca\0 Projektek\TheButtonMCAutoFlairProto\Spigot plugin\.metadata\.plugins\org.eclipse.jdt.core
|
||||
1508644233.index
|
||||
3656756579.index
|
||||
3089967703.index
|
||||
2674037006.index
|
||||
323251068.index
|
||||
355369697.index
|
||||
3716007315.index
|
||||
1934142626.index
|
||||
3716007315.index
|
||||
1045485630.index
|
||||
605290374.index
|
||||
533208796.index
|
||||
|
@ -22,5 +22,5 @@ INDEX VERSION 1.126+D:\Z - Norbi cucca\0 Projektek\TheButtonMCAutoFlairProto\Spi
|
|||
3954291735.index
|
||||
994834796.index
|
||||
3604769962.index
|
||||
1508644233.index
|
||||
3045053200.index
|
||||
3656756579.index
|
||||
|
|
|
@ -15,4 +15,5 @@
|
|||
<workingSet aggregate="true" factoryID="org.eclipse.ui.internal.WorkingSetFactory" id="1439240033242_12" label="Window Working Set" name="Aggregate for window 1439240033242"/>
|
||||
<workingSet aggregate="true" factoryID="org.eclipse.ui.internal.WorkingSetFactory" id="1439375909808_13" label="Window Working Set" name="Aggregate for window 1439375909807"/>
|
||||
<workingSet aggregate="true" factoryID="org.eclipse.ui.internal.WorkingSetFactory" id="1439547362478_14" label="Window Working Set" name="Aggregate for window 1439547362478"/>
|
||||
<workingSet aggregate="true" factoryID="org.eclipse.ui.internal.WorkingSetFactory" id="1439556351031_15" label="Window Working Set" name="Aggregate for window 1439556351031"/>
|
||||
</workingSetManager>
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -121,7 +121,7 @@ public class Commands implements CommandExecutor {
|
|||
//{
|
||||
try
|
||||
{
|
||||
PluginMain.Console.sendMessage("§6-- Reloading Auto-flair plugin...§r");
|
||||
PluginMain.Console.sendMessage("§6-- Reloading The Button Minecraft plugin...§r");
|
||||
PluginMain.LoadFiles(true); //2015.08.09.
|
||||
for(Player p : PluginMain.GetPlayers())
|
||||
{
|
||||
|
|
|
@ -34,7 +34,7 @@ public class PluginMain extends JavaPlugin
|
|||
@Override
|
||||
public void onEnable()
|
||||
{
|
||||
System.out.println("The Button Auto-flair Plugin by NorbiPeti (:P)");
|
||||
System.out.println("The Button Minecraft server plugin by NorbiPeti");
|
||||
getServer().getPluginManager().registerEvents(new PlayerListener(), this);
|
||||
this.getCommand("u").setExecutor(new Commands());
|
||||
this.getCommand("u").setUsage(this.getCommand("u").getUsage().replace('&', '§'));
|
||||
|
@ -305,11 +305,11 @@ public class PluginMain extends JavaPlugin
|
|||
{
|
||||
if(reload)
|
||||
{ //2015.08.09.
|
||||
System.out.println("Auto-flair plugin cleanup for reloading...");
|
||||
System.out.println("The Button Minecraft plugin cleanup for reloading...");
|
||||
MaybeOfflinePlayer.AllPlayers.clear();
|
||||
TownColors.clear();
|
||||
}
|
||||
System.out.println("Loading files for auto-flair plugin..."); //2015.08.09.
|
||||
System.out.println("Loading files for The Button Minecraft plugin..."); //2015.08.09.
|
||||
try {
|
||||
File file=new File("flairsaccepted.txt");
|
||||
if(file.exists())
|
||||
|
@ -377,7 +377,7 @@ public class PluginMain extends JavaPlugin
|
|||
br.close();
|
||||
}
|
||||
//throw new IOException("Test"); //2015.08.09.
|
||||
System.out.println("Auto-flair plugin loaded files!");
|
||||
System.out.println("The Button Minecraft plugin loaded files!");
|
||||
} catch (IOException e) {
|
||||
System.out.println("Error!\n"+e);
|
||||
LastException=e; //2015.08.09.
|
||||
|
|
Loading…
Reference in a new issue