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

Remove hard-coded disassembly item from crafting blocks, use recipe IDs instead #7396

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

62832
Copy link
Member

@62832 62832 commented Sep 10, 2023

Partly addresses #6934.

inventory.setItem(inventory.selected, ItemStack.EMPTY);

for (var ingredient : recipe.get().getIngredients()) {
var ingredientStack = new ItemStack(ingredient.getItems()[0].getItem(), inventory.getSelected().getCount());
Copy link
Member

Choose a reason for hiding this comment

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

Have to test for empty ingredient.
Also -> If the ingredient is a tag-ingredient, this may have VERY unintended consequences.

Copy link
Member Author

@62832 62832 Sep 10, 2023

Choose a reason for hiding this comment

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

Might it be a good idea then to outright prevent disassembly if a tag is used for the ingredient? Or, in general, suppressing disassembly if the ingredient can be of more than one item?

}

private void disassemble(ItemStack stack, Player player) {
protected ResourceLocation getRecipeId() {
Copy link
Member

Choose a reason for hiding this comment

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

Rename -> getDisassembleRecipeId()

Copy link
Member

Choose a reason for hiding this comment

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

And I am not sure this reverse lookup is a good idea. It might instead just be a property passed in at item creation time.

Copy link
Member Author

Choose a reason for hiding this comment

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

I assumed this was okay to do from the fact that this is already done for portable cells.

@shartte shartte changed the base branch from master to main November 11, 2023 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants