Search in sources :

Example 6 with FusionReactorMultiblockData

use of mekanism.generators.common.content.fusion.FusionReactorMultiblockData in project Mekanism by mekanism.

the class RenderFusionReactor method render.

@Override
protected void render(TileEntityFusionReactorController tile, float partialTick, MatrixStack matrix, IRenderTypeBuffer renderer, int light, int overlayLight, IProfiler profiler) {
    FusionReactorMultiblockData multiblock = tile.getMultiblock();
    if (multiblock.isFormed() && multiblock.isBurning()) {
        matrix.pushPose();
        matrix.translate(0.5, -1.5, 0.5);
        long scaledTemp = Math.round(multiblock.getLastPlasmaTemp() / SCALE);
        float ticks = MekanismClient.ticksPassed + partialTick;
        double scale = 1 + 0.7 * Math.sin(Math.toRadians(ticks * 3.14 * scaledTemp + 135F));
        IVertexBuilder buffer = core.getBuffer(renderer);
        renderPart(matrix, buffer, overlayLight, EnumColor.AQUA, scale, ticks, scaledTemp, -6, -7, 0, 36);
        scale = 1 + 0.8 * Math.sin(Math.toRadians(ticks * 3 * scaledTemp));
        renderPart(matrix, buffer, overlayLight, EnumColor.RED, scale, ticks, scaledTemp, 4, 4, 0, 36);
        scale = 1 - 0.9 * Math.sin(Math.toRadians(ticks * 4 * scaledTemp + 90F));
        renderPart(matrix, buffer, overlayLight, EnumColor.ORANGE, scale, ticks, scaledTemp, 5, -3, -35, 106);
        matrix.popPose();
    }
}
Also used : FusionReactorMultiblockData(mekanism.generators.common.content.fusion.FusionReactorMultiblockData) IVertexBuilder(com.mojang.blaze3d.vertex.IVertexBuilder)

Example 7 with FusionReactorMultiblockData

use of mekanism.generators.common.content.fusion.FusionReactorMultiblockData in project Mekanism by mekanism.

the class TileEntityFusionReactorBlock method setInjectionRateFromPacket.

public void setInjectionRateFromPacket(int rate) {
    FusionReactorMultiblockData multiblock = getMultiblock();
    if (multiblock.isFormed()) {
        multiblock.setInjectionRate(Math.min(FusionReactorMultiblockData.MAX_INJECTION, Math.max(0, rate - (rate % 2))));
        markDirty(false);
    }
}
Also used : FusionReactorMultiblockData(mekanism.generators.common.content.fusion.FusionReactorMultiblockData)

Aggregations

FusionReactorMultiblockData (mekanism.generators.common.content.fusion.FusionReactorMultiblockData)7 GuiEnergyTab (mekanism.client.gui.element.tab.GuiEnergyTab)4 GuiFusionReactorTab (mekanism.generators.client.gui.element.GuiFusionReactorTab)4 GuiGasGauge (mekanism.client.gui.element.gauge.GuiGasGauge)2 GuiProgress (mekanism.client.gui.element.progress.GuiProgress)2 IVertexBuilder (com.mojang.blaze3d.vertex.IVertexBuilder)1 GuiEnergyGauge (mekanism.client.gui.element.gauge.GuiEnergyGauge)1 GuiFluidGauge (mekanism.client.gui.element.gauge.GuiFluidGauge)1 GuiNumberGauge (mekanism.client.gui.element.gauge.GuiNumberGauge)1 INumberInfoHandler (mekanism.client.gui.element.gauge.GuiNumberGauge.INumberInfoHandler)1 GuiTextField (mekanism.client.gui.element.text.GuiTextField)1