sic energy sink, 1000 EU buffer, tier 1 (32 EU/t, LV) private BasicSink ic2EnergySink = new BasicSink(this, 1000, 1);
@Override public void invalidate() { ic2EnergySink.onInvalidate(); // notify the energy sink ... super.invalidate(); // this is important for mc! }
@Override public void onChunkUnload() { ic2EnergySink.onOnChunkUnload(); // notify the energy sink ... }
@Override public void readFromNBT(NBTTagCompound tag) { super.readFromNBT(tag); ic2EnergySink.onReadFromNbt(tag); ... }
@Override public void writeToNBT(NBTTagCompound tag) { super.writeToNBT(tag); ic2EnergySink.onWriteToNbt(tag); ... }
@Override public void updateEntity() { ic2EnergySink.onUpdateEntity(); // notify the energy sink ... if (ic2EnergySink.addEnergy(5)) { // use 5 eu from the sink's buffer this tick ... // do something with the energy } ... } ... }
@endcode
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.