From a1283bfc0fb5d264be4c657a1bd75126c4684cec Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 3 Apr 2012 07:08:37 -0700 Subject: [PATCH] Make titles update on levelup --- Changelog.txt | 1 + .../java/com/gmail/nossr50/listeners/mcSpoutListener.java | 2 +- src/main/java/com/gmail/nossr50/skills/Skills.java | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Changelog.txt b/Changelog.txt index 8a08c720d..48d0843a7 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -11,6 +11,7 @@ Version 1.3.05-dev + Added bonus damage to Archery, every 50 levels you gain 10% bonus damage + Added ExperienceAPI and PartyAPI classes for developer use + Added ability to cap overall power level + + Added showing powerlevel below a persons name if you run Spout (optional) = Fixed errors when Spout would disable itself after start-up = Fixed XP bar not updating when XP was gained = Fixed bug with repairing wooden tools diff --git a/src/main/java/com/gmail/nossr50/listeners/mcSpoutListener.java b/src/main/java/com/gmail/nossr50/listeners/mcSpoutListener.java index ccfd9f5f1..24056aca5 100644 --- a/src/main/java/com/gmail/nossr50/listeners/mcSpoutListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/mcSpoutListener.java @@ -33,7 +33,7 @@ public class mcSpoutListener implements Listener { //TODO: Add custom titles based on skills if (LoadProperties.showPowerLevel) { - sPlayer.setTitle(sPlayer.getTitle() + "\n" + ChatColor.YELLOW + "P" + ChatColor.GOLD + "lvl" + sPlayer.setTitle(sPlayer.getName()+ "\n" + ChatColor.YELLOW + "P" + ChatColor.GOLD + "lvl" + ChatColor.WHITE+"." + ChatColor.GREEN + String.valueOf(PPs.getPowerLevel())); } diff --git a/src/main/java/com/gmail/nossr50/skills/Skills.java b/src/main/java/com/gmail/nossr50/skills/Skills.java index 86aa25a71..a6a5fef04 100644 --- a/src/main/java/com/gmail/nossr50/skills/Skills.java +++ b/src/main/java/com/gmail/nossr50/skills/Skills.java @@ -224,6 +224,12 @@ public class Skills { } SpoutStuff.levelUpNotification(skillType, sPlayer); + + /* Update custom titles */ + if(LoadProperties.showPowerLevel) { + sPlayer.setTitle(sPlayer.getName()+ "\n" + ChatColor.YELLOW + "P" + ChatColor.GOLD + "lvl" + + ChatColor.WHITE+"." + ChatColor.GREEN + String.valueOf(PP.getPowerLevel())); + } } else { player.sendMessage(mcLocale.getString("Skills."+capitalized+"Up", new Object[] {String.valueOf(skillups), PP.getSkillLevel(skillType)}));