fix: rebuild pattern when module is enabled

This commit is contained in:
əlemi 2023-03-02 01:45:02 +01:00
parent afd65ce815
commit eb5ee8e453
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -42,6 +42,11 @@ public class Highlighter extends AbstractModule {
.build(this); .build(this);
} }
@Override
protected void onEnabled() {
this.pattern = Pattern.compile(this.query.get());
}
private List<String> enchantments(ItemStack stack) { private List<String> enchantments(ItemStack stack) {
final ListNBT tags; final ListNBT tags;
if (Items.ENCHANTED_BOOK.equals(stack.getItem())) { if (Items.ENCHANTED_BOOK.equals(stack.getItem())) {