mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-01-19 00:45:27 +01:00
Added vanilla XP boost for Fishing - includes permissions, config
options, etc
This commit is contained in:
parent
5e6b1fe362
commit
3f6bd7894d
@ -20,6 +20,7 @@ Version 1.4.00-dev
|
|||||||
+ Added XP bonus for Archery based on distance from shooter to target
|
+ Added XP bonus for Archery based on distance from shooter to target
|
||||||
+ Added ability to config Hylian Luck drops through treasures.yml
|
+ Added ability to config Hylian Luck drops through treasures.yml
|
||||||
+ Added party XP sharing
|
+ Added party XP sharing
|
||||||
|
+ Added vanilla XP boost for Fishing - includes permissions, config options, etc
|
||||||
= Fixed the guide usage string showing up every time /skillname was called
|
= Fixed the guide usage string showing up every time /skillname was called
|
||||||
= Fixed Spout not being able to precache our resources properly, and therefore making our XP bars fail
|
= Fixed Spout not being able to precache our resources properly, and therefore making our XP bars fail
|
||||||
= Fixed Spout config files loading / generating when they shouldn't have
|
= Fixed Spout config files loading / generating when they shouldn't have
|
||||||
|
@ -89,6 +89,13 @@ public class AdvancedConfig extends ConfigLoader {
|
|||||||
public int getShakeChanceRank4() { return config.getInt("Skills.Fishing.Shake_Chance.Rank_4", 60); }
|
public int getShakeChanceRank4() { return config.getInt("Skills.Fishing.Shake_Chance.Rank_4", 60); }
|
||||||
public int getShakeChanceRank5() { return config.getInt("Skills.Fishing.Shake_Chance.Rank_5", 75); }
|
public int getShakeChanceRank5() { return config.getInt("Skills.Fishing.Shake_Chance.Rank_5", 75); }
|
||||||
|
|
||||||
|
/* Vanilla XP Boost */
|
||||||
|
public int getFishingVanillaXPModifierRank1() { return config.getInt("Skills.Fishing.VanillaXPBoost.Rank_1", 1); }
|
||||||
|
public int getFishingVanillaXPModifierRank2() { return config.getInt("Skills.Fishing.VanillaXPBoost.Rank_2", 2); }
|
||||||
|
public int getFishingVanillaXPModifierRank3() { return config.getInt("Skills.Fishing.VanillaXPBoost.Rank_3", 3); }
|
||||||
|
public int getFishingVanillaXPModifierRank4() { return config.getInt("Skills.Fishing.VanillaXPBoost.Rank_4", 4); }
|
||||||
|
public int getFishingVanillaXPModifierRank5() { return config.getInt("Skills.Fishing.VanillaXPBoost.Rank_5", 5); }
|
||||||
|
|
||||||
/* HERBALISM */
|
/* HERBALISM */
|
||||||
public int getFarmerDietRankChange() { return config.getInt("Skills.Herbalism.Farmer_Diet_RankChange", 200); }
|
public int getFarmerDietRankChange() { return config.getInt("Skills.Herbalism.Farmer_Diet_RankChange", 200); }
|
||||||
|
|
||||||
|
@ -92,7 +92,9 @@ public class PlayerListener implements Listener {
|
|||||||
switch (event.getState()) {
|
switch (event.getState()) {
|
||||||
case CAUGHT_FISH:
|
case CAUGHT_FISH:
|
||||||
Fishing.beginFishing(player, skillLevel, event);
|
Fishing.beginFishing(player, skillLevel, event);
|
||||||
break;
|
Fishing.awardAdditionalVanillaXP(skillLevel, event);
|
||||||
|
break;
|
||||||
|
|
||||||
case CAUGHT_ENTITY:
|
case CAUGHT_ENTITY:
|
||||||
if (skillLevel >= AdvancedConfig.getInstance().getShakeUnlockLevel() && Permissions.shakeMob(player)) {
|
if (skillLevel >= AdvancedConfig.getInstance().getShakeUnlockLevel() && Permissions.shakeMob(player)) {
|
||||||
//TODO: Unsafe cast?
|
//TODO: Unsafe cast?
|
||||||
|
@ -29,11 +29,26 @@ public final class Fishing {
|
|||||||
|
|
||||||
// The order of the values is extremely important, Fishing.getLootTier() and ShakeMob.getShakeChance() depend on it to work properly
|
// The order of the values is extremely important, Fishing.getLootTier() and ShakeMob.getShakeChance() depend on it to work properly
|
||||||
protected enum Tier {
|
protected enum Tier {
|
||||||
FIVE(5) {@Override public int getLevel() {return ADVANCED_CONFIG.getFishingTierLevelsTier5();} @Override public int getShakeChance() {return ADVANCED_CONFIG.getShakeChanceRank5();}},
|
FIVE(5) {
|
||||||
FOUR(4) {@Override public int getLevel() {return ADVANCED_CONFIG.getFishingTierLevelsTier4();} @Override public int getShakeChance() {return ADVANCED_CONFIG.getShakeChanceRank4();}},
|
@Override public int getLevel() {return ADVANCED_CONFIG.getFishingTierLevelsTier5();}
|
||||||
THREE(3) {@Override public int getLevel() {return ADVANCED_CONFIG.getFishingTierLevelsTier3();} @Override public int getShakeChance() {return ADVANCED_CONFIG.getShakeChanceRank3();}},
|
@Override public int getShakeChance() {return ADVANCED_CONFIG.getShakeChanceRank5();}
|
||||||
TWO(2) {@Override public int getLevel() {return ADVANCED_CONFIG.getFishingTierLevelsTier2();} @Override public int getShakeChance() {return ADVANCED_CONFIG.getShakeChanceRank2();}},
|
@Override public int getVanillaXPBoostModifier() {return ADVANCED_CONFIG.getFishingVanillaXPModifierRank5();}},
|
||||||
ONE(1) {@Override public int getLevel() {return ADVANCED_CONFIG.getFishingTierLevelsTier1();} @Override public int getShakeChance() {return ADVANCED_CONFIG.getShakeChanceRank1();}};
|
FOUR(4) {
|
||||||
|
@Override public int getLevel() {return ADVANCED_CONFIG.getFishingTierLevelsTier4();}
|
||||||
|
@Override public int getShakeChance() {return ADVANCED_CONFIG.getShakeChanceRank4();}
|
||||||
|
@Override public int getVanillaXPBoostModifier() {return ADVANCED_CONFIG.getFishingVanillaXPModifierRank4();}},
|
||||||
|
THREE(3) {
|
||||||
|
@Override public int getLevel() {return ADVANCED_CONFIG.getFishingTierLevelsTier3();}
|
||||||
|
@Override public int getShakeChance() {return ADVANCED_CONFIG.getShakeChanceRank3();}
|
||||||
|
@Override public int getVanillaXPBoostModifier() {return ADVANCED_CONFIG.getFishingVanillaXPModifierRank3();}},
|
||||||
|
TWO(2) {
|
||||||
|
@Override public int getLevel() {return ADVANCED_CONFIG.getFishingTierLevelsTier2();}
|
||||||
|
@Override public int getShakeChance() {return ADVANCED_CONFIG.getShakeChanceRank2();}
|
||||||
|
@Override public int getVanillaXPBoostModifier() {return ADVANCED_CONFIG.getFishingVanillaXPModifierRank2();}},
|
||||||
|
ONE(1) {
|
||||||
|
@Override public int getLevel() {return ADVANCED_CONFIG.getFishingTierLevelsTier1();}
|
||||||
|
@Override public int getShakeChance() {return ADVANCED_CONFIG.getShakeChanceRank1();}
|
||||||
|
@Override public int getVanillaXPBoostModifier() {return ADVANCED_CONFIG.getFishingVanillaXPModifierRank1();}};
|
||||||
|
|
||||||
int numerical;
|
int numerical;
|
||||||
|
|
||||||
@ -47,6 +62,7 @@ public final class Fishing {
|
|||||||
|
|
||||||
abstract protected int getLevel();
|
abstract protected int getLevel();
|
||||||
abstract protected int getShakeChance();
|
abstract protected int getShakeChance();
|
||||||
|
abstract protected int getVanillaXPBoostModifier();
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Get rid of that
|
// TODO: Get rid of that
|
||||||
@ -115,6 +131,11 @@ public final class Fishing {
|
|||||||
SkillTools.xpProcessing(player, Users.getProfile(player), SkillType.FISHING, Config.getInstance().getFishingBaseXP() + xp);
|
SkillTools.xpProcessing(player, Users.getProfile(player), SkillType.FISHING, Config.getInstance().getFishingBaseXP() + xp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void awardAdditionalVanillaXP(int skillLevel, PlayerFishEvent event) {
|
||||||
|
int xp = event.getExpToDrop();
|
||||||
|
event.setExpToDrop(xp * getVanillaXPMultiplier(skillLevel));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks for treasure
|
* Checks for treasure
|
||||||
*
|
*
|
||||||
@ -233,4 +254,20 @@ public final class Fishing {
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the Shake Mob probability for a given skill level
|
||||||
|
*
|
||||||
|
* @param skillLevel Fishing skill level
|
||||||
|
* @return Shake Mob probability
|
||||||
|
*/
|
||||||
|
public static int getVanillaXPMultiplier(int skillLevel) {
|
||||||
|
for (Tier tier : Tier.values()) {
|
||||||
|
if (skillLevel >= tier.getLevel()) {
|
||||||
|
return tier.getVanillaXPBoostModifier();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -235,6 +235,10 @@ public final class Permissions {
|
|||||||
return hasPermission(player, "mcmmo.ability.fishing.fishermansdiet");
|
return hasPermission(player, "mcmmo.ability.fishing.fishermansdiet");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean fishingVanillaXPBoost(Player player) {
|
||||||
|
return hasPermission(player, "mcmmo.ability.fishing.vanillaxpboost");
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* MCMMO.ABILITY.MINING.*
|
* MCMMO.ABILITY.MINING.*
|
||||||
*/
|
*/
|
||||||
|
@ -106,6 +106,14 @@ Skills:
|
|||||||
Rank_4: 60
|
Rank_4: 60
|
||||||
Rank_5: 75
|
Rank_5: 75
|
||||||
|
|
||||||
|
#VanillaXPBoost: Vanilla XP gained from fishing is mutliplied by these values.
|
||||||
|
VanillaXPBoost:
|
||||||
|
Rank_1: 1
|
||||||
|
Rank_2: 2
|
||||||
|
Rank_3: 3
|
||||||
|
Rank_4: 4
|
||||||
|
Rank_5: 5
|
||||||
|
|
||||||
# Tiers
|
# Tiers
|
||||||
Tier_Levels:
|
Tier_Levels:
|
||||||
Tier1: 0
|
Tier1: 0
|
||||||
|
@ -12,7 +12,7 @@ description: >
|
|||||||
experience.
|
experience.
|
||||||
|
|
||||||
author: nossr50
|
author: nossr50
|
||||||
authors: [NuclearW, GJ, Glitchfinder, TfT_02, toothplck1]
|
authors: [GJ, NuclearW, bm01, Glitchfinder, TfT_02, toothplck1]
|
||||||
website: http://dev.bukkit.org/server-mods/mcmmo/
|
website: http://dev.bukkit.org/server-mods/mcmmo/
|
||||||
|
|
||||||
main: com.gmail.nossr50.mcMMO
|
main: com.gmail.nossr50.mcMMO
|
||||||
@ -412,6 +412,7 @@ permissions:
|
|||||||
mcmmo.ability.fishing.treasures: true
|
mcmmo.ability.fishing.treasures: true
|
||||||
mcmmo.ability.fishing.magic: true
|
mcmmo.ability.fishing.magic: true
|
||||||
mcmmo.ability.fishing.fishermansdiet: true
|
mcmmo.ability.fishing.fishermansdiet: true
|
||||||
|
mcmmo.ability.fishing.vanillaxpboost: true
|
||||||
mcmmo.ability.fishing.shakemob:
|
mcmmo.ability.fishing.shakemob:
|
||||||
description: Allows access to the Shake Mob ability
|
description: Allows access to the Shake Mob ability
|
||||||
mcmmo.ability.fishing.treasures:
|
mcmmo.ability.fishing.treasures:
|
||||||
@ -420,6 +421,8 @@ permissions:
|
|||||||
description: Allows enchanted drops from Fishing
|
description: Allows enchanted drops from Fishing
|
||||||
mcmmo.ability.fishing.fishermansdiet:
|
mcmmo.ability.fishing.fishermansdiet:
|
||||||
description: Allows access to the Fishermans's Diet ability
|
description: Allows access to the Fishermans's Diet ability
|
||||||
|
mcmmo.ability.fishing.vanillaxpboost:
|
||||||
|
description: Allows vanilla XP boost from Fishing
|
||||||
mcmmo.ability.mining.*:
|
mcmmo.ability.mining.*:
|
||||||
description: Allows access to all Mining abilities
|
description: Allows access to all Mining abilities
|
||||||
children:
|
children:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user