aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-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);
}
}