HandFOV module

HandFOV: Minecraft 26.3 cheat module, full source for every implementation (1 client: Nicotine).

1 implementationRender

Clients with this module

Full module source: 1 implementation

Every implementation below is the complete module file, verbatim. Expand a client to read its code.

NicotineRendersrc/client/java/nicotine/mod/mods/render/HandFOV.javaJava · 58 lines · 1.5 KB
SettingsFOVAspect
HandFOV.javaJava · Minecraft 26.3 · 58 lines · 1.5 KB · complete file, verbatimOriginal ↗
1
package nicotine.mod.mods.render;
2
3
import com.mojang.blaze3d.ProjectionType;
4
import com.mojang.blaze3d.systems.RenderSystem;
5
import nicotine.events.RenderHandEvent;
6
import nicotine.mod.Mod;
7
import nicotine.mod.ModCategory;
8
import nicotine.mod.option.SliderOption;
9
import nicotine.util.EventBus;
10
import org.joml.Matrix4f;
11
12
import java.util.Arrays;
13
14
import static nicotine.util.Common.mc;
15
16
public class HandFOV extends Mod {
17
18
    private final SliderOption fov = new SliderOption(
19
            "FOV",
20
            50,
21
            50,
22
            180
23
    );
24
25
    private final SliderOption aspect = new SliderOption(
26
            "Aspect",
27
            1.0f,
28
            0.1f,
29
            1.5f,
30
            true
31
    );
32
33
    public HandFOV() {
34
        super(ModCategory.Render,"HandFOV");
35
        this.addOptions(Arrays.asList(fov, aspect));
36
    }
37
38
    @Override
39
    protected void init() {
40
        EventBus.register(RenderHandEvent.class, event -> {
41
            if (!this.enabled)
42
                return true;
43
44
             Matrix4f matrix4f = new Matrix4f();
45
             matrix4f.perspective(
46
                    fov.value * (float) (Math.PI / 180.0),
47
                    ((float)mc.getWindow().getWidth() / (float)mc.getWindow().getHeight() * aspect.value),
48
                    0.05F,
49
                    100.0F
50
            );
51
52
            RenderSystem.setProjectionMatrix(event.levelProjectionMatrixBuffer.getBuffer(matrix4f), ProjectionType.PERSPECTIVE);
53
54
            return true;
55
        });
56
    }
57
}
58