From 381253eaf3f6ab527f7ab77bef28bd00d1c9f79e Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 3 Mar 2020 17:56:50 -0300 Subject: [PATCH] Fixed issue when the player is not online and sent to him the payment (#686) - Fix issue when sending an invalid page sender on playerinfo command. --- src/main/java/com/gamingmesh/jobs/PlayerManager.java | 3 +-- src/main/java/com/gamingmesh/jobs/commands/JobsCommands.java | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/gamingmesh/jobs/PlayerManager.java b/src/main/java/com/gamingmesh/jobs/PlayerManager.java index a534e1c8..c0855b4f 100644 --- a/src/main/java/com/gamingmesh/jobs/PlayerManager.java +++ b/src/main/java/com/gamingmesh/jobs/PlayerManager.java @@ -983,7 +983,7 @@ public class PlayerManager { public Boost getFinalBonus(JobsPlayer player, Job prog, Entity ent, LivingEntity victim, boolean force, boolean getall) { Boost boost = new Boost(); - if (player == null || prog == null) + if (player == null || !player.isOnline() || prog == null) return boost; if (HookManager.getMcMMOManager().mcMMOPresent || HookManager.getMcMMOManager().mcMMOOverHaul) @@ -1026,7 +1026,6 @@ public class PlayerManager { // boost.add(BoostOf.Item, Jobs.getPlayerManager().getItemBoost(player.getPlayer(), prog)); boost.add(BoostOf.Item, getItemBoostNBT(player.getPlayer(), prog)); boost.add(BoostOf.Area, new BoostMultiplier().add(Jobs.getRestrictedAreaManager().getRestrictedMultiplier(player.getPlayer()))); - return boost; } diff --git a/src/main/java/com/gamingmesh/jobs/commands/JobsCommands.java b/src/main/java/com/gamingmesh/jobs/commands/JobsCommands.java index 2a8dadba..31ae5147 100644 --- a/src/main/java/com/gamingmesh/jobs/commands/JobsCommands.java +++ b/src/main/java/com/gamingmesh/jobs/commands/JobsCommands.java @@ -309,7 +309,7 @@ public class JobsCommands implements CommandExecutor { PageInfo pi = new PageInfo(15, message.size(), page); if (page > pi.getTotalPages()) { - player.getPlayer().sendMessage(Jobs.getLanguage().getMessage("general.info.invalidPage")); + sender.sendMessage(Jobs.getLanguage().getMessage("general.info.invalidPage")); return; }