mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-27 19:24:44 +02:00
Hardcoding this is a bad idea.
This commit is contained in:
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
Reference in New Issue
Block a user