Skip to content

Commit

Permalink
🐛 fix(Machine Scrap & Advanced Machine Scrap): Make recipe output 8 i…
Browse files Browse the repository at this point in the history
…tems again. Fixes #217
  • Loading branch information
ProfElements committed Sep 9, 2024
1 parent 0b7e745 commit 53004fb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -464,15 +464,15 @@ SlimefunItems.MAGIC_LUMP_1, new ItemStack(Material.REDSTONE_BLOCK), SlimefunItem
.setKey(Keys.MACHINE_SCRAP.key())
.setRecipeType(RecipeType.GRIND_STONE)
.setInput(SlimefunItems.PROGRAMMABLE_ANDROID)
.setOutput(Items.MACHINE_SCRAP.stack())
.setOutput(Items.MACHINE_SCRAP.stack(), 8)
.register();

public static final Recipe ADVANCED_MACHINE_SCRAP = Recipe.init()

.setKey(Keys.ADVANCED_MACHINE_SCRAP.key())
.setRecipeType(RecipeType.GRIND_STONE)
.setInput(SlimefunItems.PROGRAMMABLE_ANDROID_2)
.setOutput(Items.ADVANCED_MACHINE_SCRAP.stack())
.setOutput(Items.ADVANCED_MACHINE_SCRAP.stack(), 8)
.register();

public static final Recipe VEX_GEM = Recipe.init()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,12 @@ public static void setup(@Nonnull DynaTech plugin) {
Recipes.ANCIENT_MACHINE_CORE.getRecipeType(), Recipes.ANCIENT_MACHINE_CORE.getInput()).register(plugin);

new SlimefunItem(ItemGroups.RESOURCES, Items.MACHINE_SCRAP.stack(), Recipes.MACHINE_SCRAP.getRecipeType(),
Recipes.MACHINE_SCRAP.getInput(), new SlimefunItemStack(Items.MACHINE_SCRAP.stack(), 8))
Recipes.MACHINE_SCRAP.getInput(), Recipes.MACHINE_SCRAP.getOutput()[0])
.register(plugin);

new SlimefunItem(ItemGroups.RESOURCES, Items.ADVANCED_MACHINE_SCRAP.stack(),
Recipes.ADVANCED_MACHINE_SCRAP.getRecipeType(), Recipes.ADVANCED_MACHINE_SCRAP.getInput(),
new SlimefunItemStack(Items.ADVANCED_MACHINE_SCRAP.stack(), 8)).register(plugin);
Recipes.ADVANCED_MACHINE_SCRAP.getOutput()[0]).register(plugin);

new VexGem(ItemGroups.RESOURCES, Items.VEX_GEM.stack(), Recipes.VEX_GEM.getRecipeType(),
Recipes.VEX_GEM.getInput()).register(plugin);
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/me/profelements/dynatech/utils/Recipe.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ public Recipe setOutput(ItemStack output) {
return getInstance();
}

public Recipe setOutput(ItemStack output, int amount) {
Preconditions.checkNotNull(output, "This recipe's output should not be null");
var actualOutput = output.clone();
actualOutput.setAmount(amount);
this.OUTPUT = new ItemStack[] { actualOutput };
return getInstance();
}

public Recipe setOutput(ItemStack[] output) {
Preconditions.checkNotNull(output, "This recipe's output should not be null");
this.OUTPUT = output;
Expand Down

0 comments on commit 53004fb

Please sign in to comment.