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,10 +112,12 @@ public class ItemTerminalGui extends ContainerScreen<ItemTerminalContainer> {
this.minusButton.active = this.requestAmount > 1; this.minusButton.active = this.requestAmount > 1;
this.search.tick(); this.search.tick();
String text = this.search.getText(); if (this.items != null) {
if (!this.lastSearchText.equals(text)) { String text = this.search.getText();
this.lastSearchText = text; if (!this.lastSearchText.equals(text)) {
this.updateWidgets(); this.lastSearchText = text;
this.updateWidgets();
}
} }
} }