-
Notifications
You must be signed in to change notification settings - Fork 432
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Applied Energistics Support for 1.10 (rv4) #2465
Conversation
@@ -208,7 +209,11 @@ dependencies { | |||
provided "appeng:RotaryCraft:${config.rotc.version}:api" | |||
provided ("appeng:appliedenergistics2:${config.ae2.version}:dev") { | |||
exclude module: 'buildcraft' | |||
} | |||
}*/ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should only need to use the API jar. Even if that means some code changes (I can see some usages of an internal interface).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh ok, should I rewrite the whole thing? I'm confused, in the old Version also the whole Mod was used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No not the whole thing, just the bits that use things not in the API as they may change. I know the old code uses the whole thing but it's generally not a good idea. And I do recall the reason this code is not already back in OC is because Alpha mods are not supported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I now looked into the api and there are many things which aren't accessible via api.
The api is made for creating new devices not accessing the existing ones
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just because it uses things that aren't in the api, doesn't mean there aren't other ways of doing it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@28Smiles Thanks for updating the integration! What's the status here, i.e. do you think you can port the bits that currently require non-api classes to use the API?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the status here, i.e. do you think you can port the bits that currently require non-api classes to use the API?
You could modify some Code to use the AE2-API Interfaces, but this wouldn't work for everything, so the lack of upgradeability stays due not completely using the api. I suggest to use this for now and update the whole AE2 integration to the api by using the Open-Computer adapter or adding an network access block or something like this. For now I think this is the simplest and best solution.
Edit: If you agree with me, I will start Programming something like this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added a comment on the main conversation thread with alternatives, if there are other non-api usages you can't work out I'd be happy to assist
def getFluidsInNetwork(context: Context, args: Arguments): Array[AnyRef] = | ||
result(tile.getProxy.getStorage.getFluidInventory.getStorageList.filter(stack => | ||
!Mods.ExtraCells.isAvailable || ECUtil.canSeeFluidInNetwork(stack)). | ||
map(_.getFluidStack).toArray) | ||
!Mods.ExtraCells.isModAvailable || ECUtil.canSeeFluidInNetwork(stack)). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EC is not needed to see fluids in the network. You can just remove the filter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I see
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ECUtil is excluded and not available for compiling, and also Applied Energistics on it's own doesn't support Fluids
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The API itself does support fluids. Any mod can add them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DrummerMC care to comment on this, seeing as you did the original fluid integration? Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used the filter to hide the gas fluids. EC is not updated. You can remove it.
If you do need the extra info, this one is an API oversight; you would need to save the MC Another way around this currently would be to write it to a packet and store the |
@@ -15,13 +15,14 @@ import li.cil.oc.util.ExtendedArguments._ | |||
import li.cil.oc.util.ResultWrapper._ | |||
import net.minecraft.item.ItemStack | |||
import net.minecraft.util.EnumFacing | |||
import net.minecraft.util.math.BlockPos | |||
import net.minecraft.world.World | |||
|
|||
object DriverBlockInterface extends DriverSidedTileEntity { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thiakil how about those?
@Callback(doc = "function([slot:number]):table -- Get the configuration of the interface.") def getInterfaceConfiguration(context: Context, args: Arguments): Array[AnyRef]
and
@Callback(doc = "function([slot:number][, database:address, entry:number[, size:number]]):boolean -- Configure the interface.") def setInterfaceConfiguration(context: Context, args: Arguments)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getInventoryByName
? That's part of appeng.api.implementations.tiles.ISegmentedInventory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which is a superclass of IInterfaceHost
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok thanks, i will try my best
@thiakil I can't find an altenative to accessing IGridProxyable it isn't part of the Api and without this i cannot access the Network |
I mentioned in one of my previous comments how you need to get around that. All of the |
@thiakil Thanks for your help |
That particular method should be fine, it's in The hardest part I can see for Parts is testing which part it is. e.g.
would need to be something like (please forgive my terrible Scala) |
def createEnvironment(world: World, x: Int, y: Int, z: Int, side: EnumFacing): ManagedEnvironment = | ||
new Environment(world.getTileEntity(x, y, z).asInstanceOf[TileInterface]) | ||
def createEnvironment(world: World, pos: BlockPos, side: EnumFacing): ManagedEnvironment = | ||
new Environment(world.getTileEntity(pos).asInstanceOf[TileEntity with ISegmentedInventory with IGridHost with IActionHost]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IActionHost
extends IGridHost
;)
} | ||
// We need reflection here to avoid compiling against the return and | ||
// argument type, which has changed in rv2-beta-20 or so. | ||
val fuzzyMode = (try export.getConfigManager.getClass.getMethod("getSetting", classOf[Enum[_]]) catch { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this reflection could be removed? rv2 is long gone
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea i will change this
itemStorage.getStorageList.findFuzzy(filter, fuzzyMode).toArray.toSeq | ||
else | ||
Seq(itemStorage.getStorageList.findPrecise(filter)) | ||
for (ais <- stacks.filter(_ != null) if count > 0) { //TODO: Savety Copy removed no public clone function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't understand the Scala here; which object doesn't have a public copy method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The AEStack, it's protected
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forget it, my fault
Now fully using the AE2-Api
@fnuecke Sorry Florian, but I don't get the error. Can you please tell my why the CI build failed? |
Something on Travis is killing the process, possibly it's using "too much" memory, or taking too long |
These CI builds posted by PRs have been failing for a long time. I wouldn't worry about it. Give @fnuecke some time to return and review the work. We've discussed this work you've been doing and we do plan to merge it. |
Please note that AE2 now has a 1.12 release, too! |
Since this Implementation uses the Api it works(should) for all AE2 versions and MC versions |
Looks great, really hoping this is added. |
Hi, are there still any blockers left which could prevent this from being included? Currently thinking about porting my existing FTB Beyond RS System to AE cause I like AE way more so far - feels not as OP. But I would really like an OpenComputers Integration :) -- Stephan |
I have reintegrated the support for Applied Energistics (Now rv4).
Please note that the Code compiles, but due issues between tile-registration-names (tis3d controller and ae controller) you are not able to run the build in the dev enviroment. Also i should point out, that i have added the libary for ae2-rv4, because there is no maven repository for ae right now.
Now, here are some screenshots, for testing i used FTB-Beyond and substituted the Open-Computers mod:
As you can see I tested the fundamental functions of the API, but I haven't checkt every function. Also this is the first time I programmed in Scala, so my code may not be very genius, but it is functional and isn't Scala a functional language... 🤣
Please let me know what you think