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

MC-259583 - Last potion ingredient is deleted. #376

Open
OroArmor opened this issue Jul 7, 2024 · 0 comments
Open

MC-259583 - Last potion ingredient is deleted. #376

OroArmor opened this issue Jul 7, 2024 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@OroArmor
Copy link
Member

OroArmor commented Jul 7, 2024

We supposedly fix https://bugs.mojang.com/browse/MC-259583 but it appears to not be so. This is a problem and leads to item deletion.

See also: FabricMC/fabric#2873.

Locations to look:

@Redirect(method = "craft(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/collection/DefaultedList;)V",
at = @At(value = "INVOKE", target = "Lnet/minecraft/item/ItemStack;decrement(I)V")
)
private static void applyRecipeRemainder(ItemStack ingredient, int amount, World world, BlockPos pos, DefaultedList<ItemStack> inventory) {
RecipeRemainderLogicHandler.handleRemainderForNonPlayerCraft(
ingredient,
amount,
null,
RecipeRemainderLocation.POTION_ADDITION,
inventory,
INGREDIENT_SLOT,
world,
pos
);
}

private static Item.Settings changeDragonBreathRecipeRemainder(Item.Settings instance, Item recipeRemainder) {
// See: https://github.com/FabricMC/fabric/issues/2873
// https://bugs.mojang.com/browse/MC-259583
return new QuiltItemSettings()
.recipeRemainder((_original, _recipe) -> recipeRemainder.getDefaultStack())
.recipeRemainder((original, recipe) -> original.getCount() >= 2 ? recipeRemainder.getDefaultStack() : ItemStack.EMPTY, RecipeRemainderLocation.POTION_ADDITION);
}

@ix0rai ix0rai added bug Something isn't working good first issue Good for newcomers labels Jul 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants