Package logisticspipes.proxy.buildcraft.bc61.gates

Source Code of logisticspipes.proxy.buildcraft.bc61.gates.TriggerNeedsPower

package logisticspipes.proxy.buildcraft.bc61.gates;

import logisticspipes.blocks.LogisticsSolderingTileEntity;
import logisticspipes.blocks.powertile.LogisticsPowerJunctionTileEntity;
import logisticspipes.textures.provider.LPActionTriggerIconProvider;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
import buildcraft.api.gates.IGate;
import buildcraft.api.statements.IStatementContainer;
import buildcraft.api.statements.IStatementParameter;
import buildcraft.api.statements.ITriggerExternal;

public class TriggerNeedsPower extends LPTrigger implements ITriggerExternal {

  public TriggerNeedsPower() {
    super("LogisticsPipes:trigger.nodeRequestsRecharge");
  }

  @Override
  public int getIconIndex() {
    return LPActionTriggerIconProvider.triggerPowerNeededIconIndex;
  }

  @Override
  public String getDescription() {
    return "Needs More Power";
  }

  @Override
  public boolean isTriggerActive(TileEntity tile, ForgeDirection dir, IStatementContainer paramIStatementContainer, IStatementParameter[] paramArrayOfIStatementParameter) {
    if(tile instanceof LogisticsPowerJunctionTileEntity) {
      LogisticsPowerJunctionTileEntity LPJTE = (LogisticsPowerJunctionTileEntity)tile;
      if(LPJTE.needMorePowerTriggerCheck) return true;
    }
    if(tile instanceof LogisticsSolderingTileEntity) {
      LogisticsSolderingTileEntity LSTE = (LogisticsSolderingTileEntity)tile;
      if(LSTE.hasWork) return true;
    }
    return false;
  }

  @Override
  public boolean requiresParameter() {
    return false;
 
}
TOP

Related Classes of logisticspipes.proxy.buildcraft.bc61.gates.TriggerNeedsPower

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.