Fixed not being able to exit the password insertion GUI for keypads and other password-protected blocks
@@ -8,6 +8,7 @@ import org.lwjgl.opengl.GL11;
import net.geforcemods.securitycraft.containers.ContainerGeneric;
import net.geforcemods.securitycraft.main.mod_SecurityCraft;
import net.geforcemods.securitycraft.network.packets.PacketSCheckPassword;
+import net.geforcemods.securitycraft.util.ClientUtils;
import net.geforcemods.securitycraft.util.Utils;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
@@ -99,7 +100,10 @@ public class GuiCheckPassword extends GuiContainer {
@Override
protected void keyTyped(char par1, int par2) throws IOException {
- if(this.isValidChar(par1) && par1 != ''){
+ if(this.isValidChar(par1) && par1 == '\u001B'){
+ System.out.println("running");
+ ClientUtils.closePlayerScreen();
+ }else if(this.isValidChar(par1) && par1 != ''){
Minecraft.getMinecraft().thePlayer.playSound(SoundEvent.REGISTRY.getObject(new ResourceLocation("random.click")), 0.15F, 1.0F);
this.currentString += par1;
this.setTextboxCensoredText(this.keycodeTextbox, currentString);
