Skip to content

Commit

Permalink
Don't set EMC values for inscriber presses
Browse files Browse the repository at this point in the history
  • Loading branch information
62832 committed Apr 30, 2024
1 parent 6554ad2 commit dda6ae9
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import java.util.Collection;
import java.util.Collections;
import java.util.List;

import net.minecraft.world.item.crafting.Ingredient;
import net.minecraft.world.item.crafting.Recipe;
Expand Down Expand Up @@ -39,14 +38,21 @@ public boolean canHandle(RecipeType<?> recipeType) {
return InscriberRecipe.TYPE.equals(recipeType);
}

// spotless:off
@Override
protected Collection<Ingredient> getIngredients(Recipe<?> recipe) {
if (!(recipe instanceof InscriberRecipe inscriber)) {
return Collections.emptyList();
}

return inscriber.getProcessType() == InscriberProcessType.INSCRIBE
? Collections.singletonList(inscriber.getMiddleInput())
: List.of(inscriber.getMiddleInput(), inscriber.getTopOptional(), inscriber.getBottomOptional());
if (inscriber.getProcessType() == InscriberProcessType.INSCRIBE) {
var output = inscriber.getResultItem();
return inscriber.getTopOptional().test(output) || inscriber.getBottomOptional().test(output)
? Collections.emptyList()
: Collections.singletonList(inscriber.getMiddleInput());
}

return super.getIngredients(recipe);
}
// spotless:on
}

0 comments on commit dda6ae9

Please sign in to comment.