@@ -27,6 +27,8 @@ public static void register() {
2727 REGISTER .registerAll ();
2828 }
2929
30+ // ==== SCROLLS ====
31+
3032 public static final Supplier <DataComponentType <HexPattern >> PATTERN = REGISTER .register ("pattern" , () ->
3133 DataComponentType .<HexPattern >builder ()
3234 .persistent (HexPattern .CODEC )
@@ -46,38 +48,48 @@ public static void register() {
4648 DataComponentType .<Unit >builder ()
4749 .networkSynchronized (StreamCodec .unit (Unit .INSTANCE ))
4850 .build ());
49- /**
50- * If this datacomponent is set on the item, we ignore the rest of the item and render this as if it were of the
51- * {@link at.petrak.hexcasting.api.casting.iota.IotaType IotaType} given by the resource location.
52- * <p>
53- * This is not useful to the player at all.
54- */
55- public static final Supplier <DataComponentType <Optional <IotaType <?>>>> VISUAL_OVERRIDE = REGISTER .register ("visual_override" , () ->
56- DataComponentType .<Optional <IotaType <?>>>builder ()
57- .networkSynchronized (ByteBufCodecs .optional (ByteBufCodecs .registry (HexRegistries .IOTA_TYPE )))
58- .build ());
51+
52+ // ==== ANYTHING WITH TEXTURE VARIANTS ====
53+
5954 public static final Supplier <DataComponentType <Integer >> ITEM_VARIANT = REGISTER .register ("variant" , () ->
6055 DataComponentType .<Integer >builder ()
6156 .persistent (Codec .intRange (0 , Integer .MAX_VALUE ))
6257 .networkSynchronized (ByteBufCodecs .VAR_INT )
6358 .build ());
59+
60+ // ==== IOTA HOLDERS ====
61+
6462 public static final Supplier <DataComponentType <Unit >> SEALED_IOTA_HOLDER = REGISTER .register ("sealed" , () ->
6563 DataComponentType .<Unit >builder ()
6664 .persistent (Codec .unit (Unit .INSTANCE ))
6765 .networkSynchronized (StreamCodec .unit (Unit .INSTANCE ))
6866 .build ());
69- // TODO port: Data components must implement equals and hashCode. Keep in mind they must also be immutable
67+ // TODO port: Data components are supposed to be immutable - is EntityIota.isPlayer a problem here?
7068 public static final Supplier <DataComponentType <Iota >> IOTA_HOLDER_IOTA = REGISTER .register ("iota" , () ->
7169 DataComponentType .<Iota >builder ()
7270 .persistent (IotaType .TYPED_CODEC )
7371 .networkSynchronized (IotaType .TYPED_STREAM_CODEC )
7472 .build ());
73+ /**
74+ * If this datacomponent is set on the item, we ignore the rest of the item and render this as if it were of the
75+ * {@link at.petrak.hexcasting.api.casting.iota.IotaType IotaType} given by the resource location.
76+ * <p>
77+ * This is not useful to the player at all.
78+ */
79+ public static final Supplier <DataComponentType <Optional <IotaType <?>>>> VISUAL_OVERRIDE = REGISTER .register ("visual_override" , () ->
80+ DataComponentType .<Optional <IotaType <?>>>builder ()
81+ .networkSynchronized (ByteBufCodecs .optional (ByteBufCodecs .registry (HexRegistries .IOTA_TYPE )))
82+ .build ());
83+
84+ // ==== CASTING ITEMS ====
7585
7686 public static final Supplier <DataComponentType <HexHolder >> HEX_HOLDER = REGISTER .register ("hex_holder" , () ->
7787 DataComponentType .<HexHolder >builder ()
7888 .persistent (HexHolder .CODEC )
7989 .networkSynchronized (HexHolder .STREAM_CODEC )
8090 .build ());
91+
92+ // ==== CASTING ITEMS & PHIALS ====
8193
8294 public static final Supplier <DataComponentType <Long >> MEDIA = REGISTER .register ("media" , () ->
8395 DataComponentType .<Long >builder ()
@@ -89,18 +101,25 @@ public static void register() {
89101 .persistent (Codec .LONG )
90102 .networkSynchronized (ByteBufCodecs .VAR_LONG )
91103 .build ());
104+
105+ // ==== ANCIENT CYPHERS ====
106+
92107 public static final Supplier <DataComponentType <String >> HEX_NAME = REGISTER .register ("hex_name" , () ->
93108 DataComponentType .<String >builder ()
94109 .persistent (Codec .STRING )
95110 .networkSynchronized (ByteBufCodecs .STRING_UTF8 )
96111 .build ());
97112
113+ // ==== ABACUS ====
114+
98115 public static final Supplier <DataComponentType <Double >> ABACUS_VALUE = REGISTER .register ("abacus_value" , () ->
99116 DataComponentType .<Double >builder ()
100117 .persistent (Codec .DOUBLE )
101118 .networkSynchronized (ByteBufCodecs .DOUBLE )
102119 .build ());
103120
121+ // ==== SPELLBOOKS ====
122+
104123 public static final Supplier <DataComponentType <Integer >> SELECTED_SPELLBOOK_PAGE = REGISTER .register ("page_idx" , () ->
105124 DataComponentType .<Integer >builder ()
106125 .persistent (Codec .INT )
@@ -137,6 +156,8 @@ public static void register() {
137156 ))
138157 .build ());
139158
159+ // ==== MEDIA CUBE ====
160+
140161 public static final Supplier <DataComponentType <List <Long >>> MEDIA_EXTRACTIONS = REGISTER .register ("media_extractions" , () ->
141162 DataComponentType .<List <Long >>builder ()
142163 .persistent (Codec .LONG .listOf ())
0 commit comments