Skip to content

Commit

Permalink
Fix Energized Steel output count
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremiahwinsley committed Sep 30, 2024
1 parent 3ef3740 commit c4d6fa3
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
}
],
"result": {
"count": 1,
"count": 2,
"id": "powah:energized_steel_block"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
}
],
"result": {
"count": 1,
"count": 2,
"id": "allthecompressed:energized_steel_block_1x"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
}
],
"result": {
"count": 1,
"count": 2,
"id": "allthecompressed:energized_steel_block_2x"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
}
],
"result": {
"count": 1,
"count": 2,
"id": "allthecompressed:energized_steel_block_3x"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
}
],
"result": {
"count": 1,
"count": 2,
"id": "allthecompressed:energized_steel_block_4x"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.crafting.Ingredient;
import net.minecraft.world.level.block.Blocks;
import net.neoforged.neoforge.registries.DeferredItem;
import owmii.powah.block.energizing.EnergizingRecipe;

import java.util.ArrayList;
Expand All @@ -19,16 +18,22 @@

public class EnergizingRecipeBuilder {
final Overlays overlay;
final int count;

long energy = 0L;
List<Overlays> ingredients = new ArrayList<>();

public EnergizingRecipeBuilder(Overlays overlay) {
public EnergizingRecipeBuilder(Overlays overlay, int count) {
this.overlay = overlay;
this.count = count;
}

public static EnergizingRecipeBuilder build(Overlays overlays) {
return new EnergizingRecipeBuilder(overlays);
return new EnergizingRecipeBuilder(overlays, 1);
}

public static EnergizingRecipeBuilder build(Overlays overlays, int count) {
return new EnergizingRecipeBuilder(overlays, count);
}

public EnergizingRecipeBuilder setEnergy(long energy) {
Expand Down Expand Up @@ -61,13 +66,13 @@ public void save(RecipeOutput powah) {
continue;
}

output = new ItemStack(block.get(), 1);
output = new ItemStack(block.get(), count);
for (Overlays ingredient : ingredients) {
var iblock = BuiltInRegistries.BLOCK.getOrThrow(ResourceKey.create(Registries.BLOCK, ingredient.overlay.parent));
inputs.add(Ingredient.of(iblock));
}
} else {
output = overlay.overlay.iall.get(i - 1).toStack();
output = overlay.overlay.iall.get(i - 1).toStack().copyWithCount(count);
for (Overlays ingredient : ingredients) {
inputs.add(Ingredient.of(ingredient.overlay.iall.get(i - 1)));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ protected void buildRecipes(RecipeOutput consumer) {
protected void energizingRecipes(RecipeOutput consumer) {
RecipeOutput powah = consumer.withConditions(new ModLoadedCondition(Powah.MOD_ID));

EnergizingRecipeBuilder.build(Overlays.ENERGIZED_STEEL)
EnergizingRecipeBuilder.build(Overlays.ENERGIZED_STEEL, 2)
.setEnergy(90_000)
.addIngredient(Overlays.IRON)
.addIngredient(Overlays.GOLD)
Expand Down

0 comments on commit c4d6fa3

Please sign in to comment.