Implements material wildcards for costs #14
All checks were successful
EpicKnarvik97/Blacksmith/pipeline/head This commit looks good
All checks were successful
EpicKnarvik97/Blacksmith/pipeline/head This commit looks good
This commit is contained in:
@ -44,4 +44,14 @@ public final class InputParsingHelper {
|
||||
return Enchantment.getByKey(NamespacedKey.minecraft(input.replace("-", "_")));
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a material name like "*helmet" into a regular expression ".*HELMET"
|
||||
*
|
||||
* @param input <p>The input to RegExIfy</p>
|
||||
* @return <p>The converted input</p>
|
||||
*/
|
||||
public static String regExIfy(String input) {
|
||||
return input.replace("*", ".*").toUpperCase().replace("-", "_");
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user