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();
}
}
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);
}
}
Aggregations