Interface CustomDataManager
public interface CustomDataManager
An interface to load/save custom data using
MapNode.-
Method Summary
Modifier and TypeMethodDescription@NotNull MapNodeloadData(@NotNull net.kyori.adventure.key.Key key) Loads theMapNode.voidSaves theMapNode.voidvisitData(@NotNull String namespace, @NotNull BiConsumer<net.kyori.adventure.key.Key, MapNode> consumer) Visits allMapNodes 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 allMapNodes that are keyed with the specified namespace.- Parameters:
namespace- the namespace to getMapNodeconsumer- theBiConsumerto consume loadedMapNodewith itsKey- Throws:
Exception- if a storage error occurredIllegalArgumentException- if the specified namespace is invalid (it is checked byKey.checkNamespace(String))
-