1010import at .petrak .hexcasting .common .lib .HexDataComponents ;
1111import at .petrak .hexcasting .common .misc .PatternTooltip ;
1212import at .petrak .hexcasting .interop .inline .InlinePatternData ;
13+ import at .petrak .hexcasting .xplat .IXplatAbstractions ;
1314import net .minecraft .ChatFormatting ;
1415import net .minecraft .core .BlockPos ;
1516import net .minecraft .core .Direction ;
@@ -153,8 +154,8 @@ public void inventoryTick(ItemStack pStack, Level pLevel, Entity pEntity, int pS
153154 // if op_id is set but there's no stored pattern, attempt to load the pattern on inv tick
154155 if (pStack .has (HexDataComponents .ACTION .get ()) && !pStack .has (HexDataComponents .PATTERN .get ()) && pEntity .getServer () != null ) {
155156 var action = pStack .get (HexDataComponents .ACTION .get ());
156- if (action == null ) {
157- // if the provided op_id is invalid , remove it so we don't keep trying every tick
157+ if (! IXplatAbstractions . INSTANCE . getActionRegistry (). containsKey ( action ) ) {
158+ // if the specified Action doesn't actually exist , remove the component so we don't keep trying every tick
158159 pStack .remove (HexDataComponents .ACTION .get ());
159160 return ;
160161 }
@@ -175,7 +176,7 @@ public void appendHoverText(ItemStack stack, TooltipContext context, List<Compon
175176 var needsPurchase = Component .translatable ("hexcasting.tooltip.scroll.needs_purchase" );
176177 tooltipComponents .add (needsPurchase .withStyle (ChatFormatting .GRAY ));
177178 } else if (stack .has (HexDataComponents .RECALC_WARNING .get ())) {
178- var spellName = Component .translatable ("hexcasting.action." + stack .get (HexDataComponents .RECALC_WARNING .get ()));
179+ var spellName = Component .translatable ("hexcasting.action." + stack .get (HexDataComponents .RECALC_WARNING .get ()). location () );
179180 var line1 = Component .translatable ("hexcasting.tooltip.scroll.recalc_warning.line1" , spellName );
180181 var line2 = Component .translatable ("hexcasting.tooltip.scroll.recalc_warning.line2" );
181182 tooltipComponents .add (line1 .withStyle (ChatFormatting .RED ));
0 commit comments