implemented TagAPI

This commit is contained in:
kingbirdy 2014-06-13 01:54:48 -04:00
parent 74f6f312f2
commit 44624cd18e
2 changed files with 18 additions and 2 deletions

View file

@ -2,7 +2,7 @@
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jre7"/>
<classpathentry kind="lib" path="C:/Users/Shawn/Documents/LocalServer/BukkitForPlugins.jar"/>
<classpathentry kind="lib" path="C:/Users/PhilipStephenson/Desktop/MineScape test server/craftbukkit-1.7.2-R0.3-20140131.210753-26.jar"/>
<classpathentry kind="lib" path="C:/Users/PhilipStephenson/Downloads/TagAPI.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View file

@ -18,6 +18,7 @@ import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.kitteh.tag.AsyncPlayerReceiveNameTagEvent;
import com.projectkorra.ProjectKorra.chiblocking.ChiPassive;
import com.projectkorra.ProjectKorra.earthbending.EarthPassive;
@ -49,7 +50,7 @@ public class PKListener implements Listener {
player.setDisplayName(plugin.getConfig().getString("Properties.Chat.WaterPrefix") + player.getName());
else if (elements.get(0).equals(Element.Fire))
player.setDisplayName(plugin.getConfig().getString("Properties.Chat.FirePrefix") + player.getName());
else if (elements.get(0).equals(Element.Earth))
else if (elements.get(0).equals(Element.Chi))
player.setDisplayName(plugin.getConfig().getString("Properties.Chat.ChiPrefix") + player.getName());
}
}
@ -144,4 +145,19 @@ public class PKListener implements Listener {
}
}
public void onNameTag(AsyncPlayerReceiveNameTagEvent e) {
List<Element> elements = Methods.getBendingPlayer(e.getNamedPlayer().getName()).getElements();
if (elements.size() > 1)
e.setTag(ChatColor.LIGHT_PURPLE + e.getNamedPlayer().getName());
else if (elements.get(0).equals(Element.Earth))
e.setTag(ChatColor.GREEN + e.getNamedPlayer().getName());
else if (elements.get(0).equals(Element.Air))
e.setTag(ChatColor.GRAY + e.getNamedPlayer().getName());
else if (elements.get(0).equals(Element.Water))
e.setTag(ChatColor.AQUA + e.getNamedPlayer().getName());
else if (elements.get(0).equals(Element.Fire))
e.setTag(ChatColor.RED + e.getNamedPlayer().getName());
else if (elements.get(0).equals(Element.Chi))
e.setTag(ChatColor.GOLD + e.getNamedPlayer().getName());
}
}