Skip to content

Commit

Permalink
Fixed inputs getter
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDarkDnKTv committed Oct 28, 2021
1 parent 7230afe commit 4c85780
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
12 changes: 11 additions & 1 deletion src/main/java/gregtech/api/recipes/crafttweaker/CTRecipe.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,19 @@ public CTRecipe(RecipeMap<?> recipeMap, Recipe backingRecipe) {
@ZenGetter("inputs")
public List<InputIngredient> getInputs() {
return this.backingRecipe.getInputs().stream()
.filter(out -> out.getCount() > 0)
.map(InputIngredient::new)
.collect(Collectors.toList());
}

@ZenGetter("nonConsumable")
public List<InputIngredient> getNonConsumableInputs() {
return this.backingRecipe.getInputs().stream()
.filter(out -> out.getCount() < 1)
.map(InputIngredient::new)
.collect(Collectors.toList());
}

@ZenGetter("outputs")
public List<IItemStack> getOutputs() {
return this.backingRecipe.getOutputs().stream()
Expand All @@ -50,7 +59,8 @@ public List<IItemStack> getResultItemOutputs(@Optional(valueLong = -1) long rand
.map(MCItemStack::new)
.collect(Collectors.toList());
}


@Deprecated
@ZenGetter("changedOutputs")
public List<ChancedEntry> getChancedOutputs() {
ArrayList<ChancedEntry> result = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@
public class InputIngredient implements IIngredient {

private final IIngredient iingredient;
private final int amount;

public InputIngredient(CountableIngredient backingIngredient) {
iingredient = CraftTweakerMC
.getIIngredient(backingIngredient.getIngredient())
.amount(backingIngredient.getCount());
.amount(1);
amount = backingIngredient.getCount();
}

@Override
Expand All @@ -30,7 +32,7 @@ public String getMark() {

@Override
public int getAmount() {
return iingredient.getAmount();
return amount;
}

@Override
Expand Down

0 comments on commit 4c85780

Please sign in to comment.