Class CaptureMethodRegistry
java.lang.Object
com.pixelmonmod.pixelmon.api.pokemon.catching.CaptureMethodRegistry
Registry for
CaptureMethod
instances.
Once registered here, they can be used in PokeBall
JSON files or instances of PokeBall
made via API.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic CaptureMethod
getCaptureMethod
(String key) Gets aCaptureMethod
for a given key, or the fallback method if not found.static CaptureMethod
Gets the current fallbackCaptureMethod
.static void
registerCaptureMethod
(CaptureMethod method, String... keys) Registers a newCaptureMethod
for the given keys.static void
Sets the fallback method to be returned ifgetCaptureMethod(java.lang.String)
doesn't find any method registered for a given key.
-
Constructor Details
-
CaptureMethodRegistry
public CaptureMethodRegistry()
-
-
Method Details
-
registerCaptureMethod
Registers a newCaptureMethod
for the given keys.- Parameters:
method
- NewCaptureMethod
to be registered.keys
- Varargs array of keys to register the newCaptureMethod
as.
-
getCaptureMethod
Gets aCaptureMethod
for a given key, or the fallback method if not found.- Parameters:
key
-CaptureMethod
to try and get.- Returns:
- The
CaptureMethod
found matching the given key.
-
setFallbackCaptureMethod
Sets the fallback method to be returned ifgetCaptureMethod(java.lang.String)
doesn't find any method registered for a given key.- Parameters:
method
- The new fallbackCaptureMethod
.
-
getFallbackCaptureMethod
Gets the current fallbackCaptureMethod
.- Returns:
- The current fallback
CaptureMethod
.
-