Package org.moddingx.libx.util.data
Class ResourceList.RuleBuilder
java.lang.Object
org.moddingx.libx.util.data.ResourceList.RuleBuilder
- Enclosing class:
- ResourceList
A builder for rules.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Parses a simple rule.void
Adds a rule that checks that a resource location matches a regex.void
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 givenResourceLocation
.void
simple
(net.minecraft.resources.ResourceLocation rl) Adds a simple rule that only matches the givenResourceLocation
.
-
Method Details
-
simple
public void simple(net.minecraft.resources.ResourceLocation rl) Adds a simple rule that only matches the givenResourceLocation
. 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 givenResourceLocation
. When this rule matches it will return the value ofallow
as result. -
parse
Parses a simple rule. This allows for aResourceLocation
string where asterisks (*) can match any amount of characters in theResourceLocation
. However an asterisk can never match a colon. The special case '*' matches everyResourceLocation
. 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
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
Adds a rule that checks that a resource location matches a regex. When this rule matches it will return the value ofallow
as result.
-