aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin
diff options
context:
space:
mode:
authorMicrocontrollersDev <microcontrollersyt@gmail.com>2022-01-09 01:01:02 -0700
committerMicrocontrollersDev <microcontrollersyt@gmail.com>2022-01-09 01:01:02 -0700
commit1272ce49ca600d39c072cd0a5e1a0124592023a0 (patch)
tree4d165090c711c1d4f1ee94374e7d90826b613bb6 /src/main/kotlin
parente1b69a16c299b334725f036bb33faf4b30dafd81 (diff)
downloadChatting-1272ce49ca600d39c072cd0a5e1a0124592023a0.tar.gz
Chatting-1272ce49ca600d39c072cd0a5e1a0124592023a0.tar.bz2
Chatting-1272ce49ca600d39c072cd0a5e1a0124592023a0.zip
make screenshots fail with fast render
Diffstat (limited to 'src/main/kotlin')
-rw-r--r--src/main/kotlin/cc/woverflow/chatting/Chatting.kt5
-rw-r--r--src/main/kotlin/cc/woverflow/chatting/chat/ChatShortcuts.kt1
-rw-r--r--src/main/kotlin/cc/woverflow/chatting/chat/ChatTab.kt2
3 files changed, 6 insertions, 2 deletions
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)
diff --git a/src/main/kotlin/cc/woverflow/chatting/chat/ChatShortcuts.kt b/src/main/kotlin/cc/woverflow/chatting/chat/ChatShortcuts.kt
index 5cbbc2d..f3145de 100644
--- a/src/main/kotlin/cc/woverflow/chatting/chat/ChatShortcuts.kt
+++ b/src/main/kotlin/cc/woverflow/chatting/chat/ChatShortcuts.kt
@@ -23,7 +23,6 @@ object ChatShortcuts {
}
}
-
fun initialize() {
if (initialized) {
return
diff --git a/src/main/kotlin/cc/woverflow/chatting/chat/ChatTab.kt b/src/main/kotlin/cc/woverflow/chatting/chat/ChatTab.kt
index 1389233..236ccf6 100644
--- a/src/main/kotlin/cc/woverflow/chatting/chat/ChatTab.kt
+++ b/src/main/kotlin/cc/woverflow/chatting/chat/ChatTab.kt
@@ -85,4 +85,4 @@ data class ChatTab(
companion object {
private var x = 4
}
-} \ No newline at end of file
+}