your current location:首页 > news>Advanced-How to get the data API (such as the original block, such as the original block, blood magic, industrial 2, etc

Advanced-How to get the data API (such as the original block, such as the original block, blood magic, industrial 2, etc

2024-12-10 17:54:16|Myriagame |source:minecraft skins

This tutorial is set by the author to use the CC By-NC-ND protocol.

This tutorial will teach you:

Determine whether the block (machine) is compatible with Open Computer;

Get the API function name of the data required for the corresponding block (machine).

In the official document, there is no description of how to read other block data, but in fact OC adapts many modules.

This tutorial is suitable for advanced players who try to read data from other blocks. The default readers are already familiar with and mastered:

How to build an OC system;

How to install OpenOS;

Basic LUA statement.

It is necessary to prepare a system first, and we need to use an adapter, and: the analyzer used to read the adapter address.

How to judge whether the block (machine) is compatible with Open Computer:

Refer to the adapter, enter component.list () in the system to query whether there are related names.

Go to the adaptation module list (GitHub) to see if there is a MOD name that belongs to, and click on the open to see if there is a block.AE is also adapted. In the official documentation, this list is not in this list.

Save flow:

 Agricraft, Appliednergistics2, Battlegear2, BetterReCords, Bloodmagic, BluePower, BuildCraftLibrary;

BuildCraftRecipes, BuildCrafttiles, BuildCrafttools, BuildCrafttransport, COFHENERGY, COFHITEM, COFHTILEINTITITY;

COFHTRANSPORT, ColoredLights, ComputerCraft, CraftingCosts, DeepStorageUnit, ElectricaLage, Enderio, EnderStorage;

Extracells, Factorization, Forestry, Forestry, ForgetIPART, Galacticraft, Gregtech, INDUSTRIALCRAFT2, IndusStricCraft2Classic;

Ingamewiki, Mekanism, Mekanismgas, Minecraft, MineFactoryReloaded, MyStcraft, NoteNouGhitems, NoteNoughkeys;

OpenComputers, PortalGun, PowerAdvantage, ProjectRedCore, ProjectRedtransMissation, RailCraft, Redlogic, RotaryCraft;

StargateTech2, TINKERSCONSTRUCT, TMECHWORKS, VersionChecker, WirelessREDSTONECBE (SVE)

Get the API function name of the data required for the corresponding block (machine).

AE's related APIs can be found directly in the official document.

Go to the adaptive module list (GitHub) to find the corresponding block of the corresponding module;

Check the corresponding functional sentence.

For example, I want to query the capacity of the blood magic altar, the blood magic is Blood Magic, and the altar is altar. Then I found it in the directory:

I found it in the blood magic:

Found in this file:

Then, assuming that my adapter address is 0C7FBB36-2F56-4F4C-8385-33092fee8c94 defined as (use the analyzer to sneak right-click, open the chat box, click to copy quickly):

 Local Altaradapter = Component.proxy ("0C7FBB36-2F56-4C-8385-33092fee8c94" ") 

Then the altar capacity is:

 Altaradapter.getCapAcity () 

In the same way, I can get the altar level, current blood volume, total blood volume, and directly output:

 Print ("altar level:" .. Altaradapter.gettier ()) Print ("Altaradapter.getCurrentblood () .."/".. Altaradapter.getCapaCity ()) 

The result is perfect, and this value can be used to participate in other judgments.