Wire up Super Ability config pt 1

This commit is contained in:
nossr50
2019-03-19 05:00:21 -07:00
parent e933efcee0
commit 45430d9c25
13 changed files with 113 additions and 53 deletions

View File

@ -6,6 +6,7 @@ import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.datatypes.treasure.ExcavationTreasure;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.skills.SkillManager;
import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.Permissions;
@ -78,6 +79,6 @@ public class ExcavationManager extends SkillManager {
excavationBlockCheck(blockState);
excavationBlockCheck(blockState);
SkillUtils.handleDurabilityChange(getPlayer().getInventory().getItemInMainHand(), MainConfig.getInstance().getAbilityToolDamage());
SkillUtils.handleDurabilityChange(getPlayer().getInventory().getItemInMainHand(), mcMMO.getConfigManager().getConfigSuperAbilities().getSuperAbilityLimits().getToolDurabilityDamage());
}
}

View File

@ -77,7 +77,7 @@ public class MiningManager extends SkillManager {
Material material = blockState.getType();
if (mcMMOPlayer.getAbilityMode(skill.getAbility())) {
SkillUtils.handleDurabilityChange(getPlayer().getInventory().getItemInMainHand(), MainConfig.getInstance().getAbilityToolDamage());
SkillUtils.handleDurabilityChange(getPlayer().getInventory().getItemInMainHand(), mcMMO.getConfigManager().getConfigSuperAbilities().getSuperAbilityLimits().getToolDurabilityDamage());
}
//if ((mcMMO.getModManager().isCustomMiningBlock(blockState) && !mcMMO.getModManager().getBlock(blockState).isDoubleDropEnabled()) || !MainConfig.getInstance().getDoubleDropsEnabled(skill, material)) {

View File

@ -17,9 +17,6 @@ import java.util.List;
import java.util.Set;
public final class Woodcutting {
public static int treeFellerThreshold = MainConfig.getInstance().getTreeFellerThreshold();
protected static boolean treeFellerReachedThreshold = false;
protected enum ExperienceGainMethod {
@ -152,7 +149,7 @@ public final class Woodcutting {
for (BlockState blockState : treeFellerBlocks) {
if (BlockUtils.isLog(blockState)) {
durabilityLoss += MainConfig.getInstance().getAbilityToolDamage();
durabilityLoss += mcMMO.getConfigManager().getConfigSuperAbilities().getSuperAbilityLimits().getToolDurabilityDamage();
}
}
@ -178,7 +175,7 @@ public final class Woodcutting {
}
// Without this check Tree Feller propagates through leaves until the threshold is hit
if (treeFellerBlocks.size() > treeFellerThreshold) {
if (treeFellerBlocks.size() > mcMMO.getConfigManager().getConfigSuperAbilities().getSuperAbilityLimits().getTreeFeller().getTreeFellerLimit()) {
treeFellerReachedThreshold = true;
}