Interface CustomDataManager
public interface CustomDataManager
An interface to load/save custom data using
MapNode
.-
Method Summary
Modifier and TypeMethodDescription@NotNull MapNode
loadData
(@NotNull net.kyori.adventure.key.Key key) Loads theMapNode
.void
Saves theMapNode
.void
visitData
(@NotNull String namespace, @NotNull BiConsumer<net.kyori.adventure.key.Key, MapNode> consumer) Visits allMapNode
s that are keyed with the specified namespace.
-
Method Details
-
loadData
@NotNull @NotNull MapNode loadData(@NotNull @NotNull net.kyori.adventure.key.Key key) throws Exception Loads theMapNode
. -
saveData
void saveData(@NotNull @NotNull net.kyori.adventure.key.Key key, @NotNull @NotNull MapNode mapNode) throws Exception Saves theMapNode
. -
visitData
void visitData(@NotNull @NotNull String namespace, @NotNull @NotNull BiConsumer<net.kyori.adventure.key.Key, MapNode> consumer) throws ExceptionVisits allMapNode
s that are keyed with the specified namespace.- Parameters:
namespace
- the namespace to getMapNode
consumer
- theBiConsumer
to consume loadedMapNode
with itsKey
- Throws:
Exception
- if a storage error occurredIllegalArgumentException
- if the specified namespace is invalid (it is checked byKey.checkNamespace(String)
)
-