Class ItemPredicateLoader
java.lang.Object
com.github.darksoulq.abyssallib.world.item.ItemPredicateLoader
Utility class responsible for loading and parsing data-driven
ItemPredicate definitions.
This loader scans the server's data folder for YAML files, deserializes them using
the configured codec, and injects them into the global item predicate registry.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ItemPredicateReads a YAML file from the file system and decodes it into an ItemPredicate instance.static voidScans the predicates directory and loads all valid YAML configurations into the registry.static ItemPredicateloadResource(org.bukkit.plugin.Plugin plugin, String resourcePath) Reads a YAML file bundled within a plugin's JAR resources and decodes it.
-
Constructor Details
-
ItemPredicateLoader
public ItemPredicateLoader()
-
-
Method Details
-
loadPredicates
public static void loadPredicates()Scans the predicates directory and loads all valid YAML configurations into the registry. If the base directory does not exist, it will be created automatically. -
load
Reads a YAML file from the file system and decodes it into an ItemPredicate instance.- Parameters:
path- ThePathto the YAML file to read.- Returns:
- The parsed
ItemPredicate, or null if parsing fails.
-
loadResource
Reads a YAML file bundled within a plugin's JAR resources and decodes it.- Parameters:
plugin- ThePlugininstance owning the resource.resourcePath- The internal path to the YAML resource file.- Returns:
- The parsed
ItemPredicate, or null if the resource is missing or parsing fails.
-