From 509ca5ae7fc2ea0803174b6643a510b77b72e97d Mon Sep 17 00:00:00 2001 From: nossr50 Date: Thu, 25 Jul 2019 21:47:11 -0700 Subject: [PATCH] =?UTF-8?q?=E6=AF=8E=E6=97=A5...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/gmail/nossr50/util/Motd.java | 1 + src/main/java/com/gmail/nossr50/util/skills/PerksUtils.java | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/util/Motd.java b/src/main/java/com/gmail/nossr50/util/Motd.java index a4ca18754..ac3fd4e70 100644 --- a/src/main/java/com/gmail/nossr50/util/Motd.java +++ b/src/main/java/com/gmail/nossr50/util/Motd.java @@ -85,6 +85,7 @@ public final class Motd { */ public static void displayXpPerks(Player player) { for (PrimarySkillType skill : PrimarySkillType.values()) { + //TODO: Wow this is horrifying... if (PerksUtils.handleXpPerks(player, 1, skill) > 1) { player.sendMessage(PERK_PREFIX + LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Perks.XP.Name"), LocaleLoader.getString("Perks.XP.Desc"))); return; diff --git a/src/main/java/com/gmail/nossr50/util/skills/PerksUtils.java b/src/main/java/com/gmail/nossr50/util/skills/PerksUtils.java index a4e9fae53..1d58ee9a8 100644 --- a/src/main/java/com/gmail/nossr50/util/skills/PerksUtils.java +++ b/src/main/java/com/gmail/nossr50/util/skills/PerksUtils.java @@ -50,7 +50,7 @@ public final class PerksUtils { double originalXP = xp; if (Permissions.customXpBoost(player, skill)) { - if(UserManager.getPlayer(player).isDebugMode()) { + if(UserManager.getPlayer(player) != null && UserManager.getPlayer(player).isDebugMode()) { player.sendMessage(ChatColor.GOLD + "[DEBUG] " + ChatColor.DARK_GRAY + "XP Perk Multiplier IS CUSTOM! "); } @@ -77,7 +77,7 @@ public final class PerksUtils { float modifiedXP = (float) (xp * modifier); - if(UserManager.getPlayer(player).isDebugMode()) { + if(UserManager.getPlayer(player) != null && UserManager.getPlayer(player).isDebugMode()) { player.sendMessage(ChatColor.GOLD + "[DEBUG] " + ChatColor.RESET + "XP Perk Multiplier - " + ChatColor.GREEN + modifier); player.sendMessage(ChatColor.GOLD + "[DEBUG] " + ChatColor.RESET + "Original XP before perk boosts " + ChatColor.DARK_GRAY + originalXP); player.sendMessage(ChatColor.GOLD + "[DEBUG] " + ChatColor.RESET + "XP AFTER PERKS " + ChatColor.RED + modifiedXP);