diff --git a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java index a0963eda9..e789ba304 100644 --- a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java @@ -388,22 +388,30 @@ public class EntityListener implements Listener { case GOLDEN_CARROT: /* RESTORES 3 HUNGER - RESTORES 5 1/2 HUNGER @ 1000 */ case MUSHROOM_SOUP: /* RESTORES 4 HUNGER - RESTORES 6 1/2 HUNGER @ 1000 */ case PUMPKIN_PIE: /* RESTORES 4 HUNGER - RESTORES 6 1/2 HUNGER @ 1000 */ - event.setFoodLevel(Herbalism.farmersDiet(player, Herbalism.farmersDietRankLevel1, newFoodLevel)); + if (Permissions.farmersDiet(player)) { + event.setFoodLevel(Herbalism.farmersDiet(player, Herbalism.farmersDietRankLevel1, newFoodLevel)); + } return; case COOKIE: /* RESTORES 1/2 HUNGER - RESTORES 2 HUNGER @ 1000 */ case MELON: /* RESTORES 1 HUNGER - RESTORES 2 1/2 HUNGER @ 1000 */ case POISONOUS_POTATO: /* RESTORES 1 HUNGER - RESTORES 2 1/2 HUNGER @ 1000 */ case POTATO_ITEM: /* RESTORES 1/2 HUNGER - RESTORES 2 HUNGER @ 1000 */ - event.setFoodLevel(Herbalism.farmersDiet(player, Herbalism.farmersDietRankLevel2, newFoodLevel)); + if (Permissions.farmersDiet(player)) { + event.setFoodLevel(Herbalism.farmersDiet(player, Herbalism.farmersDietRankLevel2, newFoodLevel)); + } return; case COOKED_FISH: /* RESTORES 2 1/2 HUNGER - RESTORES 5 HUNGER @ 1000 */ - event.setFoodLevel(Fishing.beginFishermansDiet(player, Fishing.fishermansDietRankLevel1, newFoodLevel)); + if (Permissions.fishermansDiet(player)) { + event.setFoodLevel(Fishing.beginFishermansDiet(player, Fishing.fishermansDietRankLevel1, newFoodLevel)); + } return; case RAW_FISH: /* RESTORES 1 HUNGER - RESTORES 2 1/2 HUNGER @ 1000 */ - event.setFoodLevel(Fishing.beginFishermansDiet(player, Fishing.fishermansDietRankLevel2, newFoodLevel)); + if (Permissions.fishermansDiet(player)) { + event.setFoodLevel(Fishing.beginFishermansDiet(player, Fishing.fishermansDietRankLevel2, newFoodLevel)); + } return; default: diff --git a/src/main/java/com/gmail/nossr50/skills/fishing/Fishing.java b/src/main/java/com/gmail/nossr50/skills/fishing/Fishing.java index 3f917c5a2..80403f66f 100644 --- a/src/main/java/com/gmail/nossr50/skills/fishing/Fishing.java +++ b/src/main/java/com/gmail/nossr50/skills/fishing/Fishing.java @@ -78,11 +78,6 @@ public final class Fishing { * @param event Event to process */ public static int beginFishermansDiet(Player player, int rankChange, int eventFoodLevel) { - // TODO: The permission should probably not be checked here - if (!Permissions.fishermansDiet(player)) { - return eventFoodLevel; - } - return SkillTools.handleFoodSkills(player, SkillType.FISHING, eventFoodLevel, fishermansDietRankLevel1, fishermansDietMaxLevel, rankChange); } diff --git a/src/main/java/com/gmail/nossr50/skills/herbalism/Herbalism.java b/src/main/java/com/gmail/nossr50/skills/herbalism/Herbalism.java index d50549528..b3d043903 100644 --- a/src/main/java/com/gmail/nossr50/skills/herbalism/Herbalism.java +++ b/src/main/java/com/gmail/nossr50/skills/herbalism/Herbalism.java @@ -57,10 +57,6 @@ public class Herbalism { * @param event The actual FoodLevelChange event */ public static int farmersDiet(Player player, int rankChange, int eventFoodLevel) { - if (!Permissions.farmersDiet(player)) { - return eventFoodLevel; - } - return SkillTools.handleFoodSkills(player, SkillType.HERBALISM, eventFoodLevel, farmersDietRankLevel1, farmersDietMaxLevel, rankChange); }