OpenMods / OpenPeripheral-Integration

Extra OP adapters
MIT License
9 stars 9 forks source link

Applied Energistics 2 support #3

Closed davenonymous closed 9 years ago

davenonymous commented 9 years ago

So, I needed this myself and had it lying around since I implemented the AE2Peripheral. I cleaned, improved and commented the code - it should be an easy read being something like the third iteration of this. Happy to implement any changes required and to fix/improve/support this in the future.

Some random thoughts:

boq commented 9 years ago

Looks great! Just add missing AppEng API files (try to exclude unneeded ones, but that's optional) and it's ready to merge.

Though I'm reserving rights to poke at few things :wink:

davenonymous commented 9 years ago

Done. Lots of those classes depend on each other, but this should be the minimum needed. Please poke at things. I'm sure there are ways to do some of the stuff in a nicer and more elaborate way ;)

boq commented 9 years ago

Ummm, so I got little bit carried away in 5d49f4ad5dc6800a33c1c324ed31ed13580e8fac and refactored huge chunk of this code (mostly renaming SearchNeedle to ItemFingerprint, moving that functionality to vanilla inventory and doing some stuff in IAEItemStack converter instead of IItemStackMetaProviders - mostly to skip all this fake NBT stuff).

Do you see any feature I missed/broken?

davenonymous commented 9 years ago

Howdy. Just tried to test it and noted a few things. getAvailableItems does not return the full itemstack anymore but only the data from the AEItemStack. Before the commit it returned a normal itemstack with an additional nbt_id field. I.e. the info from the AE system is missing a lot of data now (e.g. displayname, enchantments etc). canExtract is wrong in some way as well - having an interface point at a turtle above it and canExtract returns false for the "UP" direction.

boq commented 9 years ago

First one is deliberate - converting to full item info is bit heavy, so I just return basic info. It can still be queried before of after extracting (.getItemDetail() when in AE network and .getStackInSlot() when in target inventory).

About second one: it will never work, since turtles are not IInventories. But looks like I misunderstood IOrientable interface, and it now works only in horizontal directions.