aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/api/0472-Introduce-registry-entry-and-builders.patch
blob: 7528cb4dc3e3c465cb86241d66f4ae446a1a2cda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Bjarne Koll <git@lynxplay.dev>
Date: Thu, 13 Jun 2024 22:35:05 +0200
Subject: [PATCH] Introduce registry entry and builders

Co-authored-by: kokiriglade <git@kokirigla.de>

diff --git a/src/main/java/io/papermc/paper/registry/RegistryKey.java b/src/main/java/io/papermc/paper/registry/RegistryKey.java
index 647f6a1ec1f9d3c203b41f90a99bfd415bf67366..9b39e33514b15a9d07104e2ad826d0da11f569d6 100644
--- a/src/main/java/io/papermc/paper/registry/RegistryKey.java
+++ b/src/main/java/io/papermc/paper/registry/RegistryKey.java
@@ -74,9 +74,10 @@ public sealed interface RegistryKey<T> extends Keyed permits RegistryKeyImpl {
     @ApiStatus.Internal
     RegistryKey<BlockType> BLOCK = create("block");
     /**
-     * @apiNote DO NOT USE
+     * @apiNote use preferably only in the context of registry entries.
+     * @see io.papermc.paper.registry.data
      */
-    @ApiStatus.Internal
+    @ApiStatus.Experimental // Paper - already required for registry builders
     RegistryKey<ItemType> ITEM = create("item");
     /**
      * Built-in registry for cat variants.
diff --git a/src/main/java/io/papermc/paper/registry/data/EnchantmentRegistryEntry.java b/src/main/java/io/papermc/paper/registry/data/EnchantmentRegistryEntry.java
new file mode 100644
index 0000000000000000000000000000000000000000..f092077453cb13dd8d849550896c2ef1cfa81b7a
--- /dev/null
+++ b/src/main/java/io/papermc/paper/registry/data/EnchantmentRegistryEntry.java
@@ -0,0 +1,331 @@
+package io.papermc.paper.registry.data;
+
+import io.papermc.paper.registry.RegistryBuilder;
+import io.papermc.paper.registry.RegistryKey;
+import io.papermc.paper.registry.TypedKey;
+import io.papermc.paper.registry.set.RegistryKeySet;
+import io.papermc.paper.registry.set.RegistrySet;
+import io.papermc.paper.registry.tag.TagKey;
+import java.util.List;
+import net.kyori.adventure.text.Component;
+import org.bukkit.enchantments.Enchantment;
+import org.bukkit.inventory.EquipmentSlotGroup;
+import org.bukkit.inventory.ItemType;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.Contract;
+import org.jetbrains.annotations.Range;
+import org.jetbrains.annotations.Unmodifiable;
+import org.jspecify.annotations.NullMarked;
+import org.jspecify.annotations.Nullable;
+
+/**
+ * A data-centric version-specific registry entry for the {@link Enchantment} type.
+ */
+@ApiStatus.Experimental
+@NullMarked
+@ApiStatus.NonExtendable
+public interface EnchantmentRegistryEntry {
+
+    /**
+     * Provides the description of this enchantment entry as displayed to the client, e.g. "Sharpness" for the sharpness
+     * enchantment.
+     *
+     * @return the description component.
+     */
+    Component description();
+
+    /**
+     * Provides the registry key set referencing the items this enchantment is supported on.
+     *
+     * @return the registry key set.
+     */
+    RegistryKeySet<ItemType> supportedItems();
+
+    /**
+     * Provides the registry key set referencing the item types this enchantment can be applied to when
+     * enchanting in an enchantment table.
+     * <p>
+     * If this value is {@code null}, {@link #supportedItems()} will be sourced instead in the context of an enchantment table.
+     * Additionally, the tag {@link io.papermc.paper.registry.keys.tags.EnchantmentTagKeys#IN_ENCHANTING_TABLE} defines
+     * which enchantments can even show up in an enchantment table.
+     *
+     * @return the registry key set.
+     */
+    @Nullable RegistryKeySet<ItemType> primaryItems();
+
+    /**
+     * Provides the weight of this enchantment used by the weighted random when selecting enchantments.
+     *
+     * @return the weight value.
+     * @see <a href="https://minecraft.wiki/w/Enchanting">https://minecraft.wiki/w/Enchanting</a> for examplary weights.
+     */
+    @Range(from = 1, to = 1024) int weight();
+
+    /**
+     * Provides the maximum level this enchantment can have when applied.
+     *
+     * @return the maximum level.
+     */
+    @Range(from = 1, to = 255) int maxLevel();
+
+    /**
+     * Provides the minimum cost needed to enchant an item with this enchantment.
+     * <p>
+     * Note that a cost is not directly related to the consumed xp.
+     *
+     * @return the enchantment cost.
+     * @see <a href="https://minecraft.wiki/w/Enchanting/Levels">https://minecraft.wiki/w/Enchanting/Levels</a> for
+     * examplary costs.
+     */
+    EnchantmentCost minimumCost();
+
+    /**
+     * Provides the maximum cost allowed to enchant an item with this enchantment.
+     * <p>
+     * Note that a cost is not directly related to the consumed xp.
+     *
+     * @return the enchantment cost.
+     * @see <a href="https://minecraft.wiki/w/Enchanting/Levels">https://minecraft.wiki/w/Enchanting/Levels</a> for
+     * examplary costs.
+     */
+    EnchantmentCost maximumCost();
+
+    /**
+     * Provides the cost of applying this enchantment using an anvil.
+     * <p>
+     * Note that this is halved when using an enchantment book, and is multiplied by the level of the enchantment.
+     * See <a href="https://minecraft.wiki/w/Anvil_mechanics">https://minecraft.wiki/w/Anvil_mechanics</a> for more
+     * information.
+     * </p>
+     *
+     * @return the anvil cost of this enchantment
+     */
+    @Range(from = 0, to = Integer.MAX_VALUE) int anvilCost();
+
+    /**
+     * Provides a list of slot groups this enchantment may be active in.
+     * <p>
+     * If the item enchanted with this enchantment is equipped in a slot not covered by the returned list and its
+     * groups, the enchantment's effects, like attribute modifiers, will not activate.
+     *
+     * @return a list of equipment slot groups.
+     * @see Enchantment#getActiveSlotGroups()
+     */
+    @Unmodifiable List<EquipmentSlotGroup> activeSlots();
+
+    /**
+     * Provides the registry key set of enchantments that this enchantment is exclusive with.
+     * <p>
+     * Exclusive enchantments prohibit the application of this enchantment to an item if they are already present on
+     * said item.
+     *
+     * @return a registry set of enchantments exclusive to this one.
+     */
+    RegistryKeySet<Enchantment> exclusiveWith();
+
+    /**
+     * A mutable builder for the {@link EnchantmentRegistryEntry} plugins may change in applicable registry events.
+     * <p>
+     * The following values are required for each builder:
+     * <ul>
+     *     <li>{@link #description(Component)}</li>
+     *     <li>{@link #supportedItems(RegistryKeySet)}</li>
+     *     <li>{@link #weight(int)}</li>
+     *     <li>{@link #maxLevel(int)}</li>
+     *     <li>{@link #minimumCost(EnchantmentCost)}</li>
+     *     <li>{@link #maximumCost(EnchantmentCost)}</li>
+     *     <li>{@link #anvilCost(int)}</li>
+     *     <li>{@link #activeSlots(Iterable)}</li>
+     * </ul>
+     */
+    @ApiStatus.Experimental
+    @ApiStatus.NonExtendable
+    interface Builder extends EnchantmentRegistryEntry, RegistryBuilder<Enchantment> {
+
+        /**
+         * Configures the description of this enchantment entry as displayed to the client, e.g. "Sharpness" for the
+         * sharpness enchantment.
+         *
+         * @param description the description component.
+         * @return this builder instance.
+         */
+        @Contract(value = "_ -> this", mutates = "this")
+        Builder description(Component description);
+
+        /**
+         * Configures the set of supported items this enchantment can be applied on. This
+         * can be a {@link RegistryKeySet} created via {@link RegistrySet#keySet(io.papermc.paper.registry.RegistryKey, Iterable)} or
+         * a tag obtained via {@link io.papermc.paper.registry.event.RegistryFreezeEvent#getOrCreateTag(TagKey)} with
+         * tag keys found in {@link io.papermc.paper.registry.keys.tags.ItemTypeTagKeys} such as
+         * {@link io.papermc.paper.registry.keys.tags.ItemTypeTagKeys#ENCHANTABLE_ARMOR} and
+         * {@link io.papermc.paper.registry.keys.tags.ItemTypeTagKeys#ENCHANTABLE_SWORD}.
+         *
+         * @param supportedItems the registry key set representing the supported items.
+         * @return this builder instance.
+         * @see RegistrySet#keySet(RegistryKey, TypedKey[])
+         * @see io.papermc.paper.registry.event.RegistryFreezeEvent#getOrCreateTag(TagKey)
+         */
+        @Contract(value = "_ -> this", mutates = "this")
+        Builder supportedItems(RegistryKeySet<ItemType> supportedItems);
+
+        /**
+         * Configures a set of item types this enchantment can naturally be applied to, when enchanting in an
+         * enchantment table.This can be a {@link RegistryKeySet} created via
+         * {@link RegistrySet#keySet(io.papermc.paper.registry.RegistryKey, Iterable)} or a tag obtained via
+         * {@link io.papermc.paper.registry.event.RegistryFreezeEvent#getOrCreateTag(TagKey)} with
+         * tag keys found in {@link io.papermc.paper.registry.keys.tags.ItemTypeTagKeys} such as
+         * {@link io.papermc.paper.registry.keys.tags.ItemTypeTagKeys#ENCHANTABLE_ARMOR} and
+         * {@link io.papermc.paper.registry.keys.tags.ItemTypeTagKeys#ENCHANTABLE_SWORD}.
+         * <p>
+         * Defaults to {@code null} which means all {@link #supportedItems()} are considered primary items.
+         * Additionally, the tag {@link io.papermc.paper.registry.keys.tags.EnchantmentTagKeys#IN_ENCHANTING_TABLE} defines
+         * which enchantments can even show up in an enchantment table.
+         *
+         * @param primaryItems the registry key set representing the primary items.
+         * @return this builder instance.
+         * @see RegistrySet#keySet(RegistryKey, TypedKey[])
+         * @see io.papermc.paper.registry.event.RegistryFreezeEvent#getOrCreateTag(TagKey)
+         */
+        @Contract(value = "_ -> this", mutates = "this")
+        Builder primaryItems(@Nullable RegistryKeySet<ItemType> primaryItems);
+
+        /**
+         * Configures the weight of this enchantment used by the weighted random when selecting enchantments.
+         *
+         * @param weight the weight value.
+         * @return this builder instance.
+         * @see <a href="https://minecraft.wiki/w/Enchanting">https://minecraft.wiki/w/Enchanting</a> for examplary weights.
+         */
+        @Contract(value = "_ -> this", mutates = "this")
+        Builder weight(@Range(from = 1, to = 1024) int weight);
+
+        /**
+         * Configures the maximum level this enchantment can have when applied.
+         *
+         * @param maxLevel the maximum level.
+         * @return this builder instance.
+         */
+        @Contract(value = "_ -> this", mutates = "this")
+        Builder maxLevel(@Range(from = 1, to = 255) int maxLevel);
+
+        /**
+         * Configures the minimum cost needed to enchant an item with this enchantment.
+         * <p>
+         * Note that a cost is not directly related to the consumed xp.
+         *
+         * @param minimumCost the enchantment cost.
+         * @return this builder instance.
+         * @see <a href="https://minecraft.wiki/w/Enchanting/Levels">https://minecraft.wiki/w/Enchanting/Levels</a> for
+         * examplary costs.
+         */
+        @Contract(value = "_ -> this", mutates = "this")
+        Builder minimumCost(EnchantmentCost minimumCost);
+
+        /**
+         * Configures the maximum cost to enchant an item with this enchantment.
+         * <p>
+         * Note that a cost is not directly related to the consumed xp.
+         *
+         * @param maximumCost the enchantment cost.
+         * @return this builder instance.
+         * @see <a href="https://minecraft.wiki/w/Enchanting/Levels">https://minecraft.wiki/w/Enchanting/Levels</a> for
+         * examplary costs.
+         */
+        @Contract(value = "_ -> this", mutates = "this")
+        Builder maximumCost(EnchantmentCost maximumCost);
+
+        /**
+         * Configures the cost of applying this enchantment using an anvil.
+         * <p>
+         * Note that this is halved when using an enchantment book, and is multiplied by the level of the enchantment.
+         * See <a href="https://minecraft.wiki/w/Anvil_mechanics">https://minecraft.wiki/w/Anvil_mechanics</a> for more information.
+         * </p>
+         *
+         * @param anvilCost the anvil cost of this enchantment
+         * @return this builder instance.
+         * @see Enchantment#getAnvilCost()
+         */
+        @Contract(value = "_ -> this", mutates = "this")
+        Builder anvilCost(@Range(from = 0, to = Integer.MAX_VALUE) int anvilCost);
+
+        /**
+         * Configures the list of slot groups this enchantment may be active in.
+         * <p>
+         * If the item enchanted with this enchantment is equipped in a slot not covered by the returned list and its
+         * groups, the enchantment's effects, like attribute modifiers, will not activate.
+         *
+         * @param activeSlots a list of equipment slot groups.
+         * @return this builder instance.
+         * @see Enchantment#getActiveSlotGroups()
+         */
+        @Contract(value = "_ -> this", mutates = "this")
+        default Builder activeSlots(final EquipmentSlotGroup... activeSlots) {
+            return this.activeSlots(List.of(activeSlots));
+        }
+
+        /**
+         * Configures the list of slot groups this enchantment may be active in.
+         * <p>
+         * If the item enchanted with this enchantment is equipped in a slot not covered by the returned list and its
+         * groups, the enchantment's effects, like attribute modifiers, will not activate.
+         *
+         * @param activeSlots a list of equipment slot groups.
+         * @return this builder instance.
+         * @see Enchantment#getActiveSlotGroups()
+         */
+        @Contract(value = "_ -> this", mutates = "this")
+        Builder activeSlots(Iterable<EquipmentSlotGroup> activeSlots);
+
+        /**
+         * Configures the registry key set of enchantments that this enchantment is exclusive with.
+         * <p>
+         * Exclusive enchantments prohibit the application of this enchantment to an item if they are already present on
+         * said item.
+         * <p>
+         * Defaults to an empty set allowing this enchantment to be applied regardless of other enchantments.
+         *
+         * @param exclusiveWith a registry set of enchantments exclusive to this one.
+         * @return this builder instance.
+         * @see RegistrySet#keySet(RegistryKey, TypedKey[])
+         * @see io.papermc.paper.registry.event.RegistryFreezeEvent#getOrCreateTag(TagKey)
+         */
+        @Contract(value = "_ -> this", mutates = "this")
+        Builder exclusiveWith(RegistryKeySet<Enchantment> exclusiveWith);
+    }
+
+    /**
+     * The enchantment cost interface represents the cost of applying an enchantment, split up into its different components.
+     */
+    interface EnchantmentCost {
+
+        /**
+         * Returns the base cost of this enchantment cost, no matter what level the enchantment has.
+         *
+         * @return the cost in levels.
+         */
+        int baseCost();
+
+        /**
+         * Returns the additional cost added per level of the enchantment to be applied.
+         * This cost is applied per level above the first.
+         *
+         * @return the cost added to the {@link #baseCost()} for each level above the first.
+         */
+        int additionalPerLevelCost();
+
+        /**
+         * Creates a new enchantment cost instance based on the passed values.
+         *
+         * @param baseCost the base cost of the enchantment cost as returned by {@link #baseCost()}
+         * @param additionalPerLevelCost the additional cost per level, as returned by {@link #additionalPerLevelCost()}
+         * @return the created instance.
+         */
+        @Contract(value = "_,_ -> new", pure = true)
+        static EnchantmentCost of(final int baseCost, final int additionalPerLevelCost) {
+            record Impl(int baseCost, int additionalPerLevelCost) implements EnchantmentCost {
+            }
+
+            return new Impl(baseCost, additionalPerLevelCost);
+        }
+    }
+}
diff --git a/src/main/java/io/papermc/paper/registry/data/GameEventRegistryEntry.java b/src/main/java/io/papermc/paper/registry/data/GameEventRegistryEntry.java
new file mode 100644
index 0000000000000000000000000000000000000000..980fe12b75258b51cc2498590cadb9de80805b1f
--- /dev/null
+++ b/src/main/java/io/papermc/paper/registry/data/GameEventRegistryEntry.java
@@ -0,0 +1,49 @@
+package io.papermc.paper.registry.data;
+
+import io.papermc.paper.registry.RegistryBuilder;
+import org.bukkit.GameEvent;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.Contract;
+import org.jetbrains.annotations.Range;
+import org.jspecify.annotations.NullMarked;
+
+/**
+ * A data-centric version-specific registry entry for the {@link GameEvent} type.
+ */
+@ApiStatus.Experimental
+@NullMarked
+@ApiStatus.NonExtendable
+public interface GameEventRegistryEntry {
+
+    /**
+     * Provides the range in which this game event will notify its listeners.
+     *
+     * @return the range of blocks, represented as an int.
+     * @see GameEvent#getRange()
+     */
+    @Range(from = 0, to = Integer.MAX_VALUE) int range();
+
+    /**
+     * A mutable builder for the {@link GameEventRegistryEntry} plugins may change in applicable registry events.
+     * <p>
+     * The following values are required for each builder:
+     * <ul>
+     *     <li>{@link #range(int)}</li>
+     * </ul>
+     */
+    @ApiStatus.Experimental
+    @ApiStatus.NonExtendable
+    interface Builder extends GameEventRegistryEntry, RegistryBuilder<GameEvent> {
+
+        /**
+         * Sets the range in which this game event should notify its listeners.
+         *
+         * @param range the range of blocks.
+         * @return this builder instance.
+         * @see GameEventRegistryEntry#range()
+         * @see GameEvent#getRange()
+         */
+        @Contract(value = "_ -> this", mutates = "this")
+        Builder range(@Range(from = 0, to = Integer.MAX_VALUE) int range);
+    }
+}
diff --git a/src/main/java/io/papermc/paper/registry/data/PaintingVariantRegistryEntry.java b/src/main/java/io/papermc/paper/registry/data/PaintingVariantRegistryEntry.java
new file mode 100644
index 0000000000000000000000000000000000000000..4e2c99acd7dc307981ba8e33a62835f0f29fd73e
--- /dev/null
+++ b/src/main/java/io/papermc/paper/registry/data/PaintingVariantRegistryEntry.java
@@ -0,0 +1,131 @@
+package io.papermc.paper.registry.data;
+
+import io.papermc.paper.registry.RegistryBuilder;
+import java.util.Optional;
+import net.kyori.adventure.key.Key;
+import net.kyori.adventure.text.Component;
+import org.bukkit.Art;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.Contract;
+import org.jetbrains.annotations.Range;
+import org.jspecify.annotations.NullMarked;
+import org.jspecify.annotations.Nullable;
+
+/**
+ * A data-centric version-specific registry entry for the {@link Art} type.
+ */
+@ApiStatus.Experimental
+@NullMarked
+@ApiStatus.NonExtendable
+public interface PaintingVariantRegistryEntry {
+
+    /**
+     * Provides the width of this painting in blocks.
+     *
+     * @return the width.
+     * @see Art#getBlockWidth()
+     */
+    @Range(from = 1, to = 16) int width();
+
+    /**
+     * Provides the height of this painting in blocks.
+     *
+     * @return the height.
+     * @see Art#getBlockHeight()
+     */
+    @Range(from = 1, to = 16) int height();
+
+    /**
+     * Provides the title of the painting visible in the creative inventory.
+     *
+     * @return the title.
+     * @see Art#title()
+     */
+    @Nullable Component title();
+
+    /**
+     * Provides the author of the painting visible in the creative inventory.
+     *
+     * @return the author.
+     * @see Art#author()
+     */
+    @Nullable Component author();
+
+    /**
+     * Provides the asset id of the painting, which is the location of the sprite to use.
+     *
+     * @return the asset id.
+     * @see Art#assetId()
+     */
+    Key assetId();
+
+    /**
+     * A mutable builder for the {@link PaintingVariantRegistryEntry} plugins may change in applicable registry events.
+     * <p>
+     * The following values are required for each builder:
+     * <ul>
+     *     <li>{@link #width(int)}</li>
+     *     <li>{@link #height(int)}</li>
+     *     <li>{@link #assetId(Key)}</li>
+     * </ul>
+     */
+    @ApiStatus.Experimental
+    @ApiStatus.NonExtendable
+    interface Builder extends PaintingVariantRegistryEntry, RegistryBuilder<Art> {
+
+        /**
+         * Sets the width of the painting in blocks.
+         *
+         * @param width the width in blocks.
+         * @return this builder instance.
+         * @see PaintingVariantRegistryEntry#width()
+         * @see Art#getBlockWidth()
+         */
+        @Contract(value = "_ -> this", mutates = "this")
+        Builder width(@Range(from = 1, to = 16) int width);
+
+        /**
+         * Sets the height of the painting in blocks.
+         *
+         * @param height the height in blocks.
+         * @return this builder instance.
+         * @see PaintingVariantRegistryEntry#height()
+         * @see Art#getBlockHeight()
+         */
+        @Contract(value = "_ -> this", mutates = "this")
+        Builder height(@Range(from = 1, to = 16) int height);
+
+        /**
+         * Sets the title of the painting.
+         *
+         * @param title the title.
+         * @return this builder instance.
+         * @see PaintingVariantRegistryEntry#title()
+         * @see Art#title()
+         */
+        @Contract(value = "_ -> this", mutates = "this")
+        Builder title(@Nullable Component title);
+
+        /**
+         * Sets the author of the painting.
+         *
+         * @param author the author.
+         * @return this builder instance.
+         * @see PaintingVariantRegistryEntry#author()
+         * @see Art#author()
+         */
+        @Contract(value = "_ -> this", mutates = "this")
+        Builder author(@Nullable Component author);
+
+        /**
+         * Sets the asset id of the painting, which is the location of the sprite to use.
+         *
+         * @param assetId the asset id.
+         * @return this builder instance.
+         * @see PaintingVariantRegistryEntry#assetId()
+         * @see Art#assetId()
+         */
+        @Contract(value = "_ -> this", mutates = "this")
+        Builder assetId(Key assetId);
+    }
+}
diff --git a/src/main/java/io/papermc/paper/registry/data/package-info.java b/src/main/java/io/papermc/paper/registry/data/package-info.java
new file mode 100644
index 0000000000000000000000000000000000000000..4f8f536f437c5f483ac7bce393e664fd7bc38477
--- /dev/null
+++ b/src/main/java/io/papermc/paper/registry/data/package-info.java
@@ -0,0 +1,9 @@
+/**
+ * Collection of registry entry types that may be created or modified via the
+ * {@link io.papermc.paper.registry.event.RegistryEvent}.
+ * <p>
+ * A registry entry represents its runtime API counterpart as a version-specific data-focused type.
+ * Registry entries are not expected to be used during plugin runtime interactions with the API but are mostly
+ * exposed during registry creation/modification.
+ */
+package io.papermc.paper.registry.data;
diff --git a/src/main/java/io/papermc/paper/registry/event/RegistryEvents.java b/src/main/java/io/papermc/paper/registry/event/RegistryEvents.java
index 91ae9c0d3ec55ce417d4b447bf3d1b0d0c174b5e..40deffbd0930508bb04e9aedfd62ad2144855198 100644
--- a/src/main/java/io/papermc/paper/registry/event/RegistryEvents.java
+++ b/src/main/java/io/papermc/paper/registry/event/RegistryEvents.java
@@ -1,8 +1,17 @@
 package io.papermc.paper.registry.event;
 
+import io.papermc.paper.registry.RegistryKey;
+import io.papermc.paper.registry.data.EnchantmentRegistryEntry;
+import io.papermc.paper.registry.data.GameEventRegistryEntry;
+import io.papermc.paper.registry.data.PaintingVariantRegistryEntry;
+import org.bukkit.Art;
+import org.bukkit.GameEvent;
+import org.bukkit.enchantments.Enchantment;
 import org.jetbrains.annotations.ApiStatus;
 import org.jspecify.annotations.NullMarked;
 
+import static io.papermc.paper.registry.event.RegistryEventProviderImpl.create;
+
 /**
  * Holds providers for {@link RegistryEntryAddEvent} and {@link RegistryFreezeEvent}
  * handlers for each applicable registry.
@@ -11,6 +20,10 @@ import org.jspecify.annotations.NullMarked;
 @NullMarked
 public final class RegistryEvents {
 
+    public static final RegistryEventProvider<GameEvent, GameEventRegistryEntry.Builder> GAME_EVENT = create(RegistryKey.GAME_EVENT);
+    public static final RegistryEventProvider<Enchantment, EnchantmentRegistryEntry.Builder> ENCHANTMENT = create(RegistryKey.ENCHANTMENT);
+    public static final RegistryEventProvider<Art, PaintingVariantRegistryEntry.Builder> PAINTING_VARIANT = create(RegistryKey.PAINTING_VARIANT);
+
     private RegistryEvents() {
     }
 }
diff --git a/src/main/java/org/bukkit/GameEvent.java b/src/main/java/org/bukkit/GameEvent.java
index 8d8d2d710a291bd6442d019cc2c33a9c9a8ceb65..ac2601db7390062b50068170f5301d53cc991e4f 100644
--- a/src/main/java/org/bukkit/GameEvent.java
+++ b/src/main/java/org/bukkit/GameEvent.java
@@ -141,4 +141,22 @@ public abstract class GameEvent implements Keyed {
     private static GameEvent getEvent(@NotNull String key) {
         return Registry.GAME_EVENT.getOrThrow(NamespacedKey.minecraft(key));
     }
+    // Paper start
+    /**
+     * Gets the range of the event which is used to
+     * notify listeners of the event.
+     *
+     * @return the range
+     */
+    public abstract int getRange();
+
+    /**
+     * Gets the vibration level of the game event for vibration listeners.
+     * Not all events have vibration levels, and a level of 0 means
+     * it won't cause any vibrations.
+     *
+     * @return the vibration level
+     */
+    public abstract int getVibrationLevel();
+    // Paper end
 }
diff --git a/src/main/java/org/bukkit/inventory/ItemType.java b/src/main/java/org/bukkit/inventory/ItemType.java
index af30d6e619ae3c3556611a36229f676b34baeb0e..c65ba431cd37e75e0cfa081bff1c24e5db5c19be 100644
--- a/src/main/java/org/bukkit/inventory/ItemType.java
+++ b/src/main/java/org/bukkit/inventory/ItemType.java
@@ -46,7 +46,7 @@ import org.jetbrains.annotations.Nullable;
  * official replacement for the aforementioned enum. Entirely incompatible
  * changes may occur. Do not use this API in plugins.
  */
-@ApiStatus.Internal
+@ApiStatus.Experimental // Paper - already required for registry builders
 public interface ItemType extends Keyed, Translatable, net.kyori.adventure.translation.Translatable { // Paper - add Translatable
 
     /**