use of mekanism.common.content.tank.TankMultiblockData in project Mekanism by mekanism.
the class RenderDynamicTank method render.
@Override
protected void render(TileEntityDynamicTank tile, float partialTick, MatrixStack matrix, IRenderTypeBuffer renderer, int light, int overlayLight, IProfiler profiler) {
if (tile.isMaster()) {
TankMultiblockData multiblock = tile.getMultiblock();
if (multiblock.isFormed() && multiblock.renderLocation != null) {
RenderData data = getRenderData(multiblock);
if (data != null) {
data.location = multiblock.renderLocation;
data.height = multiblock.height() - 2;
data.length = multiblock.length();
data.width = multiblock.width();
matrix.pushPose();
IVertexBuilder buffer = renderer.getBuffer(Atlases.translucentCullBlockSheet());
BlockPos pos = tile.getBlockPos();
matrix.translate(data.location.getX() - pos.getX(), data.location.getY() - pos.getY(), data.location.getZ() - pos.getZ());
int glow = data.calculateGlowLight(MekanismRenderer.FULL_SKY_LIGHT);
Model3D model = ModelRenderer.getModel(data, multiblock.prevScale);
MekanismRenderer.renderObject(model, matrix, buffer, data.getColorARGB(multiblock.prevScale), glow, overlayLight, getFaceDisplay(data, model));
matrix.popPose();
if (data instanceof FluidRenderData) {
MekanismRenderer.renderValves(matrix, buffer, multiblock.valves, (FluidRenderData) data, pos, glow, overlayLight, isInsideMultiblock(data));
}
}
}
}
}
use of mekanism.common.content.tank.TankMultiblockData in project Mekanism by mekanism.
the class GuiDynamicTank 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));
addButton(new GuiElementHolder(this, 141, 16, 26, 56));
super.addGuiElements();
addButton(new GuiSlot(SlotType.INNER_HOLDER_SLOT, this, 145, 20));
addButton(new GuiSlot(SlotType.INNER_HOLDER_SLOT, this, 145, 50));
addButton(new GuiInnerScreen(this, 49, 21, 84, 46, () -> {
List<ITextComponent> ret = new ArrayList<>();
TankMultiblockData multiblock = tile.getMultiblock();
long capacity = multiblock.getChemicalTankCapacity();
switch(multiblock.mergedTank.getCurrentType()) {
case EMPTY:
ret.add(MekanismLang.EMPTY.translate());
break;
case FLUID:
addStored(ret, multiblock.getFluidTank().getFluid(), FluidStack::getAmount);
capacity = multiblock.getTankCapacity();
break;
case GAS:
addStored(ret, multiblock.getGasTank());
break;
case INFUSION:
addStored(ret, multiblock.getInfusionTank());
break;
case PIGMENT:
addStored(ret, multiblock.getPigmentTank());
break;
case SLURRY:
addStored(ret, multiblock.getSlurryTank());
break;
}
ret.add(MekanismLang.CAPACITY.translate(""));
ret.add(MekanismLang.GENERIC_MB.translate(TextUtils.format(capacity)));
return ret;
}).spacing(2));
addButton(new GuiDownArrow(this, 150, 39));
addButton(new GuiContainerEditModeTab<>(this, tile));
addButton(new GuiMergedTankGauge<>(() -> tile.getMultiblock().mergedTank, tile::getMultiblock, GaugeType.MEDIUM, this, 7, 16, 34, 56));
}
use of mekanism.common.content.tank.TankMultiblockData in project Mekanism by mekanism.
the class TileEntityDynamicTank method nextMode.
@Override
public void nextMode() {
TankMultiblockData multiblock = getMultiblock();
multiblock.setContainerEditMode(multiblock.editMode.getNext());
}
Aggregations