From 93548317293e2c6c5195544b99d4ce7d900abea1 Mon Sep 17 00:00:00 2001 From: "U-YUE\\Sean" Date: Tue, 30 Oct 2012 13:14:22 -0700 Subject: [PATCH] Finished fixing issues #272, #266, #261, and #255. --- .../skills/archery/ArcheryManager.java | 9 +++++++ .../nossr50/skills/swords/SwordsManager.java | 15 ++++++++++++ .../nossr50/skills/taming/TamingManager.java | 24 +++++++++++++++++++ .../skills/unarmed/UnarmedManager.java | 12 ++++++++++ .../java/com/gmail/nossr50/util/Skills.java | 6 +++++ 5 files changed, 66 insertions(+) diff --git a/src/main/java/com/gmail/nossr50/skills/archery/ArcheryManager.java b/src/main/java/com/gmail/nossr50/skills/archery/ArcheryManager.java index d3f968abb..66e4f9ed9 100644 --- a/src/main/java/com/gmail/nossr50/skills/archery/ArcheryManager.java +++ b/src/main/java/com/gmail/nossr50/skills/archery/ArcheryManager.java @@ -36,6 +36,9 @@ public class ArcheryManager { if(player == null) return; + if(permissionsInstance == null) + return; + if (!permissionsInstance.trackArrows(player)) { return; } @@ -63,6 +66,9 @@ public class ArcheryManager { if(player == null) return; + if(permissionsInstance == null) + return; + if (!permissionsInstance.daze(player)) { return; } @@ -90,6 +96,9 @@ public class ArcheryManager { if(player == null) return; + if(permissionsInstance == null) + return; + if (!permissionsInstance.archeryBonus(player)) { return; } diff --git a/src/main/java/com/gmail/nossr50/skills/swords/SwordsManager.java b/src/main/java/com/gmail/nossr50/skills/swords/SwordsManager.java index f91712b83..dcfb335a2 100644 --- a/src/main/java/com/gmail/nossr50/skills/swords/SwordsManager.java +++ b/src/main/java/com/gmail/nossr50/skills/swords/SwordsManager.java @@ -31,6 +31,9 @@ public class SwordsManager { if(player == null) return; + if(permissionsInstance == null) + return; + if (!permissionsInstance.swordsBleed(player)) { return; } @@ -52,6 +55,12 @@ public class SwordsManager { } public void counterAttackChecks(LivingEntity attacker, int damage) { + if(player == null) + return; + + if(permissionsInstance == null) + return; + if (!permissionsInstance.counterAttack(player)) { return; } @@ -75,6 +84,12 @@ public class SwordsManager { } public void serratedStrikes(LivingEntity target, int damage) { + if(player == null) + return; + + if(permissionsInstance == null) + return; + if (!permissionsInstance.serratedStrikes(player)) { return; } diff --git a/src/main/java/com/gmail/nossr50/skills/taming/TamingManager.java b/src/main/java/com/gmail/nossr50/skills/taming/TamingManager.java index eb946fa6f..7df91b147 100644 --- a/src/main/java/com/gmail/nossr50/skills/taming/TamingManager.java +++ b/src/main/java/com/gmail/nossr50/skills/taming/TamingManager.java @@ -39,6 +39,9 @@ public class TamingManager { if(player == null) return; + if(permissionsInstance == null) + return; + if (!permissionsInstance.fastFoodService(player)) { return; } @@ -67,6 +70,9 @@ public class TamingManager { if(player == null) return; + if(permissionsInstance == null) + return; + if (!permissionsInstance.sharpenedClaws(player)) { return; } @@ -87,6 +93,9 @@ public class TamingManager { if(player == null) return; + if(permissionsInstance == null) + return; + if (!permissionsInstance.gore(player)) { return; } @@ -162,6 +171,9 @@ public class TamingManager { if(player == null) return; + if(permissionsInstance == null) + return; + if (!permissionsInstance.beastLore(player)) { return; } @@ -181,6 +193,9 @@ public class TamingManager { if(player == null) return; + if(permissionsInstance == null) + return; + if (!permissionsInstance.callOfTheWild(player)) { return; } @@ -216,6 +231,9 @@ public class TamingManager { if(player == null) return; + if(permissionsInstance == null) + return; + if (!permissionsInstance.environmentallyAware(player)) { return; } @@ -251,6 +269,9 @@ public class TamingManager { if(player == null) return; + if(permissionsInstance == null) + return; + if (!permissionsInstance.thickFur(player)) { return; } @@ -271,6 +292,9 @@ public class TamingManager { if(player == null) return; + if(permissionsInstance == null) + return; + if (!permissionsInstance.shockProof(player)) { return; } diff --git a/src/main/java/com/gmail/nossr50/skills/unarmed/UnarmedManager.java b/src/main/java/com/gmail/nossr50/skills/unarmed/UnarmedManager.java index 4e49fde92..0bad03949 100644 --- a/src/main/java/com/gmail/nossr50/skills/unarmed/UnarmedManager.java +++ b/src/main/java/com/gmail/nossr50/skills/unarmed/UnarmedManager.java @@ -30,6 +30,9 @@ public class UnarmedManager { if(player == null) return; + if(permissionsInstance == null) + return; + if (!permissionsInstance.disarm(player)) { return; } @@ -64,6 +67,9 @@ public class UnarmedManager { if(player == null) return; + if(permissionsInstance == null) + return; + if (!permissionsInstance.deflect(player)) { return; } @@ -91,6 +97,9 @@ public class UnarmedManager { if(player == null) return; + if(permissionsInstance == null) + return; + if (!permissionsInstance.unarmedBonus(player)) { return; } @@ -111,6 +120,9 @@ public class UnarmedManager { if(defender == null) return false; + if(permissionsInstance == null) + return false; + if (!permissionsInstance.ironGrip(defender)) { return false; } diff --git a/src/main/java/com/gmail/nossr50/util/Skills.java b/src/main/java/com/gmail/nossr50/util/Skills.java index d2d8a48c6..2084cbdb1 100644 --- a/src/main/java/com/gmail/nossr50/util/Skills.java +++ b/src/main/java/com/gmail/nossr50/util/Skills.java @@ -507,7 +507,13 @@ public class Skills { * @param xp the amount of XP to gain */ public static void xpProcessing(Player player, PlayerProfile profile, SkillType type, int xp) { + if(player == null) + return; + if (type.getPermissions(player)) { + if(Users.getPlayer(player) == null) + return; + Users.getPlayer(player).addXP(type, xp); xpCheckSkill(type, player, profile); }