Package buildcraft.api.power

Examples of buildcraft.api.power.PowerHandler


  protected MjAPILegacy(World world, MjAPI.BatteryObject battery, PowerHandler.Type type) {
    if (battery == null) {
      throw new NullPointerException();
    }
    this.world = world;
    this.powerHandler = new PowerHandler(this, type, battery);
  }
View Full Code Here


    PipeConnectionBans.banConnection(PipeItemsObsidian.class, PipeItemsStripes.class);

    transport.travelHook = this;

    powerHandler = new PowerHandler(this, Type.MACHINE);
    powerHandler.configure(0.0f, powerToBreakABlock / 2.0f, powerToBreakABlock, powerToBreakABlock * 10);
    powerHandler.configurePowerPerdition(0, 0);
  }
View Full Code Here

  public static PowerReceiver getPowerReceiver(IEnergyInterface handler, ForgeDirection side)
  {
    if (!powerProviderMap.containsKey(handler))
    {
      PowerHandler powerHandler = new PowerHandler((IPowerReceptor) handler, Type.MACHINE);

      if (handler instanceof IEnergyContainer)
      {
        float capacity = (float) (((IEnergyContainer) handler).getEnergyCapacity(ForgeDirection.UNKNOWN) * CompatibilityType.BUILDCRAFT.ratio);
        if(capacity < 1)
        {
            capacity = 1;
        }
        powerHandler.configure(0, capacity, 1, capacity);
      }

      powerHandler.configurePowerPerdition(0, 0);
      powerProviderMap.put(handler, powerHandler);
    }

    if (handler instanceof TileEntity)
    {
View Full Code Here

    {
        if (EnergyConfigHandler.isBuildcraftLoaded())
        {
            if (this instanceof IPowerReceptor)
            {
                this.powerHandlerBC = new PowerHandler((IPowerReceptor) this, buildcraft.api.power.PowerHandler.Type.PIPE);
                ((PowerHandler) this.powerHandlerBC).configurePowerPerdition(0, 0);
                ((PowerHandler) this.powerHandlerBC).configure(0, 0, 0, 0);
            }
        }
    }
View Full Code Here

    }

    @RuntimeInterface(clazz = "buildcraft.api.power.IPowerReceptor", modID = "EnderIO")
    public void doWork(PowerHandler workProvider)
    {
        PowerHandler handler = (PowerHandler) this.powerHandlerBC;

        double energyBC = handler.getEnergyStored();
        if (energyBC > 0D)
        {
            energyBC = this.getNetwork().produce((float) energyBC * EnergyConfigHandler.BC3_RATIO, true, 1, this) * EnergyConfigHandler.TO_BC_RATIO;
            if (energyBC < 0D)
            {
                energyBC = 0D;
            }
            handler.setEnergy(energyBC);
        }

        this.reconfigureBC();
    }
View Full Code Here

                if (this.powerHandlerBC == null)
                {
                    this.initBuildCraft();
                }

                PowerHandler handler = (PowerHandler) this.powerHandlerBC;

                double energyBC = handler.getEnergyStored();
                if (energyBC > 0D)
                {
                    float usedBC = this.storage.receiveEnergyGC((float) energyBC * EnergyConfigHandler.BC3_RATIO) * EnergyConfigHandler.TO_BC_RATIO;
                    energyBC -= usedBC;
                    if (energyBC < 0D)
                    {
                        energyBC = 0D;
                    }
                    handler.setEnergy(energyBC);
                }
            }
        }
    }
View Full Code Here

     */
    public void initBuildCraft()
    {
        if (this.powerHandlerBC == null)
        {
            this.powerHandlerBC = new PowerHandler((IPowerReceptor) this, buildcraft.api.power.PowerHandler.Type.MACHINE);
        }
        float receive = this.storage.receiveEnergyGC(this.storage.getMaxReceive(), true) * EnergyConfigHandler.TO_BC_RATIO;
        if (receive < 0.1F) receive = 0F;
        ((PowerHandler) this.powerHandlerBC).configure(0D, receive, 0, (int) (this.getMaxEnergyStoredGC() * EnergyConfigHandler.TO_BC_RATIO));
        ((PowerHandler) this.powerHandlerBC).configurePowerPerdition(1, 10);
View Full Code Here

  protected MjAPILegacy(World world, IBatteryObject battery, PowerHandler.Type type) {
    if (battery == null) {
      throw new NullPointerException();
    }
    this.world = world;
    this.powerHandler = new PowerHandler(this, type, battery);
  }
View Full Code Here

{

  final protected PowerHandler bcPowerHandler;

  public MJPerdition(IPowerReceptor te) {
    bcPowerHandler = new PowerHandler( te, Type.MACHINE );
  }
View Full Code Here

    }

    public TileEngravingBench() {
        super(2);
        if (RailcraftConfig.machinesRequirePower()) {
            powerHandler = new PowerHandler(this, PowerHandler.Type.MACHINE);
            initPowerProvider();
        }
    }
View Full Code Here

TOP

Related Classes of buildcraft.api.power.PowerHandler

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.