if (e.getType() != EventRenderer2D.Type.POST) return;
if (!this.mode.is("Фов-Снап")) return;
if (mc.player == null || mc.currentScreen != null) return;
com.mojang.blaze3d.matrix.MatrixStack ms = e.getMatrixStack();
float fovDeg = fovSnapRadius.get();
int sw = mc.getMainWindow().getScaledWidth();
int sh = mc.getMainWindow().getScaledHeight();
float cx = sw / 2f;
float cy = sh / 2f;
float gameFov = (float) mc.gameRenderer.getFOVModifier(mc.getRenderManager().info, mc.getRenderPartialTicks(), true);
float radiusPx = (float)(Math.tan(Math.toRadians(fovDeg / 2.0)) / Math.tan(Math.toRadians(gameFov / 2.0))) * (sh / 2f);
int segments = 64;
int color = client.util.display.render.ColorUtil.reAlphaInt(-1, 200); // белый
org.lwjgl.opengl.GL11.glEnable(org.lwjgl.opengl.GL11.GL_LINE_SMOOTH);
com.mojang.blaze3d.systems.RenderSystem.disableTexture();
com.mojang.blaze3d.systems.RenderSystem.enableBlend();
com.mojang.blaze3d.systems.RenderSystem.lineWidth(1.5f);
net.minecraft.client.renderer.Tessellator tess = net.minecraft.client.renderer.Tessellator.getInstance();
net.minecraft.client.renderer.BufferBuilder buf = tess.getBuffer();
buf.begin(org.lwjgl.opengl.GL11.GL_LINE_LOOP, net.minecraft.client.renderer.vertex.DefaultVertexFormats.POSITION_COLOR);
int r = client.util.display.render.ColorUtil.getRed(color);
int g = client.util.display.render.ColorUtil.getGreen(color);
int b = client.util.display.render.ColorUtil.getBlue(color);
int a = client.util.display.render.ColorUtil.getAlpha(color);
net.minecraft.util.math.vector.Matrix4f mat = ms.getLast().getMatrix();
for (int i = 0; i < segments; i++) {
double angle = 2.0 * Math.PI * i / segments;
float px = cx + (float)(Math.cos(angle) * radiusPx);
float py = cy + (float)(Math.sin(angle) * radiusPx);
buf.pos(mat, px, py, 0).color(r, g, b, a).endVertex();
}
tess.draw();
com.mojang.blaze3d.systems.RenderSystem.enableTexture();
com.mojang.blaze3d.systems.RenderSystem.disableBlend();
org.lwjgl.opengl.GL11.glDisable(org.lwjgl.opengl.GL11.GL_LINE_SMOOTH);
}