Examples of GasStack


Examples of mekanism.api.gas.GasStack

    super.renderConduit(tex, conduit, component, brightness);

    if(isNSEWUD(component.dir)) {
      GasConduit lc = (GasConduit) conduit;

      GasStack gas = lc.getGasType();
      IIcon texture = null;
      if(gas != null) {
        texture = gas.getGas().getIcon();
      }

      if(texture == null) {
        texture = lc.getNotSetEdgeTexture();
      }
View Full Code Here

Examples of mekanism.api.gas.GasStack

  @Override
  public boolean canReceiveGas(ForgeDirection from, Gas gas) {
    if(network == null) {
      return false;
    }
    return getConnectionMode(from).acceptsInput() && GasConduitNetwork.areGassCompatable(getGasType(), new GasStack(gas, 0));
  }
View Full Code Here

Examples of mekanism.api.gas.GasStack

  @Override
  public boolean canDrawGas(ForgeDirection from, Gas gas) {
    if(network == null) {
      return false;
    }
    return getConnectionMode(from).acceptsOutput() && GasConduitNetwork.areGassCompatable(getGasType(), new GasStack(gas, 0));
  }
View Full Code Here

Examples of mekanism.api.gas.GasStack

            if(!(n instanceof AbstractGasTankConduit)) {
              return false;
            }
            AbstractGasTankConduit neighbour = (AbstractGasTankConduit) n;
            if(neighbour.getGasType() == null || getGasType() == null) {
              GasStack type = getGasType();
              type = type != null ? type : neighbour.getGasType();
              neighbour.setGasTypeOnNetwork(neighbour, type);
              setGasTypeOnNetwork(this, type);
            }
            return ConduitUtil.joinConduits(this, faceHit);
          } else if(containsExternalConnection(connDir)) {
            // Toggle extraction mode
            setConnectionMode(connDir, getNextConnectionMode(connDir));
          } else if(containsConduitConnection(connDir)) {
            GasStack curGasType = null;
            if(getTankNetwork() != null) {
              curGasType = getTankNetwork().getGasType();
            }
            ConduitUtil.disconectConduits(this, connDir);
            setGasType(curGasType);
View Full Code Here

Examples of mekanism.api.gas.GasStack

  public ConduitGasTank getTank() {
    return tank;
  }

  public GasStack getGasType() {
    GasStack result = null;
    if(getTankNetwork() != null) {
      result = getTankNetwork().getGasType();
    }
    if(result == null) {
      result = tank.getGas();
View Full Code Here

Examples of mekanism.api.gas.GasStack

  @Override
  public void readFromNBT(NBTTagCompound nbtRoot, short nbtVersion) {
    super.readFromNBT(nbtRoot, nbtVersion);
    updateTank();
    if(nbtRoot.hasKey("tank")) {
      GasStack gas = GasStack.readFromNBT(nbtRoot.getCompoundTag("tank"));
      tank.setGas(gas);
    } else {
      tank.setGas(null);
    }
  }
View Full Code Here

Examples of mekanism.api.gas.GasStack

  }

  @Override
  public void writeToNBT(NBTTagCompound nbtRoot) {
    super.writeToNBT(nbtRoot);
    GasStack gt = getGasType();
    if(GasUtil.isGasValid(gt)) {
      updateTank();
      gt = gt.copy();
      gt.amount = tank.getStored();
      nbtRoot.setTag("tank", gt.write(new NBTTagCompound()));
    }
  }
View Full Code Here

Examples of mekanism.api.gas.GasStack

    if(doDraw) {
      addAmount(-used);
    }

    GasStack drained = new GasStack(stored.getGas().getID(), used);

    if(stored.amount < 0) {
      stored.amount = 0;
    }
    return drained;
View Full Code Here

Examples of mekanism.api.gas.GasStack

    return nbt;
  }

  public void read(NBTTagCompound nbt) {
    if(!nbt.hasKey("emptyGasTank")) {
      GasStack gas = GasStack.readFromNBT(nbt);
      if(gas != null) {
        setGas(gas);
      }
    }
  }
View Full Code Here

Examples of mekanism.api.gas.GasStack

  @Override
  public boolean setGasType(GasStack newType) {
    if(super.setGasType(newType)) {

      GasStack ft = getGasType();
      tank.setGas(ft == null ? null : ft.copy());
      return true;
    }
    return false;
  }
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.