Don't check the permissions here.

This commit is contained in:
GJ 2013-02-26 18:26:52 -05:00
parent 0201ed332f
commit 18510ba851
3 changed files with 12 additions and 13 deletions

View File

@ -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 */
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 */
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 */
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 */
if (Permissions.fishermansDiet(player)) {
event.setFoodLevel(Fishing.beginFishermansDiet(player, Fishing.fishermansDietRankLevel2, newFoodLevel));
}
return;
default:

View File

@ -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);
}

View File

@ -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);
}