aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoman / Linnea Gräf <nea@nea.moe>2023-03-11 17:13:16 +0100
committerGitHub <noreply@github.com>2023-03-11 17:13:16 +0100
commit3adeadb8eca478f23111676fa82afdaa11a42896 (patch)
treea1d36a2d80980587d1199f42cd20518b35181b92 /src
parent1be9fb17389049c04e76735c78cb738949f6e252 (diff)
downloadskyhanni-3adeadb8eca478f23111676fa82afdaa11a42896.tar.gz
skyhanni-3adeadb8eca478f23111676fa82afdaa11a42896.tar.bz2
skyhanni-3adeadb8eca478f23111676fa82afdaa11a42896.zip
Fix mouse button chat peek and early launch crashes (#14)
Diffstat (limited to 'src')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/mixins/transformers/gui/MixinGuiNewChat.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/gui/MixinGuiNewChat.java b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/gui/MixinGuiNewChat.java
index 31a915b05..bdc0b01c2 100644
--- a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/gui/MixinGuiNewChat.java
+++ b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/gui/MixinGuiNewChat.java
@@ -1,6 +1,7 @@
package at.hannibal2.skyhanni.mixins.transformers.gui;
import at.hannibal2.skyhanni.SkyHanniMod;
+import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiNewChat;
import org.lwjgl.input.Keyboard;
import org.spongepowered.asm.mixin.Mixin;
@@ -13,7 +14,9 @@ public class MixinGuiNewChat {
@Inject(method = "getChatOpen", at = @At("HEAD"), cancellable = true)
public void onIsOpen(CallbackInfoReturnable<Boolean> cir) {
- if (SkyHanniMod.feature.chat.peekChat != Keyboard.KEY_NONE && Keyboard.isKeyDown(SkyHanniMod.feature.chat.peekChat))
+ if (SkyHanniMod.feature.chat.peekChat > Keyboard.KEY_NONE
+ && Minecraft.getMinecraft().thePlayer != null
+ && Keyboard.isKeyDown(SkyHanniMod.feature.chat.peekChat))
cir.setReturnValue(true);
}
}