Skip to content

Commit d95441d

Browse files
committed
chore: move read only note
1 parent abfd04b commit d95441d

File tree

1 file changed

+9
-2
lines changed
  • src/content/docs/paper/dev/api

1 file changed

+9
-2
lines changed

src/content/docs/paper/dev/api/pdc.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ For 1.16.5+, there's the [`ItemStack#editMeta()`](jd:org.bukkit.inventory.ItemSt
6565
It is considered good practice to reuse `NamespacedKey` objects. They can be constructed with either:
6666
- A [`Plugin`](jd:paper:org.bukkit.plugin.Plugin) instance and a [`String`](jd:java:java.lang.String) identifier
6767
- A [`String`](jd:java:java.lang.String) namespace and a [`String`](jd:java:java.lang.String) identifier
68-
- Certain classes, like `ItemStack` or [`OfflinePlayer`](jd:paper:org.bukkit.OfflinePlayer), provide a read-only view of their PDC.
69-
In contrast to `ItemStack`, `OfflinePlayer` does <u>not</u> provide any way to modify the underlying container.
7068

7169
The first option is often preferred as it will automatically use the plugin's lowercased name as namespace; however, the second option can be used if you
7270
want to use a different namespace or access the data from another plugin.
@@ -191,6 +189,15 @@ container.set(key, UUIDDataType.INSTANCE, uuid);
191189

192190
:::
193191

192+
193+
## Read-only containers
194+
:::note
195+
196+
Certain classes, like `ItemStack` or [`OfflinePlayer`](jd:paper:org.bukkit.OfflinePlayer), provide a read-only view of their PDC.
197+
In contrast to `ItemStack`, `OfflinePlayer` does <u>not</u> provide any way to modify the underlying container.
198+
199+
:::
200+
194201
## Storing on different objects
195202

196203
:::caution

0 commit comments

Comments
 (0)