Skip to content

Commit

Permalink
Bring 2.0.1
Browse files Browse the repository at this point in the history
Now with Immersive Portals compatibility.
  • Loading branch information
Past Ennui committed Jan 7, 2020
1 parent 06a915c commit f485f35
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ org.gradle.jvmargs=-Xmx1G
loader_version=0.7.3+build.176

# Mod Properties
mod_version = 2.0.0
mod_version = 2.0.1
maven_group = io.github.joaoh1
archives_base_name = okzoomer

Expand Down
11 changes: 9 additions & 2 deletions src/main/java/io/github/joaoh1/okzoomer/OkZoomer.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ public void onInitializeClient() {
minecraft.options.fov = realFov * config.zoomMultiplier;
if (config.hideHands) {
hideHandsBecauseZoom = true;
minecraft.gameRenderer.tick();
}
fovProcessing = false;
zoomProgress = 2;
Expand All @@ -127,7 +128,10 @@ public void onInitializeClient() {
if (smoothing >= config.zoomMultiplier) {
smoothing = config.zoomMultiplier / config.advancedSmoothTransSettings.smoothDivisor;
minecraft.options.fov = realFov;
hideHandsBecauseZoom = false;
if (hideHandsBecauseZoom) {
hideHandsBecauseZoom = false;
minecraft.gameRenderer.tick();
}
fovProcessing = true;
zoomProgress = 0;
} else {
Expand All @@ -150,7 +154,10 @@ public void onInitializeClient() {
if (smoothing >= config.zoomMultiplier) {
smoothing = config.zoomMultiplier / config.advancedSmoothTransSettings.smoothDivisor;
minecraft.options.fov = realFov;
hideHandsBecauseZoom = false;
if (hideHandsBecauseZoom) {
hideHandsBecauseZoom = false;
minecraft.gameRenderer.tick();
}
fovProcessing = true;
zoomProgress = 0;
zoomPressed = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ public class GameRendererMixin {
@Shadow
private boolean renderHand;

@Inject(at = @At("HEAD"), method = "net/minecraft/client/render/GameRenderer.renderWorld(FJLnet/minecraft/client/util/math/MatrixStack;)V")
@Inject(at = @At("HEAD"), method = "net/minecraft/client/render/GameRenderer.tick()V")
private void renderWorld(CallbackInfo info) {
if (OkZoomer.shouldHideHands()) {
this.renderHand = false;
} else {
this.renderHand = true;
}
}
}
}

0 comments on commit f485f35

Please sign in to comment.