Class SepareWorldItems
java.lang.Object
com.github.happyuky7.swi.api.SepareWorldItems
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 Summary
Modifier and TypeMethodDescriptionstatic @NotNull SepareWorldItemsApiget()static @Nullable SepareWorldItemsApistatic booleanisLoaded()static voidregister(@NotNull SepareWorldItemsApi api) static void
-
Method Details
-
get
- Returns:
- the running API implementation
- Throws:
IllegalStateException- if SepareWorldItems is not loaded (yet)
-
getIfLoaded
- Returns:
- the running API implementation, or null when SepareWorldItems is not installed/enabled
-
isLoaded
public static boolean isLoaded() -
register
-
unregister
@Internal public static void unregister()
-