Hardcoding this is a bad idea.

This commit is contained in:
GJ
2013-08-19 15:12:08 -04:00
parent 6518d192ec
commit 62146480db
3 changed files with 11 additions and 22 deletions

View File

@ -1,9 +1,5 @@
package com.gmail.nossr50.skills.mining;
import java.util.HashSet;
import org.bukkit.Material;
import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.config.Config;
@ -88,16 +84,4 @@ public class BlastMining {
public static int detonatorID = Config.getInstance().getDetonatorItemID();
public final static int MAXIMUM_REMOTE_DETONATION_DISTANCE = 100;
protected static HashSet<Byte> generateTransparentBlockList() {
HashSet<Byte> transparentBlocks = new HashSet<Byte>();
for (Material material : Material.values()) {
if (material.isTransparent()) {
transparentBlocks.add((byte) material.getId());
}
}
return transparentBlocks;
}
}

View File

@ -1,7 +1,6 @@
package com.gmail.nossr50.skills.mining;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import org.bukkit.Material;
@ -93,9 +92,7 @@ public class MiningManager extends SkillManager {
*/
public void remoteDetonation() {
Player player = getPlayer();
HashSet<Byte> transparentBlocks = BlastMining.generateTransparentBlockList();
Block targetBlock = player.getTargetBlock(transparentBlocks, BlastMining.MAXIMUM_REMOTE_DETONATION_DISTANCE);
Block targetBlock = player.getTargetBlock(BlockUtils.getTransparentBlocks(), BlastMining.MAXIMUM_REMOTE_DETONATION_DISTANCE);
if (targetBlock.getType() != Material.TNT || !SkillUtils.blockBreakSimulate(targetBlock, player, true) || !blastMiningCooldownOver()) {
return;