Code formatter take 2
This commit is contained in:
parent
33985f1a31
commit
5eed5b161d
450 changed files with 32768 additions and 26684 deletions
|
@ -6,27 +6,37 @@ import net.minecraft.item.Item;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
public class OreDictUtils {
|
||||
public class OreDictUtils
|
||||
{
|
||||
|
||||
public static boolean isOre(Block block, String oreName) {
|
||||
public static boolean isOre(Block block, String oreName)
|
||||
{
|
||||
return isOre(new ItemStack(Item.getItemFromBlock(block)), oreName);
|
||||
}
|
||||
|
||||
public static boolean isOre(IBlockState state, String oreName) {
|
||||
return isOre(new ItemStack(Item.getItemFromBlock(state.getBlock()), 1, state.getBlock().getMetaFromState(state)), oreName);
|
||||
public static boolean isOre(IBlockState state, String oreName)
|
||||
{
|
||||
return isOre(
|
||||
new ItemStack(Item.getItemFromBlock(state.getBlock()), 1, state.getBlock().getMetaFromState(state)),
|
||||
oreName);
|
||||
}
|
||||
|
||||
public static boolean isOre(Item item, String oreName) {
|
||||
public static boolean isOre(Item item, String oreName)
|
||||
{
|
||||
return isOre(new ItemStack(item), oreName);
|
||||
}
|
||||
|
||||
public static boolean isOre(ItemStack stack, String oreName) {
|
||||
if (stack != null && stack.getItem() != null && oreName != null) {
|
||||
public static boolean isOre(ItemStack stack, String oreName)
|
||||
{
|
||||
if (stack != null && stack.getItem() != null && oreName != null)
|
||||
{
|
||||
int id = OreDictionary.getOreID(oreName);
|
||||
int[] ids = OreDictionary.getOreIDs(stack);
|
||||
|
||||
for (int i : ids) {
|
||||
if (id == i) {
|
||||
for (int i : ids)
|
||||
{
|
||||
if (id == i)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue