aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/cc/woverflow/chatting/Chatting.kt
diff options
context:
space:
mode:
authorWyvest <45589059+Wyvest@users.noreply.github.com>2022-01-12 19:42:23 +0700
committerWyvest <45589059+Wyvest@users.noreply.github.com>2022-01-12 19:42:23 +0700
commitbb4ece833b793551524896dd882542cb25ff5241 (patch)
tree23bcc2d92bf27a75979f1db6379eb5c5fc1016c1 /src/main/kotlin/cc/woverflow/chatting/Chatting.kt
parentdb9ec1fcadb031297df815706d4a281c799ca99a (diff)
parent1272ce49ca600d39c072cd0a5e1a0124592023a0 (diff)
downloadChatting-bb4ece833b793551524896dd882542cb25ff5241.tar.gz
Chatting-bb4ece833b793551524896dd882542cb25ff5241.tar.bz2
Chatting-bb4ece833b793551524896dd882542cb25ff5241.zip
Merge remote-tracking branch 'origin/main'
Diffstat (limited to 'src/main/kotlin/cc/woverflow/chatting/Chatting.kt')
-rw-r--r--src/main/kotlin/cc/woverflow/chatting/Chatting.kt5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/kotlin/cc/woverflow/chatting/Chatting.kt b/src/main/kotlin/cc/woverflow/chatting/Chatting.kt
index 4b39a5b..8bdaee6 100644
--- a/src/main/kotlin/cc/woverflow/chatting/Chatting.kt
+++ b/src/main/kotlin/cc/woverflow/chatting/Chatting.kt
@@ -23,6 +23,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
@@ -223,6 +224,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)