SecondaryAbility's API additions

This commit is contained in:
t00thpick1
2013-11-22 12:32:23 -05:00
parent 5d63a4b910
commit 870987bba7
60 changed files with 658 additions and 596 deletions

View File

@ -20,9 +20,6 @@ import com.gmail.nossr50.util.ModUtils;
import com.gmail.nossr50.util.skills.SkillUtils;
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 treeFellerThreshold = Config.getInstance().getTreeFellerThreshold();

View File

@ -14,6 +14,7 @@ import org.bukkit.material.Tree;
import com.gmail.nossr50.datatypes.mods.CustomBlock;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
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.locale.LocaleLoader;
import com.gmail.nossr50.skills.SkillManager;
@ -32,7 +33,7 @@ public class WoodcuttingManager extends SkillManager {
}
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) {
@ -40,7 +41,7 @@ public class WoodcuttingManager extends SkillManager {
}
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);
}
/**