use of mekanism.api.chemical.merged.MergedChemicalTank.Current in project Mekanism by mekanism.
the class BoxedPressurizedTube method releaseShare.
@Nonnull
@Override
public BoxedChemicalStack releaseShare() {
BoxedChemicalStack ret;
Current current = chemicalTank.getCurrent();
if (current == Current.EMPTY) {
ret = BoxedChemicalStack.EMPTY;
} else {
IChemicalTank<?, ?> tank = chemicalTank.getTankFromCurrent(current);
ret = BoxedChemicalStack.box(tank.getStack());
tank.setEmpty();
}
return ret;
}
use of mekanism.api.chemical.merged.MergedChemicalTank.Current in project Mekanism by mekanism.
the class GuiChemicalTank method addGuiElements.
@Override
protected void addGuiElements() {
// Add the side holder before the slots, as it holds a couple of the slots
addButton(GuiSideHolder.armorHolder(this));
super.addGuiElements();
addButton(new GuiMergedChemicalBar<>(this, tile, tile.getChemicalTank(), 42, 16, 116, 10, true));
addButton(new GuiInnerScreen(this, 42, 37, 118, 28, () -> {
List<ITextComponent> ret = new ArrayList<>();
Current current = tile.getChemicalTank().getCurrent();
if (current == Current.EMPTY) {
ret.add(MekanismLang.CHEMICAL.translate(MekanismLang.NONE));
ret.add(MekanismLang.GENERIC_FRACTION.translate(0, tile.getTier() == ChemicalTankTier.CREATIVE ? MekanismLang.INFINITE : TextUtils.format(tile.getTier().getStorage())));
} else if (current == Current.GAS) {
addStored(ret, tile.getChemicalTank().getGasTank(), MekanismLang.GAS);
} else if (current == Current.INFUSION) {
addStored(ret, tile.getChemicalTank().getInfusionTank(), MekanismLang.INFUSE_TYPE);
} else if (current == Current.PIGMENT) {
addStored(ret, tile.getChemicalTank().getPigmentTank(), MekanismLang.PIGMENT);
} else if (current == Current.SLURRY) {
addStored(ret, tile.getChemicalTank().getSlurryTank(), MekanismLang.SLURRY);
} else {
throw new IllegalStateException("Unknown current type");
}
return ret;
}));
addButton(new GuiGasMode(this, 159, 72, true, () -> tile.dumping, tile.getBlockPos(), 0));
}
Aggregations