From 4ab71bcf36bfd4abf3c4a941b27dcb2df41cf71c Mon Sep 17 00:00:00 2001 From: nossr50 Date: Wed, 29 Feb 2012 12:07:47 -0800 Subject: [PATCH] Fixed inspect not working from console --- src/main/java/com/gmail/nossr50/Combat.java | 4 ++-- .../com/gmail/nossr50/commands/general/InspectCommand.java | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/Combat.java b/src/main/java/com/gmail/nossr50/Combat.java index 081250f5d..37eb5f924 100644 --- a/src/main/java/com/gmail/nossr50/Combat.java +++ b/src/main/java/com/gmail/nossr50/Combat.java @@ -83,8 +83,8 @@ public class Combat Axes.axeCriticalCheck(attacker, event, pluginx); //Critical hit //Impact - if(event.getEntity() instanceof LivingEntity) - Axes.impact(attacker, (LivingEntity)event.getEntity()); + //if(event.getEntity() instanceof LivingEntity) + // Axes.impact(attacker, (LivingEntity)event.getEntity()); if (!(event instanceof FakeEntityDamageByEntityEvent) && PPa.getSkullSplitterMode()) Axes.applyAoeDamage(attacker, event, pluginx); diff --git a/src/main/java/com/gmail/nossr50/commands/general/InspectCommand.java b/src/main/java/com/gmail/nossr50/commands/general/InspectCommand.java index 79d590963..c67ee0b11 100644 --- a/src/main/java/com/gmail/nossr50/commands/general/InspectCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/general/InspectCommand.java @@ -30,7 +30,7 @@ public class InspectCommand implements CommandExecutor { player = (Player) sender; } - if (player != null && !mcPermissions.getInstance().inspect(player)) { + if (sender instanceof Player && !mcPermissions.getInstance().inspect(player)) { sender.sendMessage(ChatColor.YELLOW + "[mcMMO] " + ChatColor.DARK_RED + mcLocale.getString("mcPlayerListener.NoPermission")); return true; } @@ -39,6 +39,7 @@ public class InspectCommand implements CommandExecutor { sender.sendMessage(ChatColor.RED + "Proper usage is /whois "); return true; } + // if split[1] is a player if (plugin.getServer().getPlayer(args[0]) != null) { @@ -68,7 +69,7 @@ public class InspectCommand implements CommandExecutor { sender.sendMessage(ChatColor.GOLD + "-=COMBAT SKILLS=-"); if (mcPermissions.getInstance().axes(target)) sender.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.AxesSkill"), PPt.getSkillLevel(SkillType.AXES), PPt.getSkillXpLevel(SkillType.AXES), PPt.getXpToLevel(SkillType.AXES))); - if (mcPermissions.getInstance().archery(player)) + if (mcPermissions.getInstance().archery(target)) sender.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.ArcherySkill"), PPt.getSkillLevel(SkillType.ARCHERY), PPt.getSkillXpLevel(SkillType.ARCHERY), PPt.getXpToLevel(SkillType.ARCHERY))); if (mcPermissions.getInstance().swords(target)) sender.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.SwordsSkill"), PPt.getSkillLevel(SkillType.SWORDS), PPt.getSkillXpLevel(SkillType.SWORDS), PPt.getXpToLevel(SkillType.SWORDS)));