mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-08-02 04:25:26 +02:00
All skills should be on the new rank system now
This commit is contained in:
@@ -2,8 +2,10 @@ package com.gmail.nossr50.skills.mining;
|
||||
|
||||
import com.gmail.nossr50.config.AdvancedConfig;
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.datatypes.skills.SubSkillType;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
import com.gmail.nossr50.util.skills.RankUtils;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.TNTPrimed;
|
||||
@@ -15,7 +17,7 @@ import java.util.List;
|
||||
|
||||
public class BlastMining {
|
||||
// The order of the values is extremely important, a few methods depend on it to work properly
|
||||
public enum Tier {
|
||||
/* public enum Tier {
|
||||
EIGHT(8),
|
||||
SEVEN(7),
|
||||
SIX(6),
|
||||
@@ -39,52 +41,58 @@ public class BlastMining {
|
||||
return AdvancedConfig.getInstance().getBlastMiningRankLevel(this);
|
||||
}
|
||||
|
||||
protected double getBlastRadiusModifier() {
|
||||
return AdvancedConfig.getInstance().getBlastRadiusModifier(this);
|
||||
}
|
||||
|
||||
protected double getOreBonus() {
|
||||
return AdvancedConfig.getInstance().getOreBonus(this);
|
||||
}
|
||||
|
||||
protected double getDebrisReduction() {
|
||||
return AdvancedConfig.getInstance().getDebrisReduction(this);
|
||||
}
|
||||
|
||||
protected double getBlastDamageDecrease() {
|
||||
return AdvancedConfig.getInstance().getBlastDamageDecrease(this);
|
||||
}
|
||||
|
||||
protected int getDropMultiplier() {
|
||||
return AdvancedConfig.getInstance().getDropMultiplier(this);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
public static Material detonator = Config.getInstance().getDetonatorItem();
|
||||
|
||||
public final static int MAXIMUM_REMOTE_DETONATION_DISTANCE = 100;
|
||||
|
||||
public static double getBlastRadiusModifier(int rank) {
|
||||
return AdvancedConfig.getInstance().getBlastRadiusModifier(rank);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static double getBlastDamageDecrease(int rank) {
|
||||
return AdvancedConfig.getInstance().getBlastDamageDecrease(rank);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static int getDemolitionExpertUnlockLevel() {
|
||||
List<Tier> tierList = Arrays.asList(Tier.values());
|
||||
/*List<Tier> tierList = Arrays.asList(Tier.values());
|
||||
for (Tier tier : tierList) {
|
||||
if (tier.getBlastDamageDecrease() > 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
return tier == Tier.EIGHT ? tier.getLevel() : tierList.get(tierList.indexOf(tier) - 1).getLevel();
|
||||
}*/
|
||||
|
||||
for(int i = 0; i < SubSkillType.MINING_BLAST_MINING.getNumRanks()-1; i++)
|
||||
{
|
||||
if(getBlastDamageDecrease(i+1) > 0)
|
||||
return RankUtils.getRankUnlockLevel(SubSkillType.MINING_BLAST_MINING, i+1);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int getBiggerBombsUnlockLevel() {
|
||||
List<Tier> tierList = Arrays.asList(Tier.values());
|
||||
/*List<Tier> tierList = Arrays.asList(Tier.values());
|
||||
for (Tier tier : tierList) {
|
||||
if (tier.getBlastRadiusModifier() > 1.0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
return tier == Tier.EIGHT ? tier.getLevel() : tierList.get(tierList.indexOf(tier) - 1).getLevel();
|
||||
}*/
|
||||
|
||||
for(int i = 0; i < SubSkillType.MINING_BLAST_MINING.getNumRanks()-1; i++)
|
||||
{
|
||||
if(getBlastRadiusModifier(i+1) > 0)
|
||||
return RankUtils.getRankUnlockLevel(SubSkillType.MINING_BLAST_MINING, i+1);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@@ -1,5 +1,6 @@
|
||||
package com.gmail.nossr50.skills.mining;
|
||||
|
||||
import com.gmail.nossr50.config.AdvancedConfig;
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.datatypes.interactions.NotificationType;
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
@@ -10,12 +11,12 @@ import com.gmail.nossr50.datatypes.skills.XPGainReason;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.runnables.skills.AbilityCooldownTask;
|
||||
import com.gmail.nossr50.skills.SkillManager;
|
||||
import com.gmail.nossr50.skills.mining.BlastMining.Tier;
|
||||
import com.gmail.nossr50.util.BlockUtils;
|
||||
import com.gmail.nossr50.util.EventUtils;
|
||||
import com.gmail.nossr50.util.Misc;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.player.NotificationManager;
|
||||
import com.gmail.nossr50.util.skills.RankUtils;
|
||||
import com.gmail.nossr50.util.skills.SkillActivationType;
|
||||
import com.gmail.nossr50.util.skills.SkillUtils;
|
||||
import org.bukkit.Material;
|
||||
@@ -45,7 +46,8 @@ public class MiningManager extends SkillManager {
|
||||
}
|
||||
|
||||
public boolean canUseBlastMining() {
|
||||
return getSkillLevel() >= BlastMining.Tier.ONE.getLevel();
|
||||
//Not checking permissions?
|
||||
return RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.MINING_BLAST_MINING);
|
||||
}
|
||||
|
||||
public boolean canUseBiggerBombs() {
|
||||
@@ -193,15 +195,7 @@ public class MiningManager extends SkillManager {
|
||||
* @return the Blast Mining tier
|
||||
*/
|
||||
public int getBlastMiningTier() {
|
||||
int skillLevel = getSkillLevel();
|
||||
|
||||
for (Tier tier : Tier.values()) {
|
||||
if (skillLevel >= tier.getLevel()) {
|
||||
return tier.toNumerical();
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
return RankUtils.getRank(getPlayer(), SubSkillType.MINING_BLAST_MINING);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -210,15 +204,15 @@ public class MiningManager extends SkillManager {
|
||||
* @return the Blast Mining tier
|
||||
*/
|
||||
public double getOreBonus() {
|
||||
int skillLevel = getSkillLevel();
|
||||
return getOreBonus(getBlastMiningTier());
|
||||
}
|
||||
|
||||
for (Tier tier : Tier.values()) {
|
||||
if (skillLevel >= tier.getLevel()) {
|
||||
return tier.getOreBonus();
|
||||
}
|
||||
}
|
||||
public static double getOreBonus(int rank) {
|
||||
return AdvancedConfig.getInstance().getOreBonus(rank);
|
||||
}
|
||||
|
||||
return 0;
|
||||
public static double getDebrisReduction(int rank) {
|
||||
return AdvancedConfig.getInstance().getDebrisReduction(rank);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -227,15 +221,11 @@ public class MiningManager extends SkillManager {
|
||||
* @return the Blast Mining tier
|
||||
*/
|
||||
public double getDebrisReduction() {
|
||||
int skillLevel = getSkillLevel();
|
||||
return getDebrisReduction(getBlastMiningTier());
|
||||
}
|
||||
|
||||
for (Tier tier : Tier.values()) {
|
||||
if (skillLevel >= tier.getLevel()) {
|
||||
return tier.getDebrisReduction();
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
public static int getDropMultiplier(int rank) {
|
||||
return AdvancedConfig.getInstance().getDropMultiplier(rank);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -244,15 +234,7 @@ public class MiningManager extends SkillManager {
|
||||
* @return the Blast Mining tier
|
||||
*/
|
||||
public int getDropMultiplier() {
|
||||
int skillLevel = getSkillLevel();
|
||||
|
||||
for (Tier tier : Tier.values()) {
|
||||
if (skillLevel >= tier.getLevel()) {
|
||||
return tier.getDropMultiplier();
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
return getDropMultiplier(getBlastMiningTier());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -261,15 +243,7 @@ public class MiningManager extends SkillManager {
|
||||
* @return the Blast Mining tier
|
||||
*/
|
||||
public double getBlastRadiusModifier() {
|
||||
int skillLevel = getSkillLevel();
|
||||
|
||||
for (Tier tier : Tier.values()) {
|
||||
if (skillLevel >= tier.getLevel()) {
|
||||
return tier.getBlastRadiusModifier();
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
return BlastMining.getBlastRadiusModifier(getBlastMiningTier());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -278,15 +252,7 @@ public class MiningManager extends SkillManager {
|
||||
* @return the Blast Mining tier
|
||||
*/
|
||||
public double getBlastDamageModifier() {
|
||||
int skillLevel = getSkillLevel();
|
||||
|
||||
for (Tier tier : Tier.values()) {
|
||||
if (skillLevel >= tier.getLevel()) {
|
||||
return tier.getBlastDamageDecrease();
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
return BlastMining.getBlastDamageDecrease(getBlastMiningTier());
|
||||
}
|
||||
|
||||
private boolean blastMiningCooldownOver() {
|
||||
|
Reference in New Issue
Block a user