Fixed display bug w/ Fish Diet, added Tropical, Raw Cod/Salmon to eligible foods

This commit is contained in:
nossr50 2019-03-09 15:48:29 -08:00
parent 6f15cd4005
commit 28b71804a2
6 changed files with 13 additions and 20 deletions

View File

@ -7,6 +7,10 @@ Key:
! Change ! Change
- Removal - Removal
Version 2.1.14
Added Tropical Fish, Raw Cod, Raw Salmon to the list of foods that benefit from Fisherman's Diet
Fixed a display issue with Fisherman's Diet
Version 2.1.13 Version 2.1.13
Fixed a bug where Archery's Arrow Retrieval was using the wrong permission node Fixed a bug where Archery's Arrow Retrieval was using the wrong permission node

View File

@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.gmail.nossr50.mcMMO</groupId> <groupId>com.gmail.nossr50.mcMMO</groupId>
<artifactId>mcMMO</artifactId> <artifactId>mcMMO</artifactId>
<version>2.1.13</version> <version>2.1.14-SNAPSHOT</version>
<name>mcMMO</name> <name>mcMMO</name>
<url>https://github.com/mcMMO-Dev/mcMMO</url> <url>https://github.com/mcMMO-Dev/mcMMO</url>
<scm> <scm>

View File

@ -89,7 +89,7 @@ public class FishingCommand extends SkillCommand {
// FISHERMAN'S DIET // FISHERMAN'S DIET
if (canFishermansDiet) { if (canFishermansDiet) {
fishermansDietRank = calculateRank(skillValue, Fishing.fishermansDietMaxLevel, Fishing.fishermansDietRankLevel1); fishermansDietRank = RankUtils.getRank(player, SubSkillType.FISHING_FISHERMANS_DIET);
} }
// MASTER ANGLER // MASTER ANGLER

View File

@ -765,19 +765,14 @@ public class EntityListener implements Listener {
event.setFoodLevel(UserManager.getPlayer(player).getHerbalismManager().farmersDiet(newFoodLevel)); event.setFoodLevel(UserManager.getPlayer(player).getHerbalismManager().farmersDiet(newFoodLevel));
} }
return; return;
case COD:
case SALMON:
case TROPICAL_FISH:
case COOKED_COD:
case COOKED_SALMON:
case COOKED_SALMON: /*
* RESTORES 2 1/2 HUNGER - RESTORES 5 HUNGER @
* 1000
*/
if (Permissions.isSubSkillEnabled(player, SubSkillType.FISHING_FISHERMANS_DIET)) { if (Permissions.isSubSkillEnabled(player, SubSkillType.FISHING_FISHERMANS_DIET)) {
event.setFoodLevel(UserManager.getPlayer(player).getFishingManager().handleFishermanDiet(Fishing.fishermansDietRankLevel1, newFoodLevel)); event.setFoodLevel(UserManager.getPlayer(player).getFishingManager().handleFishermanDiet(newFoodLevel));
}
return;
case SALMON: /* RESTORES 1 HUNGER - RESTORES 2 1/2 HUNGER @ 1000 */
if (Permissions.isSubSkillEnabled(player, SubSkillType.FISHING_FISHERMANS_DIET)) {
event.setFoodLevel(UserManager.getPlayer(player).getFishingManager().handleFishermanDiet(Fishing.fishermansDietRankLevel2, newFoodLevel));
} }
return; return;

View File

@ -1,6 +1,5 @@
package com.gmail.nossr50.skills.fishing; package com.gmail.nossr50.skills.fishing;
import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.config.treasure.TreasureConfig; import com.gmail.nossr50.config.treasure.TreasureConfig;
import com.gmail.nossr50.datatypes.treasure.ShakeTreasure; import com.gmail.nossr50.datatypes.treasure.ShakeTreasure;
import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Misc;
@ -19,10 +18,6 @@ public final class Fishing {
protected static final HashMap<Material, List<Enchantment>> ENCHANTABLE_CACHE = new HashMap<Material, List<Enchantment>>(); protected static final HashMap<Material, List<Enchantment>> ENCHANTABLE_CACHE = new HashMap<Material, List<Enchantment>>();
public static int fishermansDietRankLevel1 = AdvancedConfig.getInstance().getFishermanDietRankChange();
public static int fishermansDietRankLevel2 = fishermansDietRankLevel1 * 2;
public static int fishermansDietMaxLevel = fishermansDietRankLevel1 * 5;
public static Set<Biome> masterAnglerBiomes = BiomeAdapter.WATER_BIOMES; public static Set<Biome> masterAnglerBiomes = BiomeAdapter.WATER_BIOMES;
public static Set<Biome> iceFishingBiomes = BiomeAdapter.ICE_BIOMES; public static Set<Biome> iceFishingBiomes = BiomeAdapter.ICE_BIOMES;

View File

@ -134,12 +134,11 @@ public class FishingManager extends SkillManager {
/** /**
* Handle the Fisherman's Diet ability * Handle the Fisherman's Diet ability
* *
* @param rankChange The # of levels to change rank for the food
* @param eventFoodLevel The initial change in hunger from the event * @param eventFoodLevel The initial change in hunger from the event
* *
* @return the modified change in hunger for the event * @return the modified change in hunger for the event
*/ */
public int handleFishermanDiet(int rankChange, int eventFoodLevel) { public int handleFishermanDiet(int eventFoodLevel) {
return SkillUtils.handleFoodSkills(getPlayer(), eventFoodLevel, SubSkillType.FISHING_FISHERMANS_DIET); return SkillUtils.handleFoodSkills(getPlayer(), eventFoodLevel, SubSkillType.FISHING_FISHERMANS_DIET);
} }