mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 13:16:45 +01:00
SecondaryAbility's API additions
This commit is contained in:
parent
5d63a4b910
commit
870987bba7
@ -8,11 +8,13 @@ Key:
|
|||||||
- Removal
|
- Removal
|
||||||
|
|
||||||
Version 1.4.08-dev
|
Version 1.4.08-dev
|
||||||
|
+ Added SecondaryAbilityType enum, and new SecondaryAbilityWeightedActivationCheckEvent, fired when a secondary ability checkes its activation chances
|
||||||
+ Added the possibility to gain experience when using Fishing "Shake"
|
+ Added the possibility to gain experience when using Fishing "Shake"
|
||||||
+ Added config options to disable various sound effects
|
+ Added config options to disable various sound effects
|
||||||
+ Smelting now works with custom ores - add smelting XP value to blocks.yml, or it will default to 1/10th of normal XP.
|
+ Smelting now works with custom ores - add smelting XP value to blocks.yml, or it will default to 1/10th of normal XP.
|
||||||
+ Added automatic cleanup of backups folder.
|
+ Added automatic cleanup of backups folder.
|
||||||
+ Added bypass permission for finding Fishing traps
|
+ Added bypass permission for finding Fishing traps
|
||||||
|
= Fixed bug where LeafBlower permissions were ignored
|
||||||
= Fixed bug with toggle commands not properly displaying the success message.
|
= Fixed bug with toggle commands not properly displaying the success message.
|
||||||
= Fixed IllegalArgumentException caused by an empty Fishing treasure category
|
= Fixed IllegalArgumentException caused by an empty Fishing treasure category
|
||||||
= Fixed bug with Salvage not reading the config value for the anvil material.
|
= Fixed bug with Salvage not reading the config value for the anvil material.
|
||||||
@ -20,6 +22,8 @@ Version 1.4.08-dev
|
|||||||
= Fixed bug where the Unbreaking enchantment was ignored when using "Super Breaker" or "Giga Drill Breaker"
|
= Fixed bug where the Unbreaking enchantment was ignored when using "Super Breaker" or "Giga Drill Breaker"
|
||||||
= Fixed bug which prevented players from gaining Acrobatics XP when the setting 'Prevent_XP_After_Teleport' was set to false
|
= Fixed bug which prevented players from gaining Acrobatics XP when the setting 'Prevent_XP_After_Teleport' was set to false
|
||||||
! Updated localization files
|
! Updated localization files
|
||||||
|
! Changed AxesCritical to CriticalHit in config file
|
||||||
|
! Changed several secondary ability permissions(deprecated versions still exist)
|
||||||
|
|
||||||
Version 1.4.07
|
Version 1.4.07
|
||||||
+ Added XP boost to Acrobatics when wearing Boots of Feather Falling
|
+ Added XP boost to Acrobatics when wearing Boots of Feather Falling
|
||||||
|
@ -41,7 +41,7 @@ public class MccooldownCommand implements TabExecutor {
|
|||||||
player.sendMessage(LocaleLoader.getString("Commands.Cooldowns.Header"));
|
player.sendMessage(LocaleLoader.getString("Commands.Cooldowns.Header"));
|
||||||
player.sendMessage(LocaleLoader.getString("mcMMO.NoSkillNote"));
|
player.sendMessage(LocaleLoader.getString("mcMMO.NoSkillNote"));
|
||||||
|
|
||||||
for (AbilityType ability : AbilityType.NORMAL_ABILITIES) {
|
for (AbilityType ability : AbilityType.values()) {
|
||||||
if (!ability.getPermissions(player)) {
|
if (!ability.getPermissions(player)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -5,9 +5,9 @@ import java.util.List;
|
|||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import com.gmail.nossr50.datatypes.skills.SecondaryAbilityType;
|
||||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.skills.acrobatics.Acrobatics;
|
|
||||||
import com.gmail.nossr50.util.Permissions;
|
import com.gmail.nossr50.util.Permissions;
|
||||||
|
|
||||||
public class AcrobaticsCommand extends SkillCommand {
|
public class AcrobaticsCommand extends SkillCommand {
|
||||||
@ -30,21 +30,21 @@ public class AcrobaticsCommand extends SkillCommand {
|
|||||||
protected void dataCalculations(Player player, float skillValue, boolean isLucky) {
|
protected void dataCalculations(Player player, float skillValue, boolean isLucky) {
|
||||||
// DODGE
|
// DODGE
|
||||||
if (canDodge) {
|
if (canDodge) {
|
||||||
String[] dodgeStrings = calculateAbilityDisplayValues(skillValue, Acrobatics.dodgeMaxBonusLevel, Acrobatics.dodgeMaxChance, isLucky);
|
String[] dodgeStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbilityType.DODGE, isLucky);
|
||||||
dodgeChance = dodgeStrings[0];
|
dodgeChance = dodgeStrings[0];
|
||||||
dodgeChanceLucky = dodgeStrings[1];
|
dodgeChanceLucky = dodgeStrings[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
// ROLL
|
// ROLL
|
||||||
if (canRoll) {
|
if (canRoll) {
|
||||||
String[] rollStrings = calculateAbilityDisplayValues(skillValue, Acrobatics.rollMaxBonusLevel, Acrobatics.rollMaxChance, isLucky);
|
String[] rollStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbilityType.ROLL, isLucky);
|
||||||
rollChance = rollStrings[0];
|
rollChance = rollStrings[0];
|
||||||
rollChanceLucky = rollStrings[1];
|
rollChanceLucky = rollStrings[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
// GRACEFUL ROLL
|
// GRACEFUL ROLL
|
||||||
if (canGracefulRoll) {
|
if (canGracefulRoll) {
|
||||||
String[] gracefulRollStrings = calculateAbilityDisplayValues(skillValue, Acrobatics.gracefulRollMaxBonusLevel, Acrobatics.gracefulRollMaxChance, isLucky);
|
String[] gracefulRollStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbilityType.GRACEFUL_ROLL, isLucky);
|
||||||
gracefulRollChance = gracefulRollStrings[0];
|
gracefulRollChance = gracefulRollStrings[0];
|
||||||
gracefulRollChanceLucky = gracefulRollStrings[1];
|
gracefulRollChanceLucky = gracefulRollStrings[1];
|
||||||
}
|
}
|
||||||
@ -52,9 +52,9 @@ public class AcrobaticsCommand extends SkillCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void permissionsCheck(Player player) {
|
protected void permissionsCheck(Player player) {
|
||||||
canDodge = Permissions.dodge(player);
|
canDodge = Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.DODGE);
|
||||||
canRoll = Permissions.roll(player);
|
canRoll = Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.ROLL);
|
||||||
canGracefulRoll = Permissions.gracefulRoll(player);
|
canGracefulRoll = Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.GRACEFUL_ROLL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -5,6 +5,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import com.gmail.nossr50.datatypes.skills.SecondaryAbilityType;
|
||||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.skills.archery.Archery;
|
import com.gmail.nossr50.skills.archery.Archery;
|
||||||
@ -35,14 +36,14 @@ public class ArcheryCommand extends SkillCommand {
|
|||||||
|
|
||||||
// DAZE
|
// DAZE
|
||||||
if (canDaze) {
|
if (canDaze) {
|
||||||
String[] dazeStrings = calculateAbilityDisplayValues(skillValue, Archery.dazeMaxBonusLevel, Archery.dazeMaxBonus, isLucky);
|
String[] dazeStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbilityType.DAZE, isLucky);
|
||||||
dazeChance = dazeStrings[0];
|
dazeChance = dazeStrings[0];
|
||||||
dazeChanceLucky = dazeStrings[1];
|
dazeChanceLucky = dazeStrings[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
// RETRIEVE
|
// RETRIEVE
|
||||||
if (canRetrieve) {
|
if (canRetrieve) {
|
||||||
String[] retrieveStrings = calculateAbilityDisplayValues(skillValue, Archery.retrieveMaxBonusLevel, Archery.retrieveMaxChance, isLucky);
|
String[] retrieveStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbilityType.RETRIEVE, isLucky);
|
||||||
retrieveChance = retrieveStrings[0];
|
retrieveChance = retrieveStrings[0];
|
||||||
retrieveChanceLucky = retrieveStrings[1];
|
retrieveChanceLucky = retrieveStrings[1];
|
||||||
}
|
}
|
||||||
@ -50,9 +51,9 @@ public class ArcheryCommand extends SkillCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void permissionsCheck(Player player) {
|
protected void permissionsCheck(Player player) {
|
||||||
canSkillShot = Permissions.bonusDamage(player, skill);
|
canSkillShot = Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.SKILL_SHOT);
|
||||||
canDaze = Permissions.daze(player);
|
canDaze = Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.DAZE);
|
||||||
canRetrieve = Permissions.arrowRetrieval(player);
|
canRetrieve = Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.RETRIEVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -5,6 +5,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import com.gmail.nossr50.datatypes.skills.SecondaryAbilityType;
|
||||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.skills.axes.Axes;
|
import com.gmail.nossr50.skills.axes.Axes;
|
||||||
@ -13,14 +14,14 @@ import com.gmail.nossr50.util.Permissions;
|
|||||||
public class AxesCommand extends SkillCommand {
|
public class AxesCommand extends SkillCommand {
|
||||||
private String critChance;
|
private String critChance;
|
||||||
private String critChanceLucky;
|
private String critChanceLucky;
|
||||||
private double bonusDamage;
|
private double axeMasteryDamage;
|
||||||
private double impactDamage;
|
private double impactDamage;
|
||||||
private String skullSplitterLength;
|
private String skullSplitterLength;
|
||||||
private String skullSplitterLengthEndurance;
|
private String skullSplitterLengthEndurance;
|
||||||
|
|
||||||
private boolean canSkullSplitter;
|
private boolean canSkullSplitter;
|
||||||
private boolean canCritical;
|
private boolean canCritical;
|
||||||
private boolean canBonusDamage;
|
private boolean canAxeMastery;
|
||||||
private boolean canImpact;
|
private boolean canImpact;
|
||||||
private boolean canGreaterImpact;
|
private boolean canGreaterImpact;
|
||||||
|
|
||||||
@ -30,7 +31,7 @@ public class AxesCommand extends SkillCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void dataCalculations(Player player, float skillValue, boolean isLucky) {
|
protected void dataCalculations(Player player, float skillValue, boolean isLucky) {
|
||||||
// IMPACT
|
// ARMOR IMPACT
|
||||||
if (canImpact) {
|
if (canImpact) {
|
||||||
impactDamage = 1 + (skillValue / Axes.impactIncreaseLevel);
|
impactDamage = 1 + (skillValue / Axes.impactIncreaseLevel);
|
||||||
}
|
}
|
||||||
@ -42,26 +43,26 @@ public class AxesCommand extends SkillCommand {
|
|||||||
skullSplitterLengthEndurance = skullSplitterStrings[1];
|
skullSplitterLengthEndurance = skullSplitterStrings[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
// CRITICAL STRIKES
|
// CRITICAL HIT
|
||||||
if (canCritical) {
|
if (canCritical) {
|
||||||
String[] criticalStrikeStrings = calculateAbilityDisplayValues(skillValue, Axes.criticalHitMaxBonusLevel, Axes.criticalHitMaxChance, isLucky);
|
String[] criticalHitStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbilityType.CRITICAL_HIT, isLucky);
|
||||||
critChance = criticalStrikeStrings[0];
|
critChance = criticalHitStrings[0];
|
||||||
critChanceLucky = criticalStrikeStrings[1];
|
critChanceLucky = criticalHitStrings[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
// AXE MASTERY
|
// AXE MASTERY
|
||||||
if (canBonusDamage) {
|
if (canAxeMastery) {
|
||||||
bonusDamage = Math.min(skillValue / (Axes.bonusDamageMaxBonusLevel / Axes.bonusDamageMaxBonus), Axes.bonusDamageMaxBonus);
|
axeMasteryDamage = Math.min(skillValue / (Axes.axeMasteryMaxBonusLevel / Axes.axeMasteryMaxBonus), Axes.axeMasteryMaxBonus);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void permissionsCheck(Player player) {
|
protected void permissionsCheck(Player player) {
|
||||||
canSkullSplitter = Permissions.skullSplitter(player);
|
canSkullSplitter = Permissions.skullSplitter(player);
|
||||||
canCritical = Permissions.criticalStrikes(player);
|
canCritical = Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.CRITICAL_HIT);
|
||||||
canBonusDamage = Permissions.bonusDamage(player, skill);
|
canAxeMastery = Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.AXE_MASTERY);
|
||||||
canImpact = Permissions.armorImpact(player);
|
canImpact = Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.ARMOR_IMPACT);
|
||||||
canGreaterImpact = Permissions.greaterImpact(player);
|
canGreaterImpact = Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.GREATER_IMPACT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -76,7 +77,7 @@ public class AxesCommand extends SkillCommand {
|
|||||||
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Axes.Effect.2"), LocaleLoader.getString("Axes.Effect.3")));
|
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Axes.Effect.2"), LocaleLoader.getString("Axes.Effect.3")));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (canBonusDamage) {
|
if (canAxeMastery) {
|
||||||
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Axes.Effect.4"), LocaleLoader.getString("Axes.Effect.5")));
|
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Axes.Effect.4"), LocaleLoader.getString("Axes.Effect.5")));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -95,8 +96,8 @@ public class AxesCommand extends SkillCommand {
|
|||||||
protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) {
|
protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) {
|
||||||
List<String> messages = new ArrayList<String>();
|
List<String> messages = new ArrayList<String>();
|
||||||
|
|
||||||
if (canBonusDamage) {
|
if (canAxeMastery) {
|
||||||
messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Axes.Ability.Bonus.0"), LocaleLoader.getString("Axes.Ability.Bonus.1", bonusDamage)));
|
messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Axes.Ability.Bonus.0"), LocaleLoader.getString("Axes.Ability.Bonus.1", axeMasteryDamage)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (canImpact) {
|
if (canImpact) {
|
||||||
|
@ -5,6 +5,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import com.gmail.nossr50.datatypes.skills.SecondaryAbilityType;
|
||||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.util.Permissions;
|
import com.gmail.nossr50.util.Permissions;
|
||||||
@ -33,7 +34,7 @@ public class ExcavationCommand extends SkillCommand {
|
|||||||
@Override
|
@Override
|
||||||
protected void permissionsCheck(Player player) {
|
protected void permissionsCheck(Player player) {
|
||||||
canGigaDrill = Permissions.gigaDrillBreaker(player);
|
canGigaDrill = Permissions.gigaDrillBreaker(player);
|
||||||
canTreasureHunt = Permissions.excavationTreasureHunter(player);
|
canTreasureHunt = Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.EXCAVATION_TREASURE_HUNTER);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -10,6 +10,7 @@ import org.bukkit.entity.Player;
|
|||||||
|
|
||||||
import com.gmail.nossr50.config.AdvancedConfig;
|
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.skills.SecondaryAbilityType;
|
||||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||||
import com.gmail.nossr50.datatypes.treasure.Rarity;
|
import com.gmail.nossr50.datatypes.treasure.Rarity;
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
@ -114,12 +115,12 @@ public class FishingCommand extends SkillCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void permissionsCheck(Player player) {
|
protected void permissionsCheck(Player player) {
|
||||||
canTreasureHunt = Permissions.fishingTreasureHunter(player);
|
canTreasureHunt = Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.FISHING_TREASURE_HUNTER);
|
||||||
canMagicHunt = Permissions.magicHunter(player);
|
canMagicHunt = Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.MAGIC_HUNTER);
|
||||||
canShake = Permissions.shake(player);
|
canShake = Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.SHAKE);
|
||||||
canFishermansDiet = Permissions.fishermansDiet(player);
|
canFishermansDiet = Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.FISHERMANS_DIET);
|
||||||
canMasterAngler = Permissions.masterAngler(player);
|
canMasterAngler = Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.MASTER_ANGLER);
|
||||||
canIceFish = Permissions.iceFishing(player);
|
canIceFish = Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.ICE_FISHING);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -6,6 +6,7 @@ import java.util.List;
|
|||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import com.gmail.nossr50.datatypes.skills.SecondaryAbilityType;
|
||||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.skills.herbalism.Herbalism;
|
import com.gmail.nossr50.skills.herbalism.Herbalism;
|
||||||
@ -55,28 +56,28 @@ public class HerbalismCommand extends SkillCommand {
|
|||||||
if (canGreenThumbBlocks || canGreenThumbPlants) {
|
if (canGreenThumbBlocks || canGreenThumbPlants) {
|
||||||
greenThumbStage = calculateRank(skillValue, Herbalism.greenThumbStageMaxLevel, Herbalism.greenThumbStageChangeLevel);
|
greenThumbStage = calculateRank(skillValue, Herbalism.greenThumbStageMaxLevel, Herbalism.greenThumbStageChangeLevel);
|
||||||
|
|
||||||
String[] greenThumbStrings = calculateAbilityDisplayValues(skillValue, Herbalism.greenThumbMaxLevel, Herbalism.greenThumbMaxChance, isLucky);
|
String[] greenThumbStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbilityType.GREEN_THUMB_PLANT, isLucky);
|
||||||
greenThumbChance = greenThumbStrings[0];
|
greenThumbChance = greenThumbStrings[0];
|
||||||
greenThumbChanceLucky = greenThumbStrings[1];
|
greenThumbChanceLucky = greenThumbStrings[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
// DOUBLE DROPS
|
// DOUBLE DROPS
|
||||||
if (canDoubleDrop) {
|
if (canDoubleDrop) {
|
||||||
String[] doubleDropStrings = calculateAbilityDisplayValues(skillValue, Herbalism.doubleDropsMaxLevel, Herbalism.doubleDropsMaxChance, isLucky);
|
String[] doubleDropStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbilityType.HERBALISM_DOUBLE_DROPS, isLucky);
|
||||||
doubleDropChance = doubleDropStrings[0];
|
doubleDropChance = doubleDropStrings[0];
|
||||||
doubleDropChanceLucky = doubleDropStrings[1];
|
doubleDropChanceLucky = doubleDropStrings[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
// HYLIAN LUCK
|
// HYLIAN LUCK
|
||||||
if (hasHylianLuck) {
|
if (hasHylianLuck) {
|
||||||
String[] hylianLuckStrings = calculateAbilityDisplayValues(skillValue, Herbalism.hylianLuckMaxLevel, Herbalism.hylianLuckMaxChance, isLucky);
|
String[] hylianLuckStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbilityType.HYLIAN_LUCK, isLucky);
|
||||||
hylianLuckChance = hylianLuckStrings[0];
|
hylianLuckChance = hylianLuckStrings[0];
|
||||||
hylianLuckChanceLucky = hylianLuckStrings[1];
|
hylianLuckChanceLucky = hylianLuckStrings[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
// SHROOM THUMB
|
// SHROOM THUMB
|
||||||
if (canShroomThumb) {
|
if (canShroomThumb) {
|
||||||
String[] shroomThumbStrings = calculateAbilityDisplayValues(skillValue, Herbalism.shroomThumbMaxLevel, Herbalism.shroomThumbMaxChance, isLucky);
|
String[] shroomThumbStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbilityType.SHROOM_THUMB, isLucky);
|
||||||
shroomThumbChance = shroomThumbStrings[0];
|
shroomThumbChance = shroomThumbStrings[0];
|
||||||
shroomThumbChanceLucky = shroomThumbStrings[1];
|
shroomThumbChanceLucky = shroomThumbStrings[1];
|
||||||
}
|
}
|
||||||
@ -84,13 +85,13 @@ public class HerbalismCommand extends SkillCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void permissionsCheck(Player player) {
|
protected void permissionsCheck(Player player) {
|
||||||
hasHylianLuck = Permissions.hylianLuck(player);
|
hasHylianLuck = Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.HYLIAN_LUCK);
|
||||||
canGreenTerra = Permissions.greenTerra(player);
|
canGreenTerra = Permissions.greenTerra(player);
|
||||||
canGreenThumbPlants = Permissions.greenThumbPlant(player, Material.CROPS) || Permissions.greenThumbPlant(player, Material.CARROT) || Permissions.greenThumbPlant(player, Material.POTATO) || Permissions.greenThumbPlant(player, Material.NETHER_WARTS) || Permissions.greenThumbPlant(player, Material.COCOA);
|
canGreenThumbPlants = Permissions.greenThumbPlant(player, Material.CROPS) || Permissions.greenThumbPlant(player, Material.CARROT) || Permissions.greenThumbPlant(player, Material.POTATO) || Permissions.greenThumbPlant(player, Material.NETHER_WARTS) || Permissions.greenThumbPlant(player, Material.COCOA);
|
||||||
canGreenThumbBlocks = Permissions.greenThumbBlock(player, Material.DIRT) || Permissions.greenThumbBlock(player, Material.COBBLESTONE) || Permissions.greenThumbBlock(player, Material.COBBLE_WALL) || Permissions.greenThumbBlock(player, Material.SMOOTH_BRICK);
|
canGreenThumbBlocks = Permissions.greenThumbBlock(player, Material.DIRT) || Permissions.greenThumbBlock(player, Material.COBBLESTONE) || Permissions.greenThumbBlock(player, Material.COBBLE_WALL) || Permissions.greenThumbBlock(player, Material.SMOOTH_BRICK);
|
||||||
canFarmersDiet = Permissions.farmersDiet(player);
|
canFarmersDiet = Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.FARMERS_DIET);
|
||||||
canDoubleDrop = Permissions.doubleDrops(player, skill) && !skill.getDoubleDropsDisabled();
|
canDoubleDrop = Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.HERBALISM_DOUBLE_DROPS) && !skill.getDoubleDropsDisabled();
|
||||||
canShroomThumb = Permissions.shroomThumb(player);
|
canShroomThumb = Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.SHROOM_THUMB);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -6,10 +6,10 @@ import java.util.List;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.config.AdvancedConfig;
|
import com.gmail.nossr50.config.AdvancedConfig;
|
||||||
|
import com.gmail.nossr50.datatypes.skills.SecondaryAbilityType;
|
||||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.skills.mining.BlastMining.Tier;
|
import com.gmail.nossr50.skills.mining.BlastMining.Tier;
|
||||||
import com.gmail.nossr50.skills.mining.Mining;
|
|
||||||
import com.gmail.nossr50.skills.mining.MiningManager;
|
import com.gmail.nossr50.skills.mining.MiningManager;
|
||||||
import com.gmail.nossr50.util.Permissions;
|
import com.gmail.nossr50.util.Permissions;
|
||||||
import com.gmail.nossr50.util.player.UserManager;
|
import com.gmail.nossr50.util.player.UserManager;
|
||||||
@ -48,7 +48,7 @@ public class MiningCommand extends SkillCommand {
|
|||||||
|
|
||||||
// DOUBLE DROPS
|
// DOUBLE DROPS
|
||||||
if (canDoubleDrop) {
|
if (canDoubleDrop) {
|
||||||
String[] doubleDropStrings = calculateAbilityDisplayValues(skillValue, Mining.doubleDropsMaxLevel, Mining.doubleDropsMaxChance, isLucky);
|
String[] doubleDropStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbilityType.MINING_DOUBLE_DROPS, isLucky);
|
||||||
doubleDropChance = doubleDropStrings[0];
|
doubleDropChance = doubleDropStrings[0];
|
||||||
doubleDropChanceLucky = doubleDropStrings[1];
|
doubleDropChanceLucky = doubleDropStrings[1];
|
||||||
}
|
}
|
||||||
@ -71,7 +71,7 @@ public class MiningCommand extends SkillCommand {
|
|||||||
canBiggerBombs = Permissions.biggerBombs(player);
|
canBiggerBombs = Permissions.biggerBombs(player);
|
||||||
canBlast = Permissions.remoteDetonation(player);
|
canBlast = Permissions.remoteDetonation(player);
|
||||||
canDemoExpert = Permissions.demolitionsExpertise(player);
|
canDemoExpert = Permissions.demolitionsExpertise(player);
|
||||||
canDoubleDrop = Permissions.doubleDrops(player, skill) && !skill.getDoubleDropsDisabled();
|
canDoubleDrop = Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.MINING_DOUBLE_DROPS) && !skill.getDoubleDropsDisabled();
|
||||||
canSuperBreaker = Permissions.superBreaker(player);
|
canSuperBreaker = Permissions.superBreaker(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ import org.bukkit.Material;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
|
import com.gmail.nossr50.datatypes.skills.SecondaryAbilityType;
|
||||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.skills.repair.ArcaneForging;
|
import com.gmail.nossr50.skills.repair.ArcaneForging;
|
||||||
@ -65,7 +66,7 @@ public class RepairCommand extends SkillCommand {
|
|||||||
|
|
||||||
// SUPER REPAIR
|
// SUPER REPAIR
|
||||||
if (canSuperRepair) {
|
if (canSuperRepair) {
|
||||||
String[] superRepairStrings = calculateAbilityDisplayValues(skillValue, Repair.superRepairMaxBonusLevel, Repair.superRepairMaxChance, isLucky);
|
String[] superRepairStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbilityType.SUPER_REPAIR, isLucky);
|
||||||
superRepairChance = superRepairStrings[0];
|
superRepairChance = superRepairStrings[0];
|
||||||
superRepairChanceLucky = superRepairStrings[1];
|
superRepairChanceLucky = superRepairStrings[1];
|
||||||
}
|
}
|
||||||
@ -73,10 +74,10 @@ public class RepairCommand extends SkillCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void permissionsCheck(Player player) {
|
protected void permissionsCheck(Player player) {
|
||||||
canSuperRepair = Permissions.superRepair(player);
|
canSuperRepair = Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.SUPER_REPAIR);
|
||||||
canMasterRepair = Permissions.repairMastery(player);
|
canMasterRepair = Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.REPAIR_MASTERY);
|
||||||
canArcaneForge = Permissions.arcaneForging(player);
|
canArcaneForge = Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.ARCANE_FORGING);
|
||||||
canSalvage = Permissions.salvage(player);
|
canSalvage = Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.SALVAGE);
|
||||||
canRepairDiamond = Permissions.repairDiamond(player);
|
canRepairDiamond = Permissions.repairDiamond(player);
|
||||||
canRepairGold = Permissions.repairGold(player);
|
canRepairGold = Permissions.repairGold(player);
|
||||||
canRepairIron = Permissions.repairIron(player);
|
canRepairIron = Permissions.repairIron(player);
|
||||||
|
@ -13,6 +13,7 @@ import org.bukkit.entity.Player;
|
|||||||
import com.gmail.nossr50.config.AdvancedConfig;
|
import com.gmail.nossr50.config.AdvancedConfig;
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||||
|
import com.gmail.nossr50.datatypes.skills.SecondaryAbilityType;
|
||||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.skills.child.FamilyTree;
|
import com.gmail.nossr50.skills.child.FamilyTree;
|
||||||
@ -136,8 +137,10 @@ public abstract class SkillCommand implements TabExecutor {
|
|||||||
return displayValues;
|
return displayValues;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String[] calculateAbilityDisplayValues(float skillValue, int maxBonusLevel, double maxChance, boolean isLucky) {
|
protected String[] calculateAbilityDisplayValues(float skillValue, SecondaryAbilityType skillAbility, boolean isLucky) {
|
||||||
return calculateAbilityDisplayValues((maxChance / maxBonusLevel) * Math.min(skillValue, maxBonusLevel), isLucky);
|
int maxBonusLevel = AdvancedConfig.getInstance().getMaxBonusLevel(skillAbility);
|
||||||
|
|
||||||
|
return calculateAbilityDisplayValues((AdvancedConfig.getInstance().getMaxChance(skillAbility) / maxBonusLevel) * Math.min(skillValue, maxBonusLevel), isLucky);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String[] calculateLengthDisplayValues(Player player, float skillValue) {
|
protected String[] calculateLengthDisplayValues(Player player, float skillValue) {
|
||||||
|
@ -6,6 +6,7 @@ import java.util.List;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.config.AdvancedConfig;
|
import com.gmail.nossr50.config.AdvancedConfig;
|
||||||
|
import com.gmail.nossr50.datatypes.skills.SecondaryAbilityType;
|
||||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.skills.smelting.Smelting;
|
import com.gmail.nossr50.skills.smelting.Smelting;
|
||||||
@ -38,7 +39,7 @@ public class SmeltingCommand extends SkillCommand {
|
|||||||
|
|
||||||
// SECOND SMELT
|
// SECOND SMELT
|
||||||
if (canSecondSmelt) {
|
if (canSecondSmelt) {
|
||||||
String[] secondSmeltStrings = calculateAbilityDisplayValues(skillValue, Smelting.secondSmeltMaxLevel, Smelting.secondSmeltMaxChance, isLucky);
|
String[] secondSmeltStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbilityType.SECOND_SMELT, isLucky);
|
||||||
secondSmeltChance = secondSmeltStrings[0];
|
secondSmeltChance = secondSmeltStrings[0];
|
||||||
secondSmeltChanceLucky = secondSmeltStrings[1];
|
secondSmeltChanceLucky = secondSmeltStrings[1];
|
||||||
}
|
}
|
||||||
@ -53,9 +54,9 @@ public class SmeltingCommand extends SkillCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void permissionsCheck(Player player) {
|
protected void permissionsCheck(Player player) {
|
||||||
canFuelEfficiency = Permissions.fuelEfficiency(player);
|
canFuelEfficiency = Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.FUEL_EFFICIENCY);
|
||||||
canSecondSmelt = Permissions.doubleDrops(player, skill);
|
canSecondSmelt = Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.SECOND_SMELT);
|
||||||
canFluxMine = Permissions.fluxMining(player);
|
canFluxMine = Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.FLUX_MINING);
|
||||||
canVanillaXPBoost = Permissions.vanillaXpBoost(player, skill);
|
canVanillaXPBoost = Permissions.vanillaXpBoost(player, skill);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,14 +5,16 @@ import java.util.List;
|
|||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import com.gmail.nossr50.config.AdvancedConfig;
|
||||||
|
import com.gmail.nossr50.datatypes.skills.SecondaryAbilityType;
|
||||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.skills.swords.Swords;
|
import com.gmail.nossr50.skills.swords.Swords;
|
||||||
import com.gmail.nossr50.util.Permissions;
|
import com.gmail.nossr50.util.Permissions;
|
||||||
|
|
||||||
public class SwordsCommand extends SkillCommand {
|
public class SwordsCommand extends SkillCommand {
|
||||||
private String counterAttackChance;
|
private String counterChance;
|
||||||
private String counterAttackChanceLucky;
|
private String counterChanceLucky;
|
||||||
private int bleedLength;
|
private int bleedLength;
|
||||||
private String bleedChance;
|
private String bleedChance;
|
||||||
private String bleedChanceLucky;
|
private String bleedChanceLucky;
|
||||||
@ -38,25 +40,25 @@ public class SwordsCommand extends SkillCommand {
|
|||||||
|
|
||||||
// BLEED
|
// BLEED
|
||||||
if (canBleed) {
|
if (canBleed) {
|
||||||
bleedLength = (skillValue >= Swords.bleedMaxBonusLevel) ? Swords.bleedMaxTicks : Swords.bleedBaseTicks;
|
bleedLength = (skillValue >= AdvancedConfig.getInstance().getMaxBonusLevel(SecondaryAbilityType.BLEED)) ? Swords.bleedMaxTicks : Swords.bleedBaseTicks;
|
||||||
|
|
||||||
String[] bleedStrings = calculateAbilityDisplayValues(skillValue, Swords.bleedMaxBonusLevel, Swords.bleedMaxChance, isLucky);
|
String[] bleedStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbilityType.BLEED, isLucky);
|
||||||
bleedChance = bleedStrings[0];
|
bleedChance = bleedStrings[0];
|
||||||
bleedChanceLucky = bleedStrings[1];
|
bleedChanceLucky = bleedStrings[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
// COUNTER ATTACK
|
// COUNTER
|
||||||
if (canCounter) {
|
if (canCounter) {
|
||||||
String[] counterAttackStrings = calculateAbilityDisplayValues(skillValue, Swords.counterAttackMaxBonusLevel, Swords.counterAttackMaxChance, isLucky);
|
String[] counterStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbilityType.COUNTER, isLucky);
|
||||||
counterAttackChance = counterAttackStrings[0];
|
counterChance = counterStrings[0];
|
||||||
counterAttackChanceLucky = counterAttackStrings[1];
|
counterChanceLucky = counterStrings[1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void permissionsCheck(Player player) {
|
protected void permissionsCheck(Player player) {
|
||||||
canBleed = Permissions.bleed(player);
|
canBleed = Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.BLEED);
|
||||||
canCounter = Permissions.counterAttack(player);
|
canCounter = Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.COUNTER);
|
||||||
canSerratedStrike = Permissions.serratedStrikes(player);
|
canSerratedStrike = Permissions.serratedStrikes(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -85,7 +87,7 @@ public class SwordsCommand extends SkillCommand {
|
|||||||
List<String> messages = new ArrayList<String>();
|
List<String> messages = new ArrayList<String>();
|
||||||
|
|
||||||
if (canCounter) {
|
if (canCounter) {
|
||||||
messages.add(LocaleLoader.getString("Swords.Combat.Counter.Chance", counterAttackChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", counterAttackChanceLucky) : ""));
|
messages.add(LocaleLoader.getString("Swords.Combat.Counter.Chance", counterChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", counterChanceLucky) : ""));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (canBleed) {
|
if (canBleed) {
|
||||||
|
@ -7,6 +7,7 @@ import org.bukkit.entity.EntityType;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
|
import com.gmail.nossr50.datatypes.skills.SecondaryAbilityType;
|
||||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.skills.taming.Taming;
|
import com.gmail.nossr50.skills.taming.Taming;
|
||||||
@ -33,7 +34,7 @@ public class TamingCommand extends SkillCommand {
|
|||||||
@Override
|
@Override
|
||||||
protected void dataCalculations(Player player, float skillValue, boolean isLucky) {
|
protected void dataCalculations(Player player, float skillValue, boolean isLucky) {
|
||||||
if (canGore) {
|
if (canGore) {
|
||||||
String[] goreStrings = calculateAbilityDisplayValues(skillValue, Taming.goreMaxBonusLevel, Taming.goreMaxChance, isLucky);
|
String[] goreStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbilityType.GORE, isLucky);
|
||||||
goreChance = goreStrings[0];
|
goreChance = goreStrings[0];
|
||||||
goreChanceLucky = goreStrings[1];
|
goreChanceLucky = goreStrings[1];
|
||||||
}
|
}
|
||||||
@ -41,15 +42,15 @@ public class TamingCommand extends SkillCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void permissionsCheck(Player player) {
|
protected void permissionsCheck(Player player) {
|
||||||
canBeastLore = Permissions.beastLore(player);
|
canBeastLore = Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.BEAST_LORE);
|
||||||
canCallWild = Permissions.callOfTheWild(player, EntityType.HORSE) || Permissions.callOfTheWild(player, EntityType.WOLF) || Permissions.callOfTheWild(player, EntityType.OCELOT);
|
canCallWild = Permissions.callOfTheWild(player, EntityType.HORSE) || Permissions.callOfTheWild(player, EntityType.WOLF) || Permissions.callOfTheWild(player, EntityType.OCELOT);
|
||||||
canEnvironmentallyAware = Permissions.environmentallyAware(player);
|
canEnvironmentallyAware = Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.ENVIROMENTALLY_AWARE);
|
||||||
canFastFood = Permissions.fastFoodService(player);
|
canFastFood = Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.FAST_FOOD);
|
||||||
canGore = Permissions.gore(player);
|
canGore = Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.GORE);
|
||||||
canSharpenedClaws = Permissions.sharpenedClaws(player);
|
canSharpenedClaws = Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.SHARPENED_CLAWS);
|
||||||
canShockProof = Permissions.shockProof(player);
|
canShockProof = Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.SHOCK_PROOF);
|
||||||
canThickFur = Permissions.thickFur(player);
|
canThickFur = Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.THICK_FUR);
|
||||||
canHolyHound = Permissions.holyHound(player);
|
canHolyHound = Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.HOLY_HOUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -5,6 +5,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import com.gmail.nossr50.datatypes.skills.SecondaryAbilityType;
|
||||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.skills.unarmed.Unarmed;
|
import com.gmail.nossr50.skills.unarmed.Unarmed;
|
||||||
@ -23,7 +24,7 @@ public class UnarmedCommand extends SkillCommand {
|
|||||||
|
|
||||||
private boolean canBerserk;
|
private boolean canBerserk;
|
||||||
private boolean canDisarm;
|
private boolean canDisarm;
|
||||||
private boolean canBonusDamage;
|
private boolean canIronArm;
|
||||||
private boolean canDeflect;
|
private boolean canDeflect;
|
||||||
private boolean canIronGrip;
|
private boolean canIronGrip;
|
||||||
|
|
||||||
@ -42,26 +43,26 @@ public class UnarmedCommand extends SkillCommand {
|
|||||||
|
|
||||||
// DISARM
|
// DISARM
|
||||||
if (canDisarm) {
|
if (canDisarm) {
|
||||||
String[] disarmStrings = calculateAbilityDisplayValues(skillValue, Unarmed.disarmMaxBonusLevel, Unarmed.disarmMaxChance, isLucky);
|
String[] disarmStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbilityType.DISARM, isLucky);
|
||||||
disarmChance = disarmStrings[0];
|
disarmChance = disarmStrings[0];
|
||||||
disarmChanceLucky = disarmStrings[1];
|
disarmChanceLucky = disarmStrings[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
// DEFLECT
|
// DEFLECT
|
||||||
if (canDeflect) {
|
if (canDeflect) {
|
||||||
String[] deflectStrings = calculateAbilityDisplayValues(skillValue, Unarmed.deflectMaxBonusLevel, Unarmed.deflectMaxChance, isLucky);
|
String[] deflectStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbilityType.DEFLECT, isLucky);
|
||||||
deflectChance = deflectStrings[0];
|
deflectChance = deflectStrings[0];
|
||||||
deflectChanceLucky = deflectStrings[1];
|
deflectChanceLucky = deflectStrings[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
// IRON ARM
|
// IRON ARM
|
||||||
if (canBonusDamage) {
|
if (canIronArm) {
|
||||||
ironArmBonus = Math.min(3 + ((int) skillValue / Unarmed.ironArmIncreaseLevel), Unarmed.ironArmMaxBonusDamage);
|
ironArmBonus = Math.min(3 + ((int) skillValue / Unarmed.ironArmIncreaseLevel), Unarmed.ironArmMaxBonusDamage);
|
||||||
}
|
}
|
||||||
|
|
||||||
// IRON GRIP
|
// IRON GRIP
|
||||||
if (canIronGrip) {
|
if (canIronGrip) {
|
||||||
String[] ironGripStrings = calculateAbilityDisplayValues(skillValue, Unarmed.ironGripMaxBonusLevel, Unarmed.ironGripMaxChance, isLucky);
|
String[] ironGripStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbilityType.IRON_GRIP, isLucky);
|
||||||
ironGripChance = ironGripStrings[0];
|
ironGripChance = ironGripStrings[0];
|
||||||
ironGripChanceLucky = ironGripStrings[1];
|
ironGripChanceLucky = ironGripStrings[1];
|
||||||
}
|
}
|
||||||
@ -70,10 +71,11 @@ public class UnarmedCommand extends SkillCommand {
|
|||||||
@Override
|
@Override
|
||||||
protected void permissionsCheck(Player player) {
|
protected void permissionsCheck(Player player) {
|
||||||
canBerserk = Permissions.berserk(player);
|
canBerserk = Permissions.berserk(player);
|
||||||
canBonusDamage = Permissions.bonusDamage(player, skill);
|
canIronArm = Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.IRON_ARM);
|
||||||
canDeflect = Permissions.arrowDeflect(player);
|
canDeflect = Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.DEFLECT);
|
||||||
canDisarm = Permissions.disarm(player);
|
canDisarm = Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.DISARM);
|
||||||
canIronGrip = Permissions.ironGrip(player);
|
canIronGrip = Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.IRON_GRIP);
|
||||||
|
// TODO: Apparently we forgot about block cracker?
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -83,12 +85,13 @@ public class UnarmedCommand extends SkillCommand {
|
|||||||
if (canBerserk) {
|
if (canBerserk) {
|
||||||
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Unarmed.Effect.0"), LocaleLoader.getString("Unarmed.Effect.1")));
|
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Unarmed.Effect.0"), LocaleLoader.getString("Unarmed.Effect.1")));
|
||||||
}
|
}
|
||||||
|
// TODO: Apparently we forgot about block cracker?
|
||||||
|
|
||||||
if (canDisarm) {
|
if (canDisarm) {
|
||||||
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Unarmed.Effect.2"), LocaleLoader.getString("Unarmed.Effect.3")));
|
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Unarmed.Effect.2"), LocaleLoader.getString("Unarmed.Effect.3")));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (canBonusDamage) {
|
if (canIronArm) {
|
||||||
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Unarmed.Effect.4"), LocaleLoader.getString("Unarmed.Effect.5")));
|
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Unarmed.Effect.4"), LocaleLoader.getString("Unarmed.Effect.5")));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -107,7 +110,7 @@ public class UnarmedCommand extends SkillCommand {
|
|||||||
protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) {
|
protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) {
|
||||||
List<String> messages = new ArrayList<String>();
|
List<String> messages = new ArrayList<String>();
|
||||||
|
|
||||||
if (canBonusDamage) {
|
if (canIronArm) {
|
||||||
messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Unarmed.Ability.Bonus.0"), LocaleLoader.getString("Unarmed.Ability.Bonus.1", ironArmBonus)));
|
messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Unarmed.Ability.Bonus.0"), LocaleLoader.getString("Unarmed.Ability.Bonus.1", ironArmBonus)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,9 +6,9 @@ import java.util.List;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.config.AdvancedConfig;
|
import com.gmail.nossr50.config.AdvancedConfig;
|
||||||
|
import com.gmail.nossr50.datatypes.skills.SecondaryAbilityType;
|
||||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.skills.woodcutting.Woodcutting;
|
|
||||||
import com.gmail.nossr50.util.Permissions;
|
import com.gmail.nossr50.util.Permissions;
|
||||||
|
|
||||||
public class WoodcuttingCommand extends SkillCommand {
|
public class WoodcuttingCommand extends SkillCommand {
|
||||||
@ -36,7 +36,7 @@ public class WoodcuttingCommand extends SkillCommand {
|
|||||||
|
|
||||||
// DOUBLE DROPS
|
// DOUBLE DROPS
|
||||||
if (canDoubleDrop) {
|
if (canDoubleDrop) {
|
||||||
String[] doubleDropStrings = calculateAbilityDisplayValues(skillValue, Woodcutting.doubleDropsMaxLevel, Woodcutting.doubleDropsMaxChance, isLucky);
|
String[] doubleDropStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbilityType.WOODCUTTING_DOUBLE_DROPS, isLucky);
|
||||||
doubleDropChance = doubleDropStrings[0];
|
doubleDropChance = doubleDropStrings[0];
|
||||||
doubleDropChanceLucky = doubleDropStrings[1];
|
doubleDropChanceLucky = doubleDropStrings[1];
|
||||||
}
|
}
|
||||||
@ -45,8 +45,8 @@ public class WoodcuttingCommand extends SkillCommand {
|
|||||||
@Override
|
@Override
|
||||||
protected void permissionsCheck(Player player) {
|
protected void permissionsCheck(Player player) {
|
||||||
canTreeFell = Permissions.treeFeller(player);
|
canTreeFell = Permissions.treeFeller(player);
|
||||||
canDoubleDrop = Permissions.doubleDrops(player, skill) && !skill.getDoubleDropsDisabled();
|
canDoubleDrop = Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.WOODCUTTING_DOUBLE_DROPS) && !skill.getDoubleDropsDisabled();
|
||||||
canLeafBlow = Permissions.leafBlower(player);
|
canLeafBlow = Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.LEAF_BLOWER);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -4,10 +4,13 @@ import java.util.ArrayList;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.gmail.nossr50.datatypes.skills.SecondaryAbilityType;
|
||||||
|
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||||
import com.gmail.nossr50.skills.fishing.Fishing;
|
import com.gmail.nossr50.skills.fishing.Fishing;
|
||||||
import com.gmail.nossr50.skills.mining.BlastMining;
|
import com.gmail.nossr50.skills.mining.BlastMining;
|
||||||
import com.gmail.nossr50.skills.repair.ArcaneForging;
|
import com.gmail.nossr50.skills.repair.ArcaneForging;
|
||||||
import com.gmail.nossr50.skills.smelting.Smelting;
|
import com.gmail.nossr50.skills.smelting.Smelting;
|
||||||
|
import com.gmail.nossr50.util.StringUtils;
|
||||||
|
|
||||||
public class AdvancedConfig extends AutoUpdateConfigLoader {
|
public class AdvancedConfig extends AutoUpdateConfigLoader {
|
||||||
private static AdvancedConfig instance;
|
private static AdvancedConfig instance;
|
||||||
@ -40,11 +43,11 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ACROBATICS */
|
/* ACROBATICS */
|
||||||
if (getDodgeChanceMax() < 1) {
|
if (getMaxChance(SecondaryAbilityType.DODGE) < 1) {
|
||||||
reason.add("Skills.Acrobatics.Dodge.ChanceMax should be at least 1!");
|
reason.add("Skills.Acrobatics.Dodge.ChanceMax should be at least 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getDodgeMaxBonusLevel() < 1) {
|
if (getMaxBonusLevel(SecondaryAbilityType.DODGE) < 1) {
|
||||||
reason.add("Skills.Acrobatics.Dodge.MaxBonusLevel should be at least 1!");
|
reason.add("Skills.Acrobatics.Dodge.MaxBonusLevel should be at least 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,11 +55,11 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
|
|||||||
reason.add("Skills.Acrobatics.Dodge.DamageModifier should be greater than 1!");
|
reason.add("Skills.Acrobatics.Dodge.DamageModifier should be greater than 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getRollChanceMax() < 1) {
|
if (getMaxChance(SecondaryAbilityType.ROLL) < 1) {
|
||||||
reason.add("Skills.Acrobatics.Roll.ChanceMax should be at least 1!");
|
reason.add("Skills.Acrobatics.Roll.ChanceMax should be at least 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getRollMaxBonusLevel() < 1) {
|
if (getMaxBonusLevel(SecondaryAbilityType.ROLL) < 1) {
|
||||||
reason.add("Skills.Acrobatics.Roll.MaxBonusLevel should be at least 1!");
|
reason.add("Skills.Acrobatics.Roll.MaxBonusLevel should be at least 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -64,11 +67,11 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
|
|||||||
reason.add("Skills.Acrobatics.Roll.DamageThreshold should be at least 0!");
|
reason.add("Skills.Acrobatics.Roll.DamageThreshold should be at least 0!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getGracefulRollChanceMax() < 1) {
|
if (getMaxChance(SecondaryAbilityType.GRACEFUL_ROLL) < 1) {
|
||||||
reason.add("Skills.Acrobatics.GracefulRoll.ChanceMax should be at least 1!");
|
reason.add("Skills.Acrobatics.GracefulRoll.ChanceMax should be at least 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getGracefulRollMaxBonusLevel() < 1) {
|
if (getMaxBonusLevel(SecondaryAbilityType.GRACEFUL_ROLL) < 1) {
|
||||||
reason.add("Skills.Acrobatics.GracefulRoll.MaxBonusLevel should be at least 1!");
|
reason.add("Skills.Acrobatics.GracefulRoll.MaxBonusLevel should be at least 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -89,11 +92,11 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
|
|||||||
reason.add("Skills.Archery.SkillShot.MaxBonus should be at least 0!");
|
reason.add("Skills.Archery.SkillShot.MaxBonus should be at least 0!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getDazeBonusMax() < 1) {
|
if (getMaxChance(SecondaryAbilityType.DAZE) < 1) {
|
||||||
reason.add("Skills.Acrobatics.Daze.ChanceMax should be at least 1!");
|
reason.add("Skills.Acrobatics.Daze.ChanceMax should be at least 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getDazeMaxBonusLevel() < 1) {
|
if (getMaxBonusLevel(SecondaryAbilityType.DAZE) < 1) {
|
||||||
reason.add("Skills.Acrobatics.Daze.MaxBonusLevel should be at least 1!");
|
reason.add("Skills.Acrobatics.Daze.MaxBonusLevel should be at least 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -101,11 +104,11 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
|
|||||||
reason.add("Skills.Acrobatics.Daze.BonusDamage should be at least 0!");
|
reason.add("Skills.Acrobatics.Daze.BonusDamage should be at least 0!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getRetrieveChanceMax() < 1) {
|
if (getMaxChance(SecondaryAbilityType.RETRIEVE) < 1) {
|
||||||
reason.add("Skills.Acrobatics.Retrieve.ChanceMax should be at least 1!");
|
reason.add("Skills.Acrobatics.Retrieve.ChanceMax should be at least 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getRetrieveMaxBonusLevel() < 1) {
|
if (getMaxBonusLevel(SecondaryAbilityType.RETRIEVE) < 1) {
|
||||||
reason.add("Skills.Acrobatics.Retrieve.MaxBonusLevel should be at least 1!");
|
reason.add("Skills.Acrobatics.Retrieve.MaxBonusLevel should be at least 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -114,28 +117,28 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* AXES */
|
/* AXES */
|
||||||
if (getBonusDamageAxesBonusMax() < 1) {
|
if (getAxeMasteryBonusMax() < 1) {
|
||||||
reason.add("Skills.Axes.DamageIncrease.MaxBonus should be at least 1!");
|
reason.add("Skills.Axes.AxeMastery.MaxBonus should be at least 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getBonusDamageAxesMaxBonusLevel() < 1) {
|
if (getAxeMasteryMaxBonusLevel() < 1) {
|
||||||
reason.add("Skills.Axes.DamageIncrease.MaxBonusLevel should be at least 1!");
|
reason.add("Skills.Axes.AxeMastery.MaxBonusLevel should be at least 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getAxesCriticalChance() < 1) {
|
if (getMaxChance(SecondaryAbilityType.CRITICAL_HIT) < 1) {
|
||||||
reason.add("Skills.Axes.AxesCritical.ChanceMax should be at least 1!");
|
reason.add("Skills.Axes.CriticalHit.ChanceMax should be at least 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getAxesCriticalMaxBonusLevel() < 1) {
|
if (getMaxBonusLevel(SecondaryAbilityType.CRITICAL_HIT) < 1) {
|
||||||
reason.add("Skills.Axes.AxesCritical.MaxBonusLevel should be at least 1!");
|
reason.add("Skills.Axes.CriticalHit.MaxBonusLevel should be at least 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getAxesCriticalPVPModifier() < 1) {
|
if (getCriticalHitPVPModifier() < 1) {
|
||||||
reason.add("Skills.Axes.AxesCritical.PVP_Modifier should be at least 1!");
|
reason.add("Skills.Axes.CriticalHit.PVP_Modifier should be at least 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getAxesCriticalPVEModifier() < 1) {
|
if (getCriticalHitPVEModifier() < 1) {
|
||||||
reason.add("Skills.Axes.AxesCritical.PVE_Modifier should be at least 1!");
|
reason.add("Skills.Axes.CriticalHit.PVE_Modifier should be at least 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getGreaterImpactChance() < 1) {
|
if (getGreaterImpactChance() < 1) {
|
||||||
@ -228,44 +231,44 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
|
|||||||
reason.add("Skills.Herbalism.GreenThumb.StageChange should be at least 1!");
|
reason.add("Skills.Herbalism.GreenThumb.StageChange should be at least 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getGreenThumbChanceMax() < 1) {
|
if (getMaxChance(SecondaryAbilityType.GREEN_THUMB_PLANT) < 1) {
|
||||||
reason.add("Skills.Herbalism.GreenThumb.ChanceMax should be at least 1!");
|
reason.add("Skills.Herbalism.GreenThumb.ChanceMax should be at least 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getGreenThumbMaxLevel() < 1) {
|
if (getMaxBonusLevel(SecondaryAbilityType.GREEN_THUMB_PLANT) < 1) {
|
||||||
reason.add("Skills.Herbalism.GreenThumb.MaxBonusLevel should be at least 1!");
|
reason.add("Skills.Herbalism.GreenThumb.MaxBonusLevel should be at least 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getHerbalismDoubleDropsChanceMax() < 1) {
|
if (getMaxChance(SecondaryAbilityType.HERBALISM_DOUBLE_DROPS) < 1) {
|
||||||
reason.add("Skills.Herbalism.DoubleDrops.ChanceMax should be at least 1!");
|
reason.add("Skills.Herbalism.DoubleDrops.ChanceMax should be at least 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getHerbalismDoubleDropsMaxLevel() < 1) {
|
if (getMaxBonusLevel(SecondaryAbilityType.HERBALISM_DOUBLE_DROPS) < 1) {
|
||||||
reason.add("Skills.Herbalism.DoubleDrops.MaxBonusLevel should be at least 1!");
|
reason.add("Skills.Herbalism.DoubleDrops.MaxBonusLevel should be at least 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getHylianLuckChanceMax() < 1) {
|
if (getMaxChance(SecondaryAbilityType.HYLIAN_LUCK) < 1) {
|
||||||
reason.add("Skills.Herbalism.HylianLuck.ChanceMax should be at least 1!");
|
reason.add("Skills.Herbalism.HylianLuck.ChanceMax should be at least 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getHylianLuckMaxLevel() < 1) {
|
if (getMaxBonusLevel(SecondaryAbilityType.HYLIAN_LUCK) < 1) {
|
||||||
reason.add("Skills.Herbalism.HylianLuck.MaxBonusLevel should be at least 1!");
|
reason.add("Skills.Herbalism.HylianLuck.MaxBonusLevel should be at least 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getShroomThumbChanceMax() < 1) {
|
if (getMaxChance(SecondaryAbilityType.SHROOM_THUMB) < 1) {
|
||||||
reason.add("Skills.Herbalism.ShroomThumb.ChanceMax should be at least 1!");
|
reason.add("Skills.Herbalism.ShroomThumb.ChanceMax should be at least 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getShroomThumbMaxLevel() < 1) {
|
if (getMaxBonusLevel(SecondaryAbilityType.SHROOM_THUMB) < 1) {
|
||||||
reason.add("Skills.Herbalism.ShroomThumb.MaxBonusLevel should be at least 1!");
|
reason.add("Skills.Herbalism.ShroomThumb.MaxBonusLevel should be at least 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* MINING */
|
/* MINING */
|
||||||
if (getMiningDoubleDropChance() < 1) {
|
if (getMaxChance(SecondaryAbilityType.MINING_DOUBLE_DROPS) < 1) {
|
||||||
reason.add("Skills.Mining.DoubleDrops.ChanceMax should be at least 1!");
|
reason.add("Skills.Mining.DoubleDrops.ChanceMax should be at least 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getMiningDoubleDropMaxLevel() < 1) {
|
if (getMaxBonusLevel(SecondaryAbilityType.MINING_DOUBLE_DROPS) < 1) {
|
||||||
reason.add("Skills.Mining.DoubleDrops.MaxBonusLevel should be at least 1!");
|
reason.add("Skills.Mining.DoubleDrops.MaxBonusLevel should be at least 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -334,11 +337,11 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
|
|||||||
reason.add("Skills.Repair.RepairMastery.MaxBonusLevel should be at least 1!");
|
reason.add("Skills.Repair.RepairMastery.MaxBonusLevel should be at least 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getSuperRepairChanceMax() < 1) {
|
if (getMaxChance(SecondaryAbilityType.SUPER_REPAIR) < 1) {
|
||||||
reason.add("Skills.Repair.SuperRepair.ChanceMax should be at least 1!");
|
reason.add("Skills.Repair.SuperRepair.ChanceMax should be at least 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getSuperRepairMaxLevel() < 1) {
|
if (getMaxBonusLevel(SecondaryAbilityType.SUPER_REPAIR) < 1) {
|
||||||
reason.add("Skills.Repair.SuperRepair.MaxBonusLevel should be at least 1!");
|
reason.add("Skills.Repair.SuperRepair.MaxBonusLevel should be at least 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -387,11 +390,11 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
|
|||||||
reason.add("Skills.Smelting.FuelEfficiency.Multiplier should be at least 1!");
|
reason.add("Skills.Smelting.FuelEfficiency.Multiplier should be at least 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getSecondSmeltMaxLevel() < 1) {
|
if (getMaxBonusLevel(SecondaryAbilityType.SECOND_SMELT) < 1) {
|
||||||
reason.add("Skills.Smelting.SecondSmelt.MaxBonusLevel should be at least 1!");
|
reason.add("Skills.Smelting.SecondSmelt.MaxBonusLevel should be at least 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getSecondSmeltMaxChance() < 1) {
|
if (getMaxChance(SecondaryAbilityType.SECOND_SMELT) < 1) {
|
||||||
reason.add("Skills.Smelting.SecondSmelt.ChanceMax should be at least 1!");
|
reason.add("Skills.Smelting.SecondSmelt.ChanceMax should be at least 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -428,11 +431,11 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* SWORDS */
|
/* SWORDS */
|
||||||
if (getBleedChanceMax() < 1) {
|
if (getMaxChance(SecondaryAbilityType.BLEED) < 1) {
|
||||||
reason.add("Skills.Swords.Bleed.ChanceMax should be at least 1!");
|
reason.add("Skills.Swords.Bleed.ChanceMax should be at least 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getBleedMaxBonusLevel() < 1) {
|
if (getMaxBonusLevel(SecondaryAbilityType.BLEED) < 1) {
|
||||||
reason.add("Skills.Swords.Bleed.MaxBonusLevel should be at least 1!");
|
reason.add("Skills.Swords.Bleed.MaxBonusLevel should be at least 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -448,11 +451,11 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
|
|||||||
reason.add("Skills.Swords.Bleed.BaseTicks should be at least 1!");
|
reason.add("Skills.Swords.Bleed.BaseTicks should be at least 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getCounterChanceMax() < 1) {
|
if (getMaxChance(SecondaryAbilityType.COUNTER) < 1) {
|
||||||
reason.add("Skills.Swords.Counter.ChanceMax should be at least 1!");
|
reason.add("Skills.Swords.Counter.ChanceMax should be at least 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getCounterMaxBonusLevel() < 1) {
|
if (getMaxBonusLevel(SecondaryAbilityType.COUNTER) < 1) {
|
||||||
reason.add("Skills.Swords.Counter.MaxBonusLevel should be at least 1!");
|
reason.add("Skills.Swords.Counter.MaxBonusLevel should be at least 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -470,11 +473,11 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
|
|||||||
|
|
||||||
/* TAMING */
|
/* TAMING */
|
||||||
|
|
||||||
if (getGoreChanceMax() < 1) {
|
if (getMaxChance(SecondaryAbilityType.GORE) < 1) {
|
||||||
reason.add("Skills.Taming.Gore.ChanceMax should be at least 1!");
|
reason.add("Skills.Taming.Gore.ChanceMax should be at least 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getGoreMaxBonusLevel() < 1) {
|
if (getMaxBonusLevel(SecondaryAbilityType.GORE) < 1) {
|
||||||
reason.add("Skills.Taming.Gore.MaxBonusLevel should be at least 1!");
|
reason.add("Skills.Taming.Gore.MaxBonusLevel should be at least 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -531,27 +534,27 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* UNARMED */
|
/* UNARMED */
|
||||||
if (getDisarmChanceMax() < 1) {
|
if (getMaxChance(SecondaryAbilityType.DISARM) < 1) {
|
||||||
reason.add("Skills.Unarmed.Disarm.ChanceMax should be at least 1!");
|
reason.add("Skills.Unarmed.Disarm.ChanceMax should be at least 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getDisarmMaxBonusLevel() < 1) {
|
if (getMaxBonusLevel(SecondaryAbilityType.DISARM) < 1) {
|
||||||
reason.add("Skills.Unarmed.Disarm.MaxBonusLevel should be at least 1!");
|
reason.add("Skills.Unarmed.Disarm.MaxBonusLevel should be at least 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getDeflectChanceMax() < 1) {
|
if (getMaxChance(SecondaryAbilityType.DEFLECT) < 1) {
|
||||||
reason.add("Skills.Unarmed.Deflect.ChanceMax should be at least 1!");
|
reason.add("Skills.Unarmed.Deflect.ChanceMax should be at least 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getDeflectMaxBonusLevel() < 1) {
|
if (getMaxBonusLevel(SecondaryAbilityType.DEFLECT) < 1) {
|
||||||
reason.add("Skills.Unarmed.Deflect.MaxBonusLevel should be at least 1!");
|
reason.add("Skills.Unarmed.Deflect.MaxBonusLevel should be at least 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getIronGripChanceMax() < 1) {
|
if (getMaxChance(SecondaryAbilityType.IRON_GRIP) < 1) {
|
||||||
reason.add("Skills.Unarmed.IronGrip.ChanceMax should be at least 1!");
|
reason.add("Skills.Unarmed.IronGrip.ChanceMax should be at least 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getIronGripMaxBonusLevel() < 1) {
|
if (getMaxBonusLevel(SecondaryAbilityType.IRON_GRIP) < 1) {
|
||||||
reason.add("Skills.Unarmed.IronGrip.MaxBonusLevel should be at least 1!");
|
reason.add("Skills.Unarmed.IronGrip.MaxBonusLevel should be at least 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -576,11 +579,11 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
|
|||||||
reason.add("Skills.Woodcutting.LeafBlower.UnlockLevel should be at least 1!");
|
reason.add("Skills.Woodcutting.LeafBlower.UnlockLevel should be at least 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getWoodcuttingDoubleDropChance() < 1) {
|
if (getMaxChance(SecondaryAbilityType.WOODCUTTING_DOUBLE_DROPS) < 1) {
|
||||||
reason.add("Skills.Woodcutting.DoubleDrops.ChanceMax should be at least 1!");
|
reason.add("Skills.Woodcutting.DoubleDrops.ChanceMax should be at least 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getWoodcuttingDoubleDropMaxLevel() < 1) {
|
if (getMaxBonusLevel(SecondaryAbilityType.WOODCUTTING_DOUBLE_DROPS) < 1) {
|
||||||
reason.add("Skills.Woodcutting.DoubleDrops.MaxBonusLevel should be at least 1!");
|
reason.add("Skills.Woodcutting.DoubleDrops.MaxBonusLevel should be at least 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -611,17 +614,14 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
|
|||||||
public int getAbilityLength() { return config.getInt("Skills.General.Ability.IncreaseLevel", 50); }
|
public int getAbilityLength() { return config.getInt("Skills.General.Ability.IncreaseLevel", 50); }
|
||||||
public int getEnchantBuff() { return config.getInt("Skills.General.Ability.EnchantBuff", 5); }
|
public int getEnchantBuff() { return config.getInt("Skills.General.Ability.EnchantBuff", 5); }
|
||||||
|
|
||||||
|
public int getMaxBonusLevel(SecondaryAbilityType skillAbility) { return config.getInt("Skills." + StringUtils.getCapitalized(SkillType.bySecondaryAbility(skillAbility).toString()) + "." + StringUtils.getPrettySecondaryAbilityString(skillAbility).replace("_", "") + "." + "MaxBonusLevel"); }
|
||||||
|
public double getMaxChance(SecondaryAbilityType skillAbility) { return config.getDouble("Skills." + StringUtils.getCapitalized(SkillType.bySecondaryAbility(skillAbility).toString()) + "." + StringUtils.getPrettySecondaryAbilityString(skillAbility).replace("_", "") + "." + "ChanceMax", 100.0D); }
|
||||||
|
|
||||||
/* ACROBATICS */
|
/* ACROBATICS */
|
||||||
public double getDodgeChanceMax() { return config.getDouble("Skills.Acrobatics.Dodge.ChanceMax", 20.0D); }
|
|
||||||
public int getDodgeMaxBonusLevel() { return config.getInt("Skills.Acrobatics.Dodge.MaxBonusLevel", 800); }
|
|
||||||
public double getDodgeDamageModifier() { return config.getDouble("Skills.Acrobatics.Dodge.DamageModifier", 2.0D); }
|
public double getDodgeDamageModifier() { return config.getDouble("Skills.Acrobatics.Dodge.DamageModifier", 2.0D); }
|
||||||
|
|
||||||
public double getRollChanceMax() { return config.getDouble("Skills.Acrobatics.Roll.ChanceMax", 100.0D); }
|
|
||||||
public int getRollMaxBonusLevel() { return config.getInt("Skills.Acrobatics.Roll.MaxBonusLevel", 1000); }
|
|
||||||
public double getRollDamageThreshold() { return config.getDouble("Skills.Acrobatics.Roll.DamageThreshold", 7.0D); }
|
public double getRollDamageThreshold() { return config.getDouble("Skills.Acrobatics.Roll.DamageThreshold", 7.0D); }
|
||||||
|
|
||||||
public double getGracefulRollChanceMax() { return config.getDouble("Skills.Acrobatics.GracefulRoll.ChanceMax", 100.0D); }
|
|
||||||
public int getGracefulRollMaxBonusLevel() { return config.getInt("Skills.Acrobatics.GracefulRoll.MaxBonusLevel", 500); }
|
|
||||||
public double getGracefulRollDamageThreshold() { return config.getDouble("Skills.Acrobatics.GracefulRoll.DamageThreshold", 14.0D); }
|
public double getGracefulRollDamageThreshold() { return config.getDouble("Skills.Acrobatics.GracefulRoll.DamageThreshold", 14.0D); }
|
||||||
|
|
||||||
/* ARCHERY */
|
/* ARCHERY */
|
||||||
@ -630,23 +630,16 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
|
|||||||
public double getSkillShotBonusMax() { return config.getDouble("Skills.Archery.SkillShot.MaxBonus", 2.0D); }
|
public double getSkillShotBonusMax() { return config.getDouble("Skills.Archery.SkillShot.MaxBonus", 2.0D); }
|
||||||
public double getSkillShotDamageMax() { return config.getDouble("Skills.Archery.SkillShot.MaxDamage", 9.0D); }
|
public double getSkillShotDamageMax() { return config.getDouble("Skills.Archery.SkillShot.MaxDamage", 9.0D); }
|
||||||
|
|
||||||
public double getDazeBonusMax() { return config.getDouble("Skills.Archery.Daze.ChanceMax", 50.0D); }
|
|
||||||
public int getDazeMaxBonusLevel() { return config.getInt("Skills.Archery.Daze.MaxBonusLevel", 1000); }
|
|
||||||
public double getDazeModifier() { return config.getDouble("Skills.Archery.Daze.BonusDamage", 4.0D); }
|
public double getDazeModifier() { return config.getDouble("Skills.Archery.Daze.BonusDamage", 4.0D); }
|
||||||
|
|
||||||
public double getRetrieveChanceMax() { return config.getDouble("Skills.Archery.Retrieve.ChanceMax", 100.0D); }
|
|
||||||
public int getRetrieveMaxBonusLevel() { return config.getInt("Skills.Archery.Retrieve.MaxBonusLevel", 1000); }
|
|
||||||
|
|
||||||
public double getForceMultiplier() { return config.getDouble("Skills.Archery.ForceMultiplier", 2.0D); }
|
public double getForceMultiplier() { return config.getDouble("Skills.Archery.ForceMultiplier", 2.0D); }
|
||||||
|
|
||||||
/* AXES */
|
/* AXES */
|
||||||
public double getBonusDamageAxesBonusMax() { return config.getDouble("Skills.Axes.DamageIncrease.MaxBonus", 4.0D); }
|
public double getAxeMasteryBonusMax() { return config.getDouble("Skills.Axes.AxeMastery.MaxBonus", 4.0D); }
|
||||||
public int getBonusDamageAxesMaxBonusLevel() { return config.getInt("Skills.Axes.DamageIncrease.MaxBonusLevel", 200); }
|
public int getAxeMasteryMaxBonusLevel() { return config.getInt("Skills.Axes.AxeMastery.MaxBonusLevel", 200); }
|
||||||
|
|
||||||
public double getAxesCriticalChance() { return config.getDouble("Skills.Axes.AxesCritical.ChanceMax", 37.50D); }
|
public double getCriticalHitPVPModifier() { return config.getDouble("Skills.Axes.CriticalHit.PVP_Modifier", 1.5D); }
|
||||||
public int getAxesCriticalMaxBonusLevel() { return config.getInt("Skills.Axes.AxesCritical.MaxBonusLevel", 750); }
|
public double getCriticalHitPVEModifier() { return config.getDouble("Skills.Axes.CriticalHit.PVE_Modifier", 2.0D); }
|
||||||
public double getAxesCriticalPVPModifier() { return config.getDouble("Skills.Axes.AxesCritical.PVP_Modifier", 1.5D); }
|
|
||||||
public double getAxesCriticalPVEModifier() { return config.getDouble("Skills.Axes.AxesCritical.PVE_Modifier", 2.0D); }
|
|
||||||
|
|
||||||
public double getGreaterImpactChance() { return config.getDouble("Skills.Axes.GreaterImpact.Chance", 25.0D); }
|
public double getGreaterImpactChance() { return config.getDouble("Skills.Axes.GreaterImpact.Chance", 25.0D); }
|
||||||
public double getGreaterImpactModifier() { return config.getDouble("Skills.Axes.GreaterImpact.KnockbackModifier", 1.5D); }
|
public double getGreaterImpactModifier() { return config.getDouble("Skills.Axes.GreaterImpact.KnockbackModifier", 1.5D); }
|
||||||
@ -678,22 +671,8 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
|
|||||||
public int getFarmerDietRankChange() { return config.getInt("Skills.Herbalism.FarmersDiet.RankChange", 200); }
|
public int getFarmerDietRankChange() { return config.getInt("Skills.Herbalism.FarmersDiet.RankChange", 200); }
|
||||||
|
|
||||||
public int getGreenThumbStageChange() { return config.getInt("Skills.Herbalism.GreenThumb.StageChange", 200); }
|
public int getGreenThumbStageChange() { return config.getInt("Skills.Herbalism.GreenThumb.StageChange", 200); }
|
||||||
public double getGreenThumbChanceMax() { return config.getDouble("Skills.Herbalism.GreenThumb.ChanceMax", 100.0D); }
|
|
||||||
public int getGreenThumbMaxLevel() { return config.getInt("Skills.Herbalism.GreenThumb.MaxBonusLevel", 1500); }
|
|
||||||
|
|
||||||
public double getHerbalismDoubleDropsChanceMax() { return config.getDouble("Skills.Herbalism.DoubleDrops.ChanceMax", 100.0D); }
|
|
||||||
public int getHerbalismDoubleDropsMaxLevel() { return config.getInt("Skills.Herbalism.DoubleDrops.MaxBonusLevel", 1000); }
|
|
||||||
|
|
||||||
public double getHylianLuckChanceMax() { return config.getDouble("Skills.Herbalism.HylianLuck.ChanceMax", 10.0D); }
|
|
||||||
public int getHylianLuckMaxLevel() { return config.getInt("Skills.Herbalism.HylianLuck.MaxBonusLevel", 1000); }
|
|
||||||
|
|
||||||
public double getShroomThumbChanceMax() { return config.getDouble("Skills.Herbalism.ShroomThumb.ChanceMax", 50.0D); }
|
|
||||||
public int getShroomThumbMaxLevel() { return config.getInt("Skills.Herbalism.ShroomThumb.MaxBonusLevel", 1500); }
|
|
||||||
|
|
||||||
/* MINING */
|
/* MINING */
|
||||||
public double getMiningDoubleDropChance() { return config.getDouble("Skills.Mining.DoubleDrops.ChanceMax", 100.0D); }
|
|
||||||
public int getMiningDoubleDropMaxLevel() { return config.getInt("Skills.Mining.DoubleDrops.MaxBonusLevel", 1000); }
|
|
||||||
|
|
||||||
public int getBlastMiningRankLevel(BlastMining.Tier tier) { return config.getInt("Skills.Mining.BlastMining.Rank_Levels.Rank_" + tier.toNumerical()); }
|
public int getBlastMiningRankLevel(BlastMining.Tier tier) { return config.getInt("Skills.Mining.BlastMining.Rank_Levels.Rank_" + tier.toNumerical()); }
|
||||||
public double getBlastDamageDecrease(BlastMining.Tier tier) { return config.getDouble("Skills.Mining.BlastMining.BlastDamageDecrease.Rank_" + tier.toNumerical()); }
|
public double getBlastDamageDecrease(BlastMining.Tier tier) { return config.getDouble("Skills.Mining.BlastMining.BlastDamageDecrease.Rank_" + tier.toNumerical()); }
|
||||||
public double getOreBonus(BlastMining.Tier tier) { return config.getDouble("Skills.Mining.BlastMining.OreBonus.Rank_" + tier.toNumerical()); }
|
public double getOreBonus(BlastMining.Tier tier) { return config.getDouble("Skills.Mining.BlastMining.OreBonus.Rank_" + tier.toNumerical()); }
|
||||||
@ -704,8 +683,6 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
|
|||||||
/* REPAIR */
|
/* REPAIR */
|
||||||
public double getRepairMasteryMaxBonus() { return config.getDouble("Skills.Repair.RepairMastery.MaxBonusPercentage", 200.0D); }
|
public double getRepairMasteryMaxBonus() { return config.getDouble("Skills.Repair.RepairMastery.MaxBonusPercentage", 200.0D); }
|
||||||
public int getRepairMasteryMaxLevel() { return config.getInt("Skills.Repair.RepairMastery.MaxBonusLevel", 1000); }
|
public int getRepairMasteryMaxLevel() { return config.getInt("Skills.Repair.RepairMastery.MaxBonusLevel", 1000); }
|
||||||
public double getSuperRepairChanceMax() { return config.getDouble("Skills.Repair.SuperRepair.ChanceMax", 100.0D); }
|
|
||||||
public int getSuperRepairMaxLevel() { return config.getInt("Skills.Repair.SuperRepair.MaxBonusLevel", 1000); }
|
|
||||||
public int getSalvageUnlockLevel() { return config.getInt("Skills.Repair.Salvage.UnlockLevel", 600); }
|
public int getSalvageUnlockLevel() { return config.getInt("Skills.Repair.Salvage.UnlockLevel", 600); }
|
||||||
|
|
||||||
/* Arcane Forging */
|
/* Arcane Forging */
|
||||||
@ -721,9 +698,6 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
|
|||||||
public int getBurnModifierMaxLevel() { return config.getInt("Skills.Smelting.FuelEfficiency.MaxBonusLevel", 1000); }
|
public int getBurnModifierMaxLevel() { return config.getInt("Skills.Smelting.FuelEfficiency.MaxBonusLevel", 1000); }
|
||||||
public double getBurnTimeMultiplier() { return config.getDouble("Skills.Smelting.FuelEfficiency.Multiplier", 3.0D); }
|
public double getBurnTimeMultiplier() { return config.getDouble("Skills.Smelting.FuelEfficiency.Multiplier", 3.0D); }
|
||||||
|
|
||||||
public int getSecondSmeltMaxLevel() { return config.getInt("Skills.Smelting.SecondSmelt.MaxBonusLevel", 1000); }
|
|
||||||
public double getSecondSmeltMaxChance() { return config.getDouble("Skills.Smelting.SecondSmelt.ChanceMax", 100.0D); }
|
|
||||||
|
|
||||||
public int getFluxMiningUnlockLevel() { return config.getInt("Skills.Smelting.FluxMining.UnlockLevel", 250); }
|
public int getFluxMiningUnlockLevel() { return config.getInt("Skills.Smelting.FluxMining.UnlockLevel", 250); }
|
||||||
public double getFluxMiningChance() { return config.getDouble("Skills.Smelting.FluxMining.Chance", 33.0D); }
|
public double getFluxMiningChance() { return config.getDouble("Skills.Smelting.FluxMining.Chance", 33.0D); }
|
||||||
|
|
||||||
@ -732,22 +706,16 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
|
|||||||
public int getSmeltingVanillaXPBoostMultiplier(Smelting.Tier tier) { return config.getInt("Skills.Smelting.VanillaXPMultiplier.Rank_" + tier.toNumerical()); }
|
public int getSmeltingVanillaXPBoostMultiplier(Smelting.Tier tier) { return config.getInt("Skills.Smelting.VanillaXPMultiplier.Rank_" + tier.toNumerical()); }
|
||||||
|
|
||||||
/* SWORDS */
|
/* SWORDS */
|
||||||
public double getBleedChanceMax() { return config.getDouble("Skills.Swords.Bleed.ChanceMax", 75.0D); }
|
|
||||||
public int getBleedMaxBonusLevel() { return config.getInt("Skills.Swords.Bleed.MaxBonusLevel", 750); }
|
|
||||||
public int getBleedMaxTicks() { return config.getInt("Skills.Swords.Bleed.MaxTicks", 3); }
|
public int getBleedMaxTicks() { return config.getInt("Skills.Swords.Bleed.MaxTicks", 3); }
|
||||||
public int getBleedBaseTicks() { return config.getInt("Skills.Swords.Bleed.BaseTicks", 2); }
|
public int getBleedBaseTicks() { return config.getInt("Skills.Swords.Bleed.BaseTicks", 2); }
|
||||||
|
|
||||||
public boolean getCounterRequiresBlock() { return config.getBoolean("Skills.Swords.Counter.RequiresBlock"); }
|
public boolean getCounterRequiresBlock() { return config.getBoolean("Skills.Swords.Counter.RequiresBlock"); }
|
||||||
public double getCounterChanceMax() { return config.getDouble("Skills.Swords.Counter.ChanceMax", 30.0D); }
|
|
||||||
public int getCounterMaxBonusLevel() { return config.getInt("Skills.Swords.Counter.MaxBonusLevel", 600); }
|
|
||||||
public double getCounterModifier() { return config.getDouble("Skills.Swords.Counter.DamageModifier", 2.0D); }
|
public double getCounterModifier() { return config.getDouble("Skills.Swords.Counter.DamageModifier", 2.0D); }
|
||||||
|
|
||||||
public double getSerratedStrikesModifier() { return config.getDouble("Skills.Swords.SerratedStrikes.DamageModifier", 4.0D); }
|
public double getSerratedStrikesModifier() { return config.getDouble("Skills.Swords.SerratedStrikes.DamageModifier", 4.0D); }
|
||||||
public int getSerratedStrikesTicks() { return config.getInt("Skills.Swords.SerratedStrikes.BleedTicks", 5); }
|
public int getSerratedStrikesTicks() { return config.getInt("Skills.Swords.SerratedStrikes.BleedTicks", 5); }
|
||||||
|
|
||||||
/* TAMING */
|
/* TAMING */
|
||||||
public double getGoreChanceMax() { return config.getDouble("Skills.Taming.Gore.ChanceMax", 100.0D); }
|
|
||||||
public int getGoreMaxBonusLevel() { return config.getInt("Skills.Taming.Gore.MaxBonusLevel", 1000); }
|
|
||||||
public int getGoreBleedTicks() { return config.getInt("Skills.Taming.Gore.BleedTicks", 2); }
|
public int getGoreBleedTicks() { return config.getInt("Skills.Taming.Gore.BleedTicks", 2); }
|
||||||
public double getGoreModifier() { return config.getDouble("Skills.Taming.Gore.Modifier", 2.0D); }
|
public double getGoreModifier() { return config.getDouble("Skills.Taming.Gore.Modifier", 2.0D); }
|
||||||
|
|
||||||
@ -770,15 +738,6 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
|
|||||||
public double getMaxHorseJumpStrength() { return config.getDouble("Skills.Taming.CallOfTheWild.MaxHorseJumpStrength", 2.0D); }
|
public double getMaxHorseJumpStrength() { return config.getDouble("Skills.Taming.CallOfTheWild.MaxHorseJumpStrength", 2.0D); }
|
||||||
|
|
||||||
/* UNARMED */
|
/* UNARMED */
|
||||||
public double getDisarmChanceMax() { return config.getDouble("Skills.Unarmed.Disarm.ChanceMax", 33.0D); }
|
|
||||||
public int getDisarmMaxBonusLevel() { return config.getInt("Skills.Unarmed.Disarm.MaxBonusLevel", 1000); }
|
|
||||||
|
|
||||||
public double getDeflectChanceMax() { return config.getDouble("Skills.Unarmed.Deflect.ChanceMax", 50.0D); }
|
|
||||||
public int getDeflectMaxBonusLevel() { return config.getInt("Skills.Unarmed.Deflect.MaxBonusLevel", 1000); }
|
|
||||||
|
|
||||||
public double getIronGripChanceMax() { return config.getDouble("Skills.Unarmed.IronGrip.ChanceMax", 100.0D); }
|
|
||||||
public int getIronGripMaxBonusLevel() { return config.getInt("Skills.Unarmed.IronGrip.MaxBonusLevel", 1000); }
|
|
||||||
|
|
||||||
public double getIronArmMinBonus() { return config.getDouble("Skills.Unarmed.IronArm.BonusMin", 3.0D); }
|
public double getIronArmMinBonus() { return config.getDouble("Skills.Unarmed.IronArm.BonusMin", 3.0D); }
|
||||||
public double getIronArmMaxBonus() { return config.getDouble("Skills.Unarmed.IronArm.BonusMax", 8.0D); }
|
public double getIronArmMaxBonus() { return config.getDouble("Skills.Unarmed.IronArm.BonusMax", 8.0D); }
|
||||||
public int getIronArmIncreaseLevel() { return config.getInt("Skills.Unarmed.IronArm.IncreaseLevel", 50); }
|
public int getIronArmIncreaseLevel() { return config.getInt("Skills.Unarmed.IronArm.IncreaseLevel", 50); }
|
||||||
@ -786,9 +745,6 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
|
|||||||
/* WOODCUTTING */
|
/* WOODCUTTING */
|
||||||
public int getLeafBlowUnlockLevel() { return config.getInt("Skills.Woodcutting.LeafBlower.UnlockLevel", 100); }
|
public int getLeafBlowUnlockLevel() { return config.getInt("Skills.Woodcutting.LeafBlower.UnlockLevel", 100); }
|
||||||
|
|
||||||
public double getWoodcuttingDoubleDropChance() { return config.getDouble("Skills.Woodcutting.DoubleDrops.ChanceMax", 100.0D); }
|
|
||||||
public int getWoodcuttingDoubleDropMaxLevel() { return config.getInt("Skills.Woodcutting.DoubleDrops.MaxBonusLevel", 1000); }
|
|
||||||
|
|
||||||
/* KRAKEN STUFF */
|
/* KRAKEN STUFF */
|
||||||
public boolean getKrakenEnabled() { return config.getBoolean("Kraken.Enabled", true); }
|
public boolean getKrakenEnabled() { return config.getBoolean("Kraken.Enabled", true); }
|
||||||
public int getKrakenTriesBeforeRelease() { return config.getInt("Kraken.Tries_Before_Release", 50); }
|
public int getKrakenTriesBeforeRelease() { return config.getInt("Kraken.Tries_Before_Release", 50); }
|
||||||
|
@ -34,7 +34,7 @@ public class PlayerProfile {
|
|||||||
|
|
||||||
mobHealthbarType = Config.getInstance().getMobHealthbarDefault();
|
mobHealthbarType = Config.getInstance().getMobHealthbarDefault();
|
||||||
|
|
||||||
for (AbilityType abilityType : AbilityType.NORMAL_ABILITIES) {
|
for (AbilityType abilityType : AbilityType.values()) {
|
||||||
abilityDATS.put(abilityType, 0);
|
abilityDATS.put(abilityType, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,21 +1,15 @@
|
|||||||
package com.gmail.nossr50.datatypes.skills;
|
package com.gmail.nossr50.datatypes.skills;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.Block;
|
|
||||||
import org.bukkit.block.BlockState;
|
import org.bukkit.block.BlockState;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.util.BlockUtils;
|
import com.gmail.nossr50.util.BlockUtils;
|
||||||
import com.gmail.nossr50.util.EventUtils;
|
|
||||||
import com.gmail.nossr50.util.Permissions;
|
import com.gmail.nossr50.util.Permissions;
|
||||||
import com.gmail.nossr50.util.StringUtils;
|
import com.gmail.nossr50.util.StringUtils;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableList;
|
|
||||||
|
|
||||||
public enum AbilityType {
|
public enum AbilityType {
|
||||||
BERSERK(
|
BERSERK(
|
||||||
"Unarmed.Skills.Berserk.On",
|
"Unarmed.Skills.Berserk.On",
|
||||||
@ -75,16 +69,7 @@ public enum AbilityType {
|
|||||||
"Mining.Blast.Other.On",
|
"Mining.Blast.Other.On",
|
||||||
"Mining.Blast.Refresh",
|
"Mining.Blast.Refresh",
|
||||||
null),
|
null),
|
||||||
|
;
|
||||||
/**
|
|
||||||
* No cooldown - always active
|
|
||||||
*/
|
|
||||||
LEAF_BLOWER,
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Not a first-class Ability - part of Berserk
|
|
||||||
*/
|
|
||||||
BLOCK_CRACKER;
|
|
||||||
|
|
||||||
private String abilityOn;
|
private String abilityOn;
|
||||||
private String abilityOff;
|
private String abilityOff;
|
||||||
@ -92,20 +77,6 @@ public enum AbilityType {
|
|||||||
private String abilityRefresh;
|
private String abilityRefresh;
|
||||||
private String abilityPlayerOff;
|
private String abilityPlayerOff;
|
||||||
|
|
||||||
/**
|
|
||||||
* Those abilities that have a cooldown saved to the database.
|
|
||||||
*/
|
|
||||||
public static final List<AbilityType> NORMAL_ABILITIES = ImmutableList.of(BERSERK, BLAST_MINING, GIGA_DRILL_BREAKER, GREEN_TERRA, SERRATED_STRIKES, SKULL_SPLITTER, SUPER_BREAKER, TREE_FELLER);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Those abilities that do not have a cooldown saved to the database.
|
|
||||||
*/
|
|
||||||
public static final List<AbilityType> NON_NORMAL_ABILITIES = ImmutableList.of(BLOCK_CRACKER, LEAF_BLOWER);
|
|
||||||
|
|
||||||
private AbilityType() {
|
|
||||||
this(null, null, null, null, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
private AbilityType(String abilityOn, String abilityOff, String abilityPlayer, String abilityRefresh, String abilityPlayerOff) {
|
private AbilityType(String abilityOn, String abilityOff, String abilityPlayer, String abilityRefresh, String abilityPlayerOff) {
|
||||||
this.abilityOn = abilityOn;
|
this.abilityOn = abilityOn;
|
||||||
this.abilityOff = abilityOff;
|
this.abilityOff = abilityOff;
|
||||||
@ -181,18 +152,12 @@ public enum AbilityType {
|
|||||||
case BLAST_MINING:
|
case BLAST_MINING:
|
||||||
return Permissions.remoteDetonation(player);
|
return Permissions.remoteDetonation(player);
|
||||||
|
|
||||||
case BLOCK_CRACKER:
|
|
||||||
return Permissions.blockCracker(player);
|
|
||||||
|
|
||||||
case GIGA_DRILL_BREAKER:
|
case GIGA_DRILL_BREAKER:
|
||||||
return Permissions.gigaDrillBreaker(player);
|
return Permissions.gigaDrillBreaker(player);
|
||||||
|
|
||||||
case GREEN_TERRA:
|
case GREEN_TERRA:
|
||||||
return Permissions.greenTerra(player);
|
return Permissions.greenTerra(player);
|
||||||
|
|
||||||
case LEAF_BLOWER:
|
|
||||||
return Permissions.leafBlower(player);
|
|
||||||
|
|
||||||
case SERRATED_STRIKES:
|
case SERRATED_STRIKES:
|
||||||
return Permissions.serratedStrikes(player);
|
return Permissions.serratedStrikes(player);
|
||||||
|
|
||||||
@ -221,18 +186,12 @@ public enum AbilityType {
|
|||||||
case BERSERK:
|
case BERSERK:
|
||||||
return (BlockUtils.affectedByGigaDrillBreaker(blockState) || blockState.getType() == Material.SNOW);
|
return (BlockUtils.affectedByGigaDrillBreaker(blockState) || blockState.getType() == Material.SNOW);
|
||||||
|
|
||||||
case BLOCK_CRACKER:
|
|
||||||
return BlockUtils.affectedByBlockCracker(blockState);
|
|
||||||
|
|
||||||
case GIGA_DRILL_BREAKER:
|
case GIGA_DRILL_BREAKER:
|
||||||
return BlockUtils.affectedByGigaDrillBreaker(blockState);
|
return BlockUtils.affectedByGigaDrillBreaker(blockState);
|
||||||
|
|
||||||
case GREEN_TERRA:
|
case GREEN_TERRA:
|
||||||
return BlockUtils.canMakeMossy(blockState);
|
return BlockUtils.canMakeMossy(blockState);
|
||||||
|
|
||||||
case LEAF_BLOWER:
|
|
||||||
return BlockUtils.isLeaves(blockState);
|
|
||||||
|
|
||||||
case SUPER_BREAKER:
|
case SUPER_BREAKER:
|
||||||
return BlockUtils.affectedBySuperBreaker(blockState);
|
return BlockUtils.affectedBySuperBreaker(blockState);
|
||||||
|
|
||||||
@ -243,23 +202,4 @@ public enum AbilityType {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Check to see if ability should be triggered.
|
|
||||||
*
|
|
||||||
* @param player The player using the ability
|
|
||||||
* @param block The block modified by the ability
|
|
||||||
* @return true if the ability should activate, false otherwise
|
|
||||||
*/
|
|
||||||
public boolean triggerCheck(Player player, Block block) {
|
|
||||||
switch (this) {
|
|
||||||
case BERSERK:
|
|
||||||
case BLOCK_CRACKER:
|
|
||||||
case LEAF_BLOWER:
|
|
||||||
return blockCheck(block.getState()) && EventUtils.simulateBlockBreak(block, player, true);
|
|
||||||
|
|
||||||
default:
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,78 @@
|
|||||||
|
package com.gmail.nossr50.datatypes.skills;
|
||||||
|
|
||||||
|
public enum SecondaryAbilityType {
|
||||||
|
/* ACROBATICS */
|
||||||
|
DODGE,
|
||||||
|
GRACEFUL_ROLL,
|
||||||
|
ROLL,
|
||||||
|
|
||||||
|
/* ARCHERY */
|
||||||
|
DAZE,
|
||||||
|
RETRIEVE,
|
||||||
|
SKILL_SHOT,
|
||||||
|
|
||||||
|
/* Axes */
|
||||||
|
ARMOR_IMPACT,
|
||||||
|
AXE_MASTERY,
|
||||||
|
CRITICAL_HIT,
|
||||||
|
GREATER_IMPACT,
|
||||||
|
|
||||||
|
/* Excavation */
|
||||||
|
EXCAVATION_TREASURE_HUNTER,
|
||||||
|
|
||||||
|
/* Fishing */
|
||||||
|
FISHERMANS_DIET,
|
||||||
|
FISHING_TREASURE_HUNTER,
|
||||||
|
ICE_FISHING,
|
||||||
|
MAGIC_HUNTER,
|
||||||
|
MASTER_ANGLER,
|
||||||
|
SHAKE,
|
||||||
|
|
||||||
|
/* Herbalism */
|
||||||
|
FARMERS_DIET,
|
||||||
|
GREEN_THUMB_PLANT,
|
||||||
|
GREEN_THUMB_BLOCK,
|
||||||
|
HERBALISM_DOUBLE_DROPS,
|
||||||
|
HYLIAN_LUCK,
|
||||||
|
SHROOM_THUMB,
|
||||||
|
|
||||||
|
/* Mining */
|
||||||
|
MINING_DOUBLE_DROPS,
|
||||||
|
|
||||||
|
/* Repair */
|
||||||
|
ARCANE_FORGING,
|
||||||
|
REPAIR_MASTERY,
|
||||||
|
SALVAGE,
|
||||||
|
SUPER_REPAIR,
|
||||||
|
|
||||||
|
/* Smelting */
|
||||||
|
FLUX_MINING,
|
||||||
|
FUEL_EFFICIENCY,
|
||||||
|
SECOND_SMELT,
|
||||||
|
|
||||||
|
/* Swords */
|
||||||
|
BLEED,
|
||||||
|
COUNTER,
|
||||||
|
|
||||||
|
/* Taming */
|
||||||
|
BEAST_LORE,
|
||||||
|
CALL_OF_THE_WILD,
|
||||||
|
ENVIROMENTALLY_AWARE,
|
||||||
|
FAST_FOOD,
|
||||||
|
GORE,
|
||||||
|
HOLY_HOUND,
|
||||||
|
SHARPENED_CLAWS,
|
||||||
|
SHOCK_PROOF,
|
||||||
|
THICK_FUR,
|
||||||
|
|
||||||
|
/* Unarmed */
|
||||||
|
BLOCK_CRACKER,
|
||||||
|
DEFLECT,
|
||||||
|
DISARM,
|
||||||
|
IRON_ARM,
|
||||||
|
IRON_GRIP,
|
||||||
|
|
||||||
|
/* Woodcutting */
|
||||||
|
LEAF_BLOWER,
|
||||||
|
WOODCUTTING_DOUBLE_DROPS;
|
||||||
|
}
|
@ -34,24 +34,25 @@ import com.gmail.nossr50.util.skills.ParticleEffectUtils;
|
|||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
|
|
||||||
public enum SkillType {
|
public enum SkillType {
|
||||||
ACROBATICS(AcrobaticsManager.class, Color.WHITE),
|
ACROBATICS(AcrobaticsManager.class, Color.WHITE, ImmutableList.of(SecondaryAbilityType.DODGE, SecondaryAbilityType.GRACEFUL_ROLL, SecondaryAbilityType.ROLL)),
|
||||||
ARCHERY(ArcheryManager.class, Color.MAROON),
|
ARCHERY(ArcheryManager.class, Color.MAROON, ImmutableList.of(SecondaryAbilityType.DAZE, SecondaryAbilityType.RETRIEVE, SecondaryAbilityType.SKILL_SHOT)),
|
||||||
AXES(AxesManager.class, Color.AQUA, AbilityType.SKULL_SPLITTER, ToolType.AXE),
|
AXES(AxesManager.class, Color.AQUA, AbilityType.SKULL_SPLITTER, ToolType.AXE, ImmutableList.of(SecondaryAbilityType.ARMOR_IMPACT, SecondaryAbilityType.AXE_MASTERY, SecondaryAbilityType.CRITICAL_HIT, SecondaryAbilityType.GREATER_IMPACT)),
|
||||||
EXCAVATION(ExcavationManager.class, Color.fromRGB(139, 69, 19), AbilityType.GIGA_DRILL_BREAKER, ToolType.SHOVEL),
|
EXCAVATION(ExcavationManager.class, Color.fromRGB(139, 69, 19), AbilityType.GIGA_DRILL_BREAKER, ToolType.SHOVEL, ImmutableList.of(SecondaryAbilityType.EXCAVATION_TREASURE_HUNTER)),
|
||||||
FISHING(FishingManager.class, Color.NAVY),
|
FISHING(FishingManager.class, Color.NAVY, ImmutableList.of(SecondaryAbilityType.FISHERMANS_DIET, SecondaryAbilityType.FISHING_TREASURE_HUNTER, SecondaryAbilityType.ICE_FISHING, SecondaryAbilityType.MAGIC_HUNTER, SecondaryAbilityType.MASTER_ANGLER, SecondaryAbilityType.SHAKE)),
|
||||||
HERBALISM(HerbalismManager.class, Color.GREEN, AbilityType.GREEN_TERRA, ToolType.HOE),
|
HERBALISM(HerbalismManager.class, Color.GREEN, AbilityType.GREEN_TERRA, ToolType.HOE, ImmutableList.of(SecondaryAbilityType.FARMERS_DIET, SecondaryAbilityType.GREEN_THUMB_PLANT, SecondaryAbilityType.GREEN_THUMB_BLOCK, SecondaryAbilityType.HERBALISM_DOUBLE_DROPS, SecondaryAbilityType.HYLIAN_LUCK, SecondaryAbilityType.SHROOM_THUMB)),
|
||||||
MINING(MiningManager.class, Color.GRAY, AbilityType.SUPER_BREAKER, ToolType.PICKAXE),
|
MINING(MiningManager.class, Color.GRAY, AbilityType.SUPER_BREAKER, ToolType.PICKAXE, ImmutableList.of(SecondaryAbilityType.MINING_DOUBLE_DROPS)),
|
||||||
REPAIR(RepairManager.class, Color.SILVER),
|
REPAIR(RepairManager.class, Color.SILVER, ImmutableList.of(SecondaryAbilityType.ARCANE_FORGING, SecondaryAbilityType.REPAIR_MASTERY, SecondaryAbilityType.SALVAGE, SecondaryAbilityType.SUPER_REPAIR)),
|
||||||
SMELTING(SmeltingManager.class, Color.YELLOW),
|
SMELTING(SmeltingManager.class, Color.YELLOW, ImmutableList.of(SecondaryAbilityType.FLUX_MINING, SecondaryAbilityType.FUEL_EFFICIENCY, SecondaryAbilityType.SECOND_SMELT)),
|
||||||
SWORDS(SwordsManager.class, Color.fromRGB(178, 34, 34), AbilityType.SERRATED_STRIKES, ToolType.SWORD),
|
SWORDS(SwordsManager.class, Color.fromRGB(178, 34, 34), AbilityType.SERRATED_STRIKES, ToolType.SWORD, ImmutableList.of(SecondaryAbilityType.BLEED, SecondaryAbilityType.COUNTER)),
|
||||||
TAMING(TamingManager.class, Color.PURPLE),
|
TAMING(TamingManager.class, Color.PURPLE, ImmutableList.of(SecondaryAbilityType.BEAST_LORE, SecondaryAbilityType.CALL_OF_THE_WILD, SecondaryAbilityType.ENVIROMENTALLY_AWARE, SecondaryAbilityType.FAST_FOOD, SecondaryAbilityType.GORE, SecondaryAbilityType.HOLY_HOUND, SecondaryAbilityType.SHARPENED_CLAWS, SecondaryAbilityType.SHOCK_PROOF, SecondaryAbilityType.THICK_FUR)),
|
||||||
UNARMED(UnarmedManager.class, Color.BLACK, AbilityType.BERSERK, ToolType.FISTS),
|
UNARMED(UnarmedManager.class, Color.BLACK, AbilityType.BERSERK, ToolType.FISTS, ImmutableList.of(SecondaryAbilityType.BLOCK_CRACKER, SecondaryAbilityType.DEFLECT, SecondaryAbilityType.DISARM, SecondaryAbilityType.IRON_ARM, SecondaryAbilityType.IRON_GRIP)),
|
||||||
WOODCUTTING(WoodcuttingManager.class, Color.OLIVE, AbilityType.TREE_FELLER, ToolType.AXE);
|
WOODCUTTING(WoodcuttingManager.class, Color.OLIVE, AbilityType.TREE_FELLER, ToolType.AXE, ImmutableList.of(SecondaryAbilityType.LEAF_BLOWER, SecondaryAbilityType.WOODCUTTING_DOUBLE_DROPS));
|
||||||
|
|
||||||
private Class<? extends SkillManager> managerClass;
|
private Class<? extends SkillManager> managerClass;
|
||||||
private Color runescapeColor;
|
private Color runescapeColor;
|
||||||
private AbilityType ability;
|
private AbilityType ability;
|
||||||
private ToolType tool;
|
private ToolType tool;
|
||||||
|
private List<SecondaryAbilityType> secondaryAbilities;
|
||||||
|
|
||||||
public static final List<String> SKILL_NAMES;
|
public static final List<String> SKILL_NAMES;
|
||||||
|
|
||||||
@ -85,18 +86,16 @@ public enum SkillType {
|
|||||||
NON_CHILD_SKILLS = ImmutableList.copyOf(nonChildSkills);
|
NON_CHILD_SKILLS = ImmutableList.copyOf(nonChildSkills);
|
||||||
}
|
}
|
||||||
|
|
||||||
private SkillType(Class<? extends SkillManager> managerClass, Color runescapeColor) {
|
private SkillType(Class<? extends SkillManager> managerClass, Color runescapeColor, List<SecondaryAbilityType> secondaryAbilities) {
|
||||||
this.managerClass = managerClass;
|
this(managerClass, runescapeColor, null, null, secondaryAbilities);
|
||||||
this.runescapeColor = runescapeColor;
|
|
||||||
ability = null;
|
|
||||||
tool = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private SkillType(Class<? extends SkillManager> managerClass, Color runescapeColor, AbilityType ability, ToolType tool) {
|
private SkillType(Class<? extends SkillManager> managerClass, Color runescapeColor, AbilityType ability, ToolType tool, List<SecondaryAbilityType> secondaryAbilities) {
|
||||||
this.managerClass = managerClass;
|
this.managerClass = managerClass;
|
||||||
this.runescapeColor = runescapeColor;
|
this.runescapeColor = runescapeColor;
|
||||||
this.ability = ability;
|
this.ability = ability;
|
||||||
this.tool = tool;
|
this.tool = tool;
|
||||||
|
this.secondaryAbilities = secondaryAbilities;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Class<? extends SkillManager> getManagerClass() {
|
public Class<? extends SkillManager> getManagerClass() {
|
||||||
@ -148,6 +147,10 @@ public enum SkillType {
|
|||||||
return tool;
|
return tool;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<SecondaryAbilityType> getSkillAbilities() {
|
||||||
|
return secondaryAbilities;
|
||||||
|
}
|
||||||
|
|
||||||
public double getXpModifier() {
|
public double getXpModifier() {
|
||||||
return ExperienceConfig.getInstance().getFormulaSkillModifier(this);
|
return ExperienceConfig.getInstance().getFormulaSkillModifier(this);
|
||||||
}
|
}
|
||||||
@ -185,6 +188,15 @@ public enum SkillType {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static SkillType bySecondaryAbility(SecondaryAbilityType skillAbility) {
|
||||||
|
for (SkillType type : values()) {
|
||||||
|
if (type.getSkillAbilities().contains(skillAbility)) {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public static SkillType byAbility(AbilityType ability) {
|
public static SkillType byAbility(AbilityType ability) {
|
||||||
for (SkillType type : values()) {
|
for (SkillType type : values()) {
|
||||||
if (type.getAbility() == ability) {
|
if (type.getAbility() == ability) {
|
||||||
|
@ -0,0 +1,21 @@
|
|||||||
|
package com.gmail.nossr50.events.skills.secondaryabilities;
|
||||||
|
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import com.gmail.nossr50.datatypes.skills.SecondaryAbilityType;
|
||||||
|
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||||
|
import com.gmail.nossr50.events.skills.McMMOPlayerSkillEvent;
|
||||||
|
|
||||||
|
public abstract class SecondaryAbilityEvent extends McMMOPlayerSkillEvent {
|
||||||
|
|
||||||
|
private SecondaryAbilityType secondaryAbility;
|
||||||
|
|
||||||
|
public SecondaryAbilityEvent(Player player, SecondaryAbilityType secondaryAbility) {
|
||||||
|
super(player, SkillType.bySecondaryAbility(secondaryAbility));
|
||||||
|
this.secondaryAbility = secondaryAbility;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SecondaryAbilityType getSecondarySkillAbility() {
|
||||||
|
return secondaryAbility;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
package com.gmail.nossr50.events.skills.secondaryabilities;
|
||||||
|
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import com.gmail.nossr50.datatypes.skills.SecondaryAbilityType;
|
||||||
|
|
||||||
|
public class SecondaryAbilityWeightedActivationCheckEvent extends SecondaryAbilityEvent {
|
||||||
|
|
||||||
|
private double chance;
|
||||||
|
|
||||||
|
public SecondaryAbilityWeightedActivationCheckEvent(Player player, SecondaryAbilityType ability, double chance) {
|
||||||
|
super(player, ability);
|
||||||
|
this.chance = chance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getChance() {
|
||||||
|
return chance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChance(double chance) {
|
||||||
|
this.chance = Math.min(1D, chance);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSuccessful(boolean success) {
|
||||||
|
this.chance = success ? 1.0D : 0D;
|
||||||
|
}
|
||||||
|
}
|
@ -36,6 +36,7 @@ import com.gmail.nossr50.skills.mining.MiningManager;
|
|||||||
import com.gmail.nossr50.skills.smelting.SmeltingManager;
|
import com.gmail.nossr50.skills.smelting.SmeltingManager;
|
||||||
import com.gmail.nossr50.skills.woodcutting.WoodcuttingManager;
|
import com.gmail.nossr50.skills.woodcutting.WoodcuttingManager;
|
||||||
import com.gmail.nossr50.util.BlockUtils;
|
import com.gmail.nossr50.util.BlockUtils;
|
||||||
|
import com.gmail.nossr50.util.EventUtils;
|
||||||
import com.gmail.nossr50.util.ItemUtils;
|
import com.gmail.nossr50.util.ItemUtils;
|
||||||
import com.gmail.nossr50.util.Misc;
|
import com.gmail.nossr50.util.Misc;
|
||||||
import com.gmail.nossr50.util.Permissions;
|
import com.gmail.nossr50.util.Permissions;
|
||||||
@ -339,17 +340,17 @@ public class BlockListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (mcMMOPlayer.getAbilityMode(AbilityType.BERSERK) && heldItem.getType() == Material.AIR) {
|
else if (mcMMOPlayer.getAbilityMode(AbilityType.BERSERK) && heldItem.getType() == Material.AIR) {
|
||||||
if (AbilityType.BERSERK.triggerCheck(player, block)) {
|
if (AbilityType.BERSERK.blockCheck(block.getState()) && EventUtils.simulateBlockBreak(block, player, true)) {
|
||||||
event.setInstaBreak(true);
|
event.setInstaBreak(true);
|
||||||
player.playSound(block.getLocation(), Sound.ITEM_PICKUP, Misc.POP_VOLUME, Misc.getPopPitch());
|
player.playSound(block.getLocation(), Sound.ITEM_PICKUP, Misc.POP_VOLUME, Misc.getPopPitch());
|
||||||
}
|
}
|
||||||
else if (mcMMOPlayer.getUnarmedManager().canUseBlockCracker() && AbilityType.BLOCK_CRACKER.triggerCheck(player, block)) {
|
else if (mcMMOPlayer.getUnarmedManager().canUseBlockCracker() && BlockUtils.affectedByBlockCracker(blockState) && EventUtils.simulateBlockBreak(block, player, true)) {
|
||||||
if (mcMMOPlayer.getUnarmedManager().blockCrackerCheck(blockState)) {
|
if (mcMMOPlayer.getUnarmedManager().blockCrackerCheck(blockState)) {
|
||||||
blockState.update();
|
blockState.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (mcMMOPlayer.getWoodcuttingManager().canUseLeafBlower(heldItem) && AbilityType.LEAF_BLOWER.triggerCheck(player, block)) {
|
else if (mcMMOPlayer.getWoodcuttingManager().canUseLeafBlower(heldItem) && BlockUtils.isLeaves(blockState) && EventUtils.simulateBlockBreak(block, player, true)) {
|
||||||
event.setInstaBreak(true);
|
event.setInstaBreak(true);
|
||||||
player.playSound(blockState.getLocation(), Sound.ITEM_PICKUP, Misc.POP_VOLUME, Misc.getPopPitch());
|
player.playSound(blockState.getLocation(), Sound.ITEM_PICKUP, Misc.POP_VOLUME, Misc.getPopPitch());
|
||||||
}
|
}
|
||||||
|
@ -36,6 +36,7 @@ import com.gmail.nossr50.mcMMO;
|
|||||||
import com.gmail.nossr50.config.AdvancedConfig;
|
import com.gmail.nossr50.config.AdvancedConfig;
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||||
|
import com.gmail.nossr50.datatypes.skills.SecondaryAbilityType;
|
||||||
import com.gmail.nossr50.events.fake.FakeEntityDamageByEntityEvent;
|
import com.gmail.nossr50.events.fake.FakeEntityDamageByEntityEvent;
|
||||||
import com.gmail.nossr50.events.fake.FakeEntityDamageEvent;
|
import com.gmail.nossr50.events.fake.FakeEntityDamageEvent;
|
||||||
import com.gmail.nossr50.party.PartyManager;
|
import com.gmail.nossr50.party.PartyManager;
|
||||||
@ -515,7 +516,7 @@ public class EntityListener implements Listener {
|
|||||||
case GOLDEN_CARROT: /* RESTORES 3 HUNGER - RESTORES 5 1/2 HUNGER @ 1000 */
|
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 MUSHROOM_SOUP: /* RESTORES 4 HUNGER - RESTORES 6 1/2 HUNGER @ 1000 */
|
||||||
case PUMPKIN_PIE: /* 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)) {
|
if (Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.FARMERS_DIET)) {
|
||||||
event.setFoodLevel(UserManager.getPlayer(player).getHerbalismManager().farmersDiet(Herbalism.farmersDietRankLevel1, newFoodLevel));
|
event.setFoodLevel(UserManager.getPlayer(player).getHerbalismManager().farmersDiet(Herbalism.farmersDietRankLevel1, newFoodLevel));
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -524,19 +525,19 @@ public class EntityListener implements Listener {
|
|||||||
case MELON: /* RESTORES 1 HUNGER - RESTORES 2 1/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 POISONOUS_POTATO: /* RESTORES 1 HUNGER - RESTORES 2 1/2 HUNGER @ 1000 */
|
||||||
case POTATO_ITEM: /* RESTORES 1/2 HUNGER - RESTORES 2 HUNGER @ 1000 */
|
case POTATO_ITEM: /* RESTORES 1/2 HUNGER - RESTORES 2 HUNGER @ 1000 */
|
||||||
if (Permissions.farmersDiet(player)) {
|
if (Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.FARMERS_DIET)) {
|
||||||
event.setFoodLevel(UserManager.getPlayer(player).getHerbalismManager().farmersDiet(Herbalism.farmersDietRankLevel2, newFoodLevel));
|
event.setFoodLevel(UserManager.getPlayer(player).getHerbalismManager().farmersDiet(Herbalism.farmersDietRankLevel2, newFoodLevel));
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case COOKED_FISH: /* RESTORES 2 1/2 HUNGER - RESTORES 5 HUNGER @ 1000 */
|
case COOKED_FISH: /* RESTORES 2 1/2 HUNGER - RESTORES 5 HUNGER @ 1000 */
|
||||||
if (Permissions.fishermansDiet(player)) {
|
if (Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.FISHERMANS_DIET)) {
|
||||||
event.setFoodLevel(UserManager.getPlayer(player).getFishingManager().handleFishermanDiet(Fishing.fishermansDietRankLevel1, newFoodLevel));
|
event.setFoodLevel(UserManager.getPlayer(player).getFishingManager().handleFishermanDiet(Fishing.fishermansDietRankLevel1, newFoodLevel));
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case RAW_FISH: /* RESTORES 1 HUNGER - RESTORES 2 1/2 HUNGER @ 1000 */
|
case RAW_FISH: /* RESTORES 1 HUNGER - RESTORES 2 1/2 HUNGER @ 1000 */
|
||||||
if (Permissions.fishermansDiet(player)) {
|
if (Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.FISHERMANS_DIET)) {
|
||||||
event.setFoodLevel(UserManager.getPlayer(player).getFishingManager().handleFishermanDiet(Fishing.fishermansDietRankLevel2, newFoodLevel));
|
event.setFoodLevel(UserManager.getPlayer(player).getFishingManager().handleFishermanDiet(Fishing.fishermansDietRankLevel2, newFoodLevel));
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -17,6 +17,7 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
import org.bukkit.metadata.FixedMetadataValue;
|
import org.bukkit.metadata.FixedMetadataValue;
|
||||||
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
|
import com.gmail.nossr50.datatypes.skills.SecondaryAbilityType;
|
||||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||||
import com.gmail.nossr50.runnables.PlayerUpdateInventoryTask;
|
import com.gmail.nossr50.runnables.PlayerUpdateInventoryTask;
|
||||||
import com.gmail.nossr50.util.ItemUtils;
|
import com.gmail.nossr50.util.ItemUtils;
|
||||||
@ -73,7 +74,7 @@ public class InventoryListener implements Listener {
|
|||||||
|
|
||||||
Player player = Misc.getPlayerFromFurnace(furnaceBlock);
|
Player player = Misc.getPlayerFromFurnace(furnaceBlock);
|
||||||
|
|
||||||
if (Misc.isNPCEntity(player) || !Permissions.fuelEfficiency(player)) {
|
if (Misc.isNPCEntity(player) || !Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.FUEL_EFFICIENCY)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,6 +36,7 @@ import com.gmail.nossr50.datatypes.chat.ChatMode;
|
|||||||
import com.gmail.nossr50.datatypes.party.Party;
|
import com.gmail.nossr50.datatypes.party.Party;
|
||||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||||
import com.gmail.nossr50.datatypes.skills.AbilityType;
|
import com.gmail.nossr50.datatypes.skills.AbilityType;
|
||||||
|
import com.gmail.nossr50.datatypes.skills.SecondaryAbilityType;
|
||||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.party.ShareHandler;
|
import com.gmail.nossr50.party.ShareHandler;
|
||||||
@ -432,7 +433,7 @@ public class PlayerListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* SALVAGE CHECKS */
|
/* SALVAGE CHECKS */
|
||||||
else if (type == Repair.salvageAnvilMaterial && Permissions.salvage(player) && Repair.isSalvageable(heldItem)) {
|
else if (type == Repair.salvageAnvilMaterial && Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.SALVAGE) && Repair.isSalvageable(heldItem)) {
|
||||||
RepairManager repairManager = mcMMOPlayer.getRepairManager();
|
RepairManager repairManager = mcMMOPlayer.getRepairManager();
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
|
||||||
@ -470,7 +471,7 @@ public class PlayerListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* SALVAGE CHECKS */
|
/* SALVAGE CHECKS */
|
||||||
else if (type == Repair.salvageAnvilMaterial && Permissions.salvage(player) && Repair.isSalvageable(heldItem)) {
|
else if (type == Repair.salvageAnvilMaterial && Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.SALVAGE) && Repair.isSalvageable(heldItem)) {
|
||||||
RepairManager repairManager = mcMMOPlayer.getRepairManager();
|
RepairManager repairManager = mcMMOPlayer.getRepairManager();
|
||||||
|
|
||||||
// Cancel salvaging an enchanted item
|
// Cancel salvaging an enchanted item
|
||||||
|
@ -29,10 +29,6 @@ public abstract class SkillManager {
|
|||||||
return mcMMOPlayer.getSkillLevel(skill);
|
return mcMMOPlayer.getSkillLevel(skill);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getActivationChance() {
|
|
||||||
return activationChance;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void applyXpGain(float xp) {
|
public void applyXpGain(float xp) {
|
||||||
mcMMOPlayer.beginXpGain(skill, xp);
|
mcMMOPlayer.beginXpGain(skill, xp);
|
||||||
}
|
}
|
||||||
|
@ -5,17 +5,9 @@ import com.gmail.nossr50.config.Config;
|
|||||||
import com.gmail.nossr50.config.experience.ExperienceConfig;
|
import com.gmail.nossr50.config.experience.ExperienceConfig;
|
||||||
|
|
||||||
public final class Acrobatics {
|
public final class Acrobatics {
|
||||||
public static int dodgeMaxBonusLevel = AdvancedConfig.getInstance().getDodgeMaxBonusLevel();
|
public static double rollThreshold = AdvancedConfig.getInstance().getRollDamageThreshold();
|
||||||
public static double dodgeDamageModifier = AdvancedConfig.getInstance().getDodgeDamageModifier();
|
public static double gracefulRollThreshold = AdvancedConfig.getInstance().getGracefulRollDamageThreshold();
|
||||||
public static double dodgeMaxChance = AdvancedConfig.getInstance().getDodgeChanceMax();
|
public static double dodgeDamageModifier = AdvancedConfig.getInstance().getDodgeDamageModifier();
|
||||||
|
|
||||||
public static int rollMaxBonusLevel = AdvancedConfig.getInstance().getRollMaxBonusLevel();
|
|
||||||
public static double rollThreshold = AdvancedConfig.getInstance().getRollDamageThreshold();
|
|
||||||
public static double rollMaxChance = AdvancedConfig.getInstance().getRollChanceMax();
|
|
||||||
|
|
||||||
public static int gracefulRollMaxBonusLevel = AdvancedConfig.getInstance().getGracefulRollMaxBonusLevel();
|
|
||||||
public static double gracefulRollThreshold = AdvancedConfig.getInstance().getGracefulRollDamageThreshold();
|
|
||||||
public static double gracefulRollMaxChance = AdvancedConfig.getInstance().getGracefulRollChanceMax();
|
|
||||||
|
|
||||||
public static int dodgeXpModifier = ExperienceConfig.getInstance().getDodgeXPModifier();
|
public static int dodgeXpModifier = ExperienceConfig.getInstance().getDodgeXPModifier();
|
||||||
public static int rollXpModifier = ExperienceConfig.getInstance().getRollXPModifier();
|
public static int rollXpModifier = ExperienceConfig.getInstance().getRollXPModifier();
|
||||||
|
@ -10,6 +10,7 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
|
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||||
|
import com.gmail.nossr50.datatypes.skills.SecondaryAbilityType;
|
||||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.skills.SkillManager;
|
import com.gmail.nossr50.skills.SkillManager;
|
||||||
@ -27,11 +28,11 @@ public class AcrobaticsManager extends SkillManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean canRoll() {
|
public boolean canRoll() {
|
||||||
return !exploitPrevention() && Permissions.roll(getPlayer());
|
return !exploitPrevention() && Permissions.secondaryAbilityEnabled(getPlayer(), SecondaryAbilityType.ROLL);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canDodge(Entity damager) {
|
public boolean canDodge(Entity damager) {
|
||||||
if (Permissions.dodge(getPlayer())) {
|
if (Permissions.secondaryAbilityEnabled(getPlayer(), SecondaryAbilityType.DODGE)) {
|
||||||
if (damager instanceof LightningStrike && Acrobatics.dodgeLightningDisabled) {
|
if (damager instanceof LightningStrike && Acrobatics.dodgeLightningDisabled) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -52,7 +53,7 @@ public class AcrobaticsManager extends SkillManager {
|
|||||||
double modifiedDamage = Acrobatics.calculateModifiedDodgeDamage(damage, Acrobatics.dodgeDamageModifier);
|
double modifiedDamage = Acrobatics.calculateModifiedDodgeDamage(damage, Acrobatics.dodgeDamageModifier);
|
||||||
Player player = getPlayer();
|
Player player = getPlayer();
|
||||||
|
|
||||||
if (!isFatal(modifiedDamage) && SkillUtils.activationSuccessful(getSkillLevel(), getActivationChance(), Acrobatics.dodgeMaxChance, Acrobatics.dodgeMaxBonusLevel)) {
|
if (!isFatal(modifiedDamage) && SkillUtils.activationSuccessful(SecondaryAbilityType.DODGE, player, getSkillLevel(), activationChance)) {
|
||||||
ParticleEffectUtils.playDodgeEffect(player);
|
ParticleEffectUtils.playDodgeEffect(player);
|
||||||
|
|
||||||
if (mcMMOPlayer.useChatNotifications()) {
|
if (mcMMOPlayer.useChatNotifications()) {
|
||||||
@ -79,13 +80,13 @@ public class AcrobaticsManager extends SkillManager {
|
|||||||
public double rollCheck(double damage) {
|
public double rollCheck(double damage) {
|
||||||
Player player = getPlayer();
|
Player player = getPlayer();
|
||||||
|
|
||||||
if (player.isSneaking() && Permissions.gracefulRoll(player)) {
|
if (player.isSneaking() && Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.GRACEFUL_ROLL)) {
|
||||||
return gracefulRollCheck(damage);
|
return gracefulRollCheck(damage);
|
||||||
}
|
}
|
||||||
|
|
||||||
double modifiedDamage = Acrobatics.calculateModifiedRollDamage(damage, Acrobatics.rollThreshold);
|
double modifiedDamage = Acrobatics.calculateModifiedRollDamage(damage, Acrobatics.rollThreshold);
|
||||||
|
|
||||||
if (!isFatal(modifiedDamage) && isSuccessfulRoll(Acrobatics.rollMaxChance, Acrobatics.rollMaxBonusLevel)) {
|
if (!isFatal(modifiedDamage) && SkillUtils.activationSuccessful(SecondaryAbilityType.ROLL, player, getSkillLevel(), activationChance)) {
|
||||||
player.sendMessage(LocaleLoader.getString("Acrobatics.Roll.Text"));
|
player.sendMessage(LocaleLoader.getString("Acrobatics.Roll.Text"));
|
||||||
applyXpGain(calculateRollXP(damage, true));
|
applyXpGain(calculateRollXP(damage, true));
|
||||||
|
|
||||||
@ -109,7 +110,7 @@ public class AcrobaticsManager extends SkillManager {
|
|||||||
private double gracefulRollCheck(double damage) {
|
private double gracefulRollCheck(double damage) {
|
||||||
double modifiedDamage = Acrobatics.calculateModifiedRollDamage(damage, Acrobatics.gracefulRollThreshold);
|
double modifiedDamage = Acrobatics.calculateModifiedRollDamage(damage, Acrobatics.gracefulRollThreshold);
|
||||||
|
|
||||||
if (!isFatal(modifiedDamage) && isSuccessfulRoll(Acrobatics.gracefulRollMaxChance, Acrobatics.gracefulRollMaxBonusLevel)) {
|
if (!isFatal(modifiedDamage) && SkillUtils.activationSuccessful(SecondaryAbilityType.GRACEFUL_ROLL, getPlayer(), getSkillLevel(), activationChance)) {
|
||||||
getPlayer().sendMessage(LocaleLoader.getString("Acrobatics.Ability.Proc"));
|
getPlayer().sendMessage(LocaleLoader.getString("Acrobatics.Ability.Proc"));
|
||||||
applyXpGain(calculateRollXP(damage, true));
|
applyXpGain(calculateRollXP(damage, true));
|
||||||
|
|
||||||
@ -149,10 +150,6 @@ public class AcrobaticsManager extends SkillManager {
|
|||||||
return fallTries > Config.getInstance().getAcrobaticsAFKMaxTries();
|
return fallTries > Config.getInstance().getAcrobaticsAFKMaxTries();
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isSuccessfulRoll(double maxChance, int maxLevel) {
|
|
||||||
return (maxChance / maxLevel) * Math.min(getSkillLevel(), maxLevel) > Misc.getRandom().nextInt(activationChance);
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean isFatal(double damage) {
|
private boolean isFatal(double damage) {
|
||||||
return getPlayer().getHealth() - damage < 1;
|
return getPlayer().getHealth() - damage < 1;
|
||||||
}
|
}
|
||||||
|
@ -16,17 +16,12 @@ import com.gmail.nossr50.util.Misc;
|
|||||||
public class Archery {
|
public class Archery {
|
||||||
private static List<TrackedEntity> trackedEntities = new ArrayList<TrackedEntity>();
|
private static List<TrackedEntity> trackedEntities = new ArrayList<TrackedEntity>();
|
||||||
|
|
||||||
public static int retrieveMaxBonusLevel = AdvancedConfig.getInstance().getRetrieveMaxBonusLevel();
|
|
||||||
public static double retrieveMaxChance = AdvancedConfig.getInstance().getRetrieveChanceMax();
|
|
||||||
|
|
||||||
public static int skillShotIncreaseLevel = AdvancedConfig.getInstance().getSkillShotIncreaseLevel();
|
public static int skillShotIncreaseLevel = AdvancedConfig.getInstance().getSkillShotIncreaseLevel();
|
||||||
public static double skillShotIncreasePercentage = AdvancedConfig.getInstance().getSkillShotIncreasePercentage();
|
public static double skillShotIncreasePercentage = AdvancedConfig.getInstance().getSkillShotIncreasePercentage();
|
||||||
public static double skillShotMaxBonusPercentage = AdvancedConfig.getInstance().getSkillShotBonusMax();
|
public static double skillShotMaxBonusPercentage = AdvancedConfig.getInstance().getSkillShotBonusMax();
|
||||||
public static double skillShotMaxBonusDamage = AdvancedConfig.getInstance().getSkillShotDamageMax();
|
public static double skillShotMaxBonusDamage = AdvancedConfig.getInstance().getSkillShotDamageMax();
|
||||||
|
|
||||||
public static int dazeMaxBonusLevel = AdvancedConfig.getInstance().getDazeMaxBonusLevel();
|
|
||||||
public static double dazeModifier = AdvancedConfig.getInstance().getDazeModifier();
|
public static double dazeModifier = AdvancedConfig.getInstance().getDazeModifier();
|
||||||
public static double dazeMaxBonus = AdvancedConfig.getInstance().getDazeBonusMax();
|
|
||||||
|
|
||||||
public static final double DISTANCE_XP_MULTIPLIER = 0.025;
|
public static final double DISTANCE_XP_MULTIPLIER = 0.025;
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ import org.bukkit.potion.PotionEffectType;
|
|||||||
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||||
|
import com.gmail.nossr50.datatypes.skills.SecondaryAbilityType;
|
||||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.skills.SkillManager;
|
import com.gmail.nossr50.skills.SkillManager;
|
||||||
@ -26,15 +27,15 @@ public class ArcheryManager extends SkillManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean canDaze(LivingEntity target) {
|
public boolean canDaze(LivingEntity target) {
|
||||||
return target instanceof Player && Permissions.daze(getPlayer());
|
return target instanceof Player && Permissions.secondaryAbilityEnabled(getPlayer(), SecondaryAbilityType.DAZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canSkillShot() {
|
public boolean canSkillShot() {
|
||||||
return getSkillLevel() >= Archery.skillShotIncreaseLevel && Permissions.bonusDamage(getPlayer(), skill);
|
return getSkillLevel() >= Archery.skillShotIncreaseLevel && Permissions.secondaryAbilityEnabled(getPlayer(), SecondaryAbilityType.SKILL_SHOT);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canTrackArrows() {
|
public boolean canRetrieveArrows() {
|
||||||
return Permissions.arrowRetrieval(getPlayer());
|
return Permissions.secondaryAbilityEnabled(getPlayer(), SecondaryAbilityType.RETRIEVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -59,8 +60,8 @@ public class ArcheryManager extends SkillManager {
|
|||||||
*
|
*
|
||||||
* @param target The {@link LivingEntity} damaged by the arrow
|
* @param target The {@link LivingEntity} damaged by the arrow
|
||||||
*/
|
*/
|
||||||
public void trackArrows(LivingEntity target) {
|
public void retrieveArrows(LivingEntity target) {
|
||||||
if (SkillUtils.activationSuccessful(getSkillLevel(), getActivationChance(), Archery.retrieveMaxChance, Archery.retrieveMaxBonusLevel)) {
|
if (SkillUtils.activationSuccessful(SecondaryAbilityType.RETRIEVE, getPlayer(), getSkillLevel(), activationChance)) {
|
||||||
Archery.incrementTrackerValue(target);
|
Archery.incrementTrackerValue(target);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -72,7 +73,7 @@ public class ArcheryManager extends SkillManager {
|
|||||||
* @param arrow The {@link Arrow} that was fired
|
* @param arrow The {@link Arrow} that was fired
|
||||||
*/
|
*/
|
||||||
public double daze(Player defender, Arrow arrow) {
|
public double daze(Player defender, Arrow arrow) {
|
||||||
if (!SkillUtils.activationSuccessful(getSkillLevel(), getActivationChance(), Archery.dazeMaxBonus, Archery.dazeMaxBonusLevel)) {
|
if (!SkillUtils.activationSuccessful(SecondaryAbilityType.DAZE, getPlayer(), getSkillLevel(), activationChance)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,13 +7,11 @@ import com.gmail.nossr50.config.AdvancedConfig;
|
|||||||
import com.gmail.nossr50.util.ItemUtils;
|
import com.gmail.nossr50.util.ItemUtils;
|
||||||
|
|
||||||
public class Axes {
|
public class Axes {
|
||||||
public static double bonusDamageMaxBonus = AdvancedConfig.getInstance().getBonusDamageAxesBonusMax();
|
public static double axeMasteryMaxBonus = AdvancedConfig.getInstance().getAxeMasteryBonusMax();
|
||||||
public static int bonusDamageMaxBonusLevel = AdvancedConfig.getInstance().getBonusDamageAxesMaxBonusLevel();
|
public static int axeMasteryMaxBonusLevel = AdvancedConfig.getInstance().getAxeMasteryMaxBonusLevel();
|
||||||
|
|
||||||
public static int criticalHitMaxBonusLevel = AdvancedConfig.getInstance().getAxesCriticalMaxBonusLevel();
|
public static double criticalHitPVPModifier = AdvancedConfig.getInstance().getCriticalHitPVPModifier();
|
||||||
public static double criticalHitMaxChance = AdvancedConfig.getInstance().getAxesCriticalChance();
|
public static double criticalHitPVEModifier = AdvancedConfig.getInstance().getCriticalHitPVEModifier();
|
||||||
public static double criticalHitPVPModifier = AdvancedConfig.getInstance().getAxesCriticalPVPModifier();
|
|
||||||
public static double criticalHitPVEModifier = AdvancedConfig.getInstance().getAxesCriticalPVEModifier();
|
|
||||||
|
|
||||||
public static int impactIncreaseLevel = AdvancedConfig.getInstance().getArmorImpactIncreaseLevel();
|
public static int impactIncreaseLevel = AdvancedConfig.getInstance().getArmorImpactIncreaseLevel();
|
||||||
public static double impactChance = AdvancedConfig.getInstance().getImpactChance();
|
public static double impactChance = AdvancedConfig.getInstance().getImpactChance();
|
||||||
|
@ -4,10 +4,13 @@ import org.bukkit.entity.LivingEntity;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||||
import com.gmail.nossr50.datatypes.skills.AbilityType;
|
import com.gmail.nossr50.datatypes.skills.AbilityType;
|
||||||
|
import com.gmail.nossr50.datatypes.skills.SecondaryAbilityType;
|
||||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||||
import com.gmail.nossr50.datatypes.skills.ToolType;
|
import com.gmail.nossr50.datatypes.skills.ToolType;
|
||||||
|
import com.gmail.nossr50.events.skills.secondaryabilities.SecondaryAbilityWeightedActivationCheckEvent;
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.skills.SkillManager;
|
import com.gmail.nossr50.skills.SkillManager;
|
||||||
import com.gmail.nossr50.util.ItemUtils;
|
import com.gmail.nossr50.util.ItemUtils;
|
||||||
@ -24,19 +27,19 @@ public class AxesManager extends SkillManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean canUseAxeMastery() {
|
public boolean canUseAxeMastery() {
|
||||||
return Permissions.bonusDamage(getPlayer(), skill);
|
return Permissions.secondaryAbilityEnabled(getPlayer(), SecondaryAbilityType.AXE_MASTERY);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canCriticalHit(LivingEntity target) {
|
public boolean canCriticalHit(LivingEntity target) {
|
||||||
return target.isValid() && Permissions.criticalStrikes(getPlayer());
|
return target.isValid() && Permissions.secondaryAbilityEnabled(getPlayer(), SecondaryAbilityType.CRITICAL_HIT);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canImpact(LivingEntity target) {
|
public boolean canImpact(LivingEntity target) {
|
||||||
return target.isValid() && Permissions.armorImpact(getPlayer()) && Axes.hasArmor(target);
|
return target.isValid() && Permissions.secondaryAbilityEnabled(getPlayer(), SecondaryAbilityType.ARMOR_IMPACT) && Axes.hasArmor(target);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canGreaterImpact(LivingEntity target) {
|
public boolean canGreaterImpact(LivingEntity target) {
|
||||||
return target.isValid() && Permissions.greaterImpact(getPlayer()) && !Axes.hasArmor(target);
|
return target.isValid() && Permissions.secondaryAbilityEnabled(getPlayer(), SecondaryAbilityType.GREATER_IMPACT) && !Axes.hasArmor(target);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canUseSkullSplitter(LivingEntity target) {
|
public boolean canUseSkullSplitter(LivingEntity target) {
|
||||||
@ -53,7 +56,7 @@ public class AxesManager extends SkillManager {
|
|||||||
* @param target The {@link LivingEntity} being affected by the ability
|
* @param target The {@link LivingEntity} being affected by the ability
|
||||||
*/
|
*/
|
||||||
public double axeMastery(LivingEntity target) {
|
public double axeMastery(LivingEntity target) {
|
||||||
double axeBonus = Math.min(getSkillLevel() / (Axes.bonusDamageMaxBonusLevel / Axes.bonusDamageMaxBonus), Axes.bonusDamageMaxBonus);
|
double axeBonus = Math.min(getSkillLevel() / (Axes.axeMasteryMaxBonusLevel / Axes.axeMasteryMaxBonus), Axes.axeMasteryMaxBonus);
|
||||||
|
|
||||||
return CombatUtils.callFakeDamageEvent(getPlayer(), target, axeBonus);
|
return CombatUtils.callFakeDamageEvent(getPlayer(), target, axeBonus);
|
||||||
}
|
}
|
||||||
@ -65,7 +68,7 @@ public class AxesManager extends SkillManager {
|
|||||||
* @param damage The amount of damage initially dealt by the event
|
* @param damage The amount of damage initially dealt by the event
|
||||||
*/
|
*/
|
||||||
public double criticalHit(LivingEntity target, double damage) {
|
public double criticalHit(LivingEntity target, double damage) {
|
||||||
if (!SkillUtils.activationSuccessful(getSkillLevel(), getActivationChance(), Axes.criticalHitMaxChance, Axes.criticalHitMaxBonusLevel)) {
|
if (!SkillUtils.activationSuccessful(SecondaryAbilityType.CRITICAL_HIT, getPlayer(), getSkillLevel(), activationChance)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -94,8 +97,13 @@ public class AxesManager extends SkillManager {
|
|||||||
int durabilityDamage = 1 + (getSkillLevel() / Axes.impactIncreaseLevel);
|
int durabilityDamage = 1 + (getSkillLevel() / Axes.impactIncreaseLevel);
|
||||||
|
|
||||||
for (ItemStack armor : target.getEquipment().getArmorContents()) {
|
for (ItemStack armor : target.getEquipment().getArmorContents()) {
|
||||||
if (ItemUtils.isArmor(armor) && Axes.impactChance > Misc.getRandom().nextInt(getActivationChance())) {
|
if (ItemUtils.isArmor(armor)) {
|
||||||
SkillUtils.handleDurabilityChange(armor, durabilityDamage, Axes.impactMaxDurabilityModifier);
|
double chance = Axes.impactChance / activationChance;
|
||||||
|
SecondaryAbilityWeightedActivationCheckEvent event = new SecondaryAbilityWeightedActivationCheckEvent(getPlayer(), SecondaryAbilityType.ARMOR_IMPACT, chance);
|
||||||
|
mcMMO.p.getServer().getPluginManager().callEvent(event);
|
||||||
|
if ((event.getChance() * activationChance) > Misc.getRandom().nextInt(activationChance)) {
|
||||||
|
SkillUtils.handleDurabilityChange(armor, durabilityDamage, Axes.impactMaxDurabilityModifier);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -106,7 +114,10 @@ public class AxesManager extends SkillManager {
|
|||||||
* @param target The {@link LivingEntity} being affected by the ability
|
* @param target The {@link LivingEntity} being affected by the ability
|
||||||
*/
|
*/
|
||||||
public double greaterImpact(LivingEntity target) {
|
public double greaterImpact(LivingEntity target) {
|
||||||
if (!(Axes.greaterImpactChance > Misc.getRandom().nextInt(getActivationChance()))) {
|
double chance = Axes.greaterImpactChance / activationChance;
|
||||||
|
SecondaryAbilityWeightedActivationCheckEvent event = new SecondaryAbilityWeightedActivationCheckEvent(getPlayer(), SecondaryAbilityType.GREATER_IMPACT, chance);
|
||||||
|
mcMMO.p.getServer().getPluginManager().callEvent(event);
|
||||||
|
if ((event.getChance() * activationChance) <= Misc.getRandom().nextInt(activationChance)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ import org.bukkit.block.BlockState;
|
|||||||
|
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||||
|
import com.gmail.nossr50.datatypes.skills.SecondaryAbilityType;
|
||||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||||
import com.gmail.nossr50.datatypes.treasure.ExcavationTreasure;
|
import com.gmail.nossr50.datatypes.treasure.ExcavationTreasure;
|
||||||
import com.gmail.nossr50.skills.SkillManager;
|
import com.gmail.nossr50.skills.SkillManager;
|
||||||
@ -27,7 +28,7 @@ public class ExcavationManager extends SkillManager {
|
|||||||
public void excavationBlockCheck(BlockState blockState) {
|
public void excavationBlockCheck(BlockState blockState) {
|
||||||
int xp = Excavation.getBlockXP(blockState);
|
int xp = Excavation.getBlockXP(blockState);
|
||||||
|
|
||||||
if (Permissions.excavationTreasureHunter(getPlayer())) {
|
if (Permissions.secondaryAbilityEnabled(getPlayer(), SecondaryAbilityType.EXCAVATION_TREASURE_HUNTER)) {
|
||||||
List<ExcavationTreasure> treasures = Excavation.getTreasures(blockState);
|
List<ExcavationTreasure> treasures = Excavation.getTreasures(blockState);
|
||||||
|
|
||||||
if (!treasures.isEmpty()) {
|
if (!treasures.isEmpty()) {
|
||||||
@ -35,7 +36,7 @@ public class ExcavationManager extends SkillManager {
|
|||||||
Location location = blockState.getLocation();
|
Location location = blockState.getLocation();
|
||||||
|
|
||||||
for (ExcavationTreasure treasure : treasures) {
|
for (ExcavationTreasure treasure : treasures) {
|
||||||
if (skillLevel >= treasure.getDropLevel() && SkillUtils.treasureDropSuccessful(treasure.getDropChance(), activationChance)) {
|
if (skillLevel >= treasure.getDropLevel() && SkillUtils.treasureDropSuccessful(getPlayer(), treasure.getDropChance(), activationChance)) {
|
||||||
xp += treasure.getXp();
|
xp += treasure.getXp();
|
||||||
Misc.dropItem(location, treasure.getDrop());
|
Misc.dropItem(location, treasure.getDrop());
|
||||||
}
|
}
|
||||||
|
@ -41,6 +41,7 @@ import com.gmail.nossr50.config.Config;
|
|||||||
import com.gmail.nossr50.config.experience.ExperienceConfig;
|
import com.gmail.nossr50.config.experience.ExperienceConfig;
|
||||||
import com.gmail.nossr50.config.treasure.TreasureConfig;
|
import com.gmail.nossr50.config.treasure.TreasureConfig;
|
||||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||||
|
import com.gmail.nossr50.datatypes.skills.SecondaryAbilityType;
|
||||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||||
import com.gmail.nossr50.datatypes.treasure.EnchantmentTreasure;
|
import com.gmail.nossr50.datatypes.treasure.EnchantmentTreasure;
|
||||||
import com.gmail.nossr50.datatypes.treasure.FishingTreasure;
|
import com.gmail.nossr50.datatypes.treasure.FishingTreasure;
|
||||||
@ -48,6 +49,7 @@ import com.gmail.nossr50.datatypes.treasure.Rarity;
|
|||||||
import com.gmail.nossr50.datatypes.treasure.ShakeTreasure;
|
import com.gmail.nossr50.datatypes.treasure.ShakeTreasure;
|
||||||
import com.gmail.nossr50.events.skills.fishing.McMMOPlayerFishingTreasureEvent;
|
import com.gmail.nossr50.events.skills.fishing.McMMOPlayerFishingTreasureEvent;
|
||||||
import com.gmail.nossr50.events.skills.fishing.McMMOPlayerShakeEvent;
|
import com.gmail.nossr50.events.skills.fishing.McMMOPlayerShakeEvent;
|
||||||
|
import com.gmail.nossr50.events.skills.secondaryabilities.SecondaryAbilityWeightedActivationCheckEvent;
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.runnables.skills.KrakenAttackTask;
|
import com.gmail.nossr50.runnables.skills.KrakenAttackTask;
|
||||||
import com.gmail.nossr50.skills.SkillManager;
|
import com.gmail.nossr50.skills.SkillManager;
|
||||||
@ -74,11 +76,11 @@ public class FishingManager extends SkillManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean canShake(Entity target) {
|
public boolean canShake(Entity target) {
|
||||||
return target instanceof LivingEntity && getSkillLevel() >= Tier.ONE.getLevel() && Permissions.shake(getPlayer());
|
return target instanceof LivingEntity && getSkillLevel() >= Tier.ONE.getLevel() && Permissions.secondaryAbilityEnabled(getPlayer(), SecondaryAbilityType.SHAKE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canMasterAngler() {
|
public boolean canMasterAngler() {
|
||||||
return getSkillLevel() >= AdvancedConfig.getInstance().getMasterAnglerUnlockLevel() && Permissions.masterAngler(getPlayer());
|
return getSkillLevel() >= AdvancedConfig.getInstance().getMasterAnglerUnlockLevel() && Permissions.secondaryAbilityEnabled(getPlayer(), SecondaryAbilityType.MASTER_ANGLER);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean unleashTheKraken() {
|
public boolean unleashTheKraken() {
|
||||||
@ -205,7 +207,7 @@ public class FishingManager extends SkillManager {
|
|||||||
|
|
||||||
Player player = getPlayer();
|
Player player = getPlayer();
|
||||||
|
|
||||||
if (!Permissions.iceFishing(player)) {
|
if (!Permissions.secondaryAbilityEnabled(getPlayer(), SecondaryAbilityType.ICE_FISHING)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -306,7 +308,7 @@ public class FishingManager extends SkillManager {
|
|||||||
Player player = getPlayer();
|
Player player = getPlayer();
|
||||||
FishingTreasure treasure = null;
|
FishingTreasure treasure = null;
|
||||||
|
|
||||||
if (Config.getInstance().getFishingDropsEnabled() && Permissions.fishingTreasureHunter(player)) {
|
if (Config.getInstance().getFishingDropsEnabled() && Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.FISHING_TREASURE_HUNTER)) {
|
||||||
treasure = getFishingTreasure();
|
treasure = getFishingTreasure();
|
||||||
this.fishingCatch = null;
|
this.fishingCatch = null;
|
||||||
}
|
}
|
||||||
@ -317,7 +319,7 @@ public class FishingManager extends SkillManager {
|
|||||||
ItemStack treasureDrop = treasure.getDrop().clone(); // Not cloning is bad, m'kay?
|
ItemStack treasureDrop = treasure.getDrop().clone(); // Not cloning is bad, m'kay?
|
||||||
Map<Enchantment, Integer> enchants = new HashMap<Enchantment, Integer>();
|
Map<Enchantment, Integer> enchants = new HashMap<Enchantment, Integer>();
|
||||||
|
|
||||||
if (Permissions.magicHunter(player) && ItemUtils.isEnchantable(treasureDrop)) {
|
if (Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.MAGIC_HUNTER) && ItemUtils.isEnchantable(treasureDrop)) {
|
||||||
enchants = handleMagicHunter(treasureDrop);
|
enchants = handleMagicHunter(treasureDrop);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -375,7 +377,9 @@ public class FishingManager extends SkillManager {
|
|||||||
public void shakeCheck(LivingEntity target) {
|
public void shakeCheck(LivingEntity target) {
|
||||||
fishingTries--; // Because autoclicking to shake is OK.
|
fishingTries--; // Because autoclicking to shake is OK.
|
||||||
|
|
||||||
if (getShakeProbability() > Misc.getRandom().nextInt(getActivationChance())) {
|
SecondaryAbilityWeightedActivationCheckEvent activationEvent = new SecondaryAbilityWeightedActivationCheckEvent(getPlayer(), SecondaryAbilityType.SHAKE, getShakeProbability() / activationChance);
|
||||||
|
mcMMO.p.getServer().getPluginManager().callEvent(activationEvent);
|
||||||
|
if ((activationEvent.getChance() * activationChance) > Misc.getRandom().nextInt(activationChance)) {
|
||||||
List<ShakeTreasure> possibleDrops = Fishing.findPossibleDrops(target);
|
List<ShakeTreasure> possibleDrops = Fishing.findPossibleDrops(target);
|
||||||
|
|
||||||
if (possibleDrops == null || possibleDrops.isEmpty()) {
|
if (possibleDrops == null || possibleDrops.isEmpty()) {
|
||||||
@ -425,11 +429,11 @@ public class FishingManager extends SkillManager {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
McMMOPlayerShakeEvent event = new McMMOPlayerShakeEvent(getPlayer(), drop);
|
McMMOPlayerShakeEvent shakeEvent = new McMMOPlayerShakeEvent(getPlayer(), drop);
|
||||||
|
|
||||||
drop = event.getDrop();
|
drop = shakeEvent.getDrop();
|
||||||
|
|
||||||
if (event.isCancelled() || drop == null) {
|
if (shakeEvent.isCancelled() || drop == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,18 +17,6 @@ public class Herbalism {
|
|||||||
public static int greenThumbStageChangeLevel = AdvancedConfig.getInstance().getGreenThumbStageChange();
|
public static int greenThumbStageChangeLevel = AdvancedConfig.getInstance().getGreenThumbStageChange();
|
||||||
public static int greenThumbStageMaxLevel = greenThumbStageChangeLevel * 4;
|
public static int greenThumbStageMaxLevel = greenThumbStageChangeLevel * 4;
|
||||||
|
|
||||||
public static int greenThumbMaxLevel = AdvancedConfig.getInstance().getGreenThumbMaxLevel();
|
|
||||||
public static double greenThumbMaxChance = AdvancedConfig.getInstance().getGreenThumbChanceMax();
|
|
||||||
|
|
||||||
public static int doubleDropsMaxLevel = AdvancedConfig.getInstance().getHerbalismDoubleDropsMaxLevel();
|
|
||||||
public static double doubleDropsMaxChance = AdvancedConfig.getInstance().getHerbalismDoubleDropsChanceMax();
|
|
||||||
|
|
||||||
public static int hylianLuckMaxLevel = AdvancedConfig.getInstance().getHylianLuckMaxLevel();
|
|
||||||
public static double hylianLuckMaxChance = AdvancedConfig.getInstance().getHylianLuckChanceMax();
|
|
||||||
|
|
||||||
public static int shroomThumbMaxLevel = AdvancedConfig.getInstance().getShroomThumbMaxLevel();
|
|
||||||
public static double shroomThumbMaxChance = AdvancedConfig.getInstance().getShroomThumbChanceMax();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert blocks affected by the Green Thumb & Green Terra abilities.
|
* Convert blocks affected by the Green Thumb & Green Terra abilities.
|
||||||
*
|
*
|
||||||
|
@ -23,6 +23,7 @@ import com.gmail.nossr50.config.treasure.TreasureConfig;
|
|||||||
import com.gmail.nossr50.datatypes.mods.CustomBlock;
|
import com.gmail.nossr50.datatypes.mods.CustomBlock;
|
||||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||||
import com.gmail.nossr50.datatypes.skills.AbilityType;
|
import com.gmail.nossr50.datatypes.skills.AbilityType;
|
||||||
|
import com.gmail.nossr50.datatypes.skills.SecondaryAbilityType;
|
||||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||||
import com.gmail.nossr50.datatypes.skills.ToolType;
|
import com.gmail.nossr50.datatypes.skills.ToolType;
|
||||||
import com.gmail.nossr50.datatypes.treasure.HylianTreasure;
|
import com.gmail.nossr50.datatypes.treasure.HylianTreasure;
|
||||||
@ -56,11 +57,11 @@ public class HerbalismManager extends SkillManager {
|
|||||||
Player player = getPlayer();
|
Player player = getPlayer();
|
||||||
Material itemType = player.getItemInHand().getType();
|
Material itemType = player.getItemInHand().getType();
|
||||||
|
|
||||||
return (itemType == Material.RED_MUSHROOM || itemType == Material.BROWN_MUSHROOM) && BlockUtils.canMakeShroomy(blockState) && Permissions.shroomThumb(player);
|
return (itemType == Material.RED_MUSHROOM || itemType == Material.BROWN_MUSHROOM) && BlockUtils.canMakeShroomy(blockState) && Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.SHROOM_THUMB);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canUseHylianLuck() {
|
public boolean canUseHylianLuck() {
|
||||||
return Permissions.hylianLuck(getPlayer());
|
return Permissions.secondaryAbilityEnabled(getPlayer(), SecondaryAbilityType.HYLIAN_LUCK);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canGreenTerraBlock(BlockState blockState) {
|
public boolean canGreenTerraBlock(BlockState blockState) {
|
||||||
@ -140,7 +141,7 @@ public class HerbalismManager extends SkillManager {
|
|||||||
CustomBlock customBlock = ModUtils.getCustomBlock(blockState);
|
CustomBlock customBlock = ModUtils.getCustomBlock(blockState);
|
||||||
xp = customBlock.getXpGain();
|
xp = customBlock.getXpGain();
|
||||||
|
|
||||||
if (Permissions.doubleDrops(player, skill) && customBlock.isDoubleDropEnabled()) {
|
if (Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.HERBALISM_DOUBLE_DROPS) && customBlock.isDoubleDropEnabled()) {
|
||||||
drops = blockState.getBlock().getDrops();
|
drops = blockState.getBlock().getDrops();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -151,7 +152,7 @@ public class HerbalismManager extends SkillManager {
|
|||||||
|
|
||||||
xp = ExperienceConfig.getInstance().getXp(skill, material);
|
xp = ExperienceConfig.getInstance().getXp(skill, material);
|
||||||
|
|
||||||
if (Config.getInstance().getDoubleDropsEnabled(skill, material) && Permissions.doubleDrops(player, skill)) {
|
if (Config.getInstance().getDoubleDropsEnabled(skill, material) && Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.HERBALISM_DOUBLE_DROPS)) {
|
||||||
drops = blockState.getBlock().getDrops();
|
drops = blockState.getBlock().getDrops();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -168,7 +169,7 @@ public class HerbalismManager extends SkillManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (int i = greenTerra ? 2 : 1; i != 0; i--) {
|
for (int i = greenTerra ? 2 : 1; i != 0; i--) {
|
||||||
if (SkillUtils.activationSuccessful(getSkillLevel(), getActivationChance(), Herbalism.doubleDropsMaxChance, Herbalism.doubleDropsMaxLevel)) {
|
if (SkillUtils.activationSuccessful(SecondaryAbilityType.HERBALISM_DOUBLE_DROPS, getPlayer(), getSkillLevel(), activationChance)) {
|
||||||
for (ItemStack item : drops) {
|
for (ItemStack item : drops) {
|
||||||
Misc.dropItems(blockState.getLocation(), item, amount);
|
Misc.dropItems(blockState.getLocation(), item, amount);
|
||||||
}
|
}
|
||||||
@ -183,7 +184,7 @@ public class HerbalismManager extends SkillManager {
|
|||||||
* @return true if the ability was successful, false otherwise
|
* @return true if the ability was successful, false otherwise
|
||||||
*/
|
*/
|
||||||
public boolean processGreenThumbBlocks(BlockState blockState) {
|
public boolean processGreenThumbBlocks(BlockState blockState) {
|
||||||
if (!SkillUtils.activationSuccessful(getSkillLevel(), getActivationChance(), Herbalism.greenThumbMaxChance, Herbalism.greenThumbMaxLevel)) {
|
if (!SkillUtils.activationSuccessful(SecondaryAbilityType.GREEN_THUMB_BLOCK, getPlayer(), getSkillLevel(), activationChance)) {
|
||||||
getPlayer().sendMessage(LocaleLoader.getString("Herbalism.Ability.GTh.Fail"));
|
getPlayer().sendMessage(LocaleLoader.getString("Herbalism.Ability.GTh.Fail"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -198,7 +199,7 @@ public class HerbalismManager extends SkillManager {
|
|||||||
* @return true if the ability was successful, false otherwise
|
* @return true if the ability was successful, false otherwise
|
||||||
*/
|
*/
|
||||||
public boolean processHylianLuck(BlockState blockState) {
|
public boolean processHylianLuck(BlockState blockState) {
|
||||||
if (!SkillUtils.activationSuccessful(getSkillLevel(), getActivationChance(), Herbalism.hylianLuckMaxChance, Herbalism.hylianLuckMaxLevel)) {
|
if (!SkillUtils.activationSuccessful(SecondaryAbilityType.HYLIAN_LUCK, getPlayer(), getSkillLevel(), activationChance)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -266,7 +267,7 @@ public class HerbalismManager extends SkillManager {
|
|||||||
playerInventory.removeItem(new ItemStack(Material.RED_MUSHROOM));
|
playerInventory.removeItem(new ItemStack(Material.RED_MUSHROOM));
|
||||||
player.updateInventory();
|
player.updateInventory();
|
||||||
|
|
||||||
if (!SkillUtils.activationSuccessful(getSkillLevel(), getActivationChance(), Herbalism.shroomThumbMaxChance, Herbalism.shroomThumbMaxLevel)) {
|
if (!SkillUtils.activationSuccessful(SecondaryAbilityType.SHROOM_THUMB, getPlayer(), getSkillLevel(), activationChance)) {
|
||||||
player.sendMessage(LocaleLoader.getString("Herbalism.Ability.ShroomThumb.Fail"));
|
player.sendMessage(LocaleLoader.getString("Herbalism.Ability.ShroomThumb.Fail"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -310,7 +311,7 @@ public class HerbalismManager extends SkillManager {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!greenTerra && !SkillUtils.activationSuccessful(getSkillLevel(), getActivationChance(), Herbalism.greenThumbMaxChance, Herbalism.greenThumbMaxLevel)) {
|
if (!greenTerra && !SkillUtils.activationSuccessful(SecondaryAbilityType.GREEN_THUMB_PLANT, getPlayer(), getSkillLevel(), activationChance)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,7 +4,6 @@ import org.bukkit.Material;
|
|||||||
import org.bukkit.block.BlockState;
|
import org.bukkit.block.BlockState;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
import com.gmail.nossr50.config.AdvancedConfig;
|
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.config.experience.ExperienceConfig;
|
import com.gmail.nossr50.config.experience.ExperienceConfig;
|
||||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||||
@ -12,8 +11,6 @@ import com.gmail.nossr50.util.Misc;
|
|||||||
import com.gmail.nossr50.util.ModUtils;
|
import com.gmail.nossr50.util.ModUtils;
|
||||||
|
|
||||||
public class Mining {
|
public class Mining {
|
||||||
public static int doubleDropsMaxLevel = AdvancedConfig.getInstance().getMiningDoubleDropMaxLevel();
|
|
||||||
public static double doubleDropsMaxChance = AdvancedConfig.getInstance().getMiningDoubleDropChance();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculate XP gain for Mining.
|
* Calculate XP gain for Mining.
|
||||||
|
@ -15,6 +15,7 @@ import com.gmail.nossr50.mcMMO;
|
|||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||||
import com.gmail.nossr50.datatypes.skills.AbilityType;
|
import com.gmail.nossr50.datatypes.skills.AbilityType;
|
||||||
|
import com.gmail.nossr50.datatypes.skills.SecondaryAbilityType;
|
||||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.runnables.skills.AbilityCooldownTask;
|
import com.gmail.nossr50.runnables.skills.AbilityCooldownTask;
|
||||||
@ -60,7 +61,7 @@ public class MiningManager extends SkillManager {
|
|||||||
|
|
||||||
applyXpGain(Mining.getBlockXp(blockState));
|
applyXpGain(Mining.getBlockXp(blockState));
|
||||||
|
|
||||||
if (!Permissions.doubleDrops(player, skill)) {
|
if (!Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.MINING_DOUBLE_DROPS)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,7 +78,7 @@ public class MiningManager extends SkillManager {
|
|||||||
boolean silkTouch = player.getItemInHand().containsEnchantment(Enchantment.SILK_TOUCH);
|
boolean silkTouch = player.getItemInHand().containsEnchantment(Enchantment.SILK_TOUCH);
|
||||||
|
|
||||||
for (int i = mcMMOPlayer.getAbilityMode(skill.getAbility()) ? 2 : 1; i != 0; i--) {
|
for (int i = mcMMOPlayer.getAbilityMode(skill.getAbility()) ? 2 : 1; i != 0; i--) {
|
||||||
if (SkillUtils.activationSuccessful(getSkillLevel(), getActivationChance(), Mining.doubleDropsMaxChance, Mining.doubleDropsMaxLevel)) {
|
if (SkillUtils.activationSuccessful(SecondaryAbilityType.MINING_DOUBLE_DROPS, getPlayer(), getSkillLevel(), activationChance)) {
|
||||||
if (silkTouch) {
|
if (silkTouch) {
|
||||||
Mining.handleSilkTouchDrops(blockState);
|
Mining.handleSilkTouchDrops(blockState);
|
||||||
}
|
}
|
||||||
|
@ -19,9 +19,6 @@ public class Repair {
|
|||||||
public static int repairMasteryMaxBonusLevel = AdvancedConfig.getInstance().getRepairMasteryMaxLevel();
|
public static int repairMasteryMaxBonusLevel = AdvancedConfig.getInstance().getRepairMasteryMaxLevel();
|
||||||
public static double repairMasteryMaxBonus = AdvancedConfig.getInstance().getRepairMasteryMaxBonus();
|
public static double repairMasteryMaxBonus = AdvancedConfig.getInstance().getRepairMasteryMaxBonus();
|
||||||
|
|
||||||
public static int superRepairMaxBonusLevel = AdvancedConfig.getInstance().getSuperRepairMaxLevel();
|
|
||||||
public static double superRepairMaxChance = AdvancedConfig.getInstance().getSuperRepairChanceMax();
|
|
||||||
|
|
||||||
public static int salvageUnlockLevel = AdvancedConfig.getInstance().getSalvageUnlockLevel();
|
public static int salvageUnlockLevel = AdvancedConfig.getInstance().getSalvageUnlockLevel();
|
||||||
|
|
||||||
public static Material salvageAnvilMaterial = Config.getInstance().getSalvageAnvilMaterial();
|
public static Material salvageAnvilMaterial = Config.getInstance().getSalvageAnvilMaterial();
|
||||||
|
@ -16,6 +16,7 @@ import com.gmail.nossr50.mcMMO;
|
|||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.config.experience.ExperienceConfig;
|
import com.gmail.nossr50.config.experience.ExperienceConfig;
|
||||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||||
|
import com.gmail.nossr50.datatypes.skills.SecondaryAbilityType;
|
||||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.skills.SkillManager;
|
import com.gmail.nossr50.skills.SkillManager;
|
||||||
@ -273,12 +274,12 @@ public class RepairManager extends SkillManager {
|
|||||||
private short repairCalculate(short durability, int repairAmount) {
|
private short repairCalculate(short durability, int repairAmount) {
|
||||||
Player player = getPlayer();
|
Player player = getPlayer();
|
||||||
|
|
||||||
if (Permissions.repairMastery(player)) {
|
if (Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.REPAIR_MASTERY)) {
|
||||||
double bonus = repairAmount * Math.min((((Repair.repairMasteryMaxBonus / Repair.repairMasteryMaxBonusLevel) * getSkillLevel()) / 100.0D), Repair.repairMasteryMaxBonus / 100.0D);
|
double bonus = repairAmount * Math.min((((Repair.repairMasteryMaxBonus / Repair.repairMasteryMaxBonusLevel) * getSkillLevel()) / 100.0D), Repair.repairMasteryMaxBonus / 100.0D);
|
||||||
repairAmount += bonus;
|
repairAmount += bonus;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Permissions.superRepair(player) && checkPlayerProcRepair()) {
|
if (Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.SUPER_REPAIR) && checkPlayerProcRepair()) {
|
||||||
repairAmount *= 2.0D;
|
repairAmount *= 2.0D;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -295,7 +296,7 @@ public class RepairManager extends SkillManager {
|
|||||||
* @return true if bonus granted, false otherwise
|
* @return true if bonus granted, false otherwise
|
||||||
*/
|
*/
|
||||||
private boolean checkPlayerProcRepair() {
|
private boolean checkPlayerProcRepair() {
|
||||||
if (SkillUtils.activationSuccessful(getSkillLevel(), getActivationChance(), Repair.superRepairMaxChance, Repair.superRepairMaxBonusLevel)) {
|
if (SkillUtils.activationSuccessful(SecondaryAbilityType.SUPER_REPAIR, getPlayer(), getSkillLevel(), activationChance)) {
|
||||||
getPlayer().sendMessage(LocaleLoader.getString("Repair.Skills.FeltEasy"));
|
getPlayer().sendMessage(LocaleLoader.getString("Repair.Skills.FeltEasy"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -322,7 +323,7 @@ public class RepairManager extends SkillManager {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getArcaneForgingRank() == 0 || !Permissions.arcaneForging(player)) {
|
if (getArcaneForgingRank() == 0 || !Permissions.secondaryAbilityEnabled(player, SecondaryAbilityType.ARCANE_FORGING)) {
|
||||||
for (Enchantment enchant : enchants.keySet()) {
|
for (Enchantment enchant : enchants.keySet()) {
|
||||||
item.removeEnchantment(enchant);
|
item.removeEnchantment(enchant);
|
||||||
}
|
}
|
||||||
|
@ -43,9 +43,6 @@ public class Smelting {
|
|||||||
public static int burnModifierMaxLevel = AdvancedConfig.getInstance().getBurnModifierMaxLevel();
|
public static int burnModifierMaxLevel = AdvancedConfig.getInstance().getBurnModifierMaxLevel();
|
||||||
public static double burnTimeMultiplier = AdvancedConfig.getInstance().getBurnTimeMultiplier();
|
public static double burnTimeMultiplier = AdvancedConfig.getInstance().getBurnTimeMultiplier();
|
||||||
|
|
||||||
public static int secondSmeltMaxLevel = AdvancedConfig.getInstance().getSecondSmeltMaxLevel();
|
|
||||||
public static double secondSmeltMaxChance = AdvancedConfig.getInstance().getSecondSmeltMaxChance();
|
|
||||||
|
|
||||||
public static int fluxMiningUnlockLevel = AdvancedConfig.getInstance().getFluxMiningUnlockLevel();
|
public static int fluxMiningUnlockLevel = AdvancedConfig.getInstance().getFluxMiningUnlockLevel();
|
||||||
public static double fluxMiningChance = AdvancedConfig.getInstance().getFluxMiningChance();
|
public static double fluxMiningChance = AdvancedConfig.getInstance().getFluxMiningChance();
|
||||||
|
|
||||||
|
@ -8,10 +8,11 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||||
|
import com.gmail.nossr50.datatypes.skills.SecondaryAbilityType;
|
||||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||||
|
import com.gmail.nossr50.events.skills.secondaryabilities.SecondaryAbilityWeightedActivationCheckEvent;
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.skills.SkillManager;
|
import com.gmail.nossr50.skills.SkillManager;
|
||||||
import com.gmail.nossr50.skills.mining.Mining;
|
|
||||||
import com.gmail.nossr50.skills.smelting.Smelting.Tier;
|
import com.gmail.nossr50.skills.smelting.Smelting.Tier;
|
||||||
import com.gmail.nossr50.util.BlockUtils;
|
import com.gmail.nossr50.util.BlockUtils;
|
||||||
import com.gmail.nossr50.util.Misc;
|
import com.gmail.nossr50.util.Misc;
|
||||||
@ -24,11 +25,11 @@ public class SmeltingManager extends SkillManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean canUseFluxMining(BlockState blockState) {
|
public boolean canUseFluxMining(BlockState blockState) {
|
||||||
return getSkillLevel() >= Smelting.fluxMiningUnlockLevel && BlockUtils.affectedByFluxMining(blockState) && Permissions.fluxMining(getPlayer()) && !mcMMO.getPlaceStore().isTrue(blockState);
|
return getSkillLevel() >= Smelting.fluxMiningUnlockLevel && BlockUtils.affectedByFluxMining(blockState) && Permissions.secondaryAbilityEnabled(getPlayer(), SecondaryAbilityType.FLUX_MINING) && !mcMMO.getPlaceStore().isTrue(blockState);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isDoubleDropSuccessful() {
|
public boolean isSecondSmeltSuccessful() {
|
||||||
return Permissions.doubleDrops(getPlayer(), skill) && SkillUtils.activationSuccessful(getSkillLevel(), getActivationChance(), Mining.doubleDropsMaxChance, Mining.doubleDropsMaxLevel);
|
return Permissions.secondaryAbilityEnabled(getPlayer(), SecondaryAbilityType.SECOND_SMELT) && SkillUtils.activationSuccessful(SecondaryAbilityType.SECOND_SMELT, getPlayer(), getSkillLevel(), activationChance);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -40,7 +41,9 @@ public class SmeltingManager extends SkillManager {
|
|||||||
public boolean processFluxMining(BlockState blockState) {
|
public boolean processFluxMining(BlockState blockState) {
|
||||||
Player player = getPlayer();
|
Player player = getPlayer();
|
||||||
|
|
||||||
if (Smelting.fluxMiningChance > Misc.getRandom().nextInt(getActivationChance())) {
|
SecondaryAbilityWeightedActivationCheckEvent event = new SecondaryAbilityWeightedActivationCheckEvent(getPlayer(), SecondaryAbilityType.FLUX_MINING, Smelting.fluxMiningChance / activationChance);
|
||||||
|
mcMMO.p.getServer().getPluginManager().callEvent(event);
|
||||||
|
if ((event.getChance() * activationChance) > Misc.getRandom().nextInt(activationChance)) {
|
||||||
ItemStack item = null;
|
ItemStack item = null;
|
||||||
|
|
||||||
switch (blockState.getType()) {
|
switch (blockState.getType()) {
|
||||||
@ -60,7 +63,7 @@ public class SmeltingManager extends SkillManager {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Misc.dropItems(blockState.getLocation(), item, isDoubleDropSuccessful() ? 2 : 1);
|
Misc.dropItems(blockState.getLocation(), item, isSecondSmeltSuccessful() ? 2 : 1);
|
||||||
|
|
||||||
blockState.setType(Material.AIR);
|
blockState.setType(Material.AIR);
|
||||||
player.sendMessage(LocaleLoader.getString("Smelting.FluxMining.Success"));
|
player.sendMessage(LocaleLoader.getString("Smelting.FluxMining.Success"));
|
||||||
@ -82,11 +85,9 @@ public class SmeltingManager extends SkillManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack smeltProcessing(ItemStack smelting, ItemStack result) {
|
public ItemStack smeltProcessing(ItemStack smelting, ItemStack result) {
|
||||||
Player player = getPlayer();
|
|
||||||
|
|
||||||
applyXpGain(Smelting.getResourceXp(smelting));
|
applyXpGain(Smelting.getResourceXp(smelting));
|
||||||
|
|
||||||
if (Permissions.doubleDrops(player, skill) && SkillUtils.activationSuccessful(getSkillLevel(), getActivationChance(), Smelting.secondSmeltMaxChance, Smelting.secondSmeltMaxLevel)) {
|
if (isSecondSmeltSuccessful()) {
|
||||||
ItemStack newResult = result.clone();
|
ItemStack newResult = result.clone();
|
||||||
|
|
||||||
newResult.setAmount(result.getAmount() + 1);
|
newResult.setAmount(result.getAmount() + 1);
|
||||||
|
@ -3,15 +3,11 @@ package com.gmail.nossr50.skills.swords;
|
|||||||
import com.gmail.nossr50.config.AdvancedConfig;
|
import com.gmail.nossr50.config.AdvancedConfig;
|
||||||
|
|
||||||
public class Swords {
|
public class Swords {
|
||||||
public static int bleedMaxBonusLevel = AdvancedConfig.getInstance().getBleedMaxBonusLevel();
|
|
||||||
public static int bleedMaxTicks = AdvancedConfig.getInstance().getBleedMaxTicks();
|
public static int bleedMaxTicks = AdvancedConfig.getInstance().getBleedMaxTicks();
|
||||||
public static int bleedBaseTicks = AdvancedConfig.getInstance().getBleedBaseTicks();
|
public static int bleedBaseTicks = AdvancedConfig.getInstance().getBleedBaseTicks();
|
||||||
public static double bleedMaxChance = AdvancedConfig.getInstance().getBleedChanceMax();
|
|
||||||
|
|
||||||
public static boolean counterAttackRequiresBlock = AdvancedConfig.getInstance().getCounterRequiresBlock();
|
public static boolean counterAttackRequiresBlock = AdvancedConfig.getInstance().getCounterRequiresBlock();
|
||||||
public static int counterAttackMaxBonusLevel = AdvancedConfig.getInstance().getCounterMaxBonusLevel();
|
|
||||||
public static double counterAttackModifier = AdvancedConfig.getInstance().getCounterModifier();
|
public static double counterAttackModifier = AdvancedConfig.getInstance().getCounterModifier();
|
||||||
public static double counterAttackMaxChance = AdvancedConfig.getInstance().getCounterChanceMax();
|
|
||||||
|
|
||||||
public static double serratedStrikesModifier = AdvancedConfig.getInstance().getSerratedStrikesModifier();
|
public static double serratedStrikesModifier = AdvancedConfig.getInstance().getSerratedStrikesModifier();
|
||||||
public static int serratedStrikesBleedTicks = AdvancedConfig.getInstance().getSerratedStrikesTicks();
|
public static int serratedStrikesBleedTicks = AdvancedConfig.getInstance().getSerratedStrikesTicks();
|
||||||
|
@ -4,8 +4,10 @@ import org.bukkit.entity.Entity;
|
|||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import com.gmail.nossr50.config.AdvancedConfig;
|
||||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||||
import com.gmail.nossr50.datatypes.skills.AbilityType;
|
import com.gmail.nossr50.datatypes.skills.AbilityType;
|
||||||
|
import com.gmail.nossr50.datatypes.skills.SecondaryAbilityType;
|
||||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||||
import com.gmail.nossr50.datatypes.skills.ToolType;
|
import com.gmail.nossr50.datatypes.skills.ToolType;
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
@ -26,11 +28,11 @@ public class SwordsManager extends SkillManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean canUseBleed() {
|
public boolean canUseBleed() {
|
||||||
return Permissions.bleed(getPlayer());
|
return Permissions.secondaryAbilityEnabled(getPlayer(), SecondaryAbilityType.BLEED);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canUseCounterAttack(Entity target) {
|
public boolean canUseCounterAttack(Entity target) {
|
||||||
return target instanceof LivingEntity && Permissions.counterAttack(getPlayer());
|
return target instanceof LivingEntity && Permissions.secondaryAbilityEnabled(getPlayer(), SecondaryAbilityType.COUNTER);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canUseSerratedStrike() {
|
public boolean canUseSerratedStrike() {
|
||||||
@ -43,9 +45,9 @@ public class SwordsManager extends SkillManager {
|
|||||||
* @param target The defending entity
|
* @param target The defending entity
|
||||||
*/
|
*/
|
||||||
public void bleedCheck(LivingEntity target) {
|
public void bleedCheck(LivingEntity target) {
|
||||||
if (SkillUtils.activationSuccessful(getSkillLevel(), getActivationChance(), Swords.bleedMaxChance, Swords.bleedMaxBonusLevel)) {
|
if (SkillUtils.activationSuccessful(SecondaryAbilityType.BLEED, getPlayer(), getSkillLevel(), activationChance)) {
|
||||||
|
|
||||||
if (getSkillLevel() >= Swords.bleedMaxBonusLevel) {
|
if (getSkillLevel() >= AdvancedConfig.getInstance().getMaxBonusLevel(SecondaryAbilityType.BLEED)) {
|
||||||
BleedTimerTask.add(target, Swords.bleedMaxTicks);
|
BleedTimerTask.add(target, Swords.bleedMaxTicks);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -77,7 +79,7 @@ public class SwordsManager extends SkillManager {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SkillUtils.activationSuccessful(getSkillLevel(), getActivationChance(), Swords.counterAttackMaxChance, Swords.counterAttackMaxBonusLevel)) {
|
if (SkillUtils.activationSuccessful(SecondaryAbilityType.COUNTER, getPlayer(), getSkillLevel(), activationChance)) {
|
||||||
CombatUtils.dealDamage(attacker, damage / Swords.counterAttackModifier);
|
CombatUtils.dealDamage(attacker, damage / Swords.counterAttackModifier);
|
||||||
|
|
||||||
getPlayer().sendMessage(LocaleLoader.getString("Swords.Combat.Countered"));
|
getPlayer().sendMessage(LocaleLoader.getString("Swords.Combat.Countered"));
|
||||||
|
@ -19,9 +19,7 @@ public class Taming {
|
|||||||
public static double fastFoodServiceActivationChance = AdvancedConfig.getInstance().getFastFoodChance();
|
public static double fastFoodServiceActivationChance = AdvancedConfig.getInstance().getFastFoodChance();
|
||||||
|
|
||||||
public static int goreBleedTicks = AdvancedConfig.getInstance().getGoreBleedTicks();
|
public static int goreBleedTicks = AdvancedConfig.getInstance().getGoreBleedTicks();
|
||||||
public static int goreMaxBonusLevel = AdvancedConfig.getInstance().getGoreMaxBonusLevel();
|
|
||||||
public static double goreModifier = AdvancedConfig.getInstance().getGoreModifier();
|
public static double goreModifier = AdvancedConfig.getInstance().getGoreModifier();
|
||||||
public static double goreMaxChance = AdvancedConfig.getInstance().getGoreChanceMax();
|
|
||||||
|
|
||||||
public static int sharpenedClawsUnlockLevel = AdvancedConfig.getInstance().getSharpenedClawsUnlock();
|
public static int sharpenedClawsUnlockLevel = AdvancedConfig.getInstance().getSharpenedClawsUnlock();
|
||||||
public static double sharpenedClawsBonusDamage = AdvancedConfig.getInstance().getSharpenedClawsBonus();
|
public static double sharpenedClawsBonusDamage = AdvancedConfig.getInstance().getSharpenedClawsBonus();
|
||||||
|
@ -14,7 +14,9 @@ import com.gmail.nossr50.mcMMO;
|
|||||||
import com.gmail.nossr50.config.AdvancedConfig;
|
import com.gmail.nossr50.config.AdvancedConfig;
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||||
|
import com.gmail.nossr50.datatypes.skills.SecondaryAbilityType;
|
||||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||||
|
import com.gmail.nossr50.events.skills.secondaryabilities.SecondaryAbilityWeightedActivationCheckEvent;
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.runnables.skills.BleedTimerTask;
|
import com.gmail.nossr50.runnables.skills.BleedTimerTask;
|
||||||
import com.gmail.nossr50.skills.SkillManager;
|
import com.gmail.nossr50.skills.SkillManager;
|
||||||
@ -30,35 +32,35 @@ public class TamingManager extends SkillManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean canUseThickFur() {
|
public boolean canUseThickFur() {
|
||||||
return getSkillLevel() >= Taming.thickFurUnlockLevel && Permissions.thickFur(getPlayer());
|
return getSkillLevel() >= Taming.thickFurUnlockLevel && Permissions.secondaryAbilityEnabled(getPlayer(), SecondaryAbilityType.THICK_FUR);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canUseEnvironmentallyAware() {
|
public boolean canUseEnvironmentallyAware() {
|
||||||
return getSkillLevel() >= Taming.environmentallyAwareUnlockLevel && Permissions.environmentallyAware(getPlayer());
|
return getSkillLevel() >= Taming.environmentallyAwareUnlockLevel && Permissions.secondaryAbilityEnabled(getPlayer(), SecondaryAbilityType.ENVIROMENTALLY_AWARE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canUseShockProof() {
|
public boolean canUseShockProof() {
|
||||||
return getSkillLevel() >= Taming.shockProofUnlockLevel && Permissions.shockProof(getPlayer());
|
return getSkillLevel() >= Taming.shockProofUnlockLevel && Permissions.secondaryAbilityEnabled(getPlayer(), SecondaryAbilityType.SHOCK_PROOF);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canUseHolyHound() {
|
public boolean canUseHolyHound() {
|
||||||
return getSkillLevel() >= Taming.holyHoundUnlockLevel && Permissions.holyHound(getPlayer());
|
return getSkillLevel() >= Taming.holyHoundUnlockLevel && Permissions.secondaryAbilityEnabled(getPlayer(), SecondaryAbilityType.HOLY_HOUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canUseFastFoodService() {
|
public boolean canUseFastFoodService() {
|
||||||
return getSkillLevel() >= Taming.fastFoodServiceUnlockLevel && Permissions.fastFoodService(getPlayer());
|
return getSkillLevel() >= Taming.fastFoodServiceUnlockLevel && Permissions.secondaryAbilityEnabled(getPlayer(), SecondaryAbilityType.FAST_FOOD);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canUseSharpenedClaws() {
|
public boolean canUseSharpenedClaws() {
|
||||||
return getSkillLevel() >= Taming.sharpenedClawsUnlockLevel && Permissions.sharpenedClaws(getPlayer());
|
return getSkillLevel() >= Taming.sharpenedClawsUnlockLevel && Permissions.secondaryAbilityEnabled(getPlayer(), SecondaryAbilityType.SHARPENED_CLAWS);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canUseGore() {
|
public boolean canUseGore() {
|
||||||
return Permissions.gore(getPlayer());
|
return Permissions.secondaryAbilityEnabled(getPlayer(), SecondaryAbilityType.GORE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canUseBeastLore() {
|
public boolean canUseBeastLore() {
|
||||||
return Permissions.beastLore(getPlayer());
|
return Permissions.secondaryAbilityEnabled(getPlayer(), SecondaryAbilityType.BEAST_LORE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -92,7 +94,10 @@ public class TamingManager extends SkillManager {
|
|||||||
* @param damage The damage being absorbed by the wolf
|
* @param damage The damage being absorbed by the wolf
|
||||||
*/
|
*/
|
||||||
public void fastFoodService(Wolf wolf, double damage) {
|
public void fastFoodService(Wolf wolf, double damage) {
|
||||||
if (Taming.fastFoodServiceActivationChance > Misc.getRandom().nextInt(getActivationChance())) {
|
double chance = Taming.fastFoodServiceActivationChance / activationChance;
|
||||||
|
SecondaryAbilityWeightedActivationCheckEvent event = new SecondaryAbilityWeightedActivationCheckEvent(getPlayer(), SecondaryAbilityType.FAST_FOOD, chance);
|
||||||
|
mcMMO.p.getServer().getPluginManager().callEvent(event);
|
||||||
|
if ((event.getChance() * activationChance) > Misc.getRandom().nextInt(activationChance)) {
|
||||||
|
|
||||||
double health = wolf.getHealth();
|
double health = wolf.getHealth();
|
||||||
double maxHealth = wolf.getMaxHealth();
|
double maxHealth = wolf.getMaxHealth();
|
||||||
@ -112,7 +117,7 @@ public class TamingManager extends SkillManager {
|
|||||||
* @param wolf The wolf using the ability
|
* @param wolf The wolf using the ability
|
||||||
*/
|
*/
|
||||||
public double gore(LivingEntity target, double damage, Wolf wolf) {
|
public double gore(LivingEntity target, double damage, Wolf wolf) {
|
||||||
if (!SkillUtils.activationSuccessful(getSkillLevel(), getActivationChance(), Taming.goreMaxChance, Taming.goreMaxBonusLevel)) {
|
if (!SkillUtils.activationSuccessful(SecondaryAbilityType.GORE, getPlayer(), getSkillLevel(), activationChance)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,15 +14,6 @@ public class Unarmed {
|
|||||||
public static double ironArmMaxBonusDamage = AdvancedConfig.getInstance().getIronArmMaxBonus();
|
public static double ironArmMaxBonusDamage = AdvancedConfig.getInstance().getIronArmMaxBonus();
|
||||||
public static int ironArmIncreaseLevel = AdvancedConfig.getInstance().getIronArmIncreaseLevel();
|
public static int ironArmIncreaseLevel = AdvancedConfig.getInstance().getIronArmIncreaseLevel();
|
||||||
|
|
||||||
public static int disarmMaxBonusLevel = AdvancedConfig.getInstance().getDisarmMaxBonusLevel();
|
|
||||||
public static double disarmMaxChance = AdvancedConfig.getInstance().getDisarmChanceMax();
|
|
||||||
|
|
||||||
public static int deflectMaxBonusLevel = AdvancedConfig.getInstance().getDeflectMaxBonusLevel();
|
|
||||||
public static double deflectMaxChance = AdvancedConfig.getInstance().getDeflectChanceMax();
|
|
||||||
|
|
||||||
public static int ironGripMaxBonusLevel = AdvancedConfig.getInstance().getIronGripMaxBonusLevel();
|
|
||||||
public static double ironGripMaxChance = AdvancedConfig.getInstance().getIronGripChanceMax();
|
|
||||||
|
|
||||||
public static boolean blockCrackerSmoothBrick = Config.getInstance().getUnarmedBlockCrackerSmoothbrickToCracked();
|
public static boolean blockCrackerSmoothBrick = Config.getInstance().getUnarmedBlockCrackerSmoothbrickToCracked();
|
||||||
|
|
||||||
public static double berserkDamageModifier = 1.5;
|
public static double berserkDamageModifier = 1.5;
|
||||||
|
@ -10,6 +10,7 @@ import org.bukkit.material.SmoothBrick;
|
|||||||
|
|
||||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||||
import com.gmail.nossr50.datatypes.skills.AbilityType;
|
import com.gmail.nossr50.datatypes.skills.AbilityType;
|
||||||
|
import com.gmail.nossr50.datatypes.skills.SecondaryAbilityType;
|
||||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||||
import com.gmail.nossr50.datatypes.skills.ToolType;
|
import com.gmail.nossr50.datatypes.skills.ToolType;
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
@ -30,7 +31,7 @@ public class UnarmedManager extends SkillManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean canUseIronArm() {
|
public boolean canUseIronArm() {
|
||||||
return Permissions.bonusDamage(getPlayer(), skill);
|
return Permissions.secondaryAbilityEnabled(getPlayer(), SecondaryAbilityType.IRON_ARM);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canUseBerserk() {
|
public boolean canUseBerserk() {
|
||||||
@ -38,17 +39,17 @@ public class UnarmedManager extends SkillManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean canDisarm(LivingEntity target) {
|
public boolean canDisarm(LivingEntity target) {
|
||||||
return target instanceof Player && ((Player) target).getItemInHand().getType() != Material.AIR && Permissions.disarm(getPlayer());
|
return target instanceof Player && ((Player) target).getItemInHand().getType() != Material.AIR && Permissions.secondaryAbilityEnabled(getPlayer(), SecondaryAbilityType.DISARM);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canDeflect() {
|
public boolean canDeflect() {
|
||||||
Player player = getPlayer();
|
Player player = getPlayer();
|
||||||
|
|
||||||
return player.getItemInHand().getType() == Material.AIR && Permissions.arrowDeflect(player);
|
return player.getItemInHand().getType() == Material.AIR && Permissions.secondaryAbilityEnabled(getPlayer(), SecondaryAbilityType.DEFLECT);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canUseBlockCracker() {
|
public boolean canUseBlockCracker() {
|
||||||
return Permissions.blockCracker(getPlayer());
|
return Permissions.secondaryAbilityEnabled(getPlayer(), SecondaryAbilityType.BLOCK_CRACKER);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean blockCrackerCheck(BlockState blockState) {
|
public boolean blockCrackerCheck(BlockState blockState) {
|
||||||
@ -81,7 +82,7 @@ public class UnarmedManager extends SkillManager {
|
|||||||
* @param defender The defending player
|
* @param defender The defending player
|
||||||
*/
|
*/
|
||||||
public void disarmCheck(Player defender) {
|
public void disarmCheck(Player defender) {
|
||||||
if (SkillUtils.activationSuccessful(getSkillLevel(), getActivationChance(), Unarmed.disarmMaxChance, Unarmed.disarmMaxBonusLevel) && !hasIronGrip(defender)) {
|
if (SkillUtils.activationSuccessful(SecondaryAbilityType.DISARM, getPlayer(), getSkillLevel(), activationChance) && !hasIronGrip(defender)) {
|
||||||
if (EventUtils.callDisarmEvent(defender).isCancelled()) {
|
if (EventUtils.callDisarmEvent(defender).isCancelled()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -97,7 +98,7 @@ public class UnarmedManager extends SkillManager {
|
|||||||
* Check for arrow deflection.
|
* Check for arrow deflection.
|
||||||
*/
|
*/
|
||||||
public boolean deflectCheck() {
|
public boolean deflectCheck() {
|
||||||
if (SkillUtils.activationSuccessful(getSkillLevel(), getActivationChance(), Unarmed.deflectMaxChance, Unarmed.deflectMaxBonusLevel)) {
|
if (SkillUtils.activationSuccessful(SecondaryAbilityType.DEFLECT, getPlayer(), getSkillLevel(), activationChance)) {
|
||||||
getPlayer().sendMessage(LocaleLoader.getString("Combat.ArrowDeflect"));
|
getPlayer().sendMessage(LocaleLoader.getString("Combat.ArrowDeflect"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -135,7 +136,7 @@ public class UnarmedManager extends SkillManager {
|
|||||||
* @return true if the defender was not disarmed, false otherwise
|
* @return true if the defender was not disarmed, false otherwise
|
||||||
*/
|
*/
|
||||||
private boolean hasIronGrip(Player defender) {
|
private boolean hasIronGrip(Player defender) {
|
||||||
if (!Misc.isNPCEntity(defender) && Permissions.ironGrip(defender) && SkillUtils.activationSuccessful(defender, skill, Unarmed.ironGripMaxChance, Unarmed.ironGripMaxBonusLevel)) {
|
if (!Misc.isNPCEntity(defender) && Permissions.secondaryAbilityEnabled(defender, SecondaryAbilityType.IRON_GRIP) && SkillUtils.activationSuccessful(SecondaryAbilityType.IRON_GRIP, defender, skill)) {
|
||||||
defender.sendMessage(LocaleLoader.getString("Unarmed.Ability.IronGrip.Defender"));
|
defender.sendMessage(LocaleLoader.getString("Unarmed.Ability.IronGrip.Defender"));
|
||||||
getPlayer().sendMessage(LocaleLoader.getString("Unarmed.Ability.IronGrip.Attacker"));
|
getPlayer().sendMessage(LocaleLoader.getString("Unarmed.Ability.IronGrip.Attacker"));
|
||||||
|
|
||||||
|
@ -20,9 +20,6 @@ import com.gmail.nossr50.util.ModUtils;
|
|||||||
import com.gmail.nossr50.util.skills.SkillUtils;
|
import com.gmail.nossr50.util.skills.SkillUtils;
|
||||||
|
|
||||||
public final class Woodcutting {
|
public final class Woodcutting {
|
||||||
public static int doubleDropsMaxLevel = AdvancedConfig.getInstance().getWoodcuttingDoubleDropMaxLevel();
|
|
||||||
public static double doubleDropsMaxChance = AdvancedConfig.getInstance().getWoodcuttingDoubleDropChance();
|
|
||||||
|
|
||||||
public static int leafBlowerUnlockLevel = AdvancedConfig.getInstance().getLeafBlowUnlockLevel();
|
public static int leafBlowerUnlockLevel = AdvancedConfig.getInstance().getLeafBlowUnlockLevel();
|
||||||
public static int treeFellerThreshold = Config.getInstance().getTreeFellerThreshold();
|
public static int treeFellerThreshold = Config.getInstance().getTreeFellerThreshold();
|
||||||
|
|
||||||
|
@ -14,6 +14,7 @@ import org.bukkit.material.Tree;
|
|||||||
import com.gmail.nossr50.datatypes.mods.CustomBlock;
|
import com.gmail.nossr50.datatypes.mods.CustomBlock;
|
||||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||||
import com.gmail.nossr50.datatypes.skills.AbilityType;
|
import com.gmail.nossr50.datatypes.skills.AbilityType;
|
||||||
|
import com.gmail.nossr50.datatypes.skills.SecondaryAbilityType;
|
||||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.skills.SkillManager;
|
import com.gmail.nossr50.skills.SkillManager;
|
||||||
@ -32,7 +33,7 @@ public class WoodcuttingManager extends SkillManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean canUseLeafBlower(ItemStack heldItem) {
|
public boolean canUseLeafBlower(ItemStack heldItem) {
|
||||||
return getSkillLevel() >= Woodcutting.leafBlowerUnlockLevel && ItemUtils.isAxe(heldItem);
|
return Permissions.secondaryAbilityEnabled(getPlayer(), SecondaryAbilityType.LEAF_BLOWER) && getSkillLevel() >= Woodcutting.leafBlowerUnlockLevel && ItemUtils.isAxe(heldItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canUseTreeFeller(ItemStack heldItem) {
|
public boolean canUseTreeFeller(ItemStack heldItem) {
|
||||||
@ -40,7 +41,7 @@ public class WoodcuttingManager extends SkillManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected boolean canGetDoubleDrops() {
|
protected boolean canGetDoubleDrops() {
|
||||||
return Permissions.doubleDrops(getPlayer(), skill) && SkillUtils.activationSuccessful(getSkillLevel(), getActivationChance(), Woodcutting.doubleDropsMaxChance, Woodcutting.doubleDropsMaxLevel);
|
return Permissions.secondaryAbilityEnabled(getPlayer(), SecondaryAbilityType.WOODCUTTING_DOUBLE_DROPS) && SkillUtils.activationSuccessful(SecondaryAbilityType.WOODCUTTING_DOUBLE_DROPS, getPlayer(), getSkillLevel(), activationChance);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -11,6 +11,7 @@ import org.bukkit.plugin.PluginManager;
|
|||||||
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.commands.party.PartySubcommandType;
|
import com.gmail.nossr50.commands.party.PartySubcommandType;
|
||||||
|
import com.gmail.nossr50.datatypes.skills.SecondaryAbilityType;
|
||||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||||
|
|
||||||
public final class Permissions {
|
public final class Permissions {
|
||||||
@ -123,44 +124,19 @@ public final class Permissions {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
public static boolean skillEnabled(Permissible permissible, SkillType skill) {return permissible.hasPermission("mcmmo.skills." + skill.toString().toLowerCase()); }
|
public static boolean skillEnabled(Permissible permissible, SkillType skill) {return permissible.hasPermission("mcmmo.skills." + skill.toString().toLowerCase()); }
|
||||||
public static boolean doubleDrops(Permissible permissible, SkillType skill) { return permissible.hasPermission("mcmmo.ability." + skill.toString().toLowerCase() + ".doubledrops"); }
|
|
||||||
public static boolean vanillaXpBoost(Permissible permissible, SkillType skill) { return permissible.hasPermission("mcmmo.ability." + skill.toString().toLowerCase() + ".vanillaxpboost"); }
|
public static boolean vanillaXpBoost(Permissible permissible, SkillType skill) { return permissible.hasPermission("mcmmo.ability." + skill.toString().toLowerCase() + ".vanillaxpboost"); }
|
||||||
public static boolean bonusDamage(Permissible permissible, SkillType skill) { return permissible.hasPermission("mcmmo.ability." + skill.toString().toLowerCase() + ".bonusdamage"); }
|
public static boolean secondaryAbilityEnabled(Permissible permissible, SecondaryAbilityType skillAbility) { return permissible.hasPermission("mcmmo.ability." + SkillType.bySecondaryAbility(skillAbility).toString().toLowerCase() + "." + StringUtils.getPrettySecondaryAbilityString(skillAbility).replace("_", "").toLowerCase()); }
|
||||||
|
|
||||||
/* ACROBATICS */
|
|
||||||
public static boolean dodge(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.acrobatics.dodge"); }
|
|
||||||
public static boolean gracefulRoll(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.acrobatics.gracefulroll"); }
|
|
||||||
public static boolean roll(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.acrobatics.roll"); }
|
|
||||||
|
|
||||||
/* ARCHERY */
|
|
||||||
public static boolean arrowRetrieval(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.archery.trackarrows"); }
|
|
||||||
public static boolean daze(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.archery.daze"); }
|
|
||||||
|
|
||||||
/* AXES */
|
/* AXES */
|
||||||
public static boolean armorImpact(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.axes.impact"); }
|
|
||||||
public static boolean criticalStrikes(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.axes.criticalhit"); }
|
|
||||||
public static boolean greaterImpact(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.axes.greaterimpact"); }
|
|
||||||
public static boolean skullSplitter(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.axes.skullsplitter"); }
|
public static boolean skullSplitter(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.axes.skullsplitter"); }
|
||||||
|
|
||||||
/* EXCAVATION */
|
/* EXCAVATION */
|
||||||
public static boolean gigaDrillBreaker(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.excavation.gigadrillbreaker"); }
|
public static boolean gigaDrillBreaker(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.excavation.gigadrillbreaker"); }
|
||||||
public static boolean excavationTreasureHunter(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.excavation.treasures"); }
|
|
||||||
|
|
||||||
/* FISHING */
|
|
||||||
public static boolean fishermansDiet(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.fishing.fishermansdiet"); }
|
|
||||||
public static boolean fishingTreasureHunter(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.fishing.treasures"); }
|
|
||||||
public static boolean iceFishing(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.fishing.icefishing"); }
|
|
||||||
public static boolean magicHunter(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.fishing.magic"); }
|
|
||||||
public static boolean masterAngler(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.fishing.masterangler"); }
|
|
||||||
public static boolean shake(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.fishing.shakemob"); }
|
|
||||||
|
|
||||||
/* HERBALISM */
|
/* HERBALISM */
|
||||||
public static boolean farmersDiet(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.herbalism.farmersdiet"); }
|
|
||||||
public static boolean greenTerra(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.herbalism.greenterra"); }
|
public static boolean greenTerra(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.herbalism.greenterra"); }
|
||||||
public static boolean greenThumbBlock(Permissible permissible, Material material) { return permissible.hasPermission("mcmmo.ability.herbalism.greenthumb.blocks." + material.toString().replace("_", "").toLowerCase()); }
|
public static boolean greenThumbBlock(Permissible permissible, Material material) { return permissible.hasPermission("mcmmo.ability.herbalism.greenthumb.blocks." + material.toString().replace("_", "").toLowerCase()); }
|
||||||
public static boolean greenThumbPlant(Permissible permissible, Material material) { return permissible.hasPermission("mcmmo.ability.herbalism.greenthumb.plants." + material.toString().replace("_", "").toLowerCase()); }
|
public static boolean greenThumbPlant(Permissible permissible, Material material) { return permissible.hasPermission("mcmmo.ability.herbalism.greenthumb.plants." + material.toString().replace("_", "").toLowerCase()); }
|
||||||
public static boolean hylianLuck(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.herbalism.hylianluck"); }
|
|
||||||
public static boolean shroomThumb(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.herbalism.shroomthumb"); }
|
|
||||||
|
|
||||||
/* MINING */
|
/* MINING */
|
||||||
public static boolean biggerBombs(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.mining.blastmining.biggerbombs"); }
|
public static boolean biggerBombs(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.mining.blastmining.biggerbombs"); }
|
||||||
@ -169,11 +145,6 @@ public final class Permissions {
|
|||||||
public static boolean superBreaker(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.mining.superbreaker"); }
|
public static boolean superBreaker(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.mining.superbreaker"); }
|
||||||
|
|
||||||
/* REPAIR */
|
/* REPAIR */
|
||||||
public static boolean arcaneForging(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.repair.arcaneforging"); }
|
|
||||||
public static boolean repairMastery(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.repair.repairmastery"); }
|
|
||||||
public static boolean salvage(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.repair.salvage"); }
|
|
||||||
public static boolean superRepair(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.repair.repairbonus"); }
|
|
||||||
|
|
||||||
public static boolean repairArmor(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.repair.armorrepair"); }
|
public static boolean repairArmor(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.repair.armorrepair"); }
|
||||||
public static boolean repairTools(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.repair.toolrepair"); }
|
public static boolean repairTools(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.repair.toolrepair"); }
|
||||||
public static boolean repairOtherItems(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.repair.otherrepair"); }
|
public static boolean repairOtherItems(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.repair.otherrepair"); }
|
||||||
@ -187,36 +158,16 @@ public final class Permissions {
|
|||||||
public static boolean repairStone(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.repair.stonerepair"); }
|
public static boolean repairStone(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.repair.stonerepair"); }
|
||||||
public static boolean repairWood(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.repair.woodrepair"); }
|
public static boolean repairWood(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.repair.woodrepair"); }
|
||||||
|
|
||||||
/* SMELTING */
|
|
||||||
public static boolean fluxMining(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.smelting.fluxmining"); }
|
|
||||||
public static boolean fuelEfficiency(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.smelting.fuelefficiency"); }
|
|
||||||
|
|
||||||
/* SWORDS */
|
/* SWORDS */
|
||||||
public static boolean bleed(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.swords.bleed"); }
|
|
||||||
public static boolean counterAttack(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.swords.counterattack"); }
|
|
||||||
public static boolean serratedStrikes(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.swords.serratedstrikes"); }
|
public static boolean serratedStrikes(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.swords.serratedstrikes"); }
|
||||||
|
|
||||||
/* TAMING */
|
/* TAMING */
|
||||||
public static boolean beastLore(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.taming.beastlore"); }
|
|
||||||
public static boolean callOfTheWild(Permissible permissible, EntityType type) { return permissible.hasPermission("mcmmo.ability.taming.callofthewild." + type.toString().toLowerCase()); }
|
public static boolean callOfTheWild(Permissible permissible, EntityType type) { return permissible.hasPermission("mcmmo.ability.taming.callofthewild." + type.toString().toLowerCase()); }
|
||||||
public static boolean renamePets(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.taming.callofthewild.renamepets"); }
|
public static boolean renamePets(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.taming.callofthewild.renamepets"); }
|
||||||
public static boolean environmentallyAware(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.taming.environmentallyaware"); }
|
|
||||||
public static boolean fastFoodService(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.taming.fastfoodservice"); }
|
|
||||||
public static boolean gore(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.taming.gore"); }
|
|
||||||
public static boolean holyHound(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.taming.holyhound"); }
|
|
||||||
public static boolean thickFur(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.taming.thickfur"); }
|
|
||||||
public static boolean sharpenedClaws(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.taming.sharpenedclaws"); }
|
|
||||||
public static boolean shockProof(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.taming.shockproof"); }
|
|
||||||
|
|
||||||
/* UNARMED */
|
/* UNARMED */
|
||||||
public static boolean arrowDeflect(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.unarmed.deflect"); }
|
|
||||||
public static boolean berserk(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.unarmed.berserk"); }
|
public static boolean berserk(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.unarmed.berserk"); }
|
||||||
public static boolean blockCracker(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.unarmed.blockcracker"); }
|
|
||||||
public static boolean disarm(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.unarmed.disarm"); }
|
|
||||||
public static boolean ironGrip(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.unarmed.irongrip"); }
|
|
||||||
|
|
||||||
/* WOODCUTTING */
|
/* WOODCUTTING */
|
||||||
public static boolean leafBlower(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.woodcutting.leafblower"); }
|
|
||||||
public static boolean treeFeller(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.woodcutting.treefeller"); }
|
public static boolean treeFeller(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.woodcutting.treefeller"); }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -4,6 +4,7 @@ import org.bukkit.Material;
|
|||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
|
|
||||||
import com.gmail.nossr50.datatypes.skills.AbilityType;
|
import com.gmail.nossr50.datatypes.skills.AbilityType;
|
||||||
|
import com.gmail.nossr50.datatypes.skills.SecondaryAbilityType;
|
||||||
|
|
||||||
public class StringUtils {
|
public class StringUtils {
|
||||||
/**
|
/**
|
||||||
@ -28,6 +29,23 @@ public class StringUtils {
|
|||||||
return createPrettyEnumString(ability.toString());
|
return createPrettyEnumString(ability.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String getPrettySecondaryAbilityString(SecondaryAbilityType secondaryAbility) {
|
||||||
|
switch(secondaryAbility) {
|
||||||
|
case HERBALISM_DOUBLE_DROPS:
|
||||||
|
case MINING_DOUBLE_DROPS:
|
||||||
|
case WOODCUTTING_DOUBLE_DROPS:
|
||||||
|
return "DoubleDrops";
|
||||||
|
case FISHING_TREASURE_HUNTER:
|
||||||
|
case EXCAVATION_TREASURE_HUNTER:
|
||||||
|
return "TreasureHunter";
|
||||||
|
case GREEN_THUMB_BLOCK:
|
||||||
|
case GREEN_THUMB_PLANT:
|
||||||
|
return "GreenThumb";
|
||||||
|
default:
|
||||||
|
return createPrettyEnumString(secondaryAbility.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static String createPrettyEnumString(String baseString) {
|
private static String createPrettyEnumString(String baseString) {
|
||||||
String[] substrings = baseString.split("_");
|
String[] substrings = baseString.split("_");
|
||||||
String prettyString = "";
|
String prettyString = "";
|
||||||
|
@ -106,7 +106,7 @@ public class ScoreboardManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (AbilityType type : AbilityType.NORMAL_ABILITIES) {
|
for (AbilityType type : AbilityType.values()) {
|
||||||
abilityLabelSkillBuilder.put(type, getOfflinePlayerDots((type == AbilityType.BLAST_MINING ? ChatColor.BLUE : ChatColor.AQUA) + type.getName()));
|
abilityLabelSkillBuilder.put(type, getOfflinePlayerDots((type == AbilityType.BLAST_MINING ? ChatColor.BLUE : ChatColor.AQUA) + type.getName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -456,7 +456,7 @@ public class ScoreboardWrapper {
|
|||||||
case COOLDOWNS_BOARD:
|
case COOLDOWNS_BOARD:
|
||||||
boolean anyCooldownsActive = false;
|
boolean anyCooldownsActive = false;
|
||||||
|
|
||||||
for (AbilityType ability : AbilityType.NORMAL_ABILITIES) {
|
for (AbilityType ability : AbilityType.values()) {
|
||||||
int seconds = Math.max(mcMMOPlayer.calculateTimeRemaining(ability), 0);
|
int seconds = Math.max(mcMMOPlayer.calculateTimeRemaining(ability), 0);
|
||||||
|
|
||||||
if (seconds != 0) {
|
if (seconds != 0) {
|
||||||
|
@ -176,8 +176,8 @@ public final class CombatUtils {
|
|||||||
finalDamage += archeryManager.daze((Player) target, arrow);
|
finalDamage += archeryManager.daze((Player) target, arrow);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!arrow.hasMetadata(mcMMO.infiniteArrowKey) && archeryManager.canTrackArrows()) {
|
if (!arrow.hasMetadata(mcMMO.infiniteArrowKey) && archeryManager.canRetrieveArrows()) {
|
||||||
archeryManager.trackArrows(target);
|
archeryManager.retrieveArrows(target);
|
||||||
}
|
}
|
||||||
|
|
||||||
archeryManager.distanceXpBonus(target, arrow);
|
archeryManager.distanceXpBonus(target, arrow);
|
||||||
|
@ -18,7 +18,9 @@ import com.gmail.nossr50.config.Config;
|
|||||||
import com.gmail.nossr50.config.HiddenConfig;
|
import com.gmail.nossr50.config.HiddenConfig;
|
||||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||||
import com.gmail.nossr50.datatypes.skills.AbilityType;
|
import com.gmail.nossr50.datatypes.skills.AbilityType;
|
||||||
|
import com.gmail.nossr50.datatypes.skills.SecondaryAbilityType;
|
||||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||||
|
import com.gmail.nossr50.events.skills.secondaryabilities.SecondaryAbilityWeightedActivationCheckEvent;
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.util.ItemUtils;
|
import com.gmail.nossr50.util.ItemUtils;
|
||||||
import com.gmail.nossr50.util.Misc;
|
import com.gmail.nossr50.util.Misc;
|
||||||
@ -187,16 +189,25 @@ public class SkillUtils {
|
|||||||
itemStack.setDurability((short) Math.min(itemStack.getDurability() + durabilityModifier, maxDurability));
|
itemStack.setDurability((short) Math.min(itemStack.getDurability() + durabilityModifier, maxDurability));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean activationSuccessful(Player player, SkillType skill, double maxChance, int maxLevel) {
|
public static boolean activationSuccessful(SecondaryAbilityType skillAbility, Player player, SkillType skill) {
|
||||||
return activationSuccessful(UserManager.getPlayer(player).getSkillLevel(skill), PerksUtils.handleLuckyPerks(player, skill), maxChance, maxLevel);
|
return activationSuccessful(skillAbility, player, UserManager.getPlayer(player).getSkillLevel(skill), PerksUtils.handleLuckyPerks(player, skill));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean activationSuccessful(int skillLevel, int activationChance, double maxChance, int maxLevel) {
|
public static boolean activationSuccessful(SecondaryAbilityType skillAbility, Player player, int skillLevel, int activationChance) {
|
||||||
return (maxChance / maxLevel) * Math.min(skillLevel, maxLevel) > Misc.getRandom().nextInt(activationChance);
|
return activationSuccessful(skillAbility, player, skillLevel, activationChance, AdvancedConfig.getInstance().getMaxChance(skillAbility), AdvancedConfig.getInstance().getMaxBonusLevel(skillAbility));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean treasureDropSuccessful(double dropChance, int activationChance) {
|
public static boolean activationSuccessful(SecondaryAbilityType skillAbility, Player player, int skillLevel, int activationChance, double maxChance, int maxLevel) {
|
||||||
return dropChance > Misc.getRandom().nextDouble() * activationChance;
|
double chance = (maxChance / maxLevel) * Math.min(skillLevel, maxLevel) / activationChance;
|
||||||
|
SecondaryAbilityWeightedActivationCheckEvent event = new SecondaryAbilityWeightedActivationCheckEvent(player, skillAbility, chance);
|
||||||
|
mcMMO.p.getServer().getPluginManager().callEvent(event);
|
||||||
|
return (event.getChance() * activationChance) > Misc.getRandom().nextInt(activationChance);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean treasureDropSuccessful(Player player, double dropChance, int activationChance) {;
|
||||||
|
SecondaryAbilityWeightedActivationCheckEvent event = new SecondaryAbilityWeightedActivationCheckEvent(player, SecondaryAbilityType.EXCAVATION_TREASURE_HUNTER, dropChance / activationChance);
|
||||||
|
mcMMO.p.getServer().getPluginManager().callEvent(event);
|
||||||
|
return (event.getChance() * activationChance) > (Misc.getRandom().nextDouble() * activationChance);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean isLocalizedSkill(String skillName) {
|
private static boolean isLocalizedSkill(String skillName) {
|
||||||
|
@ -80,19 +80,17 @@ Skills:
|
|||||||
# Settings for Axes
|
# Settings for Axes
|
||||||
###
|
###
|
||||||
Axes:
|
Axes:
|
||||||
DamageIncrease:
|
AxeMastery:
|
||||||
# MaxBonus: Maximum bonus damage when on <MaxBonusLevel> or higher
|
# MaxBonus: Maximum bonus damage when on <MaxBonusLevel> or higher
|
||||||
# MaxBonusLevel: Level where <MaxBonus> is reached
|
# MaxBonusLevel: Level where <MaxBonus> is reached
|
||||||
MaxBonus: 4.0
|
MaxBonus: 4.0
|
||||||
MaxBonusLevel: 200
|
MaxBonusLevel: 200
|
||||||
|
|
||||||
AxesCritical:
|
CriticalHit:
|
||||||
# ChanceMax: Maximum chance of causing a critical hit when on <MaxBonusLevel> or higher
|
# ChanceMax: Maximum chance of causing a critical hit when on <MaxBonusLevel> or higher
|
||||||
# MaxBonusLevel: Level where <ChanceMax> of causing critical hits is reached
|
# MaxBonusLevel: Level where <ChanceMax> of causing critical hits is reached
|
||||||
ChanceMax: 37.50
|
ChanceMax: 37.50
|
||||||
MaxBonusLevel: 750
|
MaxBonusLevel: 750
|
||||||
|
|
||||||
AxesCritical:
|
|
||||||
# Damage modifier of critical hits for PVP / PVE, when causing a critical hit the damage gets multiplied by the modifier
|
# Damage modifier of critical hits for PVP / PVE, when causing a critical hit the damage gets multiplied by the modifier
|
||||||
PVP_Modifier: 1.5
|
PVP_Modifier: 1.5
|
||||||
PVE_Modifier: 2.0
|
PVE_Modifier: 2.0
|
||||||
|
@ -175,14 +175,14 @@ permissions:
|
|||||||
mcmmo.ability.archery.all:
|
mcmmo.ability.archery.all:
|
||||||
description: Allows access to all Archery abilities
|
description: Allows access to all Archery abilities
|
||||||
children:
|
children:
|
||||||
mcmmo.ability.archery.bonusdamage: true
|
mcmmo.ability.archery.skillshot: true
|
||||||
mcmmo.ability.archery.daze: true
|
mcmmo.ability.archery.daze: true
|
||||||
mcmmo.ability.archery.trackarrows: true
|
mcmmo.ability.archery.retrieve: true
|
||||||
mcmmo.ability.archery.bonusdamage:
|
mcmmo.ability.archery.skillshot:
|
||||||
description: Allows bonus damage from Archery
|
description: Allows bonus damage from the Archery SkillShot ability
|
||||||
mcmmo.ability.archery.daze:
|
mcmmo.ability.archery.daze:
|
||||||
description: Allows access to the Daze ability
|
description: Allows access to the Daze ability
|
||||||
mcmmo.ability.archery.trackarrows:
|
mcmmo.ability.archery.retrieve:
|
||||||
description: Allows tracking & retrieval of arrows
|
description: Allows tracking & retrieval of arrows
|
||||||
mcmmo.ability.axes.*:
|
mcmmo.ability.axes.*:
|
||||||
default: false
|
default: false
|
||||||
@ -192,48 +192,21 @@ permissions:
|
|||||||
mcmmo.ability.axes.all:
|
mcmmo.ability.axes.all:
|
||||||
description: Allows access to all Axes abilities
|
description: Allows access to all Axes abilities
|
||||||
children:
|
children:
|
||||||
mcmmo.ability.axes.bonusdamage: true
|
mcmmo.ability.axes.axemastery: true
|
||||||
mcmmo.ability.axes.criticalhit: true
|
mcmmo.ability.axes.criticalhit: true
|
||||||
mcmmo.ability.axes.greaterimpact: true
|
mcmmo.ability.axes.greaterimpact: true
|
||||||
mcmmo.ability.axes.impact: true
|
mcmmo.ability.axes.armorimpact: true
|
||||||
mcmmo.ability.axes.skullsplitter: true
|
mcmmo.ability.axes.skullsplitter: true
|
||||||
mcmmo.ability.axes.bonusdamage:
|
mcmmo.ability.axes.axemastery:
|
||||||
description: Allows bonus damage from Axes
|
description: Allows bonus damage from Axes
|
||||||
mcmmo.ability.axes.criticalhit:
|
mcmmo.ability.axes.criticalhit:
|
||||||
description: Allows access to the Critical Hit ability
|
description: Allows access to the Critical Hit ability
|
||||||
mcmmo.ability.axes.greaterimpact:
|
mcmmo.ability.axes.greaterimpact:
|
||||||
description: Allows access to the Greater Impact ability
|
description: Allows access to the Greater Impact ability
|
||||||
mcmmo.ability.axes.impact:
|
mcmmo.ability.axes.armorimpact:
|
||||||
description: Allows access to the Impact ability
|
description: Allows access to the Impact ability
|
||||||
mcmmo.ability.axes.skullsplitter:
|
mcmmo.ability.axes.skullsplitter:
|
||||||
description: Allows access to the Skull Splitter ability
|
description: Allows access to the Skull Splitter ability
|
||||||
mcmmo.ability.blastmining.*:
|
|
||||||
default: false
|
|
||||||
description: Allows access to all Blast Mining abilities
|
|
||||||
children:
|
|
||||||
mcmmo.ability.blastmining.all: true
|
|
||||||
mcmmo.ability.blastmining.all:
|
|
||||||
default: false
|
|
||||||
description: Allows access to all Blast Mining abilities
|
|
||||||
children:
|
|
||||||
mcmmo.ability.blastmining.biggerbombs: true
|
|
||||||
mcmmo.ability.blastmining.demolitionsexpertise: true
|
|
||||||
mcmmo.ability.blastmining.detonate: true
|
|
||||||
mcmmo.ability.blastmining.biggerbombs:
|
|
||||||
default: false
|
|
||||||
description: Allows access to the Bigger Bombs ability
|
|
||||||
children:
|
|
||||||
mcmmo.ability.mining.blastmining.biggerbombs: true
|
|
||||||
mcmmo.ability.blastmining.demolitionsexpertise:
|
|
||||||
default: false
|
|
||||||
description: Allows access to the Demolitions Expertise ability
|
|
||||||
children:
|
|
||||||
mcmmo.ability.mining.blastmining.demolitionsexpertise: true
|
|
||||||
mcmmo.ability.blastmining.detonate:
|
|
||||||
default: false
|
|
||||||
description: Allows for remote TNT detonation
|
|
||||||
children:
|
|
||||||
mcmmo.ability.mining.blastmining.detonate: true
|
|
||||||
mcmmo.ability.excavation.*:
|
mcmmo.ability.excavation.*:
|
||||||
default: false
|
default: false
|
||||||
description: Allows access to all Excavation abilities
|
description: Allows access to all Excavation abilities
|
||||||
@ -243,10 +216,10 @@ permissions:
|
|||||||
description: Allows access to all Excavation abilities
|
description: Allows access to all Excavation abilities
|
||||||
children:
|
children:
|
||||||
mcmmo.ability.excavation.gigadrillbreaker: true
|
mcmmo.ability.excavation.gigadrillbreaker: true
|
||||||
mcmmo.ability.excavation.treasures: true
|
mcmmo.ability.excavation.treasurehunter: true
|
||||||
mcmmo.ability.excavation.gigadrillbreaker:
|
mcmmo.ability.excavation.gigadrillbreaker:
|
||||||
description: Allows access to the Giga Drill Breaker ability
|
description: Allows access to the Giga Drill Breaker ability
|
||||||
mcmmo.ability.excavation.treasures:
|
mcmmo.ability.excavation.treasurehunter:
|
||||||
description: Allows treasure drops from Excavation
|
description: Allows treasure drops from Excavation
|
||||||
mcmmo.ability.fishing.*:
|
mcmmo.ability.fishing.*:
|
||||||
default: false
|
default: false
|
||||||
@ -258,22 +231,22 @@ permissions:
|
|||||||
children:
|
children:
|
||||||
mcmmo.ability.fishing.fishermansdiet: true
|
mcmmo.ability.fishing.fishermansdiet: true
|
||||||
mcmmo.ability.fishing.icefishing: true
|
mcmmo.ability.fishing.icefishing: true
|
||||||
mcmmo.ability.fishing.magic: true
|
mcmmo.ability.fishing.magichunter: true
|
||||||
mcmmo.ability.fishing.masterangler: true
|
mcmmo.ability.fishing.masterangler: true
|
||||||
mcmmo.ability.fishing.shakemob: true
|
mcmmo.ability.fishing.shake: true
|
||||||
mcmmo.ability.fishing.treasures: true
|
mcmmo.ability.fishing.treasurehunter: true
|
||||||
mcmmo.ability.fishing.vanillaxpboost: true
|
mcmmo.ability.fishing.vanillaxpboost: true
|
||||||
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.icefishing:
|
mcmmo.ability.fishing.icefishing:
|
||||||
description: Allows access to the Ice Fishing ability
|
description: Allows access to the Ice Fishing ability
|
||||||
mcmmo.ability.fishing.magic:
|
mcmmo.ability.fishing.magichunter:
|
||||||
description: Allows enchanted drops from Fishing
|
description: Allows enchanted drops from Fishing
|
||||||
mcmmo.ability.fishing.masterangler:
|
mcmmo.ability.fishing.masterangler:
|
||||||
description: Allows access to the Master Angler ability
|
description: Allows access to the Master Angler ability
|
||||||
mcmmo.ability.fishing.shakemob:
|
mcmmo.ability.fishing.shake:
|
||||||
description: Allows access to the Shake Mob ability
|
description: Allows access to the Shake Mob ability
|
||||||
mcmmo.ability.fishing.treasures:
|
mcmmo.ability.fishing.treasurehunter:
|
||||||
description: Allows treasure drops from Fishing
|
description: Allows treasure drops from Fishing
|
||||||
mcmmo.ability.fishing.vanillaxpboost:
|
mcmmo.ability.fishing.vanillaxpboost:
|
||||||
description: Allows vanilla XP boost from Fishing
|
description: Allows vanilla XP boost from Fishing
|
||||||
@ -350,36 +323,6 @@ permissions:
|
|||||||
description: Allows access to the Green Thumb ability for netherwart
|
description: Allows access to the Green Thumb ability for netherwart
|
||||||
mcmmo.ability.herbalism.greenthumb.plants.potato:
|
mcmmo.ability.herbalism.greenthumb.plants.potato:
|
||||||
description: Allows access to the Green Thumb ability for potatoes
|
description: Allows access to the Green Thumb ability for potatoes
|
||||||
mcmmo.ability.herbalism.greenthumbblocks:
|
|
||||||
default: false
|
|
||||||
description: Allows access to all Green Thumb abilities for blocks
|
|
||||||
children:
|
|
||||||
mcmmo.ability.herbalism.greenthumb.blocks.all: true
|
|
||||||
mcmmo.ability.herbalism.greenthumbcarrots:
|
|
||||||
default: false
|
|
||||||
description: Allows access to the Green Thumb ability for carrots
|
|
||||||
children:
|
|
||||||
mcmmo.ability.herbalism.greenthumb.plants.carrot: true
|
|
||||||
mcmmo.ability.herbalism.greenthumbcocoa:
|
|
||||||
default: false
|
|
||||||
description: Allows access to the Green Thumb ability for cocoa
|
|
||||||
children:
|
|
||||||
mcmmo.ability.herbalism.greenthumb.plants.cocoa: true
|
|
||||||
mcmmo.ability.herbalism.greenthumbnetherwart:
|
|
||||||
default: false
|
|
||||||
description: Allows access to the Green Thumb ability for netherwart
|
|
||||||
children:
|
|
||||||
mcmmo.ability.herbalism.greenthumb.plants.netherwarts: true
|
|
||||||
mcmmo.ability.herbalism.greenthumbpotatoes:
|
|
||||||
default: false
|
|
||||||
description: Allows access to the Green Thumb ability for potatoes
|
|
||||||
children:
|
|
||||||
mcmmo.ability.herbalism.greenthumb.plants.potato: true
|
|
||||||
mcmmo.ability.herbalism.greenthumbwheat:
|
|
||||||
default: false
|
|
||||||
description: Allows access to the Green Thumb ability for wheat
|
|
||||||
children:
|
|
||||||
mcmmo.ability.herbalism.greenthumb.plants.crops: true
|
|
||||||
mcmmo.ability.herbalism.hylianluck:
|
mcmmo.ability.herbalism.hylianluck:
|
||||||
description: Allows access to the Hylian Luck ability
|
description: Allows access to the Hylian Luck ability
|
||||||
mcmmo.ability.herbalism.shroomthumb:
|
mcmmo.ability.herbalism.shroomthumb:
|
||||||
@ -455,7 +398,7 @@ permissions:
|
|||||||
description: Allows ability to repair items of material type OTHER
|
description: Allows ability to repair items of material type OTHER
|
||||||
mcmmo.ability.repair.otherrepair:
|
mcmmo.ability.repair.otherrepair:
|
||||||
description: Allows ability to repair items of type OTHER
|
description: Allows ability to repair items of type OTHER
|
||||||
mcmmo.ability.repair.repairbonus:
|
mcmmo.ability.repair.superrepair:
|
||||||
description: Allows access to Super Repair bonus
|
description: Allows access to Super Repair bonus
|
||||||
mcmmo.ability.repair.repairmastery:
|
mcmmo.ability.repair.repairmastery:
|
||||||
description: Allows access to Repair Mastery
|
description: Allows access to Repair Mastery
|
||||||
@ -477,21 +420,16 @@ permissions:
|
|||||||
mcmmo.ability.smelting.all:
|
mcmmo.ability.smelting.all:
|
||||||
description: Allows access to all Smelting abilities
|
description: Allows access to all Smelting abilities
|
||||||
children:
|
children:
|
||||||
mcmmo.ability.smelting.doubledrops: true
|
mcmmo.ability.smelting.secondsmelt: true
|
||||||
mcmmo.ability.smelting.fluxmining: true
|
mcmmo.ability.smelting.fluxmining: true
|
||||||
mcmmo.ability.smelting.fuelefficiency: true
|
mcmmo.ability.smelting.fuelefficiency: true
|
||||||
mcmmo.ability.smelting.vanillaxpboost: true
|
mcmmo.ability.smelting.vanillaxpboost: true
|
||||||
mcmmo.ability.smelting.doubledrops:
|
|
||||||
description: Allows access to the Second Smelt ability
|
|
||||||
mcmmo.ability.smelting.fluxmining:
|
mcmmo.ability.smelting.fluxmining:
|
||||||
description: Allows access to the Flux Mining ability
|
description: Allows access to the Flux Mining ability
|
||||||
mcmmo.ability.smelting.fuelefficiency:
|
mcmmo.ability.smelting.fuelefficiency:
|
||||||
description: Allows access to the Fuel Efficiency ability
|
description: Allows access to the Fuel Efficiency ability
|
||||||
mcmmo.ability.smelting.secondsmelt:
|
mcmmo.ability.smelting.secondsmelt:
|
||||||
default: false
|
|
||||||
description: Allows access to the Second Smelt ability
|
description: Allows access to the Second Smelt ability
|
||||||
children:
|
|
||||||
mcmmo.ability.smelting.doubledrops: true
|
|
||||||
mcmmo.ability.smelting.vanillaxpboost:
|
mcmmo.ability.smelting.vanillaxpboost:
|
||||||
description: Allows vanilla XP boost from Smelting
|
description: Allows vanilla XP boost from Smelting
|
||||||
mcmmo.ability.swords.*:
|
mcmmo.ability.swords.*:
|
||||||
@ -503,11 +441,11 @@ permissions:
|
|||||||
description: Allows access to all Swords abilities
|
description: Allows access to all Swords abilities
|
||||||
children:
|
children:
|
||||||
mcmmo.ability.swords.bleed: true
|
mcmmo.ability.swords.bleed: true
|
||||||
mcmmo.ability.swords.counterattack: true
|
mcmmo.ability.swords.counter: true
|
||||||
mcmmo.ability.swords.serratedstrikes: true
|
mcmmo.ability.swords.serratedstrikes: true
|
||||||
mcmmo.ability.swords.bleed:
|
mcmmo.ability.swords.bleed:
|
||||||
description: Allows access to the Bleed ability
|
description: Allows access to the Bleed ability
|
||||||
mcmmo.ability.swords.counterattack:
|
mcmmo.ability.swords.counter:
|
||||||
description: Allows access to the Counter Attack ability
|
description: Allows access to the Counter Attack ability
|
||||||
mcmmo.ability.swords.serratedstrikes:
|
mcmmo.ability.swords.serratedstrikes:
|
||||||
description: Allows access to the Serrated Strikes ability
|
description: Allows access to the Serrated Strikes ability
|
||||||
@ -522,7 +460,7 @@ permissions:
|
|||||||
mcmmo.ability.taming.beastlore: true
|
mcmmo.ability.taming.beastlore: true
|
||||||
mcmmo.ability.taming.callofthewild.all: true
|
mcmmo.ability.taming.callofthewild.all: true
|
||||||
mcmmo.ability.taming.environmentallyaware: true
|
mcmmo.ability.taming.environmentallyaware: true
|
||||||
mcmmo.ability.taming.fastfoodservice: true
|
mcmmo.ability.taming.fastfood: true
|
||||||
mcmmo.ability.taming.gore: true
|
mcmmo.ability.taming.gore: true
|
||||||
mcmmo.ability.taming.holyhound: true
|
mcmmo.ability.taming.holyhound: true
|
||||||
mcmmo.ability.taming.sharpenedclaws: true
|
mcmmo.ability.taming.sharpenedclaws: true
|
||||||
@ -555,14 +493,9 @@ permissions:
|
|||||||
description: Allows players to rename pets with Call of the Wild
|
description: Allows players to rename pets with Call of the Wild
|
||||||
mcmmo.ability.taming.callofthewild.wolf:
|
mcmmo.ability.taming.callofthewild.wolf:
|
||||||
description: Allows players to summon Wolves with Call of the Wild
|
description: Allows players to summon Wolves with Call of the Wild
|
||||||
mcmmo.ability.taming.callofthewild_renamepets:
|
|
||||||
default: false
|
|
||||||
description: Pets spawned with Call of the Wild will have custom names
|
|
||||||
children:
|
|
||||||
mcmmo.ability.taming.callofthewild.renamepets: true
|
|
||||||
mcmmo.ability.taming.environmentallyaware:
|
mcmmo.ability.taming.environmentallyaware:
|
||||||
description: Allows access to the Environmentally Aware ability
|
description: Allows access to the Environmentally Aware ability
|
||||||
mcmmo.ability.taming.fastfoodservice:
|
mcmmo.ability.taming.fastfood:
|
||||||
description: Allows access to the Fast Food Service ability
|
description: Allows access to the Fast Food Service ability
|
||||||
mcmmo.ability.taming.gore:
|
mcmmo.ability.taming.gore:
|
||||||
description: Allows access to the Gore ability
|
description: Allows access to the Gore ability
|
||||||
@ -584,7 +517,7 @@ permissions:
|
|||||||
children:
|
children:
|
||||||
mcmmo.ability.unarmed.berserk: true
|
mcmmo.ability.unarmed.berserk: true
|
||||||
mcmmo.ability.unarmed.blockcracker: true
|
mcmmo.ability.unarmed.blockcracker: true
|
||||||
mcmmo.ability.unarmed.bonusdamage: true
|
mcmmo.ability.unarmed.ironarm: true
|
||||||
mcmmo.ability.unarmed.deflect: true
|
mcmmo.ability.unarmed.deflect: true
|
||||||
mcmmo.ability.unarmed.disarm: true
|
mcmmo.ability.unarmed.disarm: true
|
||||||
mcmmo.ability.unarmed.irongrip: true
|
mcmmo.ability.unarmed.irongrip: true
|
||||||
@ -592,8 +525,8 @@ permissions:
|
|||||||
description: Allows access to the Berserker ability
|
description: Allows access to the Berserker ability
|
||||||
mcmmo.ability.unarmed.blockcracker:
|
mcmmo.ability.unarmed.blockcracker:
|
||||||
description: Allows access to the Block Cracker ability
|
description: Allows access to the Block Cracker ability
|
||||||
mcmmo.ability.unarmed.bonusdamage:
|
mcmmo.ability.unarmed.ironarm:
|
||||||
description: Allows bonus damage from Unarmed
|
description: Allows bonus damage from the Iron Arm ability
|
||||||
mcmmo.ability.unarmed.deflect:
|
mcmmo.ability.unarmed.deflect:
|
||||||
description: Allows access to the Deflect ability
|
description: Allows access to the Deflect ability
|
||||||
mcmmo.ability.unarmed.disarm:
|
mcmmo.ability.unarmed.disarm:
|
||||||
@ -1843,3 +1776,128 @@ permissions:
|
|||||||
mcmmo.tools.updatecheck:
|
mcmmo.tools.updatecheck:
|
||||||
default: false
|
default: false
|
||||||
description: Notifies admins if there is a new version of mcMMO available
|
description: Notifies admins if there is a new version of mcMMO available
|
||||||
|
mcmmo.ability.fishing.shakemob:
|
||||||
|
default: false
|
||||||
|
description: deprecated
|
||||||
|
children:
|
||||||
|
mcmmo.ability.fishing.shake: true
|
||||||
|
mcmmo.ability.axes.impact:
|
||||||
|
default: false
|
||||||
|
description: deprecated
|
||||||
|
children:
|
||||||
|
mcmmo.ability.axes.armorimpact: true
|
||||||
|
mcmmo.ability.taming.fastfoodservice:
|
||||||
|
default: false
|
||||||
|
description: deprecated
|
||||||
|
children:
|
||||||
|
mcmmo.ability.taming.fastfood: true
|
||||||
|
mcmmo.ability.archery.trackarrows:
|
||||||
|
default: false
|
||||||
|
description: deprecated
|
||||||
|
children:
|
||||||
|
mcmmo.ability.archery.retrieve: true
|
||||||
|
mcmmo.ability.repair.repairbonus:
|
||||||
|
default: false
|
||||||
|
description: deprecated
|
||||||
|
children:
|
||||||
|
mcmmo.ability.repair.superrepair: true
|
||||||
|
mcmmo.ability.swords.counterattack:
|
||||||
|
default: false
|
||||||
|
description: deprecated
|
||||||
|
children:
|
||||||
|
mcmmo.ability.swords.counter: true
|
||||||
|
mcmmo.ability.archery.bonusdamage:
|
||||||
|
default: false
|
||||||
|
description: deprecated
|
||||||
|
children:
|
||||||
|
mcmmo.ability.archery.skillshot: true
|
||||||
|
mcmmo.ability.excavation.treasures:
|
||||||
|
default: false
|
||||||
|
description: deprecated
|
||||||
|
children:
|
||||||
|
mcmmo.ability.excavation.treasurehunter: true
|
||||||
|
mcmmo.ability.fishing.treasures:
|
||||||
|
default: false
|
||||||
|
description: deprecated
|
||||||
|
children:
|
||||||
|
mcmmo.ability.fishing.treasurehunter: true
|
||||||
|
mcmmo.ability.fishing.magic:
|
||||||
|
default: false
|
||||||
|
description: deprecated
|
||||||
|
children:
|
||||||
|
mcmmo.ability.fishing.magichunter: true
|
||||||
|
mcmmo.ability.unarmed.bonusdamage:
|
||||||
|
default: false
|
||||||
|
description: deprecated
|
||||||
|
children:
|
||||||
|
mcmmo.ability.unarmed.ironarm: true
|
||||||
|
mcmmo.ability.axes.bonusdamage:
|
||||||
|
default: false
|
||||||
|
description: deprecated
|
||||||
|
children:
|
||||||
|
mcmmo.ability.axes.axemastery: true
|
||||||
|
mcmmo.ability.smelting.doubledrops:
|
||||||
|
default: false
|
||||||
|
description: deprecated
|
||||||
|
children:
|
||||||
|
mcmmo.ability.smelting.secondsmelt: true
|
||||||
|
mcmmo.ability.taming.callofthewild_renamepets:
|
||||||
|
default: false
|
||||||
|
description: deprecated
|
||||||
|
children:
|
||||||
|
mcmmo.ability.taming.callofthewild.renamepets: true
|
||||||
|
mcmmo.ability.blastmining.*:
|
||||||
|
default: false
|
||||||
|
description: deprecated
|
||||||
|
children:
|
||||||
|
mcmmo.ability.mining.blastmining.*: true
|
||||||
|
mcmmo.ability.blastmining.all:
|
||||||
|
default: false
|
||||||
|
description: deprecated
|
||||||
|
children:
|
||||||
|
mcmmo.ability.mining.blastmining.all: true
|
||||||
|
mcmmo.ability.blastmining.biggerbombs:
|
||||||
|
default: false
|
||||||
|
description: deprecated
|
||||||
|
children:
|
||||||
|
mcmmo.ability.mining.blastmining.biggerbombs: true
|
||||||
|
mcmmo.ability.blastmining.demolitionsexpertise:
|
||||||
|
default: false
|
||||||
|
description: deprecated
|
||||||
|
children:
|
||||||
|
mcmmo.ability.mining.blastmining.demolitionsexpertise: true
|
||||||
|
mcmmo.ability.blastmining.detonate:
|
||||||
|
default: false
|
||||||
|
description: deprecated
|
||||||
|
children:
|
||||||
|
mcmmo.ability.mining.blastmining.detonate: true
|
||||||
|
mcmmo.ability.herbalism.greenthumbblocks:
|
||||||
|
default: false
|
||||||
|
description: deprecated
|
||||||
|
children:
|
||||||
|
mcmmo.ability.herbalism.greenthumb.blocks.all: true
|
||||||
|
mcmmo.ability.herbalism.greenthumbcarrots:
|
||||||
|
default: false
|
||||||
|
description: deprecated
|
||||||
|
children:
|
||||||
|
mcmmo.ability.herbalism.greenthumb.plants.carrot: true
|
||||||
|
mcmmo.ability.herbalism.greenthumbcocoa:
|
||||||
|
default: false
|
||||||
|
description: deprecated
|
||||||
|
children:
|
||||||
|
mcmmo.ability.herbalism.greenthumb.plants.cocoa: true
|
||||||
|
mcmmo.ability.herbalism.greenthumbnetherwart:
|
||||||
|
default: false
|
||||||
|
description: deprecated
|
||||||
|
children:
|
||||||
|
mcmmo.ability.herbalism.greenthumb.plants.netherwarts: true
|
||||||
|
mcmmo.ability.herbalism.greenthumbpotatoes:
|
||||||
|
default: false
|
||||||
|
description: deprecated
|
||||||
|
children:
|
||||||
|
mcmmo.ability.herbalism.greenthumb.plants.potato: true
|
||||||
|
mcmmo.ability.herbalism.greenthumbwheat:
|
||||||
|
default: false
|
||||||
|
description: deprecated
|
||||||
|
children:
|
||||||
|
mcmmo.ability.herbalism.greenthumb.plants.crops: true
|
||||||
|
Loading…
Reference in New Issue
Block a user