Class BlockPredicateLoader
java.lang.Object
com.github.darksoulq.abyssallib.world.block.BlockPredicateLoader
Utility class responsible for loading and parsing data-driven
BlockPredicate definitions.
This loader scans the server's data folder for YAML files, deserializes them using
the configured codec, and injects them into the global block predicate registry.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BlockPredicateReads a YAML file from the file system and decodes it into a BlockPredicate instance.static voidScans the predicates directory and loads all valid YAML configurations into the registry.static BlockPredicateloadResource(org.bukkit.plugin.Plugin plugin, String resourcePath) Reads a YAML file bundled within a plugin's JAR resources and decodes it.
-
Constructor Details
-
BlockPredicateLoader
public BlockPredicateLoader()
-
-
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 a BlockPredicate instance.- Parameters:
path- ThePathto the YAML file to read.- Returns:
- The parsed
BlockPredicate, or null if parsing fails or the file is invalid.
-
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
BlockPredicate, or null if the resource is missing or parsing fails.
-