From 378de09ccdb96ef2f672364bd5a76476dc46c08d Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 3 Apr 2012 07:03:42 -0700 Subject: [PATCH] Fancy formatting for power levels titles --- .../gmail/nossr50/listeners/mcSpoutListener.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/listeners/mcSpoutListener.java b/src/main/java/com/gmail/nossr50/listeners/mcSpoutListener.java index 0517ba967..ccfd9f5f1 100644 --- a/src/main/java/com/gmail/nossr50/listeners/mcSpoutListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/mcSpoutListener.java @@ -1,5 +1,6 @@ package com.gmail.nossr50.listeners; +import org.bukkit.ChatColor; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.getspout.spoutapi.event.spout.SpoutCraftEnableEvent; @@ -28,15 +29,18 @@ public class mcSpoutListener implements Listener { @EventHandler public void onSpoutCraftEnable(SpoutCraftEnableEvent event) { SpoutPlayer sPlayer = event.getPlayer(); - + PlayerProfile PPs = Users.getProfile(sPlayer); + + //TODO: Add custom titles based on skills + if (LoadProperties.showPowerLevel) { + sPlayer.setTitle(sPlayer.getTitle() + "\n" + ChatColor.YELLOW + "P" + ChatColor.GOLD + "lvl" + + ChatColor.WHITE+"." + ChatColor.GREEN + String.valueOf(PPs.getPowerLevel())); + } + if (sPlayer.isSpoutCraftEnabled()) { SpoutStuff.playerHUDs.put(sPlayer, new HUDmmo(sPlayer)); //Setup Party HUD stuff - PlayerProfile PPs = Users.getProfile(sPlayer); + PPs.toggleSpoutEnabled(); - - if (LoadProperties.showPowerLevel) { - sPlayer.setTitle(sPlayer.getName() + "- Power: " + String.valueOf(PPs.getPowerLevel())); - } } } } \ No newline at end of file