only update search text when there are items

Closes #19
This commit is contained in:
Ellpeck 2020-05-17 16:24:24 +02:00
parent a026cfc550
commit 718cef5c4e

View file

@ -112,12 +112,14 @@ public class ItemTerminalGui extends ContainerScreen<ItemTerminalContainer> {
this.minusButton.active = this.requestAmount > 1;
this.search.tick();
if (this.items != null) {
String text = this.search.getText();
if (!this.lastSearchText.equals(text)) {
this.lastSearchText = text;
this.updateWidgets();
}
}
}
@Override
public boolean keyPressed(int x, int y, int z) {