added block references for checking valid blocks for excavator/hammer
This commit is contained in:
parent
1d855f1aea
commit
ce0afb8bb5
3 changed files with 86 additions and 12 deletions
|
@ -90,7 +90,7 @@ public class Excavator
|
|||
ItemMeta diamondExcMeta = diamondExcavator.getItemMeta();
|
||||
|
||||
// Define lore
|
||||
String loreString = "Based off of item from Tinkers' Construct";
|
||||
String loreString = "Based off of item from PowerMining/Tinkers' Construct";
|
||||
List<String> lore = new ArrayList<String>() {{ add(loreString); }};
|
||||
woodExcMeta.setLore(lore);
|
||||
stoneExcMeta.setLore(lore);
|
||||
|
|
58
plugin/src/lightling/gibsoniacraft/util/BlockRef.java
Normal file
58
plugin/src/lightling/gibsoniacraft/util/BlockRef.java
Normal file
|
@ -0,0 +1,58 @@
|
|||
package lightling.gibsoniacraft.util;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.bukkit.Material;
|
||||
|
||||
public class BlockRef
|
||||
{
|
||||
public static ArrayList<Material> ValidHammerBlocks = new ArrayList<Material>()
|
||||
{{
|
||||
add(Material.COAL_ORE);
|
||||
add(Material.IRON_ORE);
|
||||
add(Material.GOLD_ORE);
|
||||
add(Material.DIAMOND_ORE);
|
||||
add(Material.EMERALD_ORE);
|
||||
add(Material.LAPIS_ORE);
|
||||
add(Material.REDSTONE_ORE);
|
||||
|
||||
add(Material.COAL_BLOCK);
|
||||
add(Material.IRON_BLOCK);
|
||||
add(Material.GOLD_BLOCK);
|
||||
add(Material.DIAMOND_BLOCK);
|
||||
add(Material.EMERALD_BLOCK);
|
||||
add(Material.LAPIS_BLOCK);
|
||||
add(Material.REDSTONE_BLOCK);
|
||||
|
||||
add(Material.COBBLESTONE);
|
||||
add(Material.STONE);
|
||||
add(Material.SANDSTONE);
|
||||
add(Material.RED_SANDSTONE);
|
||||
add(Material.DIORITE);
|
||||
add(Material.ANDESITE);
|
||||
add(Material.GRANITE);
|
||||
|
||||
add(Material.END_STONE);
|
||||
add(Material.NETHERRACK);
|
||||
add(Material.NETHER_QUARTZ_ORE);
|
||||
}};
|
||||
|
||||
public static ArrayList<Material> ValidExcavatorBlocks = new ArrayList<Material>()
|
||||
{{
|
||||
add(Material.DIRT);
|
||||
add(Material.COARSE_DIRT);
|
||||
add(Material.PODZOL);
|
||||
add(Material.GRASS_BLOCK);
|
||||
add(Material.GRASS_PATH);
|
||||
|
||||
add(Material.SAND);
|
||||
add(Material.RED_SAND);
|
||||
add(Material.GRAVEL);
|
||||
add(Material.CLAY);
|
||||
|
||||
add(Material.SNOW);
|
||||
add(Material.SNOW_BLOCK);
|
||||
|
||||
add(Material.SOUL_SAND);
|
||||
}};
|
||||
}
|
16
plugin/src/lightling/gibsoniacraft/util/ToolUtil.java
Normal file
16
plugin/src/lightling/gibsoniacraft/util/ToolUtil.java
Normal file
|
@ -0,0 +1,16 @@
|
|||
package lightling.gibsoniacraft.util;
|
||||
|
||||
import org.bukkit.Material;
|
||||
|
||||
public class ToolUtil
|
||||
{
|
||||
public boolean IsMineable(Material mat)
|
||||
{
|
||||
return BlockRef.ValidHammerBlocks.contains(mat);
|
||||
}
|
||||
|
||||
public boolean IsDiggable(Material mat)
|
||||
{
|
||||
return BlockRef.ValidExcavatorBlocks.contains(mat);
|
||||
}
|
||||
}
|
Reference in a new issue