@@ -109,6 +109,19 @@ protected void handleShowItem(final UserConnection connection, final CompoundTag
109109 handleEnchantments (componentsTag , "enchantments" );
110110 handleEnchantments (componentsTag , "stored_enchantments" );
111111
112+ // Usual item handling
113+ final CompoundTag useRemainder = TagUtil .getNamespacedCompoundTag (componentsTag , "use_remainder" );
114+ if (useRemainder != null ) {
115+ handleShowItem (connection , useRemainder );
116+ }
117+ handleContainerContents (connection , componentsTag );
118+ handleItemArrayContents (connection , componentsTag , "bundle_contents" );
119+ handleItemArrayContents (connection , componentsTag , "charged_projectiles" );
120+ handleWrittenBookContents (connection , componentsTag );
121+
122+ // NO MORE SNBT IN TEXT COMPONENTS
123+ updateUglyJson (componentsTag , connection );
124+
112125 removeDataComponents (componentsTag , StructuredDataKey .INSTRUMENT1_21_2 , StructuredDataKey .JUKEBOX_PLAYABLE1_21 );
113126 }
114127
@@ -218,22 +231,9 @@ private void updateShowItemHover(final UserConnection connection, final Compound
218231 final CompoundTag componentsTag = compoundContents .getCompoundTag ("components" );
219232 handleShowItem (connection , compoundContents , componentsTag );
220233
221- if (componentsTag = = null ) {
222- return ;
234+ if (componentsTag ! = null ) {
235+ hoverEventTag . put ( "components" , componentsTag ) ;
223236 }
224-
225- hoverEventTag .put ("components" , componentsTag );
226-
227- final CompoundTag useRemainder = TagUtil .getNamespacedCompoundTag (componentsTag , "use_remainder" );
228- if (useRemainder != null ) {
229- handleShowItem (connection , useRemainder );
230- }
231- handleContainerContents (connection , componentsTag );
232- handleItemArrayContents (connection , componentsTag , "bundle_contents" );
233- handleItemArrayContents (connection , componentsTag , "charged_projectiles" );
234- handleWrittenBookContents (connection , componentsTag );
235-
236- updateUglyJson (componentsTag , connection );
237237 } else if (contentsTag instanceof final StringTag inlinedContents ) {
238238 hoverEventTag .put ("id" , inlinedContents );
239239 }
@@ -267,7 +267,7 @@ private void updateUglyJson(final CompoundTag componentsTag, final String key, f
267267 final String actualKey = TagUtil .getNamespacedTagKey (componentsTag , key );
268268 final String json = componentsTag .getString (actualKey );
269269 if (json == null ) {
270- return ;
270+ return ;
271271 }
272272
273273 componentsTag .put (actualKey , uglyJsonToTag (connection , json ));
0 commit comments