Mekanism

Mekanism

111M Downloads

How do I make a energy-emitting block with your API? (1.12.2)

theoparis opened this issue ยท 4 comments

commented

Issue description:

I have tired extending TileEntityTransmitter, which seems to give me the side connection to a universal cable. Then I implemented IStrictEnergyOutputter, which I thought was the way to send energy to other blocks.
Right now, the cable connects to any side of my custom block, so that's not the problem. I just don't know how to get it to actually send energy.

Since I implemented IStrictEnergyOutputter, I assumed pullEnergy was automatically called by other machines, so I returned the energy.

Also, are there any tutorials or better documentation pages on how to do this?

commented

What exactly are you trying to do, given you definitely should not be extending TileEntityTransmitter, unless you are just trying to make a custom cable or something. Secondly IStrictEnergyOutputter also needs to be exposed via forge's capability system so are you doing that or are you only implementing the class in your tile.

commented

Oops, I'm not very familar with the capability system, and if adding the methods hasCapability and getCapability is what I needed to do, then I didn't do it before. Do I return "this" in the getCapability part, since I implemented the istrictoutputter?

commented

Also, I dug into the TileEntityTransmitter and found IBlockableConnection. I now have this:

implements IConfigurable, ITransmitter, IStrictEnergyAcceptor, IStrictEnergyOutputter, IBlockableConnection, ITickable

and I am no longer extending TileEntityTransmitter

commented

Should not be an issue. Feel free to discuss with us in our discord channel.