Fixed saw addition erroring
This commit is contained in:
parent
4f061aa2d1
commit
e388b29edb
1 changed files with 12 additions and 15 deletions
|
@ -26,27 +26,24 @@ import java.util.Arrays;
|
|||
@ModOnly("betterwithmods")
|
||||
@ZenRegister
|
||||
public class Saw {
|
||||
|
||||
|
||||
@ZenMethod
|
||||
public static void add(IItemStack[] output, @NotNull IIngredient input) {
|
||||
for (IItemStack stack : input.getItems())
|
||||
add(output, stack);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void add(IItemStack[] output, @NotNull IItemStack input) {
|
||||
ItemStack stack = InputHelper.toStack(input);
|
||||
if (InputHelper.isABlock(stack)) {
|
||||
Block block = ((ItemBlock) stack.getItem()).getBlock();
|
||||
ItemStack[] outputs = InputHelper.toStacks(output);
|
||||
SawRecipe r = new SawRecipe(block, stack.getMetadata(), Arrays.asList(outputs));
|
||||
ModTweaker.LATE_ADDITIONS.add(new BMAdd("Set Saw Recipe", SawManager.WOOD_SAW, Lists.newArrayList(r)));
|
||||
for(IItemStack stacks : input.getItems()) {
|
||||
ItemStack stack = InputHelper.toStack(stacks);
|
||||
if(InputHelper.isABlock(stack)) {
|
||||
Block block = ((ItemBlock) stack.getItem()).getBlock();
|
||||
ItemStack[] outputs = InputHelper.toStacks(output);
|
||||
SawRecipe r = new SawRecipe(block, stack.getMetadata(), Arrays.asList(outputs));
|
||||
ModTweaker.LATE_ADDITIONS.add(new BMAdd("Set Saw Recipe", SawManager.WOOD_SAW, Lists.newArrayList(r)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ZenMethod
|
||||
public static void remove(IItemStack input) {
|
||||
ModTweaker.LATE_REMOVALS.add(new BMRemove("Remove Saw Recipe", SawManager.WOOD_SAW, InputHelper.toStack(input)));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue