davenonymous / OCXNetDriver

OpenComputers + XNet = ❤️
https://minecraft.curseforge.com/projects/oc-xnet-driver
4 stars 5 forks source link

`xnet.transferEnergy` does not work with RFTools Powercells #7

Open SwadicalRag opened 5 years ago

SwadicalRag commented 5 years ago

image image

xnet.transferEnergy works with Thermal Expansion's energy cells though.

I'm not sure what else I should include in this bug report. I made sure that the sidedness of the RFTools power cell was correctly configured. The RFTools power cell worked fine through xnet's GUI.

SwadicalRag commented 5 years ago

https://github.com/McJtyMods/RFTools/blob/bc0d0360e673aed0179f160b4fd266f9770b6c04/src/main/java/mcjty/rftools/blocks/powercell/PowerCellTileEntity.java#L868

PowerCellTileEntity::canExtract() always returns false. This seems like an RFTools issue.

As a side note, XNet's own code does not check IEnergyStorage::canExtract and IEnergyStorage::canReceive

davenonymous commented 5 years ago

The code you linked references some NullHandler. That's the one being used if no EnumFacing was given. But yeah, the SidedHandler a few lines above also has canExtract set to false without any conditions.

This looks like an RFTools issue and there is not much I can do about it. I guess it might be made to work through tesla or redstone flux, but nah, I don't want either of those complexities added to this mod.

@McJty, can you shine some light on this? Is there a specific reason it actively pushes out energy, but does not allow pulling from it?

SwadicalRag commented 5 years ago

@thraaawn I've made a PR ( #8 ) that plays nice with how the powercell actively pushes out energy. It works by using the connector's built-in energy buffer (a la XNet's internal way of transferring power). (And as a side effect of mirroring XNet's power logic, redstone flux API support was added)

SwadicalRag commented 5 years ago

I think this is the better way to move forward, as other mods may also rely on blocks which actively push out energy.

davenonymous commented 5 years ago

I don't want either of those complexities added to this mod.

I still stand by that, to be honest. I don't like the Redstone Flux stuff for various reasons. I will look over the PR in more detail soonish (it looks like this is not using the xnet api?), but I'm a bit hesitant.