Clear NBT button for filters
penturt opened this issue ยท 4 comments
private Button clearNBTButton;
public void setMaterialNBT(@Nullable String nbt) {
if (nbt != null) {
this.nbt.setValue(nbt);
} else {
this.nbt.setValue("");
}
}
and
protected void init() {
...
addRenderableWidget(item);
// Clear nbt Button
clearNBTButton = new Button(leftPos + 6, topPos + 48, 20, 20, new TextComponent("C"), button -> {
setMaterialNBT("");
});
addRenderableWidget(clearNBTButton);
in FilterScreen.java?
As well as a 'clear NBT Data' button, it would be great if the 'match exact NBT data/match only provided tags' button cycled through the three modes i.e. added an 'ignore NBT mode' (which also greys out the NBT Data field, without clearing it).
This would also solve the labels of that button being misleading: currently the button toggles between "match exact NBT data" and "match only provided tags" but "match only provided tags" still filters based on the existence of NBT. I would expect "match only provided tags" to ignore anything in the 'NBT Data' field, and only filter items based on matching the 'Item/Tag' field!