Class ResourceList.RuleBuilder

java.lang.Object
org.moddingx.libx.util.data.ResourceList.RuleBuilder
Enclosing class:
ResourceList

public class ResourceList.RuleBuilder extends Object
A builder for rules.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    parse(String rule)
    Parses a simple rule.
    void
    regex(boolean allow, String regex)
    Adds a rule that checks that a resource location matches a regex.
    void
    regex(String regex)
    Adds a rule that checks that a resource location matches a regex.
    void
    simple(boolean allow, net.minecraft.resources.ResourceLocation rl)
    Adds a simple rule that only matches the given ResourceLocation.
    void
    simple(net.minecraft.resources.ResourceLocation rl)
    Adds a simple rule that only matches the given ResourceLocation.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • simple

      public void simple(net.minecraft.resources.ResourceLocation rl)
      Adds a simple rule that only matches the given ResourceLocation. When this rule matches it will return the allow list state of the resource list as result.
    • simple

      public void simple(boolean allow, net.minecraft.resources.ResourceLocation rl)
      Adds a simple rule that only matches the given ResourceLocation. When this rule matches it will return the value of allow as result.
    • parse

      public void parse(String rule)
      Parses a simple rule. This allows for a ResourceLocation string where asterisks (*) can match any amount of characters in the ResourceLocation. However an asterisk can never match a colon. The special case '*' matches every ResourceLocation. By default this will return the allow list state of the resource list as result. To change this prepend a plus (+) to make it return true or a minus (-) to make it return false on a match.
    • regex

      public void regex(@RegEx String regex)
      Adds a rule that checks that a resource location matches a regex. When this rule matches it will return the allow list state of the resource list as result.
    • regex

      public void regex(boolean allow, @RegEx String regex)
      Adds a rule that checks that a resource location matches a regex. When this rule matches it will return the value of allow as result.