aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/detrav/utils/BartWorksHelper.java
blob: 1bbadc71c71dfe5851ea93dd797783d294ada7e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package detrav.utils;

import net.minecraft.block.Block;
import net.minecraft.world.chunk.Chunk;

import bartworks.system.material.BWMetaGeneratedOres;
import bartworks.system.material.BWMetaGeneratedSmallOres;

public class BartWorksHelper {

    public static boolean isOre(Block tBlock) {
        return tBlock instanceof BWMetaGeneratedOres;
    }

    public static boolean isSmallOre(Block tBlock) {
        return tBlock instanceof BWMetaGeneratedSmallOres;
    }

    public static short getMetaFromBlock(Chunk c, int x, int y, int z, Block tBlock) {
        return (short) (tBlock.getDamageValue(c.worldObj, c.xPosition * 16 + x, y, c.zPosition * 16 + z) * -1);
    }

}