@@ -114,11 +114,14 @@ protected ItemInteractionResult useItemOn(final ItemStack stack, final BlockStat
114114 Component component = stack .getOrDefault (DataComponents .CUSTOM_NAME , Component .empty ());
115115 @ Nullable Component secondRowComponent = null ;
116116
117+ boolean forceFromTop = false ;
118+
117119 if (AllBlocks .CLIPBOARD .isIn (stack )) {
118120 final List <ClipboardEntry > entries = ClipboardEntry .getLastViewedEntries (stack );
119- component = entries .getFirst ().text ;
121+ component = ! entries .isEmpty () ? entries . getFirst ().text : Component . empty () ;
120122 if (entries .size () > 1 ) {
121123 secondRowComponent = entries .get (1 ).text ;
124+ forceFromTop = true ;
122125 }
123126 }
124127
@@ -129,7 +132,7 @@ protected ItemInteractionResult useItemOn(final ItemStack stack, final BlockStat
129132 final @ Nullable String secondRowTagUsed = secondRowComponent == null ? null :
130133 Component .Serializer .toJson (secondRowComponent , level .registryAccess ());
131134
132- final int startLine = getLineForPlacement (state , pos , hitResult , level );
135+ final int startLine = forceFromTop ? 0 : getLineForPlacement (state , pos , hitResult , level );
133136
134137 final GenericNixieDisplayBlockEntity .ConfigurableDisplayOptions currentDisplay = startBlockEntity .getCurrentDisplayOption ();
135138 GenericNixieDisplayTarget .walkNixies (level , pos , (currentPos , consumedCharsOnRow , blockEntity ) -> {
0 commit comments