Skip to content

Conversation

@Zorbatron
Copy link
Member

@Zorbatron Zorbatron commented Dec 6, 2025

What

Title.

Implementation Details

A widget or sync handler that wants to receive a recipe from JEI now registers itself to our GregTechGuiScreen. Unfortunately the map has to be static as there is no way to get the screen from a sync handler.

Outcome

JEI transfers are easier now and a couple things are fixed by MUI 3.0.6.

Additional Information

Should multiple receivers be allowed to exist on the panel? Or should it just be one.

@Zorbatron Zorbatron requested review from a team as code owners December 6, 2025 21:38
@Zorbatron Zorbatron added type: refactor Suggestion to refactor a section of code type: feature New feature or request labels Dec 6, 2025
@Zorbatron Zorbatron changed the title Update to MUI 3.0.5 and generify recipe transfers from JEI Update to MUI 3.0.6 and generify recipe transfers from JEI Dec 11, 2025
Copy link
Contributor

@ALongStringOfNumbers ALongStringOfNumbers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two mixins that can be removed when updating MUI2, BigIntAdapter, and TextWidget.

One thing that your new system does not handle that the old system handled was the recipe category Uid. This was used to prevent recipes from being transfered into any GUI. For example, to prevent machine recipes from being transferred into the crafting station, or prevent pages like the material tree page from being transferred. The system should optionally take in one of JEI's Uids, or just allow all transfers if not specified. (Although I would still want to exclude pages like the material tree or ore page from being transferred somehow).

public class GregTechGuiScreen extends ModularScreen implements RecipeViewerRecipeTransferHandler {

// Stores lists of higher priority recipe receivers to the left of the tree
@SideOnly(Side.CLIENT)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The class is already annotated side only client, do we need to annotate this field as well?

}

@SubscribeEvent
public static void onGuiChange(GuiOpenEvent event) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this correct? We are listening to the GUI Open Event, to see if the GUI is closing? Does this event get fired when the GUI is closing as well?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, as returning to gameplay fires this event since the gui opens to "null"

if (!recipeLayout.getRecipeCategory().getUid().equals(VanillaRecipeCategoryUid.CRAFTING)) {
JustEnoughItemsModule.transferHelper.createInternalError();
} else if (simulate) {
// TODO: highlight missing items in recipe viewer
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this missing items from the players inventory, the crafting station inventory, or both? Because one of the possible error returns you list in IRecipeTransferReciever seems to do what this todo mentions. Can we just use that error here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: feature New feature or request type: refactor Suggestion to refactor a section of code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants