dan200.computercraft.api.media.IMediaProvider Java Examples

The following examples show how to use dan200.computercraft.api.media.IMediaProvider. 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: ComputerCraftAPI.java    From OpenPeripheral-Integration with MIT License 5 votes vote down vote up
/**
 * 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
        }
    }
}
 
Example #2
Source File: ComputerCraftAPI.java    From OpenPeripheral-Integration with MIT License 5 votes vote down vote up
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;
		}
	}
}
 
Example #3
Source File: ComputerCraftAPI.java    From Framez with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 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
        }
    }
}
 
Example #4
Source File: ComputerCraftAPI.java    From Framez with GNU General Public License v3.0 5 votes vote down vote up
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;
		}
	}
}
 
Example #5
Source File: ComputerCraftAPI.java    From PneumaticCraft with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 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
        }
    }
}
 
Example #6
Source File: ComputerCraftAPI.java    From PneumaticCraft with GNU General Public License v3.0 5 votes vote down vote up
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;
		}
	}
}
 
Example #7
Source File: ComputerCraftAPI.java    From OpenPeripheral-Addons with MIT License 5 votes vote down vote up
/**
 * 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
        }
    }
}
 
Example #8
Source File: ComputerCraftAPI.java    From OpenPeripheral-Addons with MIT License 5 votes vote down vote up
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;
		}
	}
}
 
Example #9
Source File: ComputerCraftAPI.java    From BigReactors with MIT License 5 votes vote down vote up
/**
 * 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
        }
    }
}
 
Example #10
Source File: ComputerCraftAPI.java    From BigReactors with MIT License 5 votes vote down vote up
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;
		}
	}
}
 
Example #11
Source File: ComputerCraftAPI.java    From OpenPeripheral with MIT License 5 votes vote down vote up
/**
 * 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
        }
    }
}
 
Example #12
Source File: ComputerCraftAPI.java    From OpenPeripheral with MIT License 5 votes vote down vote up
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;
		}
	}
}