Logistics Pipes

Logistics Pipes

13M Downloads

[Question] API and fluid-offering/accepting

M3gaFr3ak opened this issue · 12 comments

commented

I'd like to implement AE-compatibility for fluid-API-concerning stuff. As you might know AE has a way to connect a me interface to the LP network; I'd like to do this with my fluid equivalent to the me interface. Which API files should i use for this? in the LP API folder in this repo i cant really find anything fluid-y

commented

Fluid items are normal items inside the network, and are wrapped/unwrapped
at each end. Look at the code for the liquid provider/supplier
On 18 Jan 2014 17:59, "M3gaFr3ak" [email protected] wrote:

I'd like to implement AE-compatibility for fluid-API-concerning stuff. As
you might know AE has a way to connect a me interface to the LP network;
I'd like to do this with my fluid equivalent to the me interface. Which API
files should i use for this? in the LP API folder in this repo i cant
really find anything fluid-y


Reply to this email directly or view it on GitHubhttps://github.com//issues/250
.

commented

I found out how to make those items (reflecting them, findItem doesnt really work), but how do i make my Interface connect to a request pipe? i found the IRequestAPI, but this is oly being implemented by the pipe, right?

#233

commented

just posting here, so you see my Edits (editing doesnt notify -.-)

commented

The LP AE compatibility is done on both sides. There is an API for AE to access a request pipe (IRequestAPI) and a way for LP to access the AE storage. I don't know how your Interface is working but LP is using the IFluidHandler interface from forge to access Fluids. If you don't want to allow full access trough that Interface but still want LP to be able to access all fluids inside your system through the TileEntity, LP would need a way to get a list of all stored fluids and a way to extract a specific fluid out of the TileEntity. An simple interface for that would be enought. The converting of the fluids into a Logistics Fluid Container will be handled by the Provider pipe connected to the TileEntity. If you want to be able to access LP's fluid storage we could create an Interface similar to the IRequestAPI for Fluid requests. But like for AE it would just internaly request the Fluid an then use the forge interface to insert the fluid into the TileEntity.

commented

So, I can just make an Interface which has a List OR List (with long instead of int as amount); and a drain/fill function and you would make your system "respect" it?

commented

Yes, If there there would be an interface for that I would be able to teach LP to use those methods instead of the standard methods. Is there a general Controller like AE has one, If that is the case, I also need a method to get that TileEntity, to be able to identify the network as One tank.

commented

http://hastebin.com/farajisuqa.php

that's what i prepared now, would that be enough?
you would probably just check, if my ME FluidInterface tileentity instanceof the interface?

My blocks use the AE network, so also its controller.
I could make IMEInventoryHandler recognizing a certain TileEntity of yours which has a similar Interface to mine, representing all Fluids in the network

For the interface, you would probably just include a part of EC's source (package integration, but only the Interface & the SpecialFluidStack?

If you like the interface/have suggestions, tell me, then I will git Push :D

commented

Will I be able to request Fluids over your interface? the Problem is that all those transactions must be JustInTime, so my thing wont be able to wait for the pipes, so you might needs to "remove the thing " from the network and "simulate" the transaction through pipes, idk...

I suggest you to re-download the ec gihub project (i renamed a file)...

commented

The interface looks good. But the fill to method is not needed for LP, only the drain one. And we would check the TileEntity with instanceof yes. LP will not include that class into it's jar, we use proxy classes to avoid that. And if it is possible to add a simple method to get the Controller TileEntity that would be nice.

commented

yeah, i can give you the controller TE

I thought abozt the Fill method as a thing to store fluids in the me network (i have a storagebus for tanks and a storage drive for fluids), like items in ae can be stored on storages and also from LP. But the interface can accept fluids into the network itself, as an IFluidHandler, do you mean because of that?

edit: Added controller thing;

Interface:
https://github.com/M3gaFr3ak/ExtraCells/tree/master/src/main/java/extracells/integration/logisticspipes
SpecialFluidStack:
https://github.com/M3gaFr3ak/ExtraCells/blob/master/src/main/java/extracells/util/SpecialFluidStack.java
Tell me when you made the interface for network interaction, I will then implement it into EC.

commented

Yes If LP seends fuilds to the Interface it would use the IFluidHandler interface to insert it. The Itnerface looks good. Although handling longs instead of ints will be a little work but not inpossible, I hope.

commented

I guess this needs to be reworked and reestimated for Applied Energistics 2.