Class UnsafeCallWrapper
- java.lang.Object
-
- com.onarandombox.MultiverseCore.utils.UnsafeCallWrapper
-
public class UnsafeCallWrapper extends java.lang.Object
Wraps calls that could result in exceptions that are not Multiverse's fault.
-
-
Constructor Summary
Constructors Constructor Description UnsafeCallWrapper(Core core)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
wrap(java.util.concurrent.Callable<T> callable, java.lang.String plugin, java.lang.String action, java.lang.Object... formatArgs)
Wraps calls that could result in exceptions that are not Multiverse's fault.
-
-
-
Constructor Detail
-
UnsafeCallWrapper
public UnsafeCallWrapper(Core core)
-
-
Method Detail
-
wrap
public <T> T wrap(java.util.concurrent.Callable<T> callable, java.lang.String plugin, java.lang.String action, java.lang.Object... formatArgs)
Wraps calls that could result in exceptions that are not Multiverse's fault.- Type Parameters:
T
- The type of the return value.- Parameters:
callable
- The potentially unsafe call.plugin
- The plugin that's probably the culprit.action
- What MV was attempting to do (error message, format string).formatArgs
- The formatting arguments for the error message. The exception that was thrown will be appended to these objects.- Returns:
- The return value or null if the call failed.
-
-