Package net.okocraft.box.api.bootstrap
Interface BootstrapContext
public interface BootstrapContext
An interface that represents the context during Box initialization.
This context is only available before BoxAPI
is initialized.
-
Method Summary
Modifier and TypeMethodDescription@NotNull BootstrapContext
addFeature
(@NotNull FeatureFactory factory) Adds aFeatureFactory
to create and registerBoxFeature
.static @NotNull BootstrapContext
get()
Gets theBootstrapContext
.@NotNull Path
Gets the data directory of Box.@NotNull DefaultMessageCollector
Gets theDefaultMessageCollector
.@NotNull EventCaller
<BoxEvent> Gets theEventCaller
.@NotNull ListenerSubscriber
<net.kyori.adventure.key.Key, BoxEvent, Priority> Gets theListenerSubscriber
.@NotNull String
Gets the version of Box.
-
Method Details
-
get
Gets theBootstrapContext
.- Returns:
- the
BootstrapContext
- Throws:
IllegalStateException
- if Box is not being initialized
-
getDataDirectory
Gets the data directory of Box.- Returns:
- the data directory of Box
-
getVersion
Gets the version of Box.- Returns:
- the version of Box
-
getEventCaller
Gets theEventCaller
.- Returns:
- the
EventCaller
-
getListenerSubscriber
@NotNull @NotNull ListenerSubscriber<net.kyori.adventure.key.Key,BoxEvent, getListenerSubscriber()Priority> Gets theListenerSubscriber
.- Returns:
- the
ListenerSubscriber
-
getDefaultMessageCollector
Gets theDefaultMessageCollector
.- Returns:
- the
DefaultMessageCollector
-
addFeature
@Contract("_ -> this") @NotNull @NotNull BootstrapContext addFeature(@NotNull @NotNull FeatureFactory factory) Adds aFeatureFactory
to create and registerBoxFeature
.- Parameters:
factory
- aFeatureFactory
to create and registerBoxFeature
- Returns:
- this
BootstrapContext
-