1313import appeng .api .storage .data .IAEItemStack ;
1414import codechicken .lib .gui .GuiDraw ;
1515import com .cleanroommc .modularui .drawable .text .TextRenderer ;
16- import com .cleanroommc .modularui .integration .jei . JeiGhostIngredientSlot ;
16+ import com .cleanroommc .modularui .integration .recipeviewer . RecipeViewerGhostIngredientSlot ;
1717import com .cleanroommc .modularui .screen .RichTooltip ;
1818import com .cleanroommc .modularui .screen .viewport .ModularGuiContext ;
19- import com .cleanroommc .modularui .theme .WidgetTheme ;
19+ import com .cleanroommc .modularui .theme .WidgetThemeEntry ;
2020import com .cleanroommc .modularui .utils .Color ;
2121import com .cleanroommc .modularui .value .sync .SyncHandler ;
2222import org .jetbrains .annotations .NotNull ;
2323import org .jetbrains .annotations .Nullable ;
2424
2525import java .util .function .BooleanSupplier ;
2626
27- public class AEItemConfigSlot extends AEConfigSlot <IAEItemStack > implements JeiGhostIngredientSlot <ItemStack > {
27+ public class AEItemConfigSlot extends AEConfigSlot <IAEItemStack > implements RecipeViewerGhostIngredientSlot <ItemStack > {
2828
2929 public AEItemConfigSlot (boolean isStocking , int index , @ NotNull BooleanSupplier isAutoPull ) {
3030 super (isStocking , index , isAutoPull );
@@ -34,7 +34,7 @@ public AEItemConfigSlot(boolean isStocking, int index, @NotNull BooleanSupplier
3434 @ Override
3535 public void onInit () {
3636 super .onInit ();
37- getContext ().getJeiSettings ().addJeiGhostIngredientSlot (this );
37+ getContext ().getRecipeViewerSettings ().addGhostIngredientSlot (this );
3838 }
3939
4040 @ Override
@@ -44,7 +44,8 @@ protected void buildTooltip(@NotNull RichTooltip tooltip) {
4444 tooltip .addFromItem (config .getDefinition ());
4545 tooltip .addLine ((context , x , y , width , height , widgetTheme ) -> {
4646 final int color = Color .GREY .darker (2 );
47- GuiDraw .drawRect (x , y + 3 , (int ) TextRenderer .SHARED .getLastWidth (), 2 , color );
47+ // TODO: do I need to access the text renderer like this?
48+ GuiDraw .drawRect (x , y + 3 , (int ) TextRenderer .SHARED .getLastActualWidth (), 2 , color );
4849 });
4950 }
5051
@@ -62,10 +63,10 @@ public boolean isValidSyncHandler(SyncHandler syncHandler) {
6263 }
6364
6465 @ Override
65- public void draw (ModularGuiContext context , WidgetTheme widgetTheme ) {
66+ public void draw (ModularGuiContext context , WidgetThemeEntry <?> widgetTheme ) {
6667 WrappedItemStack config = (WrappedItemStack ) getSyncHandler ().getConfig (index );
6768 if (config != null ) {
68- RenderUtil .renderItem (config .getDefinition (), 1 , 1 , 16f , 16f );
69+ RenderUtil .drawItemStack (config .getDefinition (), 1 , 1 , false );
6970 if (!isStocking ) {
7071 RenderUtil .renderTextFixedCorner (TextFormattingUtil .formatLongToCompactString (config .getStackSize (), 4 ),
7172 17d , 18d , 0xFFFFFF , true , 0.5f );
0 commit comments