personthecat.catlib.linting.ResourceArrayLinter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of catlib-quilt Show documentation
Show all versions of catlib-quilt Show documentation
Utilities for serialization, commands, noise generation, IO, and some new data types.
The newest version!
package personthecat.catlib.linting;
import java.util.regex.Pattern;
import net.minecraft.class_124;
/**
* A linter which stylizes resource location arrays in the command output.
*/
public class ResourceArrayLinter extends SyntaxLinter {
private static final Pattern NAMESPACE_PATTERN = Pattern.compile("[\\w_-]+(?=:)");
private static final Pattern PATH_PATTERN = Pattern.compile("[\\w_-]+(?=[,\\]])");
private static final Highlighter[] HIGHLIGHTERS = {
new RegexHighlighter(NAMESPACE_PATTERN, color(class_124.field_1075)),
new RegexHighlighter(PATH_PATTERN, color(class_124.field_1060))
};
public ResourceArrayLinter() {
super(HIGHLIGHTERS);
}
}