本文整理汇总了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();
}
示例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));
}
}
}
}
}
示例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");
}
示例4: init
import dan200.computercraft.api.ComputerCraftAPI; //导入依赖的package包/类
public static void init() {
registerTabs();
registerBlocks();
registerItems();
registerEvents();
if (Loader.isModLoaded("ComputerCraft")) {
ComputerCraftAPI.registerPeripheralProvider((IPeripheralProvider) blockRadio);
}
}
示例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);
}
示例6: loadCCPeripheralProviders
import dan200.computercraft.api.ComputerCraftAPI; //导入依赖的package包/类
@Method(modid = "ComputerCraft")
public void loadCCPeripheralProviders()
{
try {
ComputerCraftAPI.registerPeripheralProvider((BlockMachine) MekanismBlocks.MachineBlock);
} catch(Exception ex) {}
}
示例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);
}
示例8: onBlockRegistry
import dan200.computercraft.api.ComputerCraftAPI; //导入依赖的package包/类
@Override
public void onBlockRegistry(Block block) {
if (block instanceof IPeripheralProvider) {
ComputerCraftAPI.registerPeripheralProvider((IPeripheralProvider) block);
}
}
示例9: register
import dan200.computercraft.api.ComputerCraftAPI; //导入依赖的package包/类
public void register() {
ComputerCraftAPI.registerPeripheralProvider(this);
}
示例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());
}
示例11: postInit
import dan200.computercraft.api.ComputerCraftAPI; //导入依赖的package包/类
@EventHandler
public void postInit(FMLPostInitializationEvent event) {
ComputerCraftAPI.registerPeripheralProvider(new PeripheralProvider());
}
示例12: preInit
import dan200.computercraft.api.ComputerCraftAPI; //导入依赖的package包/类
@Override
public void preInit(FMLPreInitializationEvent ev) {
ComputerCraftAPI.registerPeripheralProvider(PeripheralProvider.INSTANCE);
}
示例13: postInit
import dan200.computercraft.api.ComputerCraftAPI; //导入依赖的package包/类
@Override
public void postInit(FMLPostInitializationEvent event) {
ComputerCraftAPI.registerPeripheralProvider(instance);
}
示例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());
}
}
示例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());
}