当前位置: 首页>>代码示例>>Java>>正文


Java IMediaProvider类代码示例

本文整理汇总了Java中dan200.computercraft.api.media.IMediaProvider的典型用法代码示例。如果您正苦于以下问题:Java IMediaProvider类的具体用法?Java IMediaProvider怎么用?Java IMediaProvider使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IMediaProvider类属于dan200.computercraft.api.media包,在下文中一共展示了IMediaProvider类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: registerMediaProvider

import dan200.computercraft.api.media.IMediaProvider; //导入依赖的package包/类
/**
 * Registers a media handler to provide IMedia implementations for Items
 * @see dan200.computercraft.api.media.IMediaProvider
 */
public static void registerMediaProvider( IMediaProvider handler )
{
    findCC();
    if( computerCraft_registerMediaProvider != null )
    {
        try {
            computerCraft_registerMediaProvider.invoke( null, handler );
        } catch (Exception e){
            // It failed
        }
    }
}
 
开发者ID:Herobone,项目名称:HeroUtils,代码行数:17,代码来源:ComputerCraftAPI.java

示例2: findCC

import dan200.computercraft.api.media.IMediaProvider; //导入依赖的package包/类
private static void findCC()
{
	if( !ccSearched ) {
		try {
			computerCraft = Class.forName( "dan200.computercraft.ComputerCraft" );
			computerCraft_createUniqueNumberedSaveDir = findCCMethod( "createUniqueNumberedSaveDir", new Class[]{
                   World.class, String.class
               } );
			computerCraft_createSaveDirMount = findCCMethod( "createSaveDirMount", new Class[] {
				World.class, String.class, Long.TYPE
			} );
			computerCraft_createResourceMount = findCCMethod( "createResourceMount", new Class[] {
				Class.class, String.class, String.class
			} );
			computerCraft_registerPeripheralProvider = findCCMethod( "registerPeripheralProvider", new Class[] {
				IPeripheralProvider.class
			} );
               computerCraft_registerTurtleUpgrade = findCCMethod( "registerTurtleUpgrade", new Class[] {
                   ITurtleUpgrade.class
               } );
               computerCraft_registerBundledRedstoneProvider = findCCMethod( "registerBundledRedstoneProvider", new Class[] {
                   IBundledRedstoneProvider.class
               } );
               computerCraft_getDefaultBundledRedstoneOutput = findCCMethod( "getDefaultBundledRedstoneOutput", new Class[] {
                   World.class, Integer.TYPE, Integer.TYPE, Integer.TYPE, Integer.TYPE
               } );
               computerCraft_registerMediaProvider = findCCMethod( "registerMediaProvider", new Class[] {
                   IMediaProvider.class
               } );
		} catch( Exception e ) {
			System.out.println( "ComputerCraftAPI: ComputerCraft not found." );
		} finally {
			ccSearched = true;
		}
	}
}
 
开发者ID:PC-Logix,项目名称:OpenFM,代码行数:37,代码来源:ComputerCraftAPI.java

示例3: findCC

import dan200.computercraft.api.media.IMediaProvider; //导入依赖的package包/类
private static void findCC()
{
	if( !ccSearched ) {
		try {
			computerCraft = Class.forName( "dan200.computercraft.ComputerCraft" );
               computerCraft_getVersion = findCCMethod( "getVersion", new Class[]{
               } );
			computerCraft_createUniqueNumberedSaveDir = findCCMethod( "createUniqueNumberedSaveDir", new Class[]{
                   World.class, String.class
               } );
			computerCraft_createSaveDirMount = findCCMethod( "createSaveDirMount", new Class[] {
				World.class, String.class, Long.TYPE
			} );
			computerCraft_createResourceMount = findCCMethod( "createResourceMount", new Class[] {
				Class.class, String.class, String.class
			} );
			computerCraft_registerPeripheralProvider = findCCMethod( "registerPeripheralProvider", new Class[] {
				IPeripheralProvider.class
			} );
               computerCraft_registerTurtleUpgrade = findCCMethod( "registerTurtleUpgrade", new Class[] {
                   ITurtleUpgrade.class
               } );
               computerCraft_registerBundledRedstoneProvider = findCCMethod( "registerBundledRedstoneProvider", new Class[] {
                   IBundledRedstoneProvider.class
               } );
               computerCraft_getDefaultBundledRedstoneOutput = findCCMethod( "getDefaultBundledRedstoneOutput", new Class[] {
                   World.class, BlockPos.class, EnumFacing.class
               } );
               computerCraft_registerMediaProvider = findCCMethod( "registerMediaProvider", new Class[] {
                   IMediaProvider.class
               } );
               computerCraft_registerPermissionProvider = findCCMethod( "registerPermissionProvider", new Class[] {
                   ITurtlePermissionProvider.class
               } );
		} catch( Exception e ) {
			System.out.println( "ComputerCraftAPI: ComputerCraft not found." );
		} finally {
			ccSearched = true;
		}
	}
}
 
开发者ID:Herobone,项目名称:HeroUtils,代码行数:42,代码来源:ComputerCraftAPI.java


注:本文中的dan200.computercraft.api.media.IMediaProvider类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。