-
Notifications
You must be signed in to change notification settings - Fork 419
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
Support stack aware recipe remainders 1.19.2 #2556
Conversation
…v1/FabricItem.java Co-authored-by: apple502j <[email protected]>
…v1/FabricItem.java Co-authored-by: apple502j <[email protected]>
…v1/FabricItem.java Co-authored-by: apple502j <[email protected]>
…v1/FabricItem.java Co-authored-by: apple502j <[email protected]>
…v1/FabricItem.java Co-authored-by: apple502j <[email protected]>
…/RecipeRemainderHandler.java Co-authored-by: Technici4n <[email protected]>
…tem/CustomDamageTest.java Co-authored-by: Salvatore Peluso <[email protected]>
…m/AbstractFurnaceBlockEntityMixin.java Co-authored-by: Salvatore Peluso <[email protected]>
fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java
Outdated
Show resolved
Hide resolved
…v1/FabricItem.java Co-authored-by: Technici4n <[email protected]>
fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItemStack.java
Show resolved
Hide resolved
fabric-item-api-v1/src/testmod/java/net/fabricmc/fabric/test/item/CustomDamageTest.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few extra things I noticed while reviewing the PR, but nothing major. This is looking pretty good!
...tem-api-v1/src/main/java/net/fabricmc/fabric/mixin/item/AbstractFurnaceBlockEntityMixin.java
Show resolved
Hide resolved
...c-item-api-v1/src/main/java/net/fabricmc/fabric/mixin/item/BrewingStandBlockEntityMixin.java
Show resolved
Hide resolved
fabric-item-api-v1/src/main/java/net/fabricmc/fabric/mixin/item/RecipeMixin.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For other things i've tested and it works great.
fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java
Outdated
Show resolved
Hide resolved
…v1/FabricItemStack.java Co-authored-by: Technici4n <[email protected]>
…v1/FabricItem.java Co-authored-by: Salvatore Peluso <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The API and changes look great just a few nit picks. Nice work 👍
However I think extra care needs to be taken with this PR to help ensure that existing behaviour is not altered. This PR has some very delicate mixins touching some very delicate parts of the game. Updating to newer MC will have a good chance at silently breaking this logic.
Unlike some other hooks that clearly can only affect the behavour when mods are being used this has a high possibility of changing vanilla behavour when only fabric API is installed.
I hope you don't mind but I have added a gametest that fully tests the furnace part of this PR. It would be great to see the same done for the brewing stand and possibly the recipe (Will need a different approach) to help ensure the stability of this when going to newer MC versions.
Thanks a lot, let me know if you have any questions.
...tem-api-v1/src/main/java/net/fabricmc/fabric/mixin/item/AbstractFurnaceBlockEntityMixin.java
Outdated
Show resolved
Hide resolved
fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItemStack.java
Outdated
Show resolved
Hide resolved
fabric-item-api-v1/src/testmod/java/net/fabricmc/fabric/test/item/CustomDamageTest.java
Outdated
Show resolved
Hide resolved
...c-item-api-v1/src/main/java/net/fabricmc/fabric/mixin/item/BrewingStandBlockEntityMixin.java
Outdated
Show resolved
Hide resolved
...tem-api-v1/src/main/java/net/fabricmc/fabric/mixin/item/AbstractFurnaceBlockEntityMixin.java
Outdated
Show resolved
Hide resolved
fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java
Outdated
Show resolved
Hide resolved
fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java
Outdated
Show resolved
Hide resolved
...c-item-api-v1/src/main/java/net/fabricmc/fabric/mixin/item/BrewingStandBlockEntityMixin.java
Show resolved
Hide resolved
...c-item-api-v1/src/main/java/net/fabricmc/fabric/mixin/item/BrewingStandBlockEntityMixin.java
Show resolved
Hide resolved
...ding-api-v1/src/testmod/java/net/fabricmc/fabric/test/client/keybinding/KeyBindingsTest.java
Outdated
Show resolved
Hide resolved
…e remainder stack instead of the original stack, refactoring.
…metest compairing stacks with themselves.
I've added the remaining tests for brewing stand and recipe, please check them 👍 |
Add automatized gametests for brewing stand and recipe mixins, fixed and tweaked something.
Use (0,1,0) position for game tests
fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java
Outdated
Show resolved
Hide resolved
...c-item-api-v1/src/main/java/net/fabricmc/fabric/mixin/item/BrewingStandBlockEntityMixin.java
Outdated
Show resolved
Hide resolved
...c-item-api-v1/src/main/java/net/fabricmc/fabric/mixin/item/BrewingStandBlockEntityMixin.java
Show resolved
Hide resolved
...tem-api-v1/src/main/java/net/fabricmc/fabric/mixin/item/AbstractFurnaceBlockEntityMixin.java
Outdated
Show resolved
Hide resolved
fabric-item-api-v1/src/main/java/net/fabricmc/fabric/impl/item/RecipeRemainderHandler.java
Outdated
Show resolved
Hide resolved
* Support stack aware recipe remainders * Fix checkstyle * Remove all overwrites * Add FabricItemStack and make RecipeRemainderHandler thread safe * Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java Co-authored-by: apple502j <[email protected]> * Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java Co-authored-by: apple502j <[email protected]> * Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java Co-authored-by: apple502j <[email protected]> * Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java Co-authored-by: apple502j <[email protected]> * Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java Co-authored-by: apple502j <[email protected]> * Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/impl/item/RecipeRemainderHandler.java Co-authored-by: Technici4n <[email protected]> * Remove hasRecipeRemainder, Update test mod and remove unneeded mixins * Update fabric-item-api-v1/src/testmod/java/net/fabricmc/fabric/test/item/CustomDamageTest.java Co-authored-by: Salvatore Peluso <[email protected]> * Avoid copying the ItemStack * Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/mixin/item/AbstractFurnaceBlockEntityMixin.java Co-authored-by: Salvatore Peluso <[email protected]> * Sneakily change duplicate keybinding to a less used key * make everything thread safe and improve AbstractFurnaceBlockEntityMixin * Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java Co-authored-by: Technici4n <[email protected]> * Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItemStack.java Co-authored-by: Technici4n <[email protected]> * Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java Co-authored-by: Salvatore Peluso <[email protected]> * clear thread local and change field prefix * forgot the allow * Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java Co-authored-by: Salvatore Peluso <[email protected]> * Update fabric-item-api-v1/src/testmod/java/net/fabricmc/fabric/test/item/CustomDamageTest.java Co-authored-by: Technici4n <[email protected]> * Add FurnaceGameTest * Change test keybind back to LShift * Fix brewing stand remainder and fix nitpicks * add code example to remainder javadoc * Fixed and reformatted docs, changed recipe mixin behavior to store the remainder stack instead of the original stack, refactoring. * Added gametests for brewing stand and recipe mixins, fixed furnace gametest compairing stacks with themselves. * Use (0,1,0) position for game tests * Review changes Co-authored-by: apple502j <[email protected]> Co-authored-by: Technici4n <[email protected]> Co-authored-by: Salvatore Peluso <[email protected]> Co-authored-by: modmuss50 <[email protected]> (cherry picked from commit fa140d5)
* Support stack aware recipe remainders * Fix checkstyle * Remove all overwrites * Add FabricItemStack and make RecipeRemainderHandler thread safe * Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java Co-authored-by: apple502j <[email protected]> * Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java Co-authored-by: apple502j <[email protected]> * Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java Co-authored-by: apple502j <[email protected]> * Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java Co-authored-by: apple502j <[email protected]> * Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java Co-authored-by: apple502j <[email protected]> * Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/impl/item/RecipeRemainderHandler.java Co-authored-by: Technici4n <[email protected]> * Remove hasRecipeRemainder, Update test mod and remove unneeded mixins * Update fabric-item-api-v1/src/testmod/java/net/fabricmc/fabric/test/item/CustomDamageTest.java Co-authored-by: Salvatore Peluso <[email protected]> * Avoid copying the ItemStack * Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/mixin/item/AbstractFurnaceBlockEntityMixin.java Co-authored-by: Salvatore Peluso <[email protected]> * Sneakily change duplicate keybinding to a less used key * make everything thread safe and improve AbstractFurnaceBlockEntityMixin * Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java Co-authored-by: Technici4n <[email protected]> * Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItemStack.java Co-authored-by: Technici4n <[email protected]> * Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java Co-authored-by: Salvatore Peluso <[email protected]> * clear thread local and change field prefix * forgot the allow * Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java Co-authored-by: Salvatore Peluso <[email protected]> * Update fabric-item-api-v1/src/testmod/java/net/fabricmc/fabric/test/item/CustomDamageTest.java Co-authored-by: Technici4n <[email protected]> * Add FurnaceGameTest * Change test keybind back to LShift * Fix brewing stand remainder and fix nitpicks * add code example to remainder javadoc * Fixed and reformatted docs, changed recipe mixin behavior to store the remainder stack instead of the original stack, refactoring. * Added gametests for brewing stand and recipe mixins, fixed furnace gametest compairing stacks with themselves. * Use (0,1,0) position for game tests * Review changes Co-authored-by: apple502j <[email protected]> Co-authored-by: Technici4n <[email protected]> Co-authored-by: Salvatore Peluso <[email protected]> Co-authored-by: modmuss50 <[email protected]> (cherry picked from commit fa140d5)
* Support stack aware recipe remainders (FabricMC#2556) * Support stack aware recipe remainders * Fix checkstyle * Remove all overwrites * Add FabricItemStack and make RecipeRemainderHandler thread safe * Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java Co-authored-by: apple502j <[email protected]> * Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java Co-authored-by: apple502j <[email protected]> * Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java Co-authored-by: apple502j <[email protected]> * Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java Co-authored-by: apple502j <[email protected]> * Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java Co-authored-by: apple502j <[email protected]> * Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/impl/item/RecipeRemainderHandler.java Co-authored-by: Technici4n <[email protected]> * Remove hasRecipeRemainder, Update test mod and remove unneeded mixins * Update fabric-item-api-v1/src/testmod/java/net/fabricmc/fabric/test/item/CustomDamageTest.java Co-authored-by: Salvatore Peluso <[email protected]> * Avoid copying the ItemStack * Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/mixin/item/AbstractFurnaceBlockEntityMixin.java Co-authored-by: Salvatore Peluso <[email protected]> * Sneakily change duplicate keybinding to a less used key * make everything thread safe and improve AbstractFurnaceBlockEntityMixin * Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java Co-authored-by: Technici4n <[email protected]> * Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItemStack.java Co-authored-by: Technici4n <[email protected]> * Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java Co-authored-by: Salvatore Peluso <[email protected]> * clear thread local and change field prefix * forgot the allow * Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java Co-authored-by: Salvatore Peluso <[email protected]> * Update fabric-item-api-v1/src/testmod/java/net/fabricmc/fabric/test/item/CustomDamageTest.java Co-authored-by: Technici4n <[email protected]> * Add FurnaceGameTest * Change test keybind back to LShift * Fix brewing stand remainder and fix nitpicks * add code example to remainder javadoc * Fixed and reformatted docs, changed recipe mixin behavior to store the remainder stack instead of the original stack, refactoring. * Added gametests for brewing stand and recipe mixins, fixed furnace gametest compairing stacks with themselves. * Use (0,1,0) position for game tests * Review changes Co-authored-by: apple502j <[email protected]> Co-authored-by: Technici4n <[email protected]> Co-authored-by: Salvatore Peluso <[email protected]> Co-authored-by: modmuss50 <[email protected]> (cherry picked from commit fa140d5) * Bump version * Update to Fabric API 0.67.0 * Update fabric-item-api-v1/src/testmod/resources/fabric-item-api-tests-v1.mixins.json Co-authored-by: Ennui Langeweile <[email protected]> Co-authored-by: AlphaMode <[email protected]> Co-authored-by: modmuss50 <[email protected]> Co-authored-by: Ennui Langeweile <[email protected]>
* Fix shulker boxes accepting other shulkers when using a directionless `InventoryStorage` (FabricMC#2669) * Fix shulker boxes accepting other shulkers If a mod creates a directionless InventoryStorage, it only calls Inventory.isValid and not SidedInventory.canInsert. However, shulker boxes only override the latter, allowing shulkers to be inserted into them. * Check for insertion in inventorySlotWrapper instead * Load modded translations on the server (FabricMC#2668) * Load modded translations on the server * Don't load built-in mods * Adjust nether biomes injection point (FabricMC#2666) Co-authored-by: apple502j <[email protected]> * Add access widener for `ItemModelGenerator#writer` (FabricMC#2635) Allows for the use of custom Models and TextureMaps for generating item models. * Fixed ScreenEvents Javadoc (FabricMC#2618) (cherry picked from commit 33716ae) * Split all duplicated packages (FabricMC#2617) * Move duplicated v0/v1 impl packages to v0 subpackages Fixes FabricMC#2616. The convention is adopted from the command API (v1) whose impl classes have the v1 subpackage. * Separate client code into its own packages everywhere * Fix code style * Fix code style, part 2 * Allow v0 in package names * Allow v0 in package names (fixed) * Support stack aware recipe remainders (FabricMC#2556) * Support stack aware recipe remainders * Fix checkstyle * Remove all overwrites * Add FabricItemStack and make RecipeRemainderHandler thread safe * Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java Co-authored-by: apple502j <[email protected]> * Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java Co-authored-by: apple502j <[email protected]> * Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java Co-authored-by: apple502j <[email protected]> * Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java Co-authored-by: apple502j <[email protected]> * Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java Co-authored-by: apple502j <[email protected]> * Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/impl/item/RecipeRemainderHandler.java Co-authored-by: Technici4n <[email protected]> * Remove hasRecipeRemainder, Update test mod and remove unneeded mixins * Update fabric-item-api-v1/src/testmod/java/net/fabricmc/fabric/test/item/CustomDamageTest.java Co-authored-by: Salvatore Peluso <[email protected]> * Avoid copying the ItemStack * Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/mixin/item/AbstractFurnaceBlockEntityMixin.java Co-authored-by: Salvatore Peluso <[email protected]> * Sneakily change duplicate keybinding to a less used key * make everything thread safe and improve AbstractFurnaceBlockEntityMixin * Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java Co-authored-by: Technici4n <[email protected]> * Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItemStack.java Co-authored-by: Technici4n <[email protected]> * Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java Co-authored-by: Salvatore Peluso <[email protected]> * clear thread local and change field prefix * forgot the allow * Update fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java Co-authored-by: Salvatore Peluso <[email protected]> * Update fabric-item-api-v1/src/testmod/java/net/fabricmc/fabric/test/item/CustomDamageTest.java Co-authored-by: Technici4n <[email protected]> * Add FurnaceGameTest * Change test keybind back to LShift * Fix brewing stand remainder and fix nitpicks * add code example to remainder javadoc * Fixed and reformatted docs, changed recipe mixin behavior to store the remainder stack instead of the original stack, refactoring. * Added gametests for brewing stand and recipe mixins, fixed furnace gametest compairing stacks with themselves. * Use (0,1,0) position for game tests * Review changes Co-authored-by: apple502j <[email protected]> Co-authored-by: Technici4n <[email protected]> Co-authored-by: Salvatore Peluso <[email protected]> Co-authored-by: modmuss50 <[email protected]> * Fix FabricMC#2657: Transfer API edge case with bad isValid overrides (FabricMC#2659) Co-authored-by: modmuss50 <[email protected]> * Only load default language on the server. * Bump version * Cleanup licenses and imports * Fix mod/mixin.json's * Port recipe remainder api Co-authored-by: Jonathan Coates <[email protected]> Co-authored-by: modmuss50 <[email protected]> Co-authored-by: apple502j <[email protected]> Co-authored-by: 90 <[email protected]> Co-authored-by: Kevinthegreat <[email protected]> Co-authored-by: Juuz <[email protected]> Co-authored-by: AlphaMode <[email protected]> Co-authored-by: Technici4n <[email protected]> Co-authored-by: Salvatore Peluso <[email protected]>
This pull request changed vanilla mechanics by using recipe remainders in brewing stands, as documented in #2873. |
This PR allows modders to add stack aware recipe remainders
This is useful for mods that adds custom buckets that support different fluids
This address the long lasting issue #50
Reopened from #2464