This commit is contained in:
@@ -69,7 +69,10 @@ Code inspired by Inferis!
|
||||
- Zoom step value
|
||||
- Scroll to zoom further
|
||||
|
||||
# Current Update
|
||||
# Next Update
|
||||
|
||||
## Client Side
|
||||
- [x] Fixed bug with too high zoom step values
|
||||
|
||||
## Server Side
|
||||
- [x] Telekinesis
|
||||
|
@@ -20,6 +20,8 @@ public class Zoom {
|
||||
|
||||
@Unique
|
||||
private static boolean initialSmoothZoom;
|
||||
@Unique
|
||||
private static boolean initialRenderHand;
|
||||
|
||||
public static void register() {
|
||||
ClientTickEvents.END_CLIENT_TICK.register(client -> {
|
||||
@@ -30,7 +32,9 @@ public class Zoom {
|
||||
MinecraftClient.getInstance().options.smoothCameraEnabled = true;
|
||||
}
|
||||
SHOULD_ZOOM = true;
|
||||
client.gameRenderer.setRenderHand(false);
|
||||
} else if (!ZOOM_BIND.isPressed() && SHOULD_ZOOM) {
|
||||
client.gameRenderer.setRenderHand(true);
|
||||
SHOULD_ZOOM = false;
|
||||
ZOOM_STEP = 0;
|
||||
if(getConfig().smoothCamera) {
|
||||
@@ -55,7 +59,7 @@ public class Zoom {
|
||||
// Clamp the zoom level so the FOV stays within [1, 110]
|
||||
float zoomFov = getZoomFov();
|
||||
if (zoomFov < 1) {
|
||||
ZOOM_STEP = Math.round((1 - getConfig().initialZoom) / getConfig().zoomStep) + 1;
|
||||
ZOOM_STEP = Math.round((1 - getConfig().initialZoom) / getConfig().zoomStep);
|
||||
} else if (zoomFov > 110) {
|
||||
ZOOM_STEP = Math.round((110 - getConfig().initialZoom) / getConfig().zoomStep);
|
||||
}
|
||||
|
@@ -15,7 +15,7 @@ public class GameRendererMixin {
|
||||
*/
|
||||
@ModifyReturnValue(method = "getFov", at = @At("RETURN"))
|
||||
private float modifyFovWithZoom(float fov, @Local(argsOnly = true) float tickDelta) {
|
||||
return Zoom.isZooming() ? Zoom.getZoomFov() : fov;
|
||||
return Zoom.isZooming() ? Math.clamp(Zoom.getZoomFov(), 1, 110) : fov;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user