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