GIANT Blast Mining update. Lots of new config options in advanced.yml

This commit is contained in:
GJ 2013-02-27 15:45:15 -05:00
parent a7f858ab03
commit c3eaec513b
13 changed files with 474 additions and 458 deletions

View File

@ -128,6 +128,51 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
public int getBlastMiningRank7() { return config.getInt("Skills.Mining.BlastMining_Rank7", 875); } public int getBlastMiningRank7() { return config.getInt("Skills.Mining.BlastMining_Rank7", 875); }
public int getBlastMiningRank8() { return config.getInt("Skills.Mining.BlastMining_Rank8", 1000); } public int getBlastMiningRank8() { return config.getInt("Skills.Mining.BlastMining_Rank8", 1000); }
public double getBlastDamageDecreaseRank1() { return config.getDouble("Skills.Mining.BlastDamageDecrease_Rank1", 0.0D); }
public double getBlastDamageDecreaseRank2() { return config.getDouble("Skills.Mining.BlastDamageDecrease_Rank2", 0.0D); }
public double getBlastDamageDecreaseRank3() { return config.getDouble("Skills.Mining.BlastDamageDecrease_Rank3", 0.0D); }
public double getBlastDamageDecreaseRank4() { return config.getDouble("Skills.Mining.BlastDamageDecrease_Rank4", 25.0D); }
public double getBlastDamageDecreaseRank5() { return config.getDouble("Skills.Mining.BlastDamageDecrease_Rank5", 25.0D); }
public double getBlastDamageDecreaseRank6() { return config.getDouble("Skills.Mining.BlastDamageDecrease_Rank6", 50.0D); }
public double getBlastDamageDecreaseRank7() { return config.getDouble("Skills.Mining.BlastDamageDecrease_Rank7", 50.0D); }
public double getBlastDamageDecreaseRank8() { return config.getDouble("Skills.Mining.BlastDamageDecrease_Rank8", 100.0D); }
public double getOreBonusRank1() { return config.getDouble("Skills.Mining.OreBonus_Rank1", 35.0D); }
public double getOreBonusRank2() { return config.getDouble("Skills.Mining.OreBonus_Rank2", 40.0D); }
public double getOreBonusRank3() { return config.getDouble("Skills.Mining.OreBonus_Rank3", 45.0D); }
public double getOreBonusRank4() { return config.getDouble("Skills.Mining.OreBonus_Rank4", 50.0D); }
public double getOreBonusRank5() { return config.getDouble("Skills.Mining.OreBonus_Rank5", 55.0D); }
public double getOreBonusRank6() { return config.getDouble("Skills.Mining.OreBonus_Rank6", 60.0D); }
public double getOreBonusRank7() { return config.getDouble("Skills.Mining.OreBonus_Rank7", 65.0D); }
public double getOreBonusRank8() { return config.getDouble("Skills.Mining.OreBonus_Rank8", 70.0D); }
public double getDebrisReductionRank1() { return config.getDouble("Skills.Mining.DebrisReduction_Rank1", 10.0D); }
public double getDebrisReductionRank2() { return config.getDouble("Skills.Mining.DebrisReduction_Rank2", 20.0D); }
public double getDebrisReductionRank3() { return config.getDouble("Skills.Mining.DebrisReduction_Rank3", 30.0D); }
public double getDebrisReductionRank4() { return config.getDouble("Skills.Mining.DebrisReduction_Rank4", 30.0D); }
public double getDebrisReductionRank5() { return config.getDouble("Skills.Mining.DebrisReduction_Rank5", 30.0D); }
public double getDebrisReductionRank6() { return config.getDouble("Skills.Mining.DebrisReduction_Rank6", 30.0D); }
public double getDebrisReductionRank7() { return config.getDouble("Skills.Mining.DebrisReduction_Rank7", 30.0D); }
public double getDebrisReductionRank8() { return config.getDouble("Skills.Mining.DebrisReduction_Rank8", 30.0D); }
public int getDropMultiplierRank1() { return config.getInt("Skills.Mining.DropMultiplier_Rank1", 1); }
public int getDropMultiplierRank2() { return config.getInt("Skills.Mining.DropMultiplier_Rank2", 1); }
public int getDropMultiplierRank3() { return config.getInt("Skills.Mining.DropMultiplier_Rank3", 1); }
public int getDropMultiplierRank4() { return config.getInt("Skills.Mining.DropMultiplier_Rank4", 1); }
public int getDropMultiplierRank5() { return config.getInt("Skills.Mining.DropMultiplier_Rank5", 2); }
public int getDropMultiplierRank6() { return config.getInt("Skills.Mining.DropMultiplier_Rank6", 2); }
public int getDropMultiplierRank7() { return config.getInt("Skills.Mining.DropMultiplier_Rank7", 3); }
public int getDropMultiplierRank8() { return config.getInt("Skills.Mining.DropMultiplier_Rank8", 3); }
public double getBlastRadiusModifierRank1() { return config.getDouble("Skills.Mining.BlastRadiusModifier_Rank1", 1.0); }
public double getBlastRadiusModifierRank2() { return config.getDouble("Skills.Mining.BlastRadiusModifier_Rank2", 1.0); }
public double getBlastRadiusModifierRank3() { return config.getDouble("Skills.Mining.BlastRadiusModifier_Rank3", 2.0); }
public double getBlastRadiusModifierRank4() { return config.getDouble("Skills.Mining.BlastRadiusModifier_Rank4", 2.0); }
public double getBlastRadiusModifierRank5() { return config.getDouble("Skills.Mining.BlastRadiusModifier_Rank5", 3.0); }
public double getBlastRadiusModifierRank6() { return config.getDouble("Skills.Mining.BlastRadiusModifier_Rank6", 3.0); }
public double getBlastRadiusModifierRank7() { return config.getDouble("Skills.Mining.BlastRadiusModifier_Rank7", 4.0); }
public double getBlastRadiusModifierRank8() { return config.getDouble("Skills.Mining.BlastRadiusModifier_Rank8", 4.0); }
/* 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); }

View File

@ -32,7 +32,7 @@ import com.gmail.nossr50.runnables.StickyPistonTracker;
import com.gmail.nossr50.skills.SkillManagerStore; import com.gmail.nossr50.skills.SkillManagerStore;
import com.gmail.nossr50.skills.excavation.ExcavationManager; import com.gmail.nossr50.skills.excavation.ExcavationManager;
import com.gmail.nossr50.skills.herbalism.HerbalismManager; import com.gmail.nossr50.skills.herbalism.HerbalismManager;
import com.gmail.nossr50.skills.mining.Mining; import com.gmail.nossr50.skills.mining.MiningManager;
import com.gmail.nossr50.skills.repair.Repair; import com.gmail.nossr50.skills.repair.Repair;
import com.gmail.nossr50.skills.repair.Salvage; import com.gmail.nossr50.skills.repair.Salvage;
import com.gmail.nossr50.skills.smelting.Smelting; import com.gmail.nossr50.skills.smelting.Smelting;
@ -179,10 +179,11 @@ public class BlockListener implements Listener {
/* MINING */ /* MINING */
else if (BlockChecks.affectedBySuperBreaker(blockState) && ItemChecks.isPickaxe(heldItem) && Permissions.skillEnabled(player, SkillType.MINING) && !mcMMO.placeStore.isTrue(blockState)) { else if (BlockChecks.affectedBySuperBreaker(blockState) && ItemChecks.isPickaxe(heldItem) && Permissions.skillEnabled(player, SkillType.MINING) && !mcMMO.placeStore.isTrue(blockState)) {
Mining.miningBlockCheck(blockState, player); MiningManager miningManager = SkillManagerStore.getInstance().getMiningManager(player.getName());
miningManager.miningBlockCheck(blockState);
if (profile.getAbilityMode(AbilityType.SUPER_BREAKER)) { if (profile.getAbilityMode(AbilityType.SUPER_BREAKER)) {
Mining.miningBlockCheck(blockState, player); miningManager.miningBlockCheck(blockState);
} }
} }

View File

@ -36,7 +36,7 @@ import com.gmail.nossr50.skills.SkillManagerStore;
import com.gmail.nossr50.skills.archery.Archery; import com.gmail.nossr50.skills.archery.Archery;
import com.gmail.nossr50.skills.fishing.Fishing; import com.gmail.nossr50.skills.fishing.Fishing;
import com.gmail.nossr50.skills.herbalism.Herbalism; import com.gmail.nossr50.skills.herbalism.Herbalism;
import com.gmail.nossr50.skills.mining.BlastMining; import com.gmail.nossr50.skills.mining.MiningManager;
import com.gmail.nossr50.skills.runnables.BleedTimer; import com.gmail.nossr50.skills.runnables.BleedTimer;
import com.gmail.nossr50.skills.taming.Taming; import com.gmail.nossr50.skills.taming.Taming;
import com.gmail.nossr50.skills.utilities.CombatTools; import com.gmail.nossr50.skills.utilities.CombatTools;
@ -189,8 +189,10 @@ public class EntityListener implements Listener {
break; break;
case BLOCK_EXPLOSION: case BLOCK_EXPLOSION:
if (Permissions.demolitionsExpertise(player)) { MiningManager miningManager = SkillManagerStore.getInstance().getMiningManager(player.getName());
event.setDamage(BlastMining.processDemolitionsExpertise(player, event.getDamage()));
if (miningManager.canUseDemolitionsExpertise()) {
event.setDamage(miningManager.processDemolitionsExpertise(event.getDamage()));
if (event.getDamage() == 0) { if (event.getDamage() == 0) {
event.setCancelled(true); event.setCancelled(true);
@ -323,10 +325,10 @@ public class EntityListener implements Listener {
int id = entity.getEntityId(); int id = entity.getEntityId();
if (plugin.tntIsTracked(id)) { if (plugin.tntIsTracked(id)) {
Player player = plugin.getTNTPlayer(id); MiningManager miningManager = SkillManagerStore.getInstance().getMiningManager(plugin.getTNTPlayer(id).getName());
if (Permissions.biggerBombs(player)) { if (miningManager.canUseBiggerBombs()) {
SkillManagerStore.getInstance().getMiningManager(player.getName()).biggerBombs(event); event.setRadius(miningManager.biggerBombs(event.getRadius()));
} }
} }
} }
@ -345,9 +347,12 @@ public class EntityListener implements Listener {
int id = entity.getEntityId(); int id = entity.getEntityId();
if (plugin.tntIsTracked(id)) { if (plugin.tntIsTracked(id)) {
Player player = plugin.getTNTPlayer(id); MiningManager miningManager = SkillManagerStore.getInstance().getMiningManager(plugin.getTNTPlayer(id).getName());
SkillManagerStore.getInstance().getMiningManager(player.getName()).blastMiningDropProcessing(event); if (miningManager.canUseBlastMining()) {
miningManager.blastMiningDropProcessing(event.getYield(), event.blockList());
event.setYield(0);
}
plugin.removeFromTNTTracker(id); plugin.removeFromTNTTracker(id);
} }

View File

@ -36,7 +36,6 @@ import com.gmail.nossr50.party.ShareHandler;
import com.gmail.nossr50.skills.SkillManagerStore; import com.gmail.nossr50.skills.SkillManagerStore;
import com.gmail.nossr50.skills.fishing.FishingManager; import com.gmail.nossr50.skills.fishing.FishingManager;
import com.gmail.nossr50.skills.herbalism.HerbalismManager; import com.gmail.nossr50.skills.herbalism.HerbalismManager;
import com.gmail.nossr50.skills.mining.BlastMining;
import com.gmail.nossr50.skills.repair.Repair; import com.gmail.nossr50.skills.repair.Repair;
import com.gmail.nossr50.skills.repair.Salvage; import com.gmail.nossr50.skills.repair.Salvage;
import com.gmail.nossr50.skills.runnables.BleedTimer; import com.gmail.nossr50.skills.runnables.BleedTimer;
@ -296,16 +295,21 @@ public class PlayerListener implements Listener {
player.updateInventory(); player.updateInventory();
} }
/* BLAST MINING CHECK */ /* BLAST MINING CHECK */
else if (player.isSneaking() && Permissions.remoteDetonation(player) && heldItem.getTypeId() == BlastMining.detonatorID) { else if (SkillManagerStore.getInstance().getMiningManager(player.getName()).canDetonate()) {
SkillManagerStore.getInstance().getMiningManager(player.getName()).detonate(event); if (blockID == Material.TNT.getId()) {
event.setCancelled(true); // Don't detonate the TNT if they're too close
}
else {
SkillManagerStore.getInstance().getMiningManager(player.getName()).remoteDetonation();
}
} }
break; break;
case RIGHT_CLICK_AIR: case RIGHT_CLICK_AIR:
/* BLAST MINING CHECK */ /* BLAST MINING CHECK */
if (player.isSneaking() && Permissions.remoteDetonation(player) && heldItem.getTypeId() == BlastMining.detonatorID) { if (SkillManagerStore.getInstance().getMiningManager(player.getName()).canDetonate()) {
SkillManagerStore.getInstance().getMiningManager(player.getName()).detonate(event); SkillManagerStore.getInstance().getMiningManager(player.getName()).remoteDetonation();
} }
break; break;

View File

@ -1,42 +0,0 @@
package com.gmail.nossr50.skills.mining;
import org.bukkit.event.entity.ExplosionPrimeEvent;
public class BiggerBombsEventHandler {
private int skillLevel;
private ExplosionPrimeEvent event;
private float radius;
private float radiusModifier;
protected BiggerBombsEventHandler(MiningManager manager, ExplosionPrimeEvent event) {
this.skillLevel = manager.getSkillLevel();
this.event = event;
this.radius = event.getRadius();
}
protected void calculateRadiusIncrease() {
if (skillLevel < BlastMining.rank2) {
return;
}
if (skillLevel >= BlastMining.rank8) {
radiusModifier = 4.0f;
}
else if (skillLevel >= BlastMining.rank6) {
radiusModifier = 3.0f;
}
else if (skillLevel >= BlastMining.rank4) {
radiusModifier = 2.0f;
}
else if (skillLevel >= BlastMining.rank2) {
radiusModifier = 1.0f;
}
}
protected void modifyBlastRadius() {
radius = radius + radiusModifier;
event.setRadius(radius);
}
}

View File

@ -1,46 +1,103 @@
package com.gmail.nossr50.skills.mining; package com.gmail.nossr50.skills.mining;
import org.bukkit.entity.Player; import java.util.HashSet;
import org.bukkit.Material;
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.skills.utilities.SkillTools;
import com.gmail.nossr50.skills.utilities.SkillType;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.Users;
public class BlastMining { public class BlastMining {
public static int rank1 = AdvancedConfig.getInstance().getBlastMiningRank1(); // The order of the values is extremely important, a few methods depend on it to work properly
public static int rank2 = AdvancedConfig.getInstance().getBlastMiningRank2(); protected enum Tier {
public static int rank3 = AdvancedConfig.getInstance().getBlastMiningRank3(); EIGHT(8) {
public static int rank4 = AdvancedConfig.getInstance().getBlastMiningRank4(); @Override public int getLevel() {return AdvancedConfig.getInstance().getBlastMiningRank8();}
public static int rank5 = AdvancedConfig.getInstance().getBlastMiningRank5(); @Override public double getBlastRadiusModifier() {return AdvancedConfig.getInstance().getBlastRadiusModifierRank8();}
public static int rank6 = AdvancedConfig.getInstance().getBlastMiningRank6(); @Override public double getOreBonus() {return AdvancedConfig.getInstance().getOreBonusRank8();}
public static int rank7 = AdvancedConfig.getInstance().getBlastMiningRank7(); @Override public double getDebrisReduction() {return AdvancedConfig.getInstance().getDebrisReductionRank8();}
public static int rank8 = AdvancedConfig.getInstance().getBlastMiningRank8(); @Override public double getBlastDamageDecrease() {return AdvancedConfig.getInstance().getBlastDamageDecreaseRank8();}
@Override public int getDropMultiplier() {return AdvancedConfig.getInstance().getDropMultiplierRank8();}},
SEVEN(7) {
@Override public int getLevel() {return AdvancedConfig.getInstance().getBlastMiningRank7();}
@Override public double getBlastRadiusModifier() {return AdvancedConfig.getInstance().getBlastRadiusModifierRank7();}
@Override public double getOreBonus() {return AdvancedConfig.getInstance().getOreBonusRank7();}
@Override public double getDebrisReduction() {return AdvancedConfig.getInstance().getDebrisReductionRank7();}
@Override public double getBlastDamageDecrease() {return AdvancedConfig.getInstance().getBlastDamageDecreaseRank7();}
@Override public int getDropMultiplier() {return AdvancedConfig.getInstance().getDropMultiplierRank7();}},
SIX(6) {
@Override public int getLevel() {return AdvancedConfig.getInstance().getBlastMiningRank6();}
@Override public double getBlastRadiusModifier() {return AdvancedConfig.getInstance().getBlastRadiusModifierRank6();}
@Override public double getOreBonus() {return AdvancedConfig.getInstance().getOreBonusRank6();}
@Override public double getDebrisReduction() {return AdvancedConfig.getInstance().getDebrisReductionRank6();}
@Override public double getBlastDamageDecrease() {return AdvancedConfig.getInstance().getBlastDamageDecreaseRank6();}
@Override public int getDropMultiplier() {return AdvancedConfig.getInstance().getDropMultiplierRank6();}},
FIVE(5) {
@Override public int getLevel() {return AdvancedConfig.getInstance().getBlastMiningRank5();}
@Override public double getBlastRadiusModifier() {return AdvancedConfig.getInstance().getBlastRadiusModifierRank5();}
@Override public double getOreBonus() {return AdvancedConfig.getInstance().getOreBonusRank5();}
@Override public double getDebrisReduction() {return AdvancedConfig.getInstance().getDebrisReductionRank5();}
@Override public double getBlastDamageDecrease() {return AdvancedConfig.getInstance().getBlastDamageDecreaseRank5();}
@Override public int getDropMultiplier() {return AdvancedConfig.getInstance().getDropMultiplierRank5();}},
FOUR(4) {
@Override public int getLevel() {return AdvancedConfig.getInstance().getBlastMiningRank4();}
@Override public double getBlastRadiusModifier() {return AdvancedConfig.getInstance().getBlastRadiusModifierRank4();}
@Override public double getOreBonus() {return AdvancedConfig.getInstance().getOreBonusRank4();}
@Override public double getDebrisReduction() {return AdvancedConfig.getInstance().getDebrisReductionRank4();}
@Override public double getBlastDamageDecrease() {return AdvancedConfig.getInstance().getBlastDamageDecreaseRank4();}
@Override public int getDropMultiplier() {return AdvancedConfig.getInstance().getDropMultiplierRank4();}},
THREE(3) {
@Override public int getLevel() {return AdvancedConfig.getInstance().getBlastMiningRank3();}
@Override public double getBlastRadiusModifier() {return AdvancedConfig.getInstance().getBlastRadiusModifierRank3();}
@Override public double getOreBonus() {return AdvancedConfig.getInstance().getOreBonusRank3();}
@Override public double getDebrisReduction() {return AdvancedConfig.getInstance().getDebrisReductionRank3();}
@Override public double getBlastDamageDecrease() {return AdvancedConfig.getInstance().getBlastDamageDecreaseRank3();}
@Override public int getDropMultiplier() {return AdvancedConfig.getInstance().getDropMultiplierRank3();}},
TWO(2) {
@Override public int getLevel() {return AdvancedConfig.getInstance().getBlastMiningRank2();}
@Override public double getBlastRadiusModifier() {return AdvancedConfig.getInstance().getBlastRadiusModifierRank2();}
@Override public double getOreBonus() {return AdvancedConfig.getInstance().getOreBonusRank2();}
@Override public double getDebrisReduction() {return AdvancedConfig.getInstance().getDebrisReductionRank2();}
@Override public double getBlastDamageDecrease() {return AdvancedConfig.getInstance().getBlastDamageDecreaseRank2();}
@Override public int getDropMultiplier() {return AdvancedConfig.getInstance().getDropMultiplierRank2();}},
ONE(1) {
@Override public int getLevel() {return AdvancedConfig.getInstance().getBlastMiningRank1();}
@Override public double getBlastRadiusModifier() {return AdvancedConfig.getInstance().getBlastRadiusModifierRank1();}
@Override public double getOreBonus() {return AdvancedConfig.getInstance().getOreBonusRank1();}
@Override public double getDebrisReduction() {return AdvancedConfig.getInstance().getDebrisReductionRank1();}
@Override public double getBlastDamageDecrease() {return AdvancedConfig.getInstance().getBlastDamageDecreaseRank1();}
@Override public int getDropMultiplier() {return AdvancedConfig.getInstance().getDropMultiplierRank1();}};
int numerical;
private Tier(int numerical) {
this.numerical = numerical;
}
public int toNumerical() {
return numerical;
}
abstract protected int getLevel();
abstract protected double getBlastRadiusModifier();
abstract protected double getOreBonus();
abstract protected double getDebrisReduction();
abstract protected double getBlastDamageDecrease();
abstract protected int getDropMultiplier();
}
public static int detonatorID = Config.getInstance().getDetonatorItemID(); public static int detonatorID = Config.getInstance().getDetonatorItemID();
public final static int MAXIMUM_REMOTE_DETONATION_DISTANCE = 100; public final static int MAXIMUM_REMOTE_DETONATION_DISTANCE = 100;
public static boolean canUseDemolitionsExpertise(Player player) { protected static HashSet<Byte> generateTransparentBlockList() {
return SkillTools.unlockLevelReached(player, SkillType.MINING, rank4) && Permissions.demolitionsExpertise(player); HashSet<Byte> transparentBlocks = new HashSet<Byte>();
}
public static int processDemolitionsExpertise(Player player, int damage) { for (Material material : Material.values()) {
int skillLevel = Users.getPlayer(player).getProfile().getSkillLevel(SkillType.MINING); if (material.isTransparent()) {
int modifiedDamage; transparentBlocks.add((byte) material.getId());
}
if (skillLevel >= BlastMining.rank8) {
modifiedDamage = 0;
}
else if (skillLevel >= BlastMining.rank6) {
modifiedDamage = damage / 4;
}
else {
modifiedDamage = damage / 2;
} }
return modifiedDamage; return transparentBlocks;
} }
} }

View File

@ -1,149 +0,0 @@
package com.gmail.nossr50.skills.mining;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockState;
import org.bukkit.event.entity.EntityExplodeEvent;
import org.bukkit.inventory.ItemStack;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.BlockChecks;
import com.gmail.nossr50.util.Misc;
public class BlastMiningDropEventHandler {
private MiningManager manager;
private int skillLevel;
private EntityExplodeEvent event;
private float yield;
private List<Block> blocks;
private List<BlockState> ores = new ArrayList<BlockState>();
private List<BlockState> debris = new ArrayList<BlockState>();
private List<BlockState> droppedOres = new ArrayList<BlockState>();
private float oreBonus;
private float debrisReduction;
private int dropMultiplier;
public BlastMiningDropEventHandler(MiningManager manager, EntityExplodeEvent event) {
this.manager = manager;
this.skillLevel = manager.getSkillLevel();
this.event = event;
this.yield = event.getYield();
this.blocks = event.blockList();
}
protected void sortExplosionBlocks() {
for (Block block : blocks) {
BlockState blockState = block.getState();
if (BlockChecks.isOre(blockState)) {
ores.add(blockState);
}
else {
debris.add(blockState);
}
}
}
protected void processXPGain() {
for (BlockState blockState : droppedOres) {
if (!mcMMO.placeStore.isTrue(blockState)) {
Mining.awardMiningXp(blockState, manager.getMcMMOPlayer().getPlayer());
}
}
}
protected void processDroppedBlocks() {
for (BlockState blockState : ores) {
if (Misc.getRandom().nextFloat() < (yield + oreBonus)) {
droppedOres.add(blockState);
Mining.handleMiningDrops(blockState);
if (!mcMMO.placeStore.isTrue(blockState)) {
for (int i = 1 ; i < dropMultiplier ; i++) {
droppedOres.add(blockState);
Mining.handleMiningDrops(blockState);
}
}
}
}
float debrisYield = yield - debrisReduction;
if (debrisYield > 0) {
for (BlockState blockState : debris) {
Location location = blockState.getLocation();
Material type = blockState.getType();
if (Misc.getRandom().nextFloat() < debrisYield) {
Misc.dropItem(location, new ItemStack(type));
}
}
}
}
protected void modifyEventYield() {
event.setYield(0);
}
protected void calcuateDropModifiers() {
calculateOreBonus();
calculateDebrisReduction();
calculateDropMultiplier();
}
private void calculateOreBonus() {
if (skillLevel >= BlastMining.rank8) {
oreBonus = .70f;
}
else if (skillLevel >= BlastMining.rank7) {
oreBonus = .65f;
}
else if (skillLevel >= BlastMining.rank6) {
oreBonus = .60f;
}
else if (skillLevel >= BlastMining.rank5) {
oreBonus = .55f;
}
else if (skillLevel >= BlastMining.rank4) {
oreBonus = .50f;
}
else if (skillLevel >= BlastMining.rank3) {
oreBonus = .45f;
}
else if (skillLevel >= BlastMining.rank2) {
oreBonus = .40f;
}
else {
debrisReduction = .35f;
}
}
private void calculateDebrisReduction() {
if (skillLevel >= BlastMining.rank3) {
debrisReduction = .30f;
}
else if (skillLevel >= BlastMining.rank2) {
debrisReduction = .20f;
}
else {
debrisReduction = .10f;
}
}
private void calculateDropMultiplier() {
if (skillLevel >= BlastMining.rank7) {
dropMultiplier = 3;
}
else if (skillLevel >= BlastMining.rank5) {
dropMultiplier = 2;
}
else {
dropMultiplier = 1;
}
}
}

View File

@ -3,19 +3,14 @@ package com.gmail.nossr50.skills.mining;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.block.BlockState; import org.bukkit.block.BlockState;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
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.mods.ModChecks; import com.gmail.nossr50.mods.ModChecks;
import com.gmail.nossr50.mods.datatypes.CustomBlock; import com.gmail.nossr50.mods.datatypes.CustomBlock;
import com.gmail.nossr50.skills.utilities.SkillTools;
import com.gmail.nossr50.skills.utilities.SkillType; import com.gmail.nossr50.skills.utilities.SkillType;
import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.Users;
public class Mining { public class Mining {
private static AdvancedConfig advancedConfig = AdvancedConfig.getInstance(); private static AdvancedConfig advancedConfig = AdvancedConfig.getInstance();
@ -24,31 +19,11 @@ public class Mining {
public static double doubleDropsMaxChance = advancedConfig.getMiningDoubleDropChance(); public static double doubleDropsMaxChance = advancedConfig.getMiningDoubleDropChance();
/** /**
* Process double drops & XP gain for Mining. * Calculate XP gain for Mining.
* *
* @param blockState The {@link BlockState} to check ability activation for * @param blockState The {@link BlockState} to check ability activation for
* @param player The {@link Player} using this ability
*/ */
public static void miningBlockCheck(BlockState blockState, Player player) { protected static int getBlockXp(BlockState blockState) {
awardMiningXp(blockState, player);
if (Permissions.doubleDrops(player, SkillType.MINING) && SkillTools.activationSuccessful(player, SkillType.MINING, doubleDropsMaxChance, doubleDropsMaxLevel)) {
if (player.getItemInHand().containsEnchantment(Enchantment.SILK_TOUCH)) {
handleSilkTouchDrops(blockState);
}
else {
handleMiningDrops(blockState);
}
}
}
/**
* Award XP gain for Mining.
*
* @param blockState The {@link BlockState} to check ability activation for
* @param player The {@link Player} using this ability
*/
protected static void awardMiningXp(BlockState blockState, Player player) {
Material blockType = blockState.getType(); Material blockType = blockState.getType();
int xp = Config.getInstance().getXp(SkillType.MINING, blockType); int xp = Config.getInstance().getXp(SkillType.MINING, blockType);
@ -59,7 +34,7 @@ public class Mining {
xp = ModChecks.getCustomBlock(blockState).getXpGain(); xp = ModChecks.getCustomBlock(blockState).getXpGain();
} }
Users.getPlayer(player).beginXpGain(SkillType.MINING, xp); return xp;
} }
/** /**

View File

@ -1,7 +1,9 @@
package com.gmail.nossr50.skills.mining; package com.gmail.nossr50.skills.mining;
import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.SkillCommand; import com.gmail.nossr50.skills.SkillCommand;
import com.gmail.nossr50.skills.SkillManagerStore;
import com.gmail.nossr50.skills.utilities.SkillType; import com.gmail.nossr50.skills.utilities.SkillType;
import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.Permissions;
@ -10,8 +12,12 @@ public class MiningCommand extends SkillCommand {
private String doubleDropChanceLucky; private String doubleDropChanceLucky;
private String superBreakerLength; private String superBreakerLength;
private String superBreakerLengthEndurance; private String superBreakerLengthEndurance;
private String blastMiningRank;
private String blastRadiusIncrease; private int blastMiningRank;
private int bonusTNTDrops;
private double blastRadiusIncrease;
private String oreBonus;
private String debrisReduction;
private String blastDamageDecrease; private String blastDamageDecrease;
private boolean canSuperBreaker; private boolean canSuperBreaker;
@ -38,51 +44,13 @@ public class MiningCommand extends SkillCommand {
doubleDropChanceLucky = doubleDropStrings[1]; doubleDropChanceLucky = doubleDropStrings[1];
//BLAST MINING //BLAST MINING
if (skillValue >= BlastMining.rank8) { MiningManager miningManager = SkillManagerStore.getInstance().getMiningManager(player.getName());
blastMiningRank = "8"; blastMiningRank = miningManager.getBlastMiningTier();
blastDamageDecrease = "100.00%"; bonusTNTDrops = miningManager.getDropMultiplier();
blastRadiusIncrease = "4"; oreBonus = percent.format(miningManager.getOreBonus() / 30.0D); // Base received in TNT is 30%
} debrisReduction = percent.format(miningManager.getDebrisReduction() / 30.0D); // Base received in TNT is 30%
else if (skillValue >= BlastMining.rank7) { blastDamageDecrease = percent.format(miningManager.getBlastDamageModifier() / 100.0D);
blastMiningRank = "7"; blastRadiusIncrease = miningManager.getBlastRadiusModifier();
blastDamageDecrease = "50.00%";
blastRadiusIncrease = "3";
}
else if (skillValue >= BlastMining.rank6) {
blastMiningRank = "6";
blastDamageDecrease = "50.00%";
blastRadiusIncrease = "3";
}
else if (skillValue >= BlastMining.rank5) {
blastMiningRank = "5";
blastDamageDecrease = "25.00%";
blastRadiusIncrease = "2";
}
else if (skillValue >= BlastMining.rank4) {
blastMiningRank = "4";
blastDamageDecrease = "25.00%";
blastRadiusIncrease = "2";
}
else if (skillValue >= BlastMining.rank3) {
blastMiningRank = "3";
blastDamageDecrease = "0.00%";
blastRadiusIncrease = "1";
}
else if (skillValue >= BlastMining.rank2) {
blastMiningRank = "2";
blastDamageDecrease = "0.00%";
blastRadiusIncrease = "1";
}
else if (skillValue >= BlastMining.rank1) {
blastMiningRank = "1";
blastDamageDecrease = "0.00%";
blastRadiusIncrease = "0";
}
else {
blastMiningRank = "0";
blastDamageDecrease = "0.00%";
blastRadiusIncrease = "0";
}
} }
@Override @Override
@ -151,17 +119,17 @@ public class MiningCommand extends SkillCommand {
} }
if (canBlast) { if (canBlast) {
if (skillValue < BlastMining.rank1) { if (skillValue < AdvancedConfig.getInstance().getBlastMiningRank1()) {
player.sendMessage(LocaleLoader.getString("Ability.Generic.Template.Lock", LocaleLoader.getString("Mining.Ability.Locked.0", BlastMining.rank1))); player.sendMessage(LocaleLoader.getString("Ability.Generic.Template.Lock", LocaleLoader.getString("Mining.Ability.Locked.0", AdvancedConfig.getInstance().getBlastMiningRank1())));
} }
else { else {
player.sendMessage(LocaleLoader.getString("Mining.Blast.Rank", blastMiningRank, LocaleLoader.getString("Mining.Blast.Effect." + (Integer.parseInt(blastMiningRank) - 1)))); player.sendMessage(LocaleLoader.getString("Mining.Blast.Rank", blastMiningRank, LocaleLoader.getString("Mining.Blast.Effect", oreBonus, debrisReduction, bonusTNTDrops)));
} }
} }
if (canBiggerBombs) { if (canBiggerBombs) {
if (skillValue < BlastMining.rank2) { if (skillValue < AdvancedConfig.getInstance().getBlastMiningRank2()) {
player.sendMessage(LocaleLoader.getString("Ability.Generic.Template.Lock", LocaleLoader.getString("Mining.Ability.Locked.1", BlastMining.rank2))); player.sendMessage(LocaleLoader.getString("Ability.Generic.Template.Lock", LocaleLoader.getString("Mining.Ability.Locked.1", AdvancedConfig.getInstance().getBlastMiningRank2())));
} }
else { else {
player.sendMessage(LocaleLoader.getString("Mining.Blast.Radius.Increase", blastRadiusIncrease)); player.sendMessage(LocaleLoader.getString("Mining.Blast.Radius.Increase", blastRadiusIncrease));
@ -169,8 +137,8 @@ public class MiningCommand extends SkillCommand {
} }
if (canDemoExpert) { if (canDemoExpert) {
if (skillValue < BlastMining.rank4) { if (skillValue < AdvancedConfig.getInstance().getBlastMiningRank4()) {
player.sendMessage(LocaleLoader.getString("Ability.Generic.Template.Lock", LocaleLoader.getString("Mining.Ability.Locked.2", BlastMining.rank4))); player.sendMessage(LocaleLoader.getString("Ability.Generic.Template.Lock", LocaleLoader.getString("Mining.Ability.Locked.2", AdvancedConfig.getInstance().getBlastMiningRank4())));
} }
else { else {
player.sendMessage(LocaleLoader.getString("Mining.Effect.Decrease", blastDamageDecrease)); player.sendMessage(LocaleLoader.getString("Mining.Effect.Decrease", blastDamageDecrease));

View File

@ -1,50 +1,104 @@
package com.gmail.nossr50.skills.mining; package com.gmail.nossr50.skills.mining;
import org.bukkit.Material; import java.util.ArrayList;
import org.bukkit.event.entity.EntityExplodeEvent; import java.util.HashSet;
import org.bukkit.event.entity.ExplosionPrimeEvent; import java.util.List;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockState;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player;
import org.bukkit.entity.TNTPrimed;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.datatypes.McMMOPlayer; import com.gmail.nossr50.datatypes.McMMOPlayer;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.SkillManager; import com.gmail.nossr50.skills.SkillManager;
import com.gmail.nossr50.skills.mining.BlastMining.Tier;
import com.gmail.nossr50.skills.utilities.AbilityType;
import com.gmail.nossr50.skills.utilities.SkillTools; import com.gmail.nossr50.skills.utilities.SkillTools;
import com.gmail.nossr50.skills.utilities.SkillType; import com.gmail.nossr50.skills.utilities.SkillType;
import com.gmail.nossr50.util.BlockChecks;
import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.Permissions;
public class MiningManager extends SkillManager{ public class MiningManager extends SkillManager{
public MiningManager (McMMOPlayer mcMMOPlayer) { public MiningManager (McMMOPlayer mcMMOPlayer) {
super(mcMMOPlayer, SkillType.MINING); super(mcMMOPlayer, SkillType.MINING);
} }
public boolean canUseDemolitionsExpertise() {
Player player = getPlayer();
return SkillTools.unlockLevelReached(player, skill, BlastMining.Tier.FOUR.getLevel()) && Permissions.demolitionsExpertise(player);
}
public boolean canDetonate() {
Player player = getPlayer();
return player.isSneaking() && player.getItemInHand().getTypeId() == BlastMining.detonatorID && Permissions.remoteDetonation(player) && SkillTools.unlockLevelReached(player, skill, BlastMining.Tier.ONE.getLevel());
}
public boolean canUseBlastMining() {
return SkillTools.unlockLevelReached(getPlayer(), skill, BlastMining.Tier.ONE.getLevel());
}
public boolean canUseBiggerBombs() {
Player player = getPlayer();
return Permissions.biggerBombs(player) && SkillTools.unlockLevelReached(getPlayer(), skill, BlastMining.Tier.TWO.getLevel());
}
/**
* Process double drops & XP gain for Mining.
*
* @param blockState The {@link BlockState} to check ability activation for
* @param player The {@link Player} using this ability
*/
public void miningBlockCheck(BlockState blockState) {
Player player = getPlayer();
int xp = Mining.getBlockXp(blockState);
if (Permissions.doubleDrops(player, skill) && SkillTools.activationSuccessful(player, skill, Mining.doubleDropsMaxChance, Mining.doubleDropsMaxLevel)) {
if (player.getItemInHand().containsEnchantment(Enchantment.SILK_TOUCH)) {
Mining.handleSilkTouchDrops(blockState);
}
else {
Mining.handleMiningDrops(blockState);
}
}
applyXpGain(xp);
}
/** /**
* Detonate TNT for Blast Mining * Detonate TNT for Blast Mining
*
* @param event The PlayerInteractEvent
*/ */
public void detonate(PlayerInteractEvent event) { public void remoteDetonation() {
if (getSkillLevel() < BlastMining.rank1) { Player player = getPlayer();
HashSet<Byte> transparentBlocks = BlastMining.generateTransparentBlockList();
Block targetBlock = player.getTargetBlock(transparentBlocks, BlastMining.MAXIMUM_REMOTE_DETONATION_DISTANCE);
if (targetBlock.getType() != Material.TNT || !SkillTools.blockBreakSimulate(targetBlock, player, true) || !blastMiningCooldownOver()) {
return; return;
} }
RemoteDetonationEventHandler eventHandler = new RemoteDetonationEventHandler(this, event); PlayerProfile profile = getProfile();
TNTPrimed tnt = player.getWorld().spawn(targetBlock.getLocation(), TNTPrimed.class);
eventHandler.targetTNT(); SkillTools.sendSkillMessage(player, AbilityType.BLAST_MINING.getAbilityPlayer(player));
player.sendMessage(LocaleLoader.getString("Mining.Blast.Boom"));
if (eventHandler.getBlock().getType() != Material.TNT) { mcMMO.p.addToTNTTracker(tnt.getEntityId(), player.getName());
return; tnt.setFuseTicks(0);
} targetBlock.setData((byte) 0x0);
targetBlock.setType(Material.AIR);
if (!SkillTools.blockBreakSimulate(eventHandler.getBlock(), mcMMOPlayer.getPlayer(), true)) { profile.setSkillDATS(AbilityType.BLAST_MINING, System.currentTimeMillis());
return; profile.setAbilityInformed(AbilityType.BLAST_MINING, false);
}
if (!eventHandler.cooldownOver()) {
return;
}
eventHandler.sendMessages();
eventHandler.handleDetonation();
eventHandler.setProfileData();
} }
/** /**
@ -52,24 +106,54 @@ public class MiningManager extends SkillManager{
* *
* @param event Event whose explosion is being processed * @param event Event whose explosion is being processed
*/ */
public void blastMiningDropProcessing(EntityExplodeEvent event) { public void blastMiningDropProcessing(float yield, List<Block> blockList) {
if (Misc.isNPCEntity(mcMMOPlayer.getPlayer())) { List<BlockState> ores = new ArrayList<BlockState>();
return; List<BlockState> debris = new ArrayList<BlockState>();
int xp = 0;
float oreBonus = (float) (getOreBonus() / 100);
float debrisReduction = (float) (getDebrisReduction() / 100);
int dropMultiplier = getDropMultiplier();
float debrisYield = yield - debrisReduction;
for (Block block : blockList) {
BlockState blockState = block.getState();
if (BlockChecks.isOre(blockState)) {
ores.add(blockState);
}
else {
debris.add(blockState);
}
} }
if (getSkillLevel() < BlastMining.rank1) { for (BlockState blockState : ores) {
return; if (Misc.getRandom().nextFloat() < (yield + oreBonus)) {
if (!mcMMO.placeStore.isTrue(blockState)) {
xp += Mining.getBlockXp(blockState);
}
Misc.dropItem(blockState.getLocation(), blockState.getData().toItemStack()); // Initial block that would have been dropped
if (!mcMMO.placeStore.isTrue(blockState)) {
for (int i = 1 ; i < dropMultiplier ; i++) {
xp += Mining.getBlockXp(blockState);
Mining.handleSilkTouchDrops(blockState); // Bonus drops - should drop the block & not the items
}
}
}
} }
BlastMiningDropEventHandler eventHandler = new BlastMiningDropEventHandler(this, event); if (debrisYield > 0) {
for (BlockState blockState : debris) {
if (Misc.getRandom().nextFloat() < debrisYield) {
Misc.dropItem(blockState.getLocation(), blockState.getData().toItemStack());
}
}
}
eventHandler.sortExplosionBlocks(); applyXpGain(xp);
eventHandler.modifyEventYield();
eventHandler.calcuateDropModifiers();
eventHandler.processDroppedBlocks();
eventHandler.processXPGain();
} }
/** /**
@ -77,14 +161,128 @@ public class MiningManager extends SkillManager{
* *
* @param event Event whose explosion radius is being changed * @param event Event whose explosion radius is being changed
*/ */
public void biggerBombs(ExplosionPrimeEvent event) { public float biggerBombs(float radius) {
if (Misc.isNPCEntity(mcMMOPlayer.getPlayer())) { return (float) (radius + getBlastRadiusModifier());
return; }
public int processDemolitionsExpertise(int damage) {
return (int) (damage * (100.0 - getBlastDamageModifier()));
}
private boolean blastMiningCooldownOver() {
Player player = getPlayer();
PlayerProfile profile = getProfile();
long oldTime = profile.getSkillDATS(AbilityType.BLAST_MINING) * Misc.TIME_CONVERSION_FACTOR;
int cooldown = AbilityType.BLAST_MINING.getCooldown();
if (!SkillTools.cooldownOver(oldTime, cooldown, player)) {
player.sendMessage(LocaleLoader.getString("Skills.TooTired", SkillTools.calculateTimeLeft(oldTime, cooldown, player)));
return false;
} }
BiggerBombsEventHandler eventHandler = new BiggerBombsEventHandler(this, event); return true;
}
eventHandler.calculateRadiusIncrease(); /**
eventHandler.modifyBlastRadius(); * Gets the Blast Mining tier
*
* @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;
}
/**
* Gets the Blast Mining tier
*
* @return the Blast Mining tier
*/
public double getOreBonus() {
int skillLevel = getSkillLevel();
for (Tier tier : Tier.values()) {
if (skillLevel >= tier.getLevel()) {
return tier.getOreBonus();
}
}
return 0;
}
/**
* Gets the Blast Mining tier
*
* @return the Blast Mining tier
*/
public double getDebrisReduction() {
int skillLevel = getSkillLevel();
for (Tier tier : Tier.values()) {
if (skillLevel >= tier.getLevel()) {
return tier.getDebrisReduction();
}
}
return 0;
}
/**
* Gets the Blast Mining tier
*
* @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;
}
/**
* Gets the Blast Mining tier
*
* @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;
}
/**
* Gets the Blast Mining tier
*
* @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;
} }
} }

View File

@ -1,89 +0,0 @@
package com.gmail.nossr50.skills.mining;
import java.util.HashSet;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.entity.TNTPrimed;
import org.bukkit.event.player.PlayerInteractEvent;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.datatypes.McMMOPlayer;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.utilities.AbilityType;
import com.gmail.nossr50.skills.utilities.SkillTools;
import com.gmail.nossr50.util.Misc;
public class RemoteDetonationEventHandler {
private MiningManager manager;
private PlayerInteractEvent event;
private Block block;
private HashSet<Byte> transparentBlocks = new HashSet<Byte>();
public RemoteDetonationEventHandler(MiningManager manager, PlayerInteractEvent event) {
this.manager = manager;
this.event = event;
this.block = event.getClickedBlock();
}
protected void targetTNT() {
if (block == null || block.getType() != Material.TNT) {
generateTransparentBlockList();
block = manager.getMcMMOPlayer().getPlayer().getTargetBlock(transparentBlocks, BlastMining.MAXIMUM_REMOTE_DETONATION_DISTANCE);
}
else {
event.setCancelled(true); // This is the only way I know to avoid the original TNT to be triggered (in case the player is close to it)
}
}
protected boolean cooldownOver() {
McMMOPlayer mcMMOPlayer = manager.getMcMMOPlayer();
Player player = mcMMOPlayer.getPlayer();
PlayerProfile profile = mcMMOPlayer.getProfile();
if (!SkillTools.cooldownOver(profile.getSkillDATS(AbilityType.BLAST_MINING) * Misc.TIME_CONVERSION_FACTOR, AbilityType.BLAST_MINING.getCooldown(), player)) {
player.sendMessage(LocaleLoader.getString("Skills.TooTired", SkillTools.calculateTimeLeft(profile.getSkillDATS(AbilityType.BLAST_MINING) * Misc.TIME_CONVERSION_FACTOR, AbilityType.BLAST_MINING.getCooldown(), player)));
return false;
}
return true;
}
protected void sendMessages() {
Player player = manager.getMcMMOPlayer().getPlayer();
SkillTools.sendSkillMessage(player, AbilityType.BLAST_MINING.getAbilityPlayer(player));
player.sendMessage(LocaleLoader.getString("Mining.Blast.Boom"));
}
protected void handleDetonation() {
Player player = manager.getMcMMOPlayer().getPlayer();
TNTPrimed tnt = player.getWorld().spawn(block.getLocation(), TNTPrimed.class);
mcMMO.p.addToTNTTracker(tnt.getEntityId(), player.getName());
tnt.setFuseTicks(0);
block.setType(Material.AIR);
}
protected void setProfileData() {
PlayerProfile profile = manager.getMcMMOPlayer().getProfile();
profile.setSkillDATS(AbilityType.BLAST_MINING, System.currentTimeMillis());
profile.setAbilityInformed(AbilityType.BLAST_MINING, false);
}
private void generateTransparentBlockList() {
for (Material material : Material.values()) {
if (material.isTransparent()) {
transparentBlocks.add((byte) material.getId());
}
}
}
protected Block getBlock() {
return block;
}
}

View File

@ -183,6 +183,56 @@ Skills:
BlastMining_Rank6: 750 BlastMining_Rank6: 750
BlastMining_Rank7: 875 BlastMining_Rank7: 875
BlastMining_Rank8: 1000 BlastMining_Rank8: 1000
# BlastDamageDecrease_Rank: % of damage reduced from TNT explosions
BlastDamageDecrease_Rank1: 0.0
BlastDamageDecrease_Rank2: 0.0
BlastDamageDecrease_Rank3: 0.0
BlastDamageDecrease_Rank4: 25.0
BlastDamageDecrease_Rank5: 25.0
BlastDamageDecrease_Rank6: 50.0
BlastDamageDecrease_Rank7: 50.0
BlastDamageDecrease_Rank8: 100.0
# OreBonus_Rank: % of extra ores received when Blast Mining
OreBonus_Rank1: 35.0
OreBonus_Rank2: 40.0
OreBonus_Rank3: 45.0
OreBonus_Rank4: 50.0
OreBonus_Rank5: 55.0
OreBonus_Rank6: 60.0
OreBonus_Rank7: 65.0
OreBonus_Rank8: 70.0
# DebrisReduction_Rank: % of fewer non-ores received when Blast Mining
DebrisReduction_Rank1: 10.0
DebrisReduction_Rank2: 20.0
DebrisReduction_Rank3: 30.0
DebrisReduction_Rank4: 30.0
DebrisReduction_Rank5: 30.0
DebrisReduction_Rank6: 30.0
DebrisReduction_Rank7: 30.0
DebrisReduction_Rank8: 30.0
# DropMultiplier_Rank: # of times each ore will drop
DropMultiplier_Rank1: 1
DropMultiplier_Rank2: 1
DropMultiplier_Rank3: 1
DropMultiplier_Rank4: 1
DropMultiplier_Rank5: 2
DropMultiplier_Rank6: 2
DropMultiplier_Rank7: 3
DropMultiplier_Rank8: 3
# BlastRadiusModifier_Rank: Increases the blast radius by this amount
BlastRadiusModifier_Rank1: 1.0
BlastRadiusModifier_Rank2: 1.0
BlastRadiusModifier_Rank3: 2.0
BlastRadiusModifier_Rank4: 2.0
BlastRadiusModifier_Rank5: 3.0
BlastRadiusModifier_Rank6: 3.0
BlastRadiusModifier_Rank7: 4.0
BlastRadiusModifier_Rank8: 4.0
# #
# Settings for Repair # Settings for Repair
### ###

View File

@ -187,14 +187,7 @@ Mining.Skillup=[[YELLOW]]Mining skill increased by {0}. Total ({1})
#Blast Mining #Blast Mining
Mining.Blast.Boom=[[GRAY]]**BOOM** Mining.Blast.Boom=[[GRAY]]**BOOM**
Mining.Blast.Effect.0=+35% ore yield Mining.Blast.Effect=+{0} ore yield, -{1} debris yield, {2}x drops
Mining.Blast.Effect.1=+40% ore yield
Mining.Blast.Effect.2=+45% ore yield, no debris
Mining.Blast.Effect.3=+50% ore yield, no debris
Mining.Blast.Effect.4=+55% ore yield, no debris, double drops
Mining.Blast.Effect.5=+60% ore yield, no debris, double drops
Mining.Blast.Effect.6=+65% ore yield, no debris, triple drops
Mining.Blast.Effect.7=+70% ore yield, no debris, triple drops
Mining.Blast.Radius.Increase=[[RED]]Blast Radius Increase: [[YELLOW]]+{0} Mining.Blast.Radius.Increase=[[RED]]Blast Radius Increase: [[YELLOW]]+{0}
Mining.Blast.Rank=[[RED]]Blast Mining: [[YELLOW]] Rank {0}/8 [[GRAY]]({1}) Mining.Blast.Rank=[[RED]]Blast Mining: [[YELLOW]] Rank {0}/8 [[GRAY]]({1})
Mining.Blast.Other.On=[[GREEN]]{0}[[DARK_GREEN]] has used [[RED]]Blast Mining! Mining.Blast.Other.On=[[GREEN]]{0}[[DARK_GREEN]] has used [[RED]]Blast Mining!