Hi, I have trying to get what isAddedToEnergyNet means, but seriously I have no idea, If someone could explain when I need to set it to return true or false, I would appreciate it, also If I need to add a function to emit the Energy to the Net, or the maxEnergyOutput does it automatically, thanks
isAddedToEnergyNet function HELP.
- Varocarrascosa
- Closed
-
-
After you added your TileEntity to the E-net it must return true. False otherwise. Thats all.
-
So you mean after the block is placed, it return true, to produce energy?
-
So you mean after the block is placed, it return true, to produce energy?
You know the function to add your TileEntity to the E-net? After you called that function it must return true, to confirm that your Machine is plugged in.
-
Easy-to-say: if you set it to true, it will connect to a cable, otherwise not. Seriously, no one electric device could work without adding to the enet (and generators (IEnergyEmitters) and machines (IEnergySink)).
You must connect device to energyNet always (in updateEntity method of course)
Source example:Codepublic void updateEntity() { super.updateEntity(); if (!this.addedToEnergyNet) { EnergyNet.getForWorld(this.worldObj).addTileEntity(this); this.addedToEnergyNet = true; } }
And you also have to delete your TE from energy net in invalidate() method.
-
Thank you so much