1
0
Fork 0

added block references for checking valid blocks for excavator/hammer

This commit is contained in:
lightling 2019-09-12 20:54:42 -04:00
parent 1d855f1aea
commit ce0afb8bb5
3 changed files with 86 additions and 12 deletions

View file

@ -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);

View 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);
}};
}

View 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);
}
}