Package mekanism.api.gas

Examples of mekanism.api.gas.GasStack.copy()


  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


  @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

        GasStack drained = extTank.drawGas(dir.getOpposite(), maxExtract);
        if(drained == null || drained.amount <= 0) {
          return false;
        }
        setGasType(drained);
        tank.setGas(drained.copy());
        return true;
      }

      GasStack couldDrain = gasType.copy();
      couldDrain.amount = maxExtract;
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.