Package valorless.havenbags.features
Class CustomData.DataModel
java.lang.Object
valorless.havenbags.features.CustomData.DataModel
- Enclosing class:
CustomData
Model representing one configured custom-data entry for a specific bag size.
For PDC entries, pluginName is used to resolve the owning plugin namespace
for the created NamespacedKey. For NBT entries, only key and value
are used.
-
Field Summary
FieldsModifier and TypeFieldDescriptionStorage backend for this model.Key used for NBT tag name or PDCNamespacedKey.getKey()depending ondataType.Plugin name used for PDC namespacing.intBag size (slot count) this model applies to.org.bukkit.persistence.PersistentDataTypePDC type hint used when writing to thePersistentDataContainer.Configured value to write. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
slots
public int slotsBag size (slot count) this model applies to.Different bag sizes can have different sets of custom-data entries.
-
pluginName
Plugin name used for PDC namespacing.This is resolved via
Bukkit.getPluginManager()and used to create aNamespacedKey. Ignored forCustomData.DataType.NBT. -
key
Key used for NBT tag name or PDCNamespacedKey.getKey()depending ondataType. -
value
Configured value to write.For NBT this may be String/Integer/Double/Boolean/Float/UUID. For PDC this should match
type. -
type
public org.bukkit.persistence.PersistentDataType typePDC type hint used when writing to thePersistentDataContainer. Defaults toPersistentDataType.STRING. -
dataType
Storage backend for this model.
-
-
Constructor Details
-
DataModel
public DataModel(int slots) Creates a model for a given bag size.- Parameters:
slots- bag size (slot count)
-
-
Method Details