Java Code Examples for net.minecraft.block.material.Material#tnt()

The following examples show how to use net.minecraft.block.material.Material#tnt() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ToolSword.java    From GregTech with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public boolean canMineBlock(IBlockState block, ItemStack stack) {
    String tool = block.getBlock().getHarvestTool(block);
    return (tool != null && tool.equals("sword")) ||
        block.getMaterial() == Material.LEAVES ||
        block.getMaterial() == Material.GOURD ||
        block.getMaterial() == Material.VINE ||
        block.getMaterial() == Material.WEB ||
        block.getMaterial() == Material.CLOTH ||
        block.getMaterial() == Material.CARPET ||
        block.getMaterial() == Material.PLANTS ||
        block.getMaterial() == Material.CACTUS ||
        block.getMaterial() == Material.CAKE ||
        block.getMaterial() == Material.TNT ||
        block.getMaterial() == Material.SPONGE;
}
 
Example 2
Source File: MixinTileEntityFurnace.java    From Production-Line with MIT License 6 votes vote down vote up
@Inject(method = "update", at = @At("RETURN"))
private void onUpdate(CallbackInfo callbackInfo) {
    if (!this.world.isRemote) {
        if (this.isBurning()) {
            ItemStack itemStack = this.furnaceItemStacks[0];
            if (itemStack != null) {
                if (itemStack.getItem() instanceof ItemBlock) {
                    Block block = ((ItemBlock) itemStack.getItem()).block;
                    if (block.getMaterial(block.getStateFromMeta(itemStack.getMetadata())) == Material.TNT) {
                        this.doExplosion();
                    }
                } else if (itemStack.getItem() == Items.GUNPOWDER) {
                    this.doExplosion();
                } else if (itemStack.getItem() instanceof ItemFirework || itemStack.getItem()
                        instanceof ItemFireworkCharge) {
                    this.doExplosion();
                }
            }
        }
    }
}
 
Example 3
Source File: ToolUniversalSpade.java    From GregTech with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public boolean canMineBlock(IBlockState block, ItemStack stack) {
    String tool = block.getBlock().getHarvestTool(block);
    return (tool != null && (tool.equals("shovel") ||
        tool.equals("axe") ||
        tool.equals("saw") ||
        tool.equals("sword") ||
        tool.equals("crowbar"))) ||
        block.getMaterial() == Material.SAND ||
        block.getMaterial() == Material.GRASS ||
        block.getMaterial() == Material.GROUND ||
        block.getMaterial() == Material.SNOW ||
        block.getMaterial() == Material.CLAY ||
        block.getMaterial() == Material.CRAFTED_SNOW ||
        block.getMaterial() == Material.LEAVES ||
        block.getMaterial() == Material.VINE ||
        block.getMaterial() == Material.WOOD ||
        block.getMaterial() == Material.CACTUS ||
        block.getMaterial() == Material.CIRCUITS ||
        block.getMaterial() == Material.GOURD ||
        block.getMaterial() == Material.WEB ||
        block.getMaterial() == Material.CLOTH ||
        block.getMaterial() == Material.CARPET ||
        block.getMaterial() == Material.PLANTS ||
        block.getMaterial() == Material.CAKE ||
        block.getMaterial() == Material.TNT ||
        block.getMaterial() == Material.SPONGE;
}