ghen-git / Thirst-Mod

Other
15 stars 11 forks source link

Specific Blacklist keyword don't work #132

Open KiyooChan-hub opened 3 months ago

KiyooChan-hub commented 3 months ago

I've enabled keywords config, and set "tea" and "coffee" as drink, but I can't use blacklist to disable the "herbalbrews:coffee_beans" and "herbalbrews:tea_blossom" with words "blossom" and "beans". I'm using MC 1.20.1, Forge 47.2.32, mod version 1.3.8

mlus-asuka commented 3 months ago

could you show me the entire config

KiyooChan-hub commented 3 months ago

could you show me the entire config

["Keyword config"]

This config allows for faster implementation of new thirst quenching items. It works by defining

#lists of regular expressions to select items by their id name. It divides the items into categories
#that have preset values for hydration and quenching
#If the keyword config should be taken into consideration
enableKeywordConfig = true

["Keyword config"."Default Hydration values"]
    #Default hydration for drinks selected with keywords [0-20]
    defaultDrinkHydration = 10
    #Default quenchness for drinks selected with keywords [0-20]
    defaultDrinkQuenchness = 14
    #Default hydration for soups selected with keywords [0-20]
    defaultSoupHydration = 4
    #Default quenchness for soups selected with keywords [0-20]
    defaultSoupQuenchness = 5
    #Default hydration for fruits selected with keywords [0-20]
    defaultFruitHydration = 2
    #Default quenchness for fruits selected with keywords [0-20]
    defaultFruitQuenchness = 3

    ["Keyword config"."Default Hydration values"."Blacklisted Keywords"]
        #The list of items to be ignored if they get selected by mistake by other keywords
        #Format: [(keyword1|keyword2|keyword3)]
        keyword_blacklist = "(?:\\b|[^a-zA-Z])(dried|candied|leaf|leaves|gummy|crate|jam|sauce|bucket|seed|cookie|pie|bush|sapling|bean|curry|cake|candy|cupcake|blossom|beans)(?:\\b|[^a-zA-Z])"

    ["Keyword config"."Default Hydration values"."Drink Keywords"]
        #List of keywords for drinks
        #Format: [(keyword1|keyword2|keyword3)]
        keyword_drink = "(?:\\b|[^a-zA-Z])(drink|juice|soda|yogurt|water|te_mocha|ade|leicha|jaegertee|posca|punch|syllabub|posset|beverage|grapejuice|tea|coffee)(?:\\b|[^a-zA-Z])"

    ["Keyword config"."Default Hydration values"."Soup Keywords"]
        #List of keywords for soups
        #Format: [(keyword1|keyword2|keyword3)]
        keyword_soup = "(?:\\b|[^a-zA-Z])(soup|stew|porridge|stock|stracciatella|ukha|chowder|acquacotta|bisque|borscht|congee|custard|fish_chowder|fricassee|tongsui|gruel|hodgepodge|okroshka|must|milk|wine|beer|cider|whiskey|hot_chocolate|hot_chocolate|jo_special_mixture|creepers_crush|villagers_fright|mead|bottle_mojang_noir|eiswein|hot_cocoa|flask|goulash|rice_pudding|milkshake|smoothie|cocktail|shiraz)(?:\\b|[^a-zA-Z])"

    ["Keyword config"."Default Hydration values"."Fruit Keywords"]
        #List of keywords for fruits
        #Format: [(keyword1|keyword2|keyword3)]
        keyword_fruit = "(?:\\b|[^a-zA-Z])(fig|fruit|berry|berries|grape|grapes|orange|peach|pear|coconut|lemon|melon|cherry|apple|strawberry|pineapple|mango|lime|raspberry|blueberry|blackberry|tomato|lettuce|cabbage)(?:\\b|[^a-zA-Z])"
KiyooChan-hub commented 3 months ago

could you show me the entire config

the other config files remained default, since I didn't even touch them.

mlus-asuka commented 3 months ago

image As you can see the regular expression can't match the string. What about try to remove "(?:\b|[^a-zA-Z])" in the end?

KiyooChan-hub commented 3 months ago

image

image As you can see the regular expression can't match the string. What about try to remove "(?:\b|[^a-zA-Z])" in the end?

Sadly, it happens nothing. I decide to remove the tea and coffee from drink keywords and add them individually in item config, that may work.