This commit is contained in:
Raoul Van den Berge
2016-05-04 21:24:03 +02:00
parent 9fd1fc865b
commit fe1f7e0f2a
4 changed files with 38 additions and 8 deletions

View File

@@ -14,7 +14,10 @@ import net.minecraftforge.fml.relauncher.Side;
import refinedstorage.RefinedStorage;
import refinedstorage.RefinedStorageBlocks;
import refinedstorage.RefinedStorageItems;
import refinedstorage.block.*;
import refinedstorage.block.BlockBase;
import refinedstorage.block.EnumControllerType;
import refinedstorage.block.EnumGridType;
import refinedstorage.block.EnumStorageType;
import refinedstorage.gui.GuiHandler;
import refinedstorage.item.*;
import refinedstorage.network.*;
@@ -235,6 +238,18 @@ public class CommonProxy {
'M', new ItemStack(RefinedStorageBlocks.MACHINE_CASING)
);
// Processing Pattern Encoder
GameRegistry.addRecipe(new ItemStack(RefinedStorageBlocks.PROCESSING_PATTERN_ENCODER),
"ECE",
"PMP",
"EFE",
'E', new ItemStack(RefinedStorageItems.QUARTZ_ENRICHED_IRON),
'M', new ItemStack(RefinedStorageBlocks.MACHINE_CASING),
'P', new ItemStack(RefinedStorageItems.PATTERN),
'C', new ItemStack(Blocks.crafting_table),
'F', new ItemStack(Blocks.furnace)
);
// External Storage
GameRegistry.addRecipe(new ItemStack(RefinedStorageBlocks.EXTERNAL_STORAGE),
"CED",

View File

@@ -63,6 +63,7 @@ public class TileController extends TileBase implements IEnergyReceiver, INetwor
private List<CraftingPattern> patterns = new ArrayList<CraftingPattern>();
private List<ICraftingTask> craftingTasks = new ArrayList<ICraftingTask>();
private List<ICraftingTask> craftingTasksToAdd = new ArrayList<ICraftingTask>();
private Set<String> visited = new HashSet<String>();
@@ -172,6 +173,9 @@ public class TileController extends TileBase implements IEnergyReceiver, INetwor
}
}
craftingTasks.addAll(craftingTasksToAdd);
craftingTasksToAdd.clear();
Iterator<ICraftingTask> craftingTaskIterator = craftingTasks.iterator();
while (craftingTaskIterator.hasNext()) {
@@ -253,7 +257,15 @@ public class TileController extends TileBase implements IEnergyReceiver, INetwor
}
public void addCraftingTask(ICraftingTask task) {
craftingTasks.add(task);
craftingTasksToAdd.add(task);
}
public void addCraftingTaskForPattern(CraftingPattern pattern) {
if (pattern.isProcessing()) {
addCraftingTask(new ProcessingCraftingTask(pattern));
} else {
addCraftingTask(new BasicCraftingTask(pattern));
}
}
public List<CraftingPattern> getPatterns() {
@@ -704,11 +716,7 @@ public class TileController extends TileBase implements IEnergyReceiver, INetwor
while (quantity > 0) {
if (pattern != null) {
if (pattern.isProcessing()) {
addCraftingTask(new ProcessingCraftingTask(pattern));
} else {
addCraftingTask(new BasicCraftingTask(pattern));
}
addCraftingTaskForPattern(pattern);
quantity -= quantityPerRequest;
} else {

View File

@@ -36,7 +36,7 @@ public class BasicCraftingTask implements ICraftingTask {
CraftingPattern pattern = controller.getPatternForItem(input);
if (pattern != null) {
controller.addCraftingTask(new BasicCraftingTask(pattern));
controller.addCraftingTaskForPattern(pattern);
childTasks[i] = true;