Printed processors in block form solderer recipes

This commit is contained in:
Raoul Van den Berge
2016-11-27 22:50:24 +01:00
parent 05a486bfa4
commit ef2efac2c0
3 changed files with 24 additions and 14 deletions

View File

@@ -3,6 +3,7 @@ package com.raoulvdberge.refinedstorage.apiimpl.solderer;
import com.raoulvdberge.refinedstorage.RSItems;
import com.raoulvdberge.refinedstorage.api.solderer.ISoldererRecipe;
import com.raoulvdberge.refinedstorage.item.ItemProcessor;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
@@ -10,24 +11,30 @@ import javax.annotation.Nonnull;
public class SoldererRecipePrintedProcessor implements ISoldererRecipe {
private int type;
private boolean fullBlock;
private ItemStack result;
private ItemStack requirement;
public SoldererRecipePrintedProcessor(int type) {
public SoldererRecipePrintedProcessor(int type, boolean fullBlock) {
this.type = type;
this.result = new ItemStack(RSItems.PROCESSOR, 1, type);
this.fullBlock = fullBlock;
this.result = new ItemStack(RSItems.PROCESSOR, fullBlock ? 9 : 1, type);
switch (type) {
case ItemProcessor.TYPE_PRINTED_BASIC:
this.requirement = new ItemStack(Items.IRON_INGOT);
this.requirement = fullBlock ? new ItemStack(Blocks.IRON_BLOCK) : new ItemStack(Items.IRON_INGOT);
break;
case ItemProcessor.TYPE_PRINTED_IMPROVED:
this.requirement = new ItemStack(Items.GOLD_INGOT);
this.requirement = fullBlock ? new ItemStack(Blocks.GOLD_BLOCK) : new ItemStack(Items.GOLD_INGOT);
break;
case ItemProcessor.TYPE_PRINTED_ADVANCED:
this.requirement = new ItemStack(Items.DIAMOND);
this.requirement = fullBlock ? new ItemStack(Blocks.DIAMOND_BLOCK) : new ItemStack(Items.DIAMOND);
break;
case ItemProcessor.TYPE_PRINTED_SILICON:
if (fullBlock) {
throw new IllegalArgumentException("Printed silicon can't be made from block form!");
}
this.requirement = new ItemStack(RSItems.SILICON);
break;
}
@@ -49,13 +56,13 @@ public class SoldererRecipePrintedProcessor implements ISoldererRecipe {
public int getDuration() {
switch (type) {
case ItemProcessor.TYPE_PRINTED_BASIC:
return 100;
return 100 * (fullBlock ? 9 : 1);
case ItemProcessor.TYPE_PRINTED_IMPROVED:
return 150;
return 150 * (fullBlock ? 9 : 1);
case ItemProcessor.TYPE_PRINTED_ADVANCED:
return 200;
return 200 * (fullBlock ? 9 : 1);
case ItemProcessor.TYPE_PRINTED_SILICON:
return 90;
return 90 * (fullBlock ? 9 : 1);
default:
return 0;
}

View File

@@ -24,7 +24,7 @@ public class ItemHandlerBasic extends ItemStackHandler {
@Override
@Nonnull
public ItemStack insertItem(int slot, ItemStack stack, boolean simulate) {
public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) {
if (validators.length > 0) {
for (IItemValidator validator : validators) {
if (validator.isValid(stack)) {

View File

@@ -206,10 +206,13 @@ public class ProxyCommon {
OreDictionary.registerOre("itemSilicon", RSItems.SILICON);
// Processors
API.instance().getSoldererRegistry().addRecipe(new SoldererRecipePrintedProcessor(ItemProcessor.TYPE_PRINTED_BASIC));
API.instance().getSoldererRegistry().addRecipe(new SoldererRecipePrintedProcessor(ItemProcessor.TYPE_PRINTED_IMPROVED));
API.instance().getSoldererRegistry().addRecipe(new SoldererRecipePrintedProcessor(ItemProcessor.TYPE_PRINTED_ADVANCED));
API.instance().getSoldererRegistry().addRecipe(new SoldererRecipePrintedProcessor(ItemProcessor.TYPE_PRINTED_SILICON));
API.instance().getSoldererRegistry().addRecipe(new SoldererRecipePrintedProcessor(ItemProcessor.TYPE_PRINTED_BASIC, false));
API.instance().getSoldererRegistry().addRecipe(new SoldererRecipePrintedProcessor(ItemProcessor.TYPE_PRINTED_IMPROVED, false));
API.instance().getSoldererRegistry().addRecipe(new SoldererRecipePrintedProcessor(ItemProcessor.TYPE_PRINTED_ADVANCED, false));
API.instance().getSoldererRegistry().addRecipe(new SoldererRecipePrintedProcessor(ItemProcessor.TYPE_PRINTED_BASIC, true));
API.instance().getSoldererRegistry().addRecipe(new SoldererRecipePrintedProcessor(ItemProcessor.TYPE_PRINTED_IMPROVED, true));
API.instance().getSoldererRegistry().addRecipe(new SoldererRecipePrintedProcessor(ItemProcessor.TYPE_PRINTED_ADVANCED, true));
API.instance().getSoldererRegistry().addRecipe(new SoldererRecipePrintedProcessor(ItemProcessor.TYPE_PRINTED_SILICON, false));
API.instance().getSoldererRegistry().addRecipe(new SoldererRecipeProcessor(ItemProcessor.TYPE_BASIC));
API.instance().getSoldererRegistry().addRecipe(new SoldererRecipeProcessor(ItemProcessor.TYPE_IMPROVED));