Skip to content

Improve AspectHelper#379

Open
brachy84 wants to merge 2 commits intomasterfrom
thaum
Open

Improve AspectHelper#379
brachy84 wants to merge 2 commits intomasterfrom
thaum

Conversation

@brachy84
Copy link
Copy Markdown
Member

  • replace OreDictIngredient with IIngredient
  • remove ItemStack methods if possible (since its an IIngredient)

Copy link
Copy Markdown
Collaborator

@WaitingIdly WaitingIdly left a comment

Choose a reason for hiding this comment

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

seems functional

@MethodDescription(description = "groovyscript.wiki.thaumcraft.aspect_helper.add_item", type = MethodDescription.Type.ADDITION)
public void add(ItemStack item, AspectStack aspect) {
this.add(item, aspect, true);
public void add(IIngredient oreDict, AspectStack aspect) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

maybe rename oreDict to ingredient? (also in a few other places)

public void add(IIngredient ingredient, AspectStack aspect, boolean doBackup) {
if (ingredient != null && aspect != null) {
ItemStack[] ores = ingredient.getMatchingStacks();
if (ores != null) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

i dont think we do nullchecks for IIngredient#getMatchingStacks - it should always be an empty array. also applies to line 218.

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