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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CaptureMethodgetCaptureMethod(String key) Gets aCaptureMethodfor a given key, or the fallback method if not found.static CaptureMethodGets the current fallbackCaptureMethod.static voidregisterCaptureMethod(CaptureMethod method, String... keys) Registers a newCaptureMethodfor the given keys.static voidSets 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 newCaptureMethodfor the given keys.- Parameters:
method- NewCaptureMethodto be registered.keys- Varargs array of keys to register the newCaptureMethodas.
-
getCaptureMethod
Gets aCaptureMethodfor a given key, or the fallback method if not found.- Parameters:
key-CaptureMethodto try and get.- Returns:
- The
CaptureMethodfound 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.
-