Class PDCUtils
java.lang.Object
org.skriptlang.skript.bukkit.pdc.PDCUtils
Utilities for working with
PersistentDataContainers.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voideditPersistentDataContainer(Object holder, Consumer<org.bukkit.persistence.PersistentDataContainer> consumer) Helper to easily edit PDCs.static io.papermc.paper.persistence.PersistentDataContainerViewgetPersistentDataContainer(Object holder) Gets the data container of an object.static io.papermc.paper.persistence.PersistentDataContainerViewgetPersistentDataContainer(Object holder, Consumer<io.papermc.paper.persistence.PersistentDataContainerView> consumer) Gets the data container of an object.
-
Constructor Details
-
PDCUtils
public PDCUtils()
-
-
Method Details
-
getPersistentDataContainer
public static io.papermc.paper.persistence.PersistentDataContainerView getPersistentDataContainer(Object holder) Gets the data container of an object. UseeditPersistentDataContainer(Object, Consumer)if editing is desired.- Parameters:
holder- Source of the container- Returns:
- The container, or null if the holder doesn't have one.
-
getPersistentDataContainer
public static io.papermc.paper.persistence.PersistentDataContainerView getPersistentDataContainer(Object holder, Consumer<io.papermc.paper.persistence.PersistentDataContainerView> consumer) Gets the data container of an object. UseeditPersistentDataContainer(Object, Consumer)if editing is desired.- Parameters:
holder- Source of the containerconsumer- Code to run with the container- Returns:
- The container, or null if the holder doesn't have one.
-
editPersistentDataContainer
-