Class OptionalCallback

java.lang.Object
net.minestom.server.utils.callback.OptionalCallback

public class OptionalCallback extends Object
Convenient class to execute callbacks which can be null.
  • Constructor Details

    • OptionalCallback

      public OptionalCallback()
  • Method Details

    • execute

      public static void execute(@Nullable @Nullable Runnable callback)
      Executes an optional Runnable.
      Parameters:
      callback - the optional runnable, can be null
    • execute

      public static void execute(@Nullable @Nullable ChunkCallback callback, @Nullable @Nullable Chunk chunk)
      Executes an optional ChunkCallback.
      Parameters:
      callback - the optional chunk callback, can be null
      chunk - the chunk to forward to the callback