All Downloads are FREE. Search and download functionalities are using the official Maven repository.

personthecat.catlib.linting.ResourceArrayLinter Maven / Gradle / Ivy

Go to download

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);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy