From 1272ce49ca600d39c072cd0a5e1a0124592023a0 Mon Sep 17 00:00:00 2001 From: MicrocontrollersDev Date: Sun, 9 Jan 2022 01:01:02 -0700 Subject: make screenshots fail with fast render --- src/main/kotlin/cc/woverflow/chatting/Chatting.kt | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/main/kotlin/cc/woverflow/chatting/Chatting.kt') diff --git a/src/main/kotlin/cc/woverflow/chatting/Chatting.kt b/src/main/kotlin/cc/woverflow/chatting/Chatting.kt index 5fb7c67..f0df46b 100644 --- a/src/main/kotlin/cc/woverflow/chatting/Chatting.kt +++ b/src/main/kotlin/cc/woverflow/chatting/Chatting.kt @@ -16,6 +16,7 @@ import gg.essential.universal.UResolution import net.minecraft.client.Minecraft import net.minecraft.client.gui.* import net.minecraft.client.renderer.GlStateManager +import net.minecraft.client.renderer.OpenGlHelper import net.minecraft.client.settings.KeyBinding import net.minecraft.client.shader.Framebuffer import net.minecraft.util.MathHelper @@ -134,6 +135,10 @@ object Chatting { EssentialAPI.getNotifications().push("Chatting", "Chat window is empty.") return null } + if (!OpenGlHelper.isFramebufferEnabled()) { + EssentialAPI.getNotifications().push("Chatting", "Screenshot failed, please disable “Fast Render” in OptiFine’s “Performance” tab.") + return null + } val fr: FontRenderer = ModCompatHooks.fontRenderer val fb: Framebuffer = RenderHelper.createBindFramebuffer(width * 3, (messages.size * 9) * 3) -- cgit