Recipe for crafting cpu + crafting unit

This commit is contained in:
Raoul Van den Berge
2016-04-12 20:47:43 +02:00
parent 9874814303
commit e719e8895c
2 changed files with 60 additions and 4 deletions

View File

@@ -14,10 +14,7 @@ import net.minecraftforge.fml.relauncher.Side;
import refinedstorage.RefinedStorage;
import refinedstorage.RefinedStorageBlocks;
import refinedstorage.RefinedStorageItems;
import refinedstorage.block.BlockBase;
import refinedstorage.block.EnumControllerType;
import refinedstorage.block.EnumGridType;
import refinedstorage.block.EnumStorageType;
import refinedstorage.block.*;
import refinedstorage.gui.GuiHandler;
import refinedstorage.item.*;
import refinedstorage.network.*;
@@ -399,6 +396,24 @@ public class CommonProxy {
SoldererRegistry.addRecipe(new SoldererRecipeStorage(EnumStorageType.TYPE_16K, ItemStoragePart.TYPE_16K));
SoldererRegistry.addRecipe(new SoldererRecipeStorage(EnumStorageType.TYPE_64K, ItemStoragePart.TYPE_64K));
// Crafting Unit
GameRegistry.addShapedRecipe(new ItemStack(RefinedStorageBlocks.CRAFTING_UNIT),
"ECE",
"PMP",
"EDE",
'P', new ItemStack(RefinedStorageItems.PROCESSOR, 1, ItemProcessor.TYPE_BASIC),
'E', new ItemStack(RefinedStorageItems.QUARTZ_ENRICHED_IRON),
'M', new ItemStack(RefinedStorageBlocks.MACHINE_CASING),
'C', new ItemStack(RefinedStorageItems.CORE, 1, ItemCore.TYPE_CONSTRUCTION),
'D', new ItemStack(RefinedStorageItems.CORE, 1, ItemCore.TYPE_DESTRUCTION)
);
// Crafting CPUs
SoldererRegistry.addRecipe(new SoldererRecipeCraftingCPU(EnumCraftingCPUType.TYPE_1K, ItemStoragePart.TYPE_1K));
SoldererRegistry.addRecipe(new SoldererRecipeCraftingCPU(EnumCraftingCPUType.TYPE_4K, ItemStoragePart.TYPE_4K));
SoldererRegistry.addRecipe(new SoldererRecipeCraftingCPU(EnumCraftingCPUType.TYPE_16K, ItemStoragePart.TYPE_16K));
SoldererRegistry.addRecipe(new SoldererRecipeCraftingCPU(EnumCraftingCPUType.TYPE_64K, ItemStoragePart.TYPE_64K));
// Interface
SoldererRegistry.addRecipe(new SoldererRecipeInterface());
}

View File

@@ -0,0 +1,41 @@
package refinedstorage.tile.solderer;
import net.minecraft.item.ItemStack;
import refinedstorage.RefinedStorageBlocks;
import refinedstorage.RefinedStorageItems;
import refinedstorage.block.EnumCraftingCPUType;
import refinedstorage.item.ItemBlockStorage;
import refinedstorage.item.ItemProcessor;
public class SoldererRecipeCraftingCPU implements ISoldererRecipe {
private EnumCraftingCPUType type;
private int storagePart;
public SoldererRecipeCraftingCPU(EnumCraftingCPUType type, int storagePart) {
this.type = type;
this.storagePart = storagePart;
}
@Override
public ItemStack getRow(int row) {
if (row == 0) {
return new ItemStack(RefinedStorageItems.STORAGE_PART, 1, storagePart);
} else if (row == 1) {
return new ItemStack(RefinedStorageBlocks.CRAFTING_UNIT);
} else if (row == 2) {
return new ItemStack(RefinedStorageItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED);
}
return null;
}
@Override
public ItemStack getResult() {
return ItemBlockStorage.initNBT(new ItemStack(RefinedStorageBlocks.CRAFTING_CPU, 1, type.getId()));
}
@Override
public int getDuration() {
return 200;
}
}