Package crazypants.enderio.machine.power

Examples of crazypants.enderio.machine.power.TileCapacitorBank$Receptor


  }

  //@Override
  public boolean isTriggerActive(ForgeDirection side, TileEntity tile, ITriggerParameter parameter) {
    if(tile instanceof TileCapacitorBank) {
      TileCapacitorBank capacitorBank = (TileCapacitorBank) tile;

      if(triggerID == 0) {
        return capacitorBank.getEnergyStored() == 0;
      }
      if(triggerID == 1) {
        return capacitorBank.getEnergyStored() != 0;
      }
      if(triggerID == 2) {
        return capacitorBank.getMaxEnergyStored() - capacitorBank.getEnergyStored() < 5;
      }
      if(triggerID == 3 || triggerID == 4) {
        ItemStack[] items = new ItemStack[capacitorBank.getSizeInventory()];
        for (int i = 0; i < items.length; i++) {
          items[i] = capacitorBank.getStackInSlot(i);
        }
        boolean capacitorBankEmpty = true;
        for (int i = 0; i < items.length; i++) {
          if(items[i] != null && items[i].getItem() instanceof IChargeableItem) {
            capacitorBankEmpty = false;
View Full Code Here


      float toBalance = 0;
      float maxToBalance = 0;

      for (ReceptorEntry rec : storageReceptors) {
        TileCapacitorBank cb = (TileCapacitorBank) rec.powerInterface.getDelegate();

        boolean processed = capBanks.contains(cb.getController());

        if(!processed) {
          stored += cb.getEnergyStored();
          maxCap += cb.getMaxEnergyStored();
          capBanks.add(cb.getController());
        }

        if(rec.emmiter.getConnectionMode(rec.direction) == ConnectionMode.IN_OUT) {
          toBalance += cb.getEnergyStored();
          maxToBalance += cb.getMaxEnergyStored();
        }

        int canGet = 0;
        if(cb.isOutputEnabled(rec.direction.getOpposite())) {
          canGet = Math.min(cb.getEnergyStored(), cb.getMaxOutput());
          canGet = Math.min(canGet, rec.emmiter.getMaxEnergyRecieved(rec.direction));
          canExtract += canGet;
        }
        int canFill = 0;
        if(cb.isInputEnabled(rec.direction.getOpposite())) {
          canFill = Math.min(cb.getMaxEnergyStored() - cb.getEnergyStored(), cb.getMaxInput());
          canFill = Math.min(canFill, rec.emmiter.getMaxEnergyExtracted(rec.direction));
          this.canFill += canFill;
        }
        enteries.add(new CapBankSupplyEntry(cb, canGet, canFill, rec.emmiter, rec.direction));
View Full Code Here

TOP

Related Classes of crazypants.enderio.machine.power.TileCapacitorBank$Receptor

Copyright © 2018 www.massapicom. 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.