use of com.mojang.blaze3d.matrix.MatrixStack in project NetherEx by LogicTechCorp.
the class RenderEventHandler method renderThirdPersonBlueFire.
private static void renderThirdPersonBlueFire(MatrixStack matrixStack, IRenderTypeBuffer buffer, Entity entity) {
TextureAtlasSprite blueFireLayerOSprite = BLUE_FIRE_LAYER_O.getSprite();
TextureAtlasSprite blueFireLayer1Sprite = BLUE_FIRE_LAYER_1.getSprite();
matrixStack.push();
float f = entity.getWidth() * 1.4F;
matrixStack.scale(f, f, f);
float f1 = 0.5F;
float f3 = entity.getHeight() / f;
float f4 = 0.0F;
matrixStack.rotate(Vector3f.YP.rotationDegrees(-MINECRAFT.getRenderManager().info.getYaw()));
matrixStack.translate(0.0D, 0.0D, (-0.3F + (float) ((int) f3) * 0.02F));
float f5 = 0.0F;
int i = 0;
IVertexBuilder builder = buffer.getBuffer(Atlases.getCutoutBlockType());
for (MatrixStack.Entry matrixEntry = matrixStack.getLast(); f3 > 0.0F; i++) {
TextureAtlasSprite sprite = i % 2 == 0 ? blueFireLayerOSprite : blueFireLayer1Sprite;
float minU = sprite.getMinU();
float minV = sprite.getMinV();
float maxU = sprite.getMaxU();
float maxV = sprite.getMaxV();
if (i / 2 % 2 == 0) {
float f10 = maxU;
maxU = minU;
minU = f10;
}
fireVertex(matrixEntry, builder, f1 - 0.0F, 0.0F - f4, f5, maxU, maxV);
fireVertex(matrixEntry, builder, -f1 - 0.0F, 0.0F - f4, f5, minU, maxV);
fireVertex(matrixEntry, builder, -f1 - 0.0F, 1.4F - f4, f5, minU, minV);
fireVertex(matrixEntry, builder, f1 - 0.0F, 1.4F - f4, f5, maxU, minV);
f3 -= 0.45F;
f4 -= 0.45F;
f1 *= 0.9F;
f5 += 0.03F;
}
matrixStack.pop();
}
Aggregations