Fix for inventory key not exiting the Arcane Workbench GUI #897 (Lumberjacksparrow)

This commit is contained in:
Lumberjacksparrow
2025-12-29 13:17:18 -08:00
committed by GitHub
parent e547aa32ca
commit b451399323
@@ -515,12 +515,13 @@ public class GuiArcaneWorkbench extends GuiContainer {
@Override @Override
protected void keyTyped(char typedChar, int keyCode) throws IOException { protected void keyTyped(char typedChar, int keyCode) throws IOException {
if(this.searchNeedsClearing){ if(this.searchNeedsClearing){
this.searchNeedsClearing = false; this.searchNeedsClearing = false;
this.searchField.setText(""); this.searchField.setText("");
} }
if(this.searchField.textboxKeyTyped(typedChar, keyCode)){ // Allow exiting the GUI by pressing the inventory button. Does not work if bookshelves are present by default
if(this.searchField.getVisible() && this.searchField.textboxKeyTyped(typedChar, keyCode)){
arcaneWorkbenchContainer.setSearchText(searchField.getText().toLowerCase(Locale.ROOT)); arcaneWorkbenchContainer.setSearchText(searchField.getText().toLowerCase(Locale.ROOT));
}else{ }else{
super.keyTyped(typedChar, keyCode); super.keyTyped(typedChar, keyCode);
@@ -1062,4 +1063,4 @@ public class GuiArcaneWorkbench extends GuiContainer {
} }
} }
} }