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