Class OptionalCallback
java.lang.Object
net.minestom.server.utils.callback.OptionalCallback
public class OptionalCallback
extends java.lang.Object
Convenient class to execute callbacks which can be null.
-
Constructor Summary
Constructors Constructor Description OptionalCallback()
-
Method Summary
Modifier and Type Method Description static void
execute(java.lang.Runnable callback)
Executes an optionalRunnable
.static void
execute(ChunkCallback callback, Chunk chunk)
Executes an optionalChunkCallback
.
-
Constructor Details
-
OptionalCallback
public OptionalCallback()
-
-
Method Details
-
execute
public static void execute(@Nullable java.lang.Runnable callback)Executes an optionalRunnable
.- Parameters:
callback
- the optional runnable, can be null
-
execute
Executes an optionalChunkCallback
.- Parameters:
callback
- the optional chunk callback, can be nullchunk
- the chunk to forward to the callback
-