Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port/Rework Crafting Station to MUI2 + Misc Fixes #2455

Merged
merged 180 commits into from
Feb 19, 2025

Conversation

ghzdude
Copy link
Contributor

@ghzdude ghzdude commented Apr 17, 2024

What

the fabled pr that ports the crashing Crafting Station to cleanroom mui, and also reworks the crafting station logic.
i now believe it is feature complete and ready for review
also a bunch of misc fixes because this pr is very old

Implementation Details

rework crafting station logic
port crafting station to mui2
fixes toolbelt crashing with bogosorter
implements fixes from mui2 master as mixins (jei ghost dragging)
makes crate notify neighbors on inventory change
minor fixes to Quantum Storage Network
improve RecipeRepairItem mixin
adds metadata to ItemStackHashStrategy
reworks ItemHandlerList
GTItemStackHandler's setStackInSlot() now only sets the stack if the stack is different
format easy case in TextFormattingUtil#formatLongToCompactString()
add method to RenderUtil to render item stacks
deleted a bunch of old gui widget classes for the workbench

Todo/Notes

  • crafting grid - essentially complete
    • JEI transfer complete
    • should probably not be specific to the crafting station
    • no longer extends itemslot
  • output slot
    • no longer extends itemslot, syncing and interaction is handled manually
  • recipe memory slots
    • effectively feature complete
  • inventory tab - essentially complete
    • should correctly update and handle when inventories are added/removed

Outcome

crafting station will continue to exist

@ghzdude ghzdude added the type: feature New feature or request label Apr 17, 2024
@ghzdude ghzdude force-pushed the gh-crafting-station-mui-port branch from 270a020 to 85a5c84 Compare April 20, 2024 21:20
@ghzdude ghzdude marked this pull request as ready for review May 3, 2024 18:51
@ghzdude ghzdude requested review from a team as code owners May 3, 2024 18:51
@bruberu
Copy link
Member

bruberu commented Jun 4, 2024

To summarize a few things I found in an in-game review that would be good to have before I go all-in with reviewing 19 files:

  • Re-implement the red tint on top of missing items
  • Use the correct tool slot overlay
  • Add an output stack amount indicator
  • Allow JEI shortcuts on all of the different ghost slots
  • Prevent unlocked items in recipe memory from at least getting immediately overwritten
  • Remove unused classes from the pre-MUI widget system-
  • Move datacodes to the correct file
  • Fix the lock icon rendering under the items
  • Resolve the "tool damage" TODO (and in fact process all item crafting behaviors, such as that of buckets)
  • Re-implement shift-clicking behavior

@ghzdude ghzdude force-pushed the gh-crafting-station-mui-port branch 2 times, most recently from f528df5 to 07a2377 Compare June 9, 2024 19:46
@ghzdude ghzdude force-pushed the gh-crafting-station-mui-port branch from 2c0f220 to f4e1615 Compare July 20, 2024 17:24
@ghzdude ghzdude force-pushed the gh-crafting-station-mui-port branch from 9914d3b to 6160fd7 Compare August 25, 2024 06:53
@ghzdude ghzdude force-pushed the gh-crafting-station-mui-port branch from d88f038 to 1558a94 Compare October 17, 2024 00:13
@ghzdude ghzdude force-pushed the gh-crafting-station-mui-port branch from 3350a30 to f542e0b Compare January 10, 2025 01:46
@@ -58,7 +58,7 @@ static ItemStackHashStrategy comparingItemDamageCount() {
*/
class ItemStackHashStrategyBuilder {

private boolean item, count, damage, tag;
private boolean item, count, damage, tag, meta;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is damage not enough?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

iirc because of GT Tools or something like that, i made this change a long time ago.

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.

Shift clicking the output slot of the crafting station does not do anything, when you have enough items in the inventory to craft multiple of the output.

When viewing the contents of connected inventories in the inventory tab, the contents are not sorted so that all the actual items are visible at the top of the tab. Instead items are separated by any empty inventory spaces remaining in one of the inventories before showing other existing items.

2025-01-28_16-53
this is 2 chests, 1 on either side of the station.

Crafting a recipe, locking the recipe in the memorized tab, and then crafting the recipe again removes the lock status in the memorized recipe tab.

There should be a way to clear the existing recipe displayed in the crafting slots widget, so you don't have to clock all the slots one by one. A little x or something in the top next to the grid.

I somehow managed to reset the count of the items crafted. Not sure how. I had crafted 16 LV motors, left the GUI, came back, crafted some other stuff, and the times crafted tooltip only showed 8.

There is some delay with the scroll bar in the item source window that can really be felt. If you scroll down and then immediately scroll back up, nothing happens on the scroll back up. You have to reach the bottom/top of the scroll bar distance for this to happen, if you change directions in the middle it feels ok.

The scroll bar for the item source tab is too close to the slots in the window, and cuts off the item counts of things in the right most slots.

The item source window should get some special handling for the quantum chest I believe, because right now is shows the virtualized items and the items in the output slot. It would be better if it showed a combined total of the two.

When the crafting station is checking if it can complete a recipe, it only checks its internal inventory and the connected inventories. Do we want to check the players inventory as well?

@ghzdude ghzdude force-pushed the gh-crafting-station-mui-port branch from 4539e5a to e217b29 Compare January 29, 2025 21:31
@ghzdude
Copy link
Contributor Author

ghzdude commented Jan 30, 2025

Shift clicking the output slot of the crafting station does not do anything, when you have enough items in the inventory to craft multiple of the output.

it should craft the item once (at least it does for me)

I somehow managed to reset the count of the items crafted. Not sure how. I had crafted 16 LV motors, left the GUI, came back, crafted some other stuff, and the times crafted tooltip only showed 8.

uh, not sure how that could happen, and i don't think i'm reproducing it.

There is some delay with the scroll bar in the item source window that can really be felt. If you scroll down and then immediately scroll back up, nothing happens on the scroll back up. You have to reach the bottom/top of the scroll bar distance for this to happen, if you change directions in the middle it feels ok.

this is a mui2 issue i think, would need to look into it more

The scroll bar for the item source tab is too close to the slots in the window, and cuts off the item counts of things in the right most slots.

that's the grid default, but i might be able to change it

When the crafting station is checking if it can complete a recipe, it only checks its internal inventory and the connected inventories. Do we want to check the players inventory as well?

i don't think previous logic checked the player inventory, but i could look into adding that

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.

The crafting station doesn't handle special crafting recipe with fluid containers. EG, you can use a drum of creosote to craft treated wood in a normal crafting table, but this is not recognized in the crafting station.

Some weird highlighting going on with the crafting grid when I placed in ghost ingredients by hand. Started in the bottom right, and then added items counter clockwise. I think it failed on the stick recipe when I added the two items into the grid, but then did not update the tint as I added more items into the grid. Yeah, testing this with jungle planks, it forms the stick recipe after placing in two planks, but then the tint does not disappear after invalidating the stick recipe by placing a third plank in the grid.

picture:
2025-01-29_19-45

Found a way to void items. When crafting a lot of an item, such that the internal inventory fills up, continueing to shift click craft the item will void the output, instead of placing it in the players inventory or dropping it on the ground if the players inventory is full (I don't remember if vanilla drops the items on the ground if the players inventory is full, or just prevents more crafts). I was testing this with the Invar Wrench recipe, and this only happened when shift clicking the craft.

No tool crafting sounds are played when crafting items with GT tools in the crafting station. This does not apply to the breaking sound though, that works fine.

Found some weird slot tinting issue, where some slots are tinted darker than other slots. I had the recipe for Circuit Boards in the table, and then shift clicked in the recipe for iron plates from JEI, and two of the slots were tinted darker than they should be for empty slots.

picture:
2025-01-29_20-05

For the memorized recipe grid, while it is not full, new crafts are added to the beginning of the list and displayed in the top right slot. However, after the grid is filled up new recipes are added to the bottom right slot. Previously new recipes would always be added to the top left slot, and if the grid was full the bottom right slot would be deleted, with the slot next to it taking its place. This is to always have the most recent crafted recipe not immediately be pushed off the grid if you craft another new recipe.

@ghzdude
Copy link
Contributor Author

ghzdude commented Jan 30, 2025

The crafting station doesn't handle special crafting recipe with fluid containers. EG, you can use a drum of creosote to craft treated wood in a normal crafting table, but this is not recognized in the crafting station.

these recipes work fine for me

Some weird highlighting going on with the crafting grid when I placed in ghost ingredients by hand. Started in the bottom right, and then added items counter clockwise. I think it failed on the stick recipe when I added the two items into the grid, but then did not update the tint as I added more items into the grid. Yeah, testing this with jungle planks, it forms the stick recipe after placing in two planks, but then the tint does not disappear after invalidating the stick recipe by placing a third plank in the grid.

this is fixed.

Found a way to void items. When crafting a lot of an item, such that the internal inventory fills up, continueing to shift click craft the item will void the output, instead of placing it in the players inventory or dropping it on the ground if the players inventory is full (I don't remember if vanilla drops the items on the ground if the players inventory is full, or just prevents more crafts). I was testing this with the Invar Wrench recipe, and this only happened when shift clicking the craft.

fixed

No tool crafting sounds are played when crafting items with GT tools in the crafting station. This does not apply to the breaking sound though, that works fine.

i'm actually not sure how to get the tool crafting sound

Found some weird slot tinting issue, where some slots are tinted darker than other slots. I had the recipe for Circuit Boards in the table, and then shift clicked in the recipe for iron plates from JEI, and two of the slots were tinted darker than they should be for empty slots.

couldn't reproduce

For the memorized recipe grid, while it is not full, new crafts are added to the beginning of the list and displayed in the top right slot.

i couldn't reproduce this, but it might be fixed now

However, after the grid is filled up new recipes are added to the bottom right slot. Previously new recipes would always be added to the top left slot, and if the grid was full the bottom right slot would be deleted, with the slot next to it taking its place. This is to always have the most recent crafted recipe not immediately be pushed off the grid if you craft another new recipe.

this is fixed now

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.

The implemented dragging ghost ingredients from JEI doesn't really work. You can get the ghost ingredient onto your cursor, but when you click the grid with the item, nothing happens.

Durability render for tools in the crafting matrix is offcenter.
image

Can't click items from the output slot if there are items on the players cursor, even if the items match. You might want to look at the previous implementation of the various button clicks on the output slot, and see what all edge cases they solved.

Cannot use R/U JEI buttons on items in the memorized recipe widget

You can have both a locked and nonlocked memorized recipe of the same output (Tested with invar plates). If there is a locked recipe already, a new one should not be added, especially if it is the same recipe.

This may be hard, but right now, if the internal inventory is full, shift clicking a recipe will not complete the recipe, even if all the inputs would be consumed, thus freeing a slot in the internal inventory. Maybe it would be possible to calculate if a slot would be freed after using all the inputs, and if so craft the item, depositing the output into the now vacant input slot?

@ghzdude ghzdude force-pushed the gh-crafting-station-mui-port branch from 6162861 to c6dce01 Compare February 1, 2025 18:08
@ghzdude
Copy link
Contributor Author

ghzdude commented Feb 1, 2025

The implemented dragging ghost ingredients from JEI doesn't really work. You can get the ghost ingredient onto your cursor, but when you click the grid with the item, nothing happens.

this is a consequence of setting the input event for Mui2 to "HIGH", it's fixed in mui2 master and i've implemented a mixin to fix it until the next mui2 release

Can't click items from the output slot if there are items on the players cursor, even if the items match. You might want to look at the previous implementation of the various button clicks on the output slot, and see what all edge cases they solved.

this was a minor oversight in checking if there was enough space to fit the outputs, fixed now

Cannot use R/U JEI buttons on items in the memorized recipe widget

You can have both a locked and nonlocked memorized recipe of the same output (Tested with invar plates). If there is a locked recipe already, a new one should not be added, especially if it is the same recipe.

both fixed

This may be hard, but right now, if the internal inventory is full, shift clicking a recipe will not complete the recipe, even if all the inputs would be consumed, thus freeing a slot in the internal inventory. Maybe it would be possible to calculate if a slot would be freed after using all the inputs, and if so craft the item, depositing the output into the now vacant input slot?

i think this is doable, but it's general convention to check if there's space first and only run if there is space.
i could probably consume the items first, then transfer the output stack

@ghzdude ghzdude force-pushed the gh-crafting-station-mui-port branch 2 times, most recently from 3d25f6b to 91c440f Compare February 3, 2025 21:49
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.

Some visual desync with the crafting input grid. I had in a recipe for neutronium plates with a hammer, dragged in a random item from JEI to the bottom slot to break the recipe, closed the GUI and reopened the GUI. The bottom slot showed a neutronium ingot instead of the item that I dragged in, but the output slot was empty. Closed and reopened the GUI again and the output slot was occupied.

Dragging items from JEI does not update the missing items red tint if the recipe is broken. EG, I had the neutronium plate recipe loaded in the crafting input, with no ingots in the table so that the two ingots in the crafting matrix were red. I then dragged in something completly random from JEI to break the output of the recipe and turn it to nothing, and the two plates were still highlighted red. This doesn't happen when clicking items into the crafting grid from a stack on the cursor, just when dragging from JEI.

Items being dragged from JEI render under items in the crafting matrix and output slot and memorized recipe widget. But the green target area renders over tooltips of hovered items.

You can start the JEI dragging ghost item when you are on the storage tab, which renders the green target square over the items in the storage tab list. Dragging should only be available when on the crafting tab.

You can use the JEI + recipe transfer when in the storage tab, and it will change the recipe in the crafting matrix. This should either be disabled in the storage tab, or set the crafting tab as the main active tab.

For some reason, you cannot JEI ghost drag enchanted books

public void setItemsCraftedAmount(int itemsCrafted) {
this.itemsCrafted = itemsCrafted;
public void updateInventory(IItemHandlerModifiable handler) {
this.availableHandlers = handler;
}

public void clearCraftingGrid() {
fillCraftingGrid(Collections.emptyMap());
}

public void fillCraftingGrid(Map<Integer, ItemStack> ingredients) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this need to be passed a Map? Can't it just be passed a ItemStack to fill the grid with? The only use of this method is to clear the grid by passing an empty map to fill with empty itemstacks.

@M-W-K
Copy link
Contributor

M-W-K commented Feb 6, 2025

Findings from playing around ingame:

  • Using a toolbelt with tools in it does not reliably damage the right tool. Either special case handling is needed, or toolbelt logic needs to be revisited.
  • Recipes that use as input what they output (e.g. electric wrench uses a wrench in its recipe) have extremely broken behavior. Infinite duping galore.
  • Storage view pushing occupied slots to the top completely obfuscates what inventory slots belong to, or where in that inventory they are. This is most noticeable for empty slots. Perhaps the GUI for storage view could be redesigned to be similar to ae2 interface terminal GUI, where it has names associated with inventories.
  • Storage view slots are accessible even when the tab is not visible; e.g. shift-double-click to pickup all matching items will pull from storage view slots while in the crafting tab. This may be a feature.

@ghzdude
Copy link
Contributor Author

ghzdude commented Feb 6, 2025

Some visual desync with the crafting input grid. I had in a recipe for neutronium plates with a hammer, dragged in a random item from JEI to the bottom slot to break the recipe, closed the GUI and reopened the GUI. The bottom slot showed a neutronium ingot instead of the item that I dragged in, but the output slot was empty. Closed and reopened the GUI again and the output slot was occupied.

could not reproduce

Dragging items from JEI does not update the missing items red tint if the recipe is broken. EG, I had the neutronium plate recipe loaded in the crafting input, with no ingots in the table so that the two ingots in the crafting matrix were red. I then dragged in something completly random from JEI to break the output of the recipe and turn it to nothing, and the two plates were still highlighted red. This doesn't happen when clicking items into the crafting grid from a stack on the cursor, just when dragging from JEI.

fixed

Items being dragged from JEI render under items in the crafting matrix and output slot and memorized recipe widget. But the green target area renders over tooltips of hovered items.

green area is from JEI i think? fixed input items over dragged item

You can start the JEI dragging ghost item when you are on the storage tab, which renders the green target square over the items in the storage tab list. Dragging should only be available when on the crafting tab.

fixed

You can use the JEI + recipe transfer when in the storage tab, and it will change the recipe in the crafting matrix. This should either be disabled in the storage tab, or set the crafting tab as the main active tab.

fixed

For some reason, you cannot JEI ghost drag enchanted books

JEI returns "EnchantmentData" instead of the item stack itself for some reason

Using a toolbelt with tools in it does not reliably damage the right tool. Either special case handling is needed, or toolbelt logic needs to be revisited.

the toolbelt seems to be damaging the right tool from what i can see, but there are some other issues involving the active index of the toolbelt

Recipes that use as input what they output (e.g. electric wrench uses a wrench in its recipe) have extremely broken behavior. Infinite duping galore.

didn't reproduce any duping, but maybe it's fixed now

Storage view slots are accessible even when the tab is not visible; e.g. shift-double-click to pickup all matching items will pull from storage view slots while in the crafting tab. This may be a feature.

only the root page is disabled for page widgets, all children are still enabled and active

simplify attemptMatchRecipe()
add method to get base index offset from ItemHandlerList
@ghzdude ghzdude force-pushed the gh-crafting-station-mui-port branch from a461cf1 to e6589f0 Compare February 7, 2025 22:03
@Zorbatron
Copy link
Member

The crafting station seems to have issues with electric tools, but I only got this to happen once. I can't reproduce it 😕
When it was happeneing, if I set the craft to a maintenance hatch and the screwdriver is normal, it'll only accept a normal screwdriver and if it was electric, vice versa.

@Zorbatron
Copy link
Member

If you have multiple tools in a toolbelt, it won't visually have the right tool selected. In my test it has a screwdriver (slot 1) and a wrench (slot 2), and putting it in marks the screwdriver as valid, but the TB is shown to be on the wrench. Putting another wrench in the crafting station makes it work and the TB shows as the screwdriver.

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.

When doing a fluid container craft, eg our treated wood recipe, if you get to a point where the container is empty, the container is consumed instead of the recipe not being possible. You can then repeat the recipe, voiding the container, by providing extra empty containers.

Clicking a tab, Storage/Crafting, with an item in the cursor throws the item in the cursor to the ground.

Not sure at what point we should truncate item counts in the storage window. I had 1,664 items in an adjacent quantum chest, and the crafting storage window displayed that as 1.664k, which could be truncated.

The Storage panel does not work with the qunatum storage network if you add a chest onto an existing, powered network that is connected to the workbench. You have to power off the network and then repower it, and then the new inventory in the quantum network gets synced.

int j = toStack.getCount() + fromStack.getCount();
int maxSize = Math.min(toSlot.getSlotStackLimit(), fromStack.getMaxStackSize());

if (j <= maxSize) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be j < maxSize not <= right? Since if it is equal, j will be the slot limit, or max stack size, and so nothing should be inserted into that slot, since it is full.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

j is the combined stack sizes of toStack and fromStack. if the cursor has a size of 63 and the output slot a size of 1, then we couldn't take the stack because 63 + 1 < maxStackSize would be false

finalStack.getCount() < outputStack.getMaxStackSize()) {
if (!recipeLogic.performRecipe()) break;
finalStack.setCount(finalStack.getCount() + outputStack.getCount());
handleItemCraft(outputStack, getSyncManager().getPlayer());
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be passing finalStack instead of ouputStack?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no, it gets called for each recipe craft, which will always be the original output stack. the final stack is what is sent to the slots

@ghzdude
Copy link
Contributor Author

ghzdude commented Feb 12, 2025

The crafting station seems to have issues with electric tools, but I only got this to happen once. I can't reproduce it 😕 When it was happeneing, if I set the craft to a maintenance hatch and the screwdriver is normal, it'll only accept a normal screwdriver and if it was electric, vice versa.

this should be fixed now, it was an issue with the RecipeRepairItem mixin

If you have multiple tools in a toolbelt, it won't visually have the right tool selected. In my test it has a screwdriver (slot 1) and a wrench (slot 2), and putting it in marks the screwdriver as valid, but the TB is shown to be on the wrench. Putting another wrench in the crafting station makes it work and the TB shows as the screwdriver.

this isn't easily fixable, since the toolbelt can only have one tool selected at a time

@ghzdude
Copy link
Contributor Author

ghzdude commented Feb 12, 2025

When doing a fluid container craft, eg our treated wood recipe, if you get to a point where the container is empty, the container is consumed instead of the recipe not being possible. You can then repeat the recipe, voiding the container, by providing extra empty containers.

cannot reproduce

Clicking a tab, Storage/Crafting, with an item in the cursor throws the item in the cursor to the ground.

this is an issue that should be fixed in mui2

Not sure at what point we should truncate item counts in the storage window. I had 1,664 items in an adjacent quantum chest, and the crafting storage window displayed that as 1.664k, which could be truncated.

fixed

The Storage panel does not work with the qunatum storage network if you add a chest onto an existing, powered network that is connected to the workbench. You have to power off the network and then repower it, and then the new inventory in the quantum network gets synced.

handler notifs weren't being sent when the network rebuilds itself when placing new quantum storages. fixed now

@ALongStringOfNumbers
Copy link
Contributor

When doing a fluid container craft, eg our treated wood recipe, if you get to a point where the container is empty, the container is consumed instead of the recipe not being possible. You can then repeat the recipe, voiding the container, by providing extra empty containers.

cannot reproduce

Can reproduce on the latest commit using a GT bronze drum. I filled the drum up all the way (32B), went the the workbench, placed in the ghost recipe using the drum and jungle wood. Shift clicked 4 times to empty the bucket, making 4 stacks of treated wood. Normal clicked once, and the bucket vanished from the input section. Then adding a stack more of empty drums and clicking the output voided the drums, but did not actually craft anything

use format number for easy case in compact string
rename int sync value to be more appropriate
move ingredient list to CachedRecipeData
apply the ingredient to the stack when extracting
@ghzdude
Copy link
Contributor Author

ghzdude commented Feb 12, 2025

Can reproduce on the latest commit using a GT bronze drum. I filled the drum up all the way (32B), went the the workbench, placed in the ghost recipe using the drum and jungle wood. Shift clicked 4 times to empty the bucket, making 4 stacks of treated wood. Normal clicked once, and the bucket vanished from the input section. Then adding a stack more of empty drums and clicking the output voided the drums, but did not actually craft anything

okay, i see what i was doing differently.
i had imported the recipe directly from JEI (so bucket in recipe instead of drum) and that was working fine for me
i used the drum in place of the bucket in the recipe, and the issue was reproduced
it should be fixed now

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.

You can pick up itemstacks when you are ghost dragging an item, which probably should not be allowed.

When you are ghost dragging an item, you can change the tab to the storage tab, which will leave the green highlighted slots. If the target of the ghost drag gets out of focus, ie on closed or not accesible GUI, the ghost dragging should maybe be cancelled.

You can still interact with the MemorizedRecipe Widget slots when dragging an item.

Minor: The move items + in JEI shows up when you are in the crafting station GUI looking at JEI recipes, even if the recipe is not a crafting table recipe. IE, I can click the + when looking at a fluid extractor recipe.

}

// this is actually supposed to include the tool and storage inventory
// but that causes problems
Copy link
Contributor

Choose a reason for hiding this comment

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

eh, I don't think that the inventory page is supposed to contain the tool and internal inventory. It is really just a connected inventory page. So this comment is kinda not needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the older inventory page used to include the tool and internal inventory as well as the connected inventory.

.mapTo(rowSize, list));
}

public void sendHandlerToClient(PacketBuffer buffer) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This just sends the connected inventories, but the readHandler method uses all the inventories. Do we need to write the internal inventory and the tool inventory as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the internal and tool inventories exist on both sides and don't change. the only handler that can change is the connected inventory

compact ids
simplify crate change listener
address todo
only interact when not ghost dragging
@ghzdude
Copy link
Contributor Author

ghzdude commented Feb 14, 2025

You can pick up itemstacks when you are ghost dragging an item, which probably should not be allowed.

When you are ghost dragging an item, you can change the tab to the storage tab, which will leave the green highlighted slots. If the target of the ghost drag gets out of focus, ie on closed or not accesible GUI, the ghost dragging should maybe be cancelled.

You can still interact with the MemorizedRecipe Widget slots when dragging an item.

ah, if it isn't the consequences of my actions. i've fixed all three of these by preventing interaction entirely with widgets while ghost dragging.

Minor: The move items + in JEI shows up when you are in the crafting station GUI looking at JEI recipes, even if the recipe is not a crafting table recipe. IE, I can click the + when looking at a fluid extractor recipe.

i'm actually not sure why this is happening or how to fix it.

        // register transfer handler for crafting recipes
        registry.getRecipeTransferRegistry().addRecipeTransferHandler(new GregTechGuiTransferHandler(
                jeiHelpers.recipeTransferHandlerHelper()), VanillaRecipeCategoryUid.CRAFTING);

I pass in VanillaRecipeCategoryUid.CRAFTING which (i assume) marks the transfer handler as only working with crafting table recipes. and this is how the old handler for the workbench was done as well.

@ghzdude ghzdude changed the title Port/Rework Crafting Station to MUI2 Port/Rework Crafting Station to MUI2 + Misc Fixes Feb 14, 2025
@ghzdude ghzdude merged commit 4733593 into GregTechCEu:master Feb 19, 2025
3 checks passed
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
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

6 participants