Examples of EnergyTileSourceEvent


Examples of ic2.api.energy.event.EnergyTileSourceEvent

  private int emitEnergy()
  {
    //if (ChargingBench.isDebugging) System.out.println("preEmit-currentEnergy: " + currentEnergy);
    if (currentEnergy >= packetSize)
    {
      EnergyTileSourceEvent sourceEvent = new EnergyTileSourceEvent(this, packetSize);
      MinecraftForge.EVENT_BUS.post(sourceEvent);
      final int surplus = sourceEvent.amount;

      if (surplus < packetSize)
      {
View Full Code Here

Examples of ic2.api.energy.event.EnergyTileSourceEvent

        EnergyNet net = EnergyNet.getForWorld(worldObj);
        boolean packetSent;
        do
        {
          packetSent = false;
          EnergyTileSourceEvent sourceEvent = new EnergyTileSourceEvent(this, packetSize);
          MinecraftForge.EVENT_BUS.post(sourceEvent);
          final int surplus = sourceEvent.amount;

          if (surplus < packetSize) // If any of it was consumed...
          {
View Full Code Here

Examples of ic2.api.energy.event.EnergyTileSourceEvent

    {
      energyBuffer += outputRate;
      EnergyNet net = EnergyNet.getForWorld(worldObj);
      while (energyBuffer >= packetSize)
      {
        EnergyTileSourceEvent sourceEvent = new EnergyTileSourceEvent(this, packetSize);
        MinecraftForge.EVENT_BUS.post(sourceEvent);
        //        net.emitEnergyFrom(this, packetSize); // No reason to save any surplus. Output is always the same.
        energyBuffer -= packetSize;
      }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
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.