diff --git a/gradle.properties b/gradle.properties index 07ed1c4..19c28bc 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ org.gradle.jvmargs=-Xmx1G -mod_version=1.2.0 +mod_version=1.2.1 maven_group=com.terraformersmc archive_name=vistas diff --git a/src/main/java/com/terraformersmc/vistas/config/PanoramaConfig.java b/src/main/java/com/terraformersmc/vistas/config/PanoramaConfig.java index c632e9a..dfb5c40 100644 --- a/src/main/java/com/terraformersmc/vistas/config/PanoramaConfig.java +++ b/src/main/java/com/terraformersmc/vistas/config/PanoramaConfig.java @@ -12,6 +12,7 @@ public class PanoramaConfig implements ConfigData { public boolean forcePanorama = false; public boolean randomPerScreen = false; public boolean hectic = false; + public boolean lockPanoramicScreenshotRotation = true; public static void init() { AutoConfig.register(PanoramaConfig.class, GsonConfigSerializer::new); diff --git a/src/main/java/com/terraformersmc/vistas/mixin/GameRendererMixin.java b/src/main/java/com/terraformersmc/vistas/mixin/GameRendererMixin.java index d7c0176..b8219e4 100644 --- a/src/main/java/com/terraformersmc/vistas/mixin/GameRendererMixin.java +++ b/src/main/java/com/terraformersmc/vistas/mixin/GameRendererMixin.java @@ -7,6 +7,7 @@ */ package com.terraformersmc.vistas.mixin; +import com.terraformersmc.vistas.config.PanoramaConfig; import com.terraformersmc.vistas.screenshot.PanoramicScreenshots; import net.minecraft.client.MinecraftClient; import net.minecraft.client.render.GameRenderer; @@ -59,6 +60,12 @@ public abstract class GameRendererMixin { // setup boolean oldFov90 = renderingPanorama; + float oldPitch = client.player.pitch; + float oldYaw = client.player.yaw; + if (PanoramaConfig.getInstance().lockPanoramicScreenshotRotation) { + client.player.pitch = 0; + client.player.yaw = 0; + } boolean oldCulling = client.chunkCullingEnabled; client.chunkCullingEnabled = false; renderingPanorama = true; @@ -73,6 +80,8 @@ public abstract class GameRendererMixin { // restore renderingPanorama = oldFov90; client.chunkCullingEnabled = oldCulling; + client.player.pitch = oldPitch; + client.player.yaw = oldYaw; if (client.player != null) { client.player.sendMessage(new TranslatableText("vistas.panoramic_screenshot.saved", new LiteralText(root.toAbsolutePath().toString()).styled(style -> style.withClickEvent(new ClickEvent(ClickEvent.Action.OPEN_FILE, root.toAbsolutePath().toString())).withUnderline(true))), false); } diff --git a/src/main/resources/assets/vistas/lang/en_us.json b/src/main/resources/assets/vistas/lang/en_us.json index 6599a1b..32cce28 100644 --- a/src/main/resources/assets/vistas/lang/en_us.json +++ b/src/main/resources/assets/vistas/lang/en_us.json @@ -4,6 +4,7 @@ "text.autoconfig.vistas.option.forcePanorama": "Force Panorama", "text.autoconfig.vistas.option.randomPerScreen": "Random Per Screen", "text.autoconfig.vistas.option.hectic": "Hectic (Warning, Flashing Colors)", + "text.autoconfig.vistas.option.lockPanoramicScreenshotRotation": "Lock Panoramic Screenshot Rotation to (0 / 0)", "vistas.panoramic_screenshot.saved": "Panorama taken and saved at %s directory", "key.vistas.panoramic_screenshot": "Take Panoramic Screenshot" }