Class SepareWorldItems

java.lang.Object
com.github.happyuky7.swi.api.SepareWorldItems

public final class SepareWorldItems extends Object
Static entry point to the SepareWorldItems API.

Works the same on every platform (Bukkit/Spigot/Paper/Folia plugin and Fabric mod):

SepareWorldItemsApi api = SepareWorldItems.get();
api.events().subscribe(GroupSwitchPostEvent.class, e -> ...);

The implementation registers itself while the plugin/mod is starting, so call get() from your own enable/initialize logic (declare SepareWorldItems as a dependency so it loads first), or use getIfLoaded() when the dependency is optional.

  • Method Details

    • get

      @NotNull public static @NotNull SepareWorldItemsApi get()
      Returns:
      the running API implementation
      Throws:
      IllegalStateException - if SepareWorldItems is not loaded (yet)
    • getIfLoaded

      @Nullable public static @Nullable SepareWorldItemsApi getIfLoaded()
      Returns:
      the running API implementation, or null when SepareWorldItems is not installed/enabled
    • isLoaded

      public static boolean isLoaded()
    • register

      @Internal public static void register(@NotNull @NotNull SepareWorldItemsApi api)
    • unregister

      @Internal public static void unregister()