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


Java ComputerCraftAPI类代码示例

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


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

示例1: postInit

import dan200.computercraft.api.ComputerCraftAPI; //导入依赖的package包/类
@EventHandler
public void postInit(FMLPostInitializationEvent event) {
    proxy.postInit();
    ComputerCraft.init();

    ModItems.addRecipes();
    ModBlocks.addRecipes();

    LuaType.registerTypeConverter(new ConverterItemStack());
    LuaType.registerClassToNameMapping(ItemStack.class, "item");
    LuaType.registerTypeConverter(new ConverterSide());
    LuaType.registerClassToNameMapping(Side.class, "side");

    ComputerCraftAPI.registerPeripheralProvider(new PeripheralProvider());

    for (IModule module : MODULES)
        if (module.shouldLoad())
            module.postInit();
}
 
开发者ID:theoriginalbit,项目名称:MoarPeripherals,代码行数:20,代码来源:MoarPeripherals.java

示例2: registerShearingUpgrades

import dan200.computercraft.api.ComputerCraftAPI; //导入依赖的package包/类
private static void registerShearingUpgrades() {
	if (ConfigurationLib.shearUpgradesEnabled) {
		for (String shearUpgrade : ConfigurationLib.shearUpgrades) {
			String[] string = shearUpgrade.split("-");
			int shearUpgradeID = Integer.parseInt(string[0]);
			String unlocalizedName = string[1];
			if (Item.itemRegistry.containsKey(unlocalizedName)) {
				Object object = Item.itemRegistry.getObject(unlocalizedName);
				if (object != null && object instanceof ItemShears) {
					ItemStack shears = new ItemStack((Item) object);
					ComputerCraftAPI.registerTurtleUpgrade(new ShearingUpgrade(shearUpgradeID, shears));
				}
			}
		}
	}
}
 
开发者ID:SlimeVoid,项目名称:TurtleExtension,代码行数:17,代码来源:TurtleExtensionCore.java

示例3: initComputerCraft

import dan200.computercraft.api.ComputerCraftAPI; //导入依赖的package包/类
@Optional.Method(modid = Configs.COMPUTERCRAFT)
private static void initComputerCraft() {
	log.info("Init ComputerCraft Handler");
	ComputerCraftAPI.registerPeripheralProvider((IPeripheralProvider) enderMemory);
	// ComputerCraftAPI.registerPeripheralProvider((IPeripheralProvider)
	// CCProxy);
	ComputerCraftAPI.registerPeripheralProvider((IPeripheralProvider) GPU);
	ComputerCraftAPI.registerPeripheralProvider((IPeripheralProvider) Monitor);
	ComputerCraftAPI.registerPeripheralProvider((IPeripheralProvider) WirelessPeripheral);
	ComputerCraftAPI.registerPeripheralProvider((IPeripheralProvider) EnderPlayerSensor);
	ComputerCraftAPI.registerPeripheralProvider((IPeripheralProvider) holotapeReader);
	ComputerCraftAPI.registerPeripheralProvider((IPeripheralProvider) holotapeWriter);
	ComputerCraftAPI.registerPeripheralProvider((IPeripheralProvider) RedstonePort);
	ComputerCraftAPI.registerPeripheralProvider((IPeripheralProvider) DefenseInit.forceCapacitor);
	/*ComputerCraftAPI.registerPeripheralProvider((IPeripheralProvider) EnergyInit.MK1Storage);
	ComputerCraftAPI.registerPeripheralProvider((IPeripheralProvider) EnergyInit.MK2Storage);
	ComputerCraftAPI.registerPeripheralProvider((IPeripheralProvider) EnergyInit.MK3Storage);*/
	ComputerCraftAPI.registerPeripheralProvider(EnergyInit.batteryBox);
	ComputerCraftAPI.registerPeripheralProvider((IPeripheralProvider) MagCardDevice);
	// ComputerCraftAPI.registerPeripheralProvider((IPeripheralProvider) ComputerRegulator);
	// ComputerRegulatorClass.init();
	if (Config.enableAdventureItems) {
		ComputerCraftAPI.registerPeripheralProvider((IPeripheralProvider) TabletController);
		ComputerCraftAPI.registerPeripheralProvider((IPeripheralProvider) AntennaController);
	}
	if (Config.enableCommandExecutor)
		ComputerCraftAPI.registerPeripheralProvider((IPeripheralProvider) CommandExecutor);
	ComputerCraftAPI.registerPeripheralProvider(MultipartProvider.INSTANCE);
	log.info("ComputerCraft Handler Loaded");
}
 
开发者ID:tom5454,项目名称:Toms-Mod,代码行数:31,代码来源:CoreInit.java

示例4: init

import dan200.computercraft.api.ComputerCraftAPI; //导入依赖的package包/类
public static void init() {
       registerTabs();
       registerBlocks();
       registerItems();
       registerEvents();
       if (Loader.isModLoaded("ComputerCraft")) {
       	ComputerCraftAPI.registerPeripheralProvider((IPeripheralProvider) blockRadio);
       }
}
 
开发者ID:PC-Logix,项目名称:OpenFM,代码行数:10,代码来源:ContentRegistry.java

示例5: ChunkLoaderPeripheralBlock

import dan200.computercraft.api.ComputerCraftAPI; //导入依赖的package包/类
public ChunkLoaderPeripheralBlock()
{
	super(Material.rock);
	setBlockName(unlocalizedName);//unlocalized name
	setCreativeTab(ChunkyPeripherals.getCreativeTab());
	setBlockTextureName(ChunkyPeripherals.MODID + ":" + "ChunkLoaderPeripheralBlock");
	GameRegistry.registerTileEntity(ChunkLoaderPeripheralTileEntity.class, ChunkLoaderPeripheralTileEntity.internalName);
	ComputerCraftAPI.registerPeripheralProvider(this);
}
 
开发者ID:c-rizz,项目名称:ChunkyPeripherals,代码行数:10,代码来源:ChunkLoaderPeripheralBlock.java

示例6: loadCCPeripheralProviders

import dan200.computercraft.api.ComputerCraftAPI; //导入依赖的package包/类
@Method(modid = "ComputerCraft")
public void loadCCPeripheralProviders()
{
	try {
		ComputerCraftAPI.registerPeripheralProvider((BlockMachine) MekanismBlocks.MachineBlock);
	} catch(Exception ex) {}
}
 
开发者ID:Microsoft,项目名称:vsminecraft,代码行数:8,代码来源:MekanismHooks.java

示例7: preInit

import dan200.computercraft.api.ComputerCraftAPI; //导入依赖的package包/类
public static void preInit(ModStartupHelper helper) {
	helper.registerBlocksHolder(Blocks.class);

	MinecraftForge.EVENT_BUS.register(new IconLoader());

	sensorUpgrade = new TurtleUpgradeSensor();
	ComputerCraftAPI.registerTurtleUpgrade(sensorUpgrade);

	narcissiticUpgrade = new TurtleUpgradeNarcissistic();
	ComputerCraftAPI.registerTurtleUpgrade(narcissiticUpgrade);
}
 
开发者ID:OpenMods,项目名称:OpenPeripheral-Addons,代码行数:12,代码来源:ModuleComputerCraft.java

示例8: onBlockRegistry

import dan200.computercraft.api.ComputerCraftAPI; //导入依赖的package包/类
@Override
public void onBlockRegistry(Block block) {
    if (block instanceof IPeripheralProvider) {
        ComputerCraftAPI.registerPeripheralProvider((IPeripheralProvider) block);
    }
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:7,代码来源:ComputerCraft.java

示例9: register

import dan200.computercraft.api.ComputerCraftAPI; //导入依赖的package包/类
public void register() {
    ComputerCraftAPI.registerPeripheralProvider(this);
}
 
开发者ID:Lordmau5,项目名称:FFS,代码行数:4,代码来源:CCPeripheralProvider.java

示例10: load

import dan200.computercraft.api.ComputerCraftAPI; //导入依赖的package包/类
@EventHandler 
public void load(FMLInitializationEvent event)
{
        proxy.registerRenderers();
        
                       
        if(useChunkyModule)
        {
         chunkyModuleItem = new ChunkyModuleItem();
         chunkyModuleItem.loadRecipe();
         if(useAlsoAlternativeRecipes)
         	chunkyModuleItem.loadAlternativeRecipe();
         infoLog("registering chunkyModuleUpgrade with ID "+chunkyModuleUpgradeID);                
         ComputerCraftAPI.registerTurtleUpgrade(new ChunkyUpgrade());
        }
        
        if(useMinyChunkyModule)
        {
         minyChunkyModuleItem = new MinyChunkyItem();
         minyChunkyModuleItem.loadRecipe();
         infoLog("registering minyChunkyModuleUpgrade with ID "+minyChunkyModuleUpgradeID); 
         ComputerCraftAPI.registerTurtleUpgrade(new MinyChunkyUpgrade());
        }
        
        if(useWirelessChunkyModule)
        {
         wirelessChunkyModuleItem = new WirelessChunkyItem();
         wirelessChunkyModuleItem.loadRecipe();
         infoLog("registering wirelessChunkyModuleUpgrade with ID "+wirelessChunkyModuleUpgradeID); 
         ComputerCraftAPI.registerTurtleUpgrade(new WirelessChunkyUpgrade());
        }
        
        if(useChunkLoaderPeripheralBlock)
        {
        	chunkLoaderPeripheralBlock = new ChunkLoaderPeripheralBlock();
         GameRegistry.registerBlock(chunkLoaderPeripheralBlock, ChunkLoaderPeripheralBlock.unlocalizedName);
        	chunkLoaderPeripheralBlock.loadRecipe();
         if(useAlsoAlternativeRecipes)
         	chunkLoaderPeripheralBlock.loadAlternativeRecipe();
         infoLog("registering chunkLoaderPeripheralBlock"); 
        }
        
        if(useChunkyDetector)
        {
        	chunkyDetectorItem = new ChunkyDetectorItem();
        	chunkyDetectorItem.loadRecipe();
         infoLog("registering chunkyDetectorItem"); 
        }
        
        
        ChunkLoadingCallback.starterTicketsList 				= 	new ConcurrentHashMap<Object, Ticket>(2);//create the map (by defualt capacity is 2 (overworld and nether))
       // logger.info("CRMod.instance="+ChunkyPeripherals.instance);
        ForgeChunkManager.setForcedChunkLoadingCallback(ChunkyPeripherals.instance, new ChunkLoadingCallback());
}
 
开发者ID:c-rizz,项目名称:ChunkyPeripherals,代码行数:55,代码来源:ChunkyPeripherals.java

示例11: postInit

import dan200.computercraft.api.ComputerCraftAPI; //导入依赖的package包/类
@EventHandler
public void postInit(FMLPostInitializationEvent event) {
	ComputerCraftAPI.registerPeripheralProvider(new PeripheralProvider());
}
 
开发者ID:thraaawn,项目名称:CCFactoryManager,代码行数:5,代码来源:CCFactoryManager.java

示例12: preInit

import dan200.computercraft.api.ComputerCraftAPI; //导入依赖的package包/类
@Override
public void preInit(FMLPreInitializationEvent ev) {

    ComputerCraftAPI.registerPeripheralProvider(PeripheralProvider.INSTANCE);
}
 
开发者ID:Quetzi,项目名称:BluePower,代码行数:6,代码来源:CompatModuleCC.java

示例13: postInit

import dan200.computercraft.api.ComputerCraftAPI; //导入依赖的package包/类
@Override
public void postInit(FMLPostInitializationEvent event) {
	ComputerCraftAPI.registerPeripheralProvider(instance);
}
 
开发者ID:Shirkit,项目名称:CountCraft,代码行数:5,代码来源:ComputerCraftHandler.java

示例14: init

import dan200.computercraft.api.ComputerCraftAPI; //导入依赖的package包/类
public static void init() {
    if (Loader.isModLoaded("ComputerCraft")) {
        Log.info("Registering peripheral provider for ComputerCraft");
        ComputerCraftAPI.registerPeripheralProvider(new PeripheralProvider());
    }
}
 
开发者ID:theoriginalbit,项目名称:peripheral-framework,代码行数:7,代码来源:PeripheralFramework.java

示例15: init

import dan200.computercraft.api.ComputerCraftAPI; //导入依赖的package包/类
@Mod.EventHandler
public void init(FMLInitializationEvent event) {
	NetworkRegistry.INSTANCE.registerGuiHandler(instance, new GuiHandler());
	LOGGER.info("Registering peripherals...");
	proxy.registerTileEntities();
	ComputerCraftAPI.registerPeripheralProvider(new IPlusPlusPeripheral.Provider());
	LOGGER.info("Registering turtle upgrades...");
	registerUpgrade(new TurtleChatBox());
	registerUpgrade(new TurtlePlayerSensor());
	registerUpgrade(new TurtleCompass());
	registerUpgrade(new TurtleXP());
	if (Loader.isModLoaded(ModIds.Factorization) || Loader.isModLoaded(ModIds.JABBA)) {
		LOGGER.info("A mod that adds barrels is loaded! Registering the barrel turtle upgrade...");
		registerUpgrade(new TurtleBarrel());
	} else
		LOGGER.info("No barrel-adding mods found, skipping the barrel turtle upgrade");
	registerUpgrade(new TurtleOreDictionary());
	registerUpgrade(new TurtleEnvironmentScanner());
	registerUpgrade(new TurtleFeeder());
	registerUpgrade(new TurtleShear());
	registerUpgrade(new TurtleSignReader());
	registerUpgrade(new TurtleGarden());
	if (Loader.isModLoaded(ModIds.ProjectRed_Exploration) || Loader.isModLoaded(ModIds.BluePower)) {
		LOGGER.info("At least one RedPower-like mod is loaded! Registering RedPower-like turtle upgrades...");
		registerRedPowerLikeUpgrades();
	} else
		LOGGER.info("No RedPower-like mods found, skipping RedPower-like turtle upgrades");
	registerUpgrade(new TurtleSpeaker());
	registerUpgrade(new TurtleTank());
	registerUpgrade(new TurtleNoteBlock());
	registerUpgrade(new TurtleRidable());
	registerUpgrade(new TurtleDispenser());
	registerUpgrade(new TurtleResupply());
	registerUpgrade(new TurtleChunkLoader());
	LOGGER.info("Registering pocket computer upgrades...");
	try {
		ComputerCraftRegistry.registerPocketUpgrade(new PocketMotionDetector());
		ComputerCraftRegistry.registerPocketUpgrade(new PocketPeripheralContainer());
	} catch (Exception e) {
		e.printStackTrace();
	}
	LOGGER.info("All peripherals and turtle upgrades registered!");
	proxy.registerRenderers();
	if (Config.enableVillagers)
		proxy.setupVillagers();
	EntityRegistry.registerModEntity(EntityRidableTurtle.class, "Ridable Turtle", 1, instance, 64, 1, true);
	EntityRegistry.registerModEntity(EntityNanoBotSwarm.class, "NanoBotSwarm", 2, instance, 64, 20, true);

	ForgeChunkManager.setForcedChunkLoadingCallback(PeripheralsPlusPlus.instance, new PeripheralChunkLoader.LoaderHandler());
}
 
开发者ID:austinv11,项目名称:PeripheralsPlusPlus,代码行数:51,代码来源:PeripheralsPlusPlus.java


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