Fix all bugs, crafting task saving to disk done.

This commit is contained in:
Raoul Van den Berge
2016-05-08 16:24:42 +02:00
parent 59772fd303
commit ace6a56ffe
5 changed files with 13 additions and 6 deletions

View File

@@ -4,8 +4,7 @@
WIP WIP
**TODO** **TODO**
- Saving crafting task state - Crafter direction
- Cancelling all crafting tasks
- Textures - Textures
- Update wiki - Update wiki

View File

@@ -52,7 +52,7 @@ public class GuiCrafter extends GuiBase {
if (crafter.getStackInSlot(i) != null) { if (crafter.getStackInSlot(i) != null) {
ItemStack pattern = crafter.getStackInSlot(i); ItemStack pattern = crafter.getStackInSlot(i);
String text = "Processing"; String text = t("misc.refinedstorage:processing");
if (!ItemPattern.isProcessing(pattern)) { if (!ItemPattern.isProcessing(pattern)) {
ItemStack result = ItemPattern.getOutputs(pattern)[0]; ItemStack result = ItemPattern.getOutputs(pattern)[0];
@@ -66,7 +66,7 @@ public class GuiCrafter extends GuiBase {
float scale = 0.5f; float scale = 0.5f;
GlStateManager.scale(scale, scale, 1); GlStateManager.scale(scale, scale, 1);
drawString(calculateOffsetOnScale(x + (ItemPattern.isProcessing(pattern) ? 0 : 20), scale), calculateOffsetOnScale(y + 6, scale), text); drawString(calculateOffsetOnScale(x + (ItemPattern.isProcessing(pattern) ? 5 : 20), scale), calculateOffsetOnScale(y + 6, scale), text);
GlStateManager.popMatrix(); GlStateManager.popMatrix();
} }

View File

@@ -520,10 +520,10 @@ public class TileController extends TileBase implements IEnergyReceiver, INetwor
NBTTagCompound taskTag = taskList.getCompoundTagAt(i); NBTTagCompound taskTag = taskList.getCompoundTagAt(i);
switch (taskTag.getInteger("Type")) { switch (taskTag.getInteger("Type")) {
case 0: case BasicCraftingTask.ID:
addCraftingTask(new BasicCraftingTask(taskTag)); addCraftingTask(new BasicCraftingTask(taskTag));
break; break;
case 1: case ProcessingCraftingTask.ID:
addCraftingTask(new ProcessingCraftingTask(taskTag)); addCraftingTask(new ProcessingCraftingTask(taskTag));
break; break;
} }

View File

@@ -36,6 +36,7 @@ public class CraftingPattern {
if (crafter == null) { if (crafter == null) {
crafter = (TileCrafter) world.getTileEntity(new BlockPos(crafterX, crafterY, crafterZ)); crafter = (TileCrafter) world.getTileEntity(new BlockPos(crafterX, crafterY, crafterZ));
} }
return crafter; return crafter;
} }

View File

@@ -4,6 +4,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList; import net.minecraft.nbt.NBTTagList;
import net.minecraft.util.text.TextFormatting; import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.common.util.Constants;
import refinedstorage.tile.TileController; import refinedstorage.tile.TileController;
import refinedstorage.tile.autocrafting.CraftingPattern; import refinedstorage.tile.autocrafting.CraftingPattern;
import refinedstorage.util.NBTUtils; import refinedstorage.util.NBTUtils;
@@ -37,6 +38,12 @@ public class BasicCraftingTask implements ICraftingTask {
this.satisfied = NBTUtils.readBoolArray(tag, NBT_SATISFIED); this.satisfied = NBTUtils.readBoolArray(tag, NBT_SATISFIED);
this.checked = NBTUtils.readBoolArray(tag, NBT_CHECKED); this.checked = NBTUtils.readBoolArray(tag, NBT_CHECKED);
this.childTasks = NBTUtils.readBoolArray(tag, NBT_CHILD_TASKS); this.childTasks = NBTUtils.readBoolArray(tag, NBT_CHILD_TASKS);
NBTTagList tookList = tag.getTagList(NBT_TOOK, Constants.NBT.TAG_COMPOUND);
for (int i = 0; i < tookList.tagCount(); ++i) {
itemsTook.add(ItemStack.loadItemStackFromNBT(tookList.getCompoundTagAt(i)));
}
} }
public CraftingPattern getPattern() { public CraftingPattern getPattern() {