From ea19d8ca2993fabbc0e930e7e70016455291919a Mon Sep 17 00:00:00 2001 From: BuildTools Date: Sun, 11 Jun 2017 16:17:11 +0100 Subject: [PATCH] PlaceholderAPI Hook added + removed TagAPI (could not locate dependency) --- .idea/compiler.xml | 2 +- .idea/workspace.xml | 468 ++++++++++++++---------- Nicky.iml | 3 +- pom.xml | 42 ++- config.yml => src/config.yml | 0 src/io/loyloy/nicky/Nick.java | 6 - src/io/loyloy/nicky/Nicky.java | 13 +- src/io/loyloy/nicky/TagAPIListener.java | 19 - plugin.yml => src/plugin.yml | 4 +- 9 files changed, 324 insertions(+), 233 deletions(-) rename config.yml => src/config.yml (100%) delete mode 100644 src/io/loyloy/nicky/TagAPIListener.java rename plugin.yml => src/plugin.yml (96%) diff --git a/.idea/compiler.xml b/.idea/compiler.xml index cf6df28..5a3e9d1 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -10,7 +10,7 @@ - + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 4027f17..2daa996 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,16 +2,15 @@ - - + + + - - + - @@ -35,41 +34,46 @@ - + - + + + + + + - + - - + + - - + + - - - - - + + + - - + + - - - + + + + + @@ -77,12 +81,17 @@ - + - - - + + + + + + + + @@ -93,7 +102,11 @@ - + + + + + @@ -103,7 +116,13 @@ - + + + + + + + @@ -111,8 +130,8 @@ - - + + @@ -121,16 +140,9 @@ - - - - - - - - - - + + + @@ -170,13 +182,14 @@ @@ -187,11 +200,6 @@ DEFINITION_ORDER - + @@ -248,8 +258,9 @@ - + + @@ -262,6 +273,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + - @@ -318,19 +378,20 @@ - + - - - + + + + - @@ -815,38 +877,39 @@ - + + - - + - - + + - - + + - + - + - - + + - + - - + + + @@ -912,18 +975,6 @@ - - - - - - - - - - - - @@ -936,14 +987,7 @@ - - - - - - - - + @@ -951,7 +995,12 @@ - + + + + + + @@ -959,9 +1008,7 @@ - - - + @@ -973,7 +1020,7 @@ - + @@ -985,9 +1032,14 @@ - - - + + + + + + + + @@ -1004,14 +1056,7 @@ - - - - - - - - + @@ -1019,7 +1064,12 @@ - + + + + + + @@ -1027,9 +1077,7 @@ - - - + @@ -1041,7 +1089,7 @@ - + @@ -1053,9 +1101,14 @@ - - - + + + + + + + + @@ -1072,14 +1125,7 @@ - - - - - - - - + @@ -1087,7 +1133,12 @@ - + + + + + + @@ -1095,9 +1146,7 @@ - - - + @@ -1109,7 +1158,7 @@ - + @@ -1121,9 +1170,14 @@ - - - + + + + + + + + @@ -1140,7 +1194,12 @@ - + + + + + + @@ -1148,9 +1207,7 @@ - - - + @@ -1162,7 +1219,7 @@ - + @@ -1174,9 +1231,14 @@ - - - + + + + + + + + @@ -1193,7 +1255,12 @@ - + + + + + + @@ -1278,98 +1345,119 @@ - + - + - - + + - - - - - - + + + + + + + + - + - - - + + + + + + + - + - - + + - + + + + + - + - + + + + + + - + - - - - - - - + + + - + - - + + - + - - + + - + - - + + - + - - + + + + + + + + + + + + diff --git a/Nicky.iml b/Nicky.iml index aad8625..82372d1 100644 --- a/Nicky.iml +++ b/Nicky.iml @@ -1,6 +1,6 @@ - + @@ -27,5 +27,6 @@ + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 8389aee..7ebe649 100644 --- a/pom.xml +++ b/pom.xml @@ -3,37 +3,65 @@ 4.0.0 io.loyloy.nicky Nicky - 0.6.9 + 0.7.0 Nicky - + + src + ${project.artifactId} + + + src + + **/*.java + + + + + + 3.1 + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + + + + + spigot-repo https://hub.spigotmc.org/nexus/content/groups/public/ - dmulloy2-repo http://repo.dmulloy2.net/nexus/repository/public/ + + placeholderapi + http://repo.extendedclip.com/content/repositories/placeholderapi/ + - org.spigotmc spigot-api 1.8.7-R0.1-SNAPSHOT - com.comphenix.protocol ProtocolLib-API 4.2.1 - + + me.clip + placeholderapi + 2.0.8 + provided + - \ No newline at end of file diff --git a/config.yml b/src/config.yml similarity index 100% rename from config.yml rename to src/config.yml diff --git a/src/io/loyloy/nicky/Nick.java b/src/io/loyloy/nicky/Nick.java index 7ad1d4c..524ac39 100644 --- a/src/io/loyloy/nicky/Nick.java +++ b/src/io/loyloy/nicky/Nick.java @@ -3,7 +3,6 @@ import io.loyloy.nicky.databases.SQL; import org.bukkit.ChatColor; import org.bukkit.entity.Player; -import org.kitteh.tag.TagAPI; import java.util.List; @@ -145,10 +144,5 @@ private void refresh() { unLoad(); load(); - - if( Nicky.isTagAPIUsed() ) - { - TagAPI.refreshPlayer( player ); - } } } \ No newline at end of file diff --git a/src/io/loyloy/nicky/Nicky.java b/src/io/loyloy/nicky/Nicky.java index 14066e9..10fa04f 100644 --- a/src/io/loyloy/nicky/Nicky.java +++ b/src/io/loyloy/nicky/Nicky.java @@ -7,6 +7,7 @@ import io.loyloy.nicky.databases.MySQL; import io.loyloy.nicky.databases.SQL; import io.loyloy.nicky.databases.SQLite; +import io.loyloy.nicky.hook.PAPIHook; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.configuration.file.FileConfiguration; @@ -34,7 +35,7 @@ public class Nicky extends JavaPlugin public Nicky() { - databases = new HashSet(); + databases = new HashSet<>(); } @Override @@ -50,14 +51,12 @@ public void onEnable() PluginManager pm = getServer().getPluginManager(); pm.registerEvents( new PlayerListener(), this ); - if( pm.isPluginEnabled( "TagAPI" ) && getConfig().getBoolean( "tagapi" ) ) - { - pm.registerEvents( new TagAPIListener(), this ); - log( "TagAPI link enabled." ); - TAGAPI = true; + if (pm.isPluginEnabled("PlaceholderAPI")) { + new PAPIHook(this).hook(); + log("PlaceholderAPI hook has been enabled."); } - BLACKLIST = new ArrayList(); + BLACKLIST = new ArrayList<>(); reloadNickyConfig(); getCommand( "nick" ).setExecutor( new NickCommand( this ) ); diff --git a/src/io/loyloy/nicky/TagAPIListener.java b/src/io/loyloy/nicky/TagAPIListener.java deleted file mode 100644 index 6bdfd0c..0000000 --- a/src/io/loyloy/nicky/TagAPIListener.java +++ /dev/null @@ -1,19 +0,0 @@ -package io.loyloy.nicky; - -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.kitteh.tag.AsyncPlayerReceiveNameTagEvent; - -public class TagAPIListener implements Listener -{ - @EventHandler - public void onNameTag( AsyncPlayerReceiveNameTagEvent event ) - { - Nick nick = new Nick( event.getNamedPlayer() ); - - if( nick.get() != null ) - { - event.setTag( nick.get() ); - } - } -} diff --git a/plugin.yml b/src/plugin.yml similarity index 96% rename from plugin.yml rename to src/plugin.yml index 0fab4a5..d790e24 100644 --- a/plugin.yml +++ b/src/plugin.yml @@ -1,9 +1,9 @@ name: Nicky main: io.loyloy.nicky.Nicky -version: 0.6.9 +version: 0.7.0 description: Simple SQL nickname plugin. author: Melonking -softdepend: [TagAPI] +softdepend: [TagAPI, PlaceholderAPI] commands: nicky: