Fancy formatting for power levels titles

This commit is contained in:
nossr50 2012-04-03 07:03:42 -07:00
parent 20febbc3bc
commit 378de09ccd

View File

@ -1,5 +1,6 @@
package com.gmail.nossr50.listeners; package com.gmail.nossr50.listeners;
import org.bukkit.ChatColor;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
import org.getspout.spoutapi.event.spout.SpoutCraftEnableEvent; import org.getspout.spoutapi.event.spout.SpoutCraftEnableEvent;
@ -28,15 +29,18 @@ public class mcSpoutListener implements Listener {
@EventHandler @EventHandler
public void onSpoutCraftEnable(SpoutCraftEnableEvent event) { public void onSpoutCraftEnable(SpoutCraftEnableEvent event) {
SpoutPlayer sPlayer = event.getPlayer(); 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()) { if (sPlayer.isSpoutCraftEnabled()) {
SpoutStuff.playerHUDs.put(sPlayer, new HUDmmo(sPlayer)); //Setup Party HUD stuff SpoutStuff.playerHUDs.put(sPlayer, new HUDmmo(sPlayer)); //Setup Party HUD stuff
PlayerProfile PPs = Users.getProfile(sPlayer);
PPs.toggleSpoutEnabled();
if (LoadProperties.showPowerLevel) { PPs.toggleSpoutEnabled();
sPlayer.setTitle(sPlayer.getName() + "- Power: " + String.valueOf(PPs.getPowerLevel()));
}
} }
} }
} }