Lots of work on Formulaic Assemblicators, still need to do a good bit of polishing

This commit is contained in:
aidancbrady 2016-03-15 17:34:17 -04:00
parent 1dfc35c6dd
commit 779c2c49e7
6 changed files with 246 additions and 33 deletions

View file

@ -1,7 +1,9 @@
package mekanism.client.gui; package mekanism.client.gui;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import mekanism.api.Coord4D;
import mekanism.api.util.ListUtils; import mekanism.api.util.ListUtils;
import mekanism.client.gui.element.GuiElement.IInfoHandler; import mekanism.client.gui.element.GuiElement.IInfoHandler;
import mekanism.client.gui.element.GuiEnergyInfo; import mekanism.client.gui.element.GuiEnergyInfo;
@ -12,7 +14,9 @@ import mekanism.client.gui.element.GuiSlot;
import mekanism.client.gui.element.GuiSlot.SlotOverlay; import mekanism.client.gui.element.GuiSlot.SlotOverlay;
import mekanism.client.gui.element.GuiSlot.SlotType; import mekanism.client.gui.element.GuiSlot.SlotType;
import mekanism.client.gui.element.GuiTransporterConfigTab; import mekanism.client.gui.element.GuiTransporterConfigTab;
import mekanism.common.Mekanism;
import mekanism.common.inventory.container.ContainerFormulaicAssemblicator; import mekanism.common.inventory.container.ContainerFormulaicAssemblicator;
import mekanism.common.network.PacketTileEntity.TileEntityMessage;
import mekanism.common.tile.TileEntityFormulaicAssemblicator; import mekanism.common.tile.TileEntityFormulaicAssemblicator;
import mekanism.common.util.LangUtils; import mekanism.common.util.LangUtils;
import mekanism.common.util.MekanismUtils; import mekanism.common.util.MekanismUtils;
@ -36,7 +40,7 @@ public class GuiFormulaicAssemblicator extends GuiMekanism
guiElements.add(new GuiRedstoneControl(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiFormulaicAssemblicator.png"))); guiElements.add(new GuiRedstoneControl(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiFormulaicAssemblicator.png")));
guiElements.add(new GuiSideConfigurationTab(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiFormulaicAssemblicator.png"))); guiElements.add(new GuiSideConfigurationTab(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiFormulaicAssemblicator.png")));
guiElements.add(new GuiTransporterConfigTab(this, 34, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiFormulaicAssemblicator.png"))); guiElements.add(new GuiTransporterConfigTab(this, 34, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiFormulaicAssemblicator.png")));
guiElements.add(new GuiPowerBar(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiFormulaicAssemblicator.png"), 159, 16)); guiElements.add(new GuiPowerBar(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiFormulaicAssemblicator.png"), 159, 15));
guiElements.add(new GuiEnergyInfo(new IInfoHandler() { guiElements.add(new GuiEnergyInfo(new IInfoHandler() {
@Override @Override
public List<String> getInfo() public List<String> getInfo()
@ -45,7 +49,7 @@ public class GuiFormulaicAssemblicator extends GuiMekanism
return ListUtils.asList(LangUtils.localize("gui.using") + ": " + multiplier + "/t", LangUtils.localize("gui.needed") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy())); return ListUtils.asList(LangUtils.localize("gui.using") + ": " + multiplier + "/t", LangUtils.localize("gui.needed") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
} }
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiFormulaicAssemblicator.png"))); }, this, MekanismUtils.getResource(ResourceType.GUI, "GuiFormulaicAssemblicator.png")));
guiElements.add(new GuiSlot(SlotType.POWER, this, MekanismUtils.getResource(ResourceType.GUI, "GuiFormulaicAssemblicator.png"), 154, 75).with(SlotOverlay.POWER)); guiElements.add(new GuiSlot(SlotType.POWER, this, MekanismUtils.getResource(ResourceType.GUI, "GuiFormulaicAssemblicator.png"), 151, 75).with(SlotOverlay.POWER));
ySize+=64; ySize+=64;
} }
@ -53,9 +57,38 @@ public class GuiFormulaicAssemblicator extends GuiMekanism
@Override @Override
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
{ {
int xAxis = (mouseX - (width - xSize) / 2);
int yAxis = (mouseY - (height - ySize) / 2);
fontRendererObj.drawString(tileEntity.getInventoryName(), (xSize/2)-(fontRendererObj.getStringWidth(tileEntity.getInventoryName())/2), 6, 0x404040); fontRendererObj.drawString(tileEntity.getInventoryName(), (xSize/2)-(fontRendererObj.getStringWidth(tileEntity.getInventoryName())/2), 6, 0x404040);
fontRendererObj.drawString(LangUtils.localize("container.inventory"), 8, (ySize - 96) + 2, 0x404040); fontRendererObj.drawString(LangUtils.localize("container.inventory"), 8, (ySize - 96) + 2, 0x404040);
if(!tileEntity.autoMode)
{
/*if(xAxis >= 7 && xAxis <= 21 && yAxis >= 45 && yAxis <= 59)
{
drawTexturedModalRect(guiWidth + 7, guiHeight + 45, 176, 0, 14, 14);
}
if(xAxis >= 71 && xAxis <= 87 && yAxis >= 75 && yAxis <= 91)
{
drawTexturedModalRect(guiWidth + 71, guiHeight + 75, 176 + 14, 0, 16, 16);
}
if(xAxis >= 89 && xAxis <= 105 && yAxis >= 75 && yAxis <= 91)
{
drawTexturedModalRect(guiWidth + 89, guiHeight + 75, 176 + 30, 0, 16, 16);
}*/
}
if(tileEntity.formula != null)
{
if(xAxis >= 107 && xAxis <= 123 && yAxis >= 75 && yAxis <= 91)
{
}
}
super.drawGuiContainerForegroundLayer(mouseX, mouseY); super.drawGuiContainerForegroundLayer(mouseX, mouseY);
} }
@ -68,6 +101,105 @@ public class GuiFormulaicAssemblicator extends GuiMekanism
int guiHeight = (height - ySize) / 2; int guiHeight = (height - ySize) / 2;
drawTexturedModalRect(guiWidth, guiHeight, 0, 0, xSize, ySize); drawTexturedModalRect(guiWidth, guiHeight, 0, 0, xSize, ySize);
int xAxis = mouseX - guiWidth;
int yAxis = mouseY - guiHeight;
if(!tileEntity.autoMode)
{
if(xAxis >= 7 && xAxis <= 21 && yAxis >= 45 && yAxis <= 59)
{
drawTexturedModalRect(guiWidth + 7, guiHeight + 45, 176, 0, 14, 14);
}
else {
drawTexturedModalRect(guiWidth + 7, guiHeight + 45, 176, 14, 14, 14);
}
if(xAxis >= 71 && xAxis <= 87 && yAxis >= 75 && yAxis <= 91)
{
drawTexturedModalRect(guiWidth + 71, guiHeight + 75, 176 + 14, 0, 16, 16);
}
else {
drawTexturedModalRect(guiWidth + 71, guiHeight + 75, 176 + 14, 16, 16, 16);
}
if(xAxis >= 89 && xAxis <= 105 && yAxis >= 75 && yAxis <= 91)
{
drawTexturedModalRect(guiWidth + 89, guiHeight + 75, 176 + 30, 0, 16, 16);
}
else {
drawTexturedModalRect(guiWidth + 89, guiHeight + 75, 176 + 30, 16, 16, 16);
}
}
else {
drawTexturedModalRect(guiWidth + 7, guiHeight + 45, 176, 28, 14, 14);
drawTexturedModalRect(guiWidth + 71, guiHeight + 75, 176 + 14, 32, 16, 16);
drawTexturedModalRect(guiWidth + 89, guiHeight + 75, 176 + 30, 32, 16, 16);
}
if(tileEntity.formula != null)
{
if(xAxis >= 107 && xAxis <= 123 && yAxis >= 75 && yAxis <= 91)
{
drawTexturedModalRect(guiWidth + 107, guiHeight + 75, 176 + 46, 0, 16, 16);
}
else {
drawTexturedModalRect(guiWidth + 107, guiHeight + 75, 176 + 46, 16, 16, 16);
}
}
else {
drawTexturedModalRect(guiWidth + 107, guiHeight + 75, 176 + 46, 32, 16, 16);
}
super.drawGuiContainerBackgroundLayer(partialTick, mouseX, mouseY); super.drawGuiContainerBackgroundLayer(partialTick, mouseX, mouseY);
} }
@Override
protected void mouseClicked(int mouseX, int mouseY, int button)
{
super.mouseClicked(mouseX, mouseY, button);
if(button == 0)
{
int xAxis = (mouseX - (width - xSize) / 2);
int yAxis = (mouseY - (height - ySize) / 2);
if(!tileEntity.autoMode)
{
if(xAxis >= 7 && xAxis <= 21 && yAxis >= 45 && yAxis <= 59)
{
ArrayList data = new ArrayList();
data.add(1);
Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(tileEntity), data));
}
if(xAxis >= 71 && xAxis <= 87 && yAxis >= 75 && yAxis <= 91)
{
ArrayList data = new ArrayList();
data.add(2);
Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(tileEntity), data));
}
if(xAxis >= 89 && xAxis <= 105 && yAxis >= 75 && yAxis <= 91)
{
ArrayList data = new ArrayList();
data.add(3);
Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(tileEntity), data));
}
}
if(tileEntity.formula != null)
{
if(xAxis >= 107 && xAxis <= 123 && yAxis >= 75 && yAxis <= 91)
{
ArrayList data = new ArrayList();
data.add(0);
Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(tileEntity), data));
}
}
}
}
} }

View file

@ -76,6 +76,7 @@ import mekanism.common.tile.TileEntityAdvancedBoundingBlock;
import mekanism.common.tile.TileEntityBoundingBlock; import mekanism.common.tile.TileEntityBoundingBlock;
import mekanism.common.tile.TileEntityCardboardBox; import mekanism.common.tile.TileEntityCardboardBox;
import mekanism.common.tile.TileEntityElectricBlock; import mekanism.common.tile.TileEntityElectricBlock;
import mekanism.common.tile.TileEntityFormulaicAssemblicator;
import mekanism.common.tile.TileEntityPressureDisperser; import mekanism.common.tile.TileEntityPressureDisperser;
import mekanism.common.tile.TileEntityQuantumEntangloporter; import mekanism.common.tile.TileEntityQuantumEntangloporter;
import mekanism.common.tile.TileEntitySuperheatingElement; import mekanism.common.tile.TileEntitySuperheatingElement;
@ -518,6 +519,9 @@ public class Mekanism
MachineType.QUANTUM_ENTANGLOPORTER.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock3, 1, 0), new Object[] { MachineType.QUANTUM_ENTANGLOPORTER.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock3, 1, 0), new Object[] {
"OCO", "ATA", "OCO", Character.valueOf('O'), "ingotRefinedObsidian", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.ULTIMATE), Character.valueOf('A'), "alloyUltimate", Character.valueOf('T'), MekanismItems.TeleportationCore "OCO", "ATA", "OCO", Character.valueOf('O'), "ingotRefinedObsidian", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.ULTIMATE), Character.valueOf('A'), "alloyUltimate", Character.valueOf('T'), MekanismItems.TeleportationCore
})); }));
MachineType.FORMULAIC_ASSEMBLICATOR.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock3, 1, 5), new Object[] {
"STS", "BIB", "SCS", Character.valueOf('S'), "ingotSteel", Character.valueOf('T'), Blocks.crafting_table, Character.valueOf('B'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('I'), new ItemStack(MekanismBlocks.MachineBlock, 1, 8), Character.valueOf('C'), Blocks.chest
}));
//Energy Cube recipes //Energy Cube recipes
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismUtils.getEnergyCube(EnergyCubeTier.BASIC), new Object[] { CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismUtils.getEnergyCube(EnergyCubeTier.BASIC), new Object[] {
@ -1118,9 +1122,10 @@ public class Mekanism
GameRegistry.registerTileEntity(TileEntityCardboardBox.class, "CardboardBox"); GameRegistry.registerTileEntity(TileEntityCardboardBox.class, "CardboardBox");
GameRegistry.registerTileEntity(TileEntityThermalEvaporationValve.class, "SalinationValve"); //TODO rename GameRegistry.registerTileEntity(TileEntityThermalEvaporationValve.class, "SalinationValve"); //TODO rename
GameRegistry.registerTileEntity(TileEntityThermalEvaporationBlock.class, "SalinationTank"); //TODO rename GameRegistry.registerTileEntity(TileEntityThermalEvaporationBlock.class, "SalinationTank"); //TODO rename
GameRegistry.registerTileEntity(TileEntityQuantumEntangloporter.class, "EntangledBlock"); GameRegistry.registerTileEntity(TileEntityQuantumEntangloporter.class, "QuantumEntangloporter");
GameRegistry.registerTileEntity(TileEntityPressureDisperser.class, "PressureDisperser"); GameRegistry.registerTileEntity(TileEntityPressureDisperser.class, "PressureDisperser");
GameRegistry.registerTileEntity(TileEntitySuperheatingElement.class, "SuperheatingElement"); GameRegistry.registerTileEntity(TileEntitySuperheatingElement.class, "SuperheatingElement");
GameRegistry.registerTileEntity(TileEntityFormulaicAssemblicator.class, "FormulaicAssemblicator");
//Load tile entities that have special renderers. //Load tile entities that have special renderers.
proxy.registerSpecialTileEntities(); proxy.registerSpecialTileEntities();

View file

@ -25,7 +25,7 @@ public class ContainerFormulaicAssemblicator extends Container
public ContainerFormulaicAssemblicator(InventoryPlayer inventory, TileEntityFormulaicAssemblicator tentity) public ContainerFormulaicAssemblicator(InventoryPlayer inventory, TileEntityFormulaicAssemblicator tentity)
{ {
tileEntity = tentity; tileEntity = tentity;
addSlotToContainer(new SlotDischarge(tentity, 1, 155, 76)); addSlotToContainer(new SlotDischarge(tentity, 1, 152, 76));
addSlotToContainer(new SlotSpecific(tentity, 2, 6, 26, ItemCraftingFormula.class)); addSlotToContainer(new SlotSpecific(tentity, 2, 6, 26, ItemCraftingFormula.class));
int slotY; int slotY;
@ -42,13 +42,19 @@ public class ContainerFormulaicAssemblicator extends Container
{ {
for(int slotX = 0; slotX < 3; slotX++) for(int slotX = 0; slotX < 3; slotX++)
{ {
addSlotToContainer(new Slot(tentity, slotX + slotY * 9 + 27, 26 + slotX * 18, 17 + slotY * 18) { addSlotToContainer(new Slot(tentity, slotX + slotY * 3 + 27, 26 + slotX * 18, 17 + slotY * 18) {
@Override @Override
public boolean isItemValid(ItemStack stack) public boolean isItemValid(ItemStack stack)
{ {
return !tileEntity.autoMode; return !tileEntity.autoMode;
} }
@Override
public boolean canTakeStack(EntityPlayer player)
{
return !tileEntity.autoMode;
}
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public boolean func_111238_b() public boolean func_111238_b()
{ {
@ -77,7 +83,7 @@ public class ContainerFormulaicAssemblicator extends Container
{ {
for(int slotX = 0; slotX < 2; slotX++) for(int slotX = 0; slotX < 2; slotX++)
{ {
addSlotToContainer(new SlotOutput(tentity, slotX + slotY * 9 + 21, 116 + slotX * 18, 17 + slotY * 18)); addSlotToContainer(new SlotOutput(tentity, slotX + slotY * 2 + 21, 116 + slotX * 18, 17 + slotY * 18));
} }
} }

View file

@ -43,6 +43,13 @@ public class ItemCraftingFormula extends ItemMekanism
return getInventory(stack) == null ? icons[0] : (isInvalid(stack) ? icons[1] : icons[2]); return getInventory(stack) == null ? icons[0] : (isInvalid(stack) ? icons[1] : icons[2]);
} }
@Override
@SideOnly(Side.CLIENT)
public boolean requiresMultipleRenderPasses()
{
return true;
}
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void addInformation(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) public void addInformation(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag)
@ -145,7 +152,7 @@ public class ItemCraftingFormula extends ItemMekanism
public ItemStack[] getInventory(ItemStack stack) public ItemStack[] getInventory(ItemStack stack)
{ {
if(stack.stackTagCompound == null) if(stack.stackTagCompound == null || !stack.stackTagCompound.hasKey("Items"))
{ {
return null; return null;
} }
@ -174,6 +181,12 @@ public class ItemCraftingFormula extends ItemMekanism
stack.setTagCompound(new NBTTagCompound()); stack.setTagCompound(new NBTTagCompound());
} }
if(inv == null)
{
stack.stackTagCompound.removeTag("Items");
return;
}
NBTTagList tagList = new NBTTagList(); NBTTagList tagList = new NBTTagList();
for(int slotCount = 0; slotCount < 9; slotCount++) for(int slotCount = 0; slotCount < 9; slotCount++)

View file

@ -18,9 +18,6 @@ import mekanism.common.base.IUpgradeTile;
import mekanism.common.block.BlockMachine.MachineType; import mekanism.common.block.BlockMachine.MachineType;
import mekanism.common.content.assemblicator.RecipeFormula; import mekanism.common.content.assemblicator.RecipeFormula;
import mekanism.common.item.ItemCraftingFormula; import mekanism.common.item.ItemCraftingFormula;
import mekanism.common.recipe.RecipeHandler;
import mekanism.common.recipe.RecipeHandler.Recipe;
import mekanism.common.recipe.inputs.InfusionInput;
import mekanism.common.tile.component.TileComponentConfig; import mekanism.common.tile.component.TileComponentConfig;
import mekanism.common.tile.component.TileComponentEjector; import mekanism.common.tile.component.TileComponentEjector;
import mekanism.common.tile.component.TileComponentUpgrade; import mekanism.common.tile.component.TileComponentUpgrade;
@ -47,6 +44,8 @@ public class TileEntityFormulaicAssemblicator extends TileEntityElectricBlock im
public boolean autoMode = false; public boolean autoMode = false;
public boolean isRecipe = false;
public int pulseOperations; public int pulseOperations;
public RecipeFormula formula; public RecipeFormula formula;
@ -72,7 +71,7 @@ public class TileEntityFormulaicAssemblicator extends TileEntityElectricBlock im
configComponent.setConfig(TransmissionType.ITEM, new byte[] {0, 0, 0, 3, 1, 2}); configComponent.setConfig(TransmissionType.ITEM, new byte[] {0, 0, 0, 3, 1, 2});
configComponent.setInputConfig(TransmissionType.ENERGY); configComponent.setInputConfig(TransmissionType.ENERGY);
inventory = new ItemStack[35]; inventory = new ItemStack[36];
upgradeComponent = new TileComponentUpgrade(this, 0); upgradeComponent = new TileComponentUpgrade(this, 0);
@ -131,16 +130,20 @@ public class TileEntityFormulaicAssemblicator extends TileEntityElectricBlock im
formula = null; formula = null;
} }
if(autoMode && formula == null)
{
toggleAutoMode();
}
else if(formula != null)
{
moveItemsToGrid();
}
if(autoMode && formula != null && ((controlType == RedstoneControl.PULSE && pulseOperations > 0) || MekanismUtils.canFunction(this))) if(autoMode && formula != null && ((controlType == RedstoneControl.PULSE && pulseOperations > 0) || MekanismUtils.canFunction(this)))
{ {
boolean canOperate = true; boolean canOperate = true;
if(!formula.matches(worldObj, inventory, 27)) if(formula.matches(worldObj, inventory, 27))
{
canOperate = moveItemsToGrid();
}
if(canOperate)
{ {
if(operatingTicks == ticksRequired) if(operatingTicks == ticksRequired)
{ {
@ -187,12 +190,45 @@ public class TileEntityFormulaicAssemblicator extends TileEntityElectricBlock im
for(int i = 27; i <= 35; i++) for(int i = 27; i <= 35; i++)
{ {
if(inventory[i] != null)
{
ItemStack stack = inventory[i];
inventory[i].stackSize--; inventory[i].stackSize--;
if(inventory[i].stackSize == 0) if(inventory[i].stackSize == 0)
{ {
inventory[i] = null; inventory[i] = null;
} }
if(stack.stackSize == 0 && stack.getItem().hasContainerItem(stack))
{
ItemStack container = stack.getItem().getContainerItem(stack);
if(container != null && container.isItemStackDamageable() && container.getItemDamage() > container.getMaxDamage())
{
container = null;
}
if(container != null && !stack.getItem().doesContainerItemLeaveCraftingGrid(stack))
{
if(!stack.getItem().doesContainerItemLeaveCraftingGrid(stack))
{
inventory[i] = container.copy();
}
else {
boolean move = tryMoveToOutput(container.copy(), false);
if(move)
{
tryMoveToOutput(container.copy(), true);
}
inventory[i] = move ? null : container.copy();
}
}
}
}
} }
markDirty(); markDirty();
@ -216,11 +252,11 @@ public class TileEntityFormulaicAssemblicator extends TileEntityElectricBlock im
if(canOperate) if(canOperate)
{ {
doSingleCraft(); return doSingleCraft();
} }
} }
else { else {
doSingleCraft(); return doSingleCraft();
} }
return false; return false;
@ -282,6 +318,17 @@ public class TileEntityFormulaicAssemblicator extends TileEntityElectricBlock im
while(craftSingle()); while(craftSingle());
} }
private void moveItemsToInput()
{
for(int i = 27; i <= 35; i++)
{
if(inventory[i] != null && formula != null && !formula.isIngredientInPos(worldObj, inventory[i], i-27))
{
inventory[i] = tryMoveToInput(inventory[i]);
}
}
}
private void toggleAutoMode() private void toggleAutoMode()
{ {
if(autoMode) if(autoMode)
@ -289,15 +336,13 @@ public class TileEntityFormulaicAssemblicator extends TileEntityElectricBlock im
operatingTicks = 0; operatingTicks = 0;
autoMode = false; autoMode = false;
} }
else { else if(formula != null)
for(int i = 27; i <= 35; i++)
{ {
inventory[i] = tryMoveToInput(inventory[i]); moveItemsToInput();
autoMode = true;
} }
markDirty(); markDirty();
autoMode = true;
}
} }
private ItemStack tryMoveToInput(ItemStack stack) private ItemStack tryMoveToInput(ItemStack stack)
@ -485,15 +530,19 @@ public class TileEntityFormulaicAssemblicator extends TileEntityElectricBlock im
autoMode = dataStream.readBoolean(); autoMode = dataStream.readBoolean();
operatingTicks = dataStream.readInt(); operatingTicks = dataStream.readInt();
controlType = RedstoneControl.values()[dataStream.readInt()]; controlType = RedstoneControl.values()[dataStream.readInt()];
isRecipe = dataStream.readBoolean();
if(dataStream.readBoolean()) if(dataStream.readBoolean())
{ {
ItemStack[] inv = new ItemStack[9]; ItemStack[] inv = new ItemStack[9];
for(int i = 0; i < 9; i++) for(int i = 0; i < 9; i++)
{
if(dataStream.readBoolean())
{ {
inv[i] = PacketHandler.readStack(dataStream); inv[i] = PacketHandler.readStack(dataStream);
} }
}
formula = new RecipeFormula(inv); formula = new RecipeFormula(inv);
} }
@ -510,6 +559,7 @@ public class TileEntityFormulaicAssemblicator extends TileEntityElectricBlock im
data.add(autoMode); data.add(autoMode);
data.add(operatingTicks); data.add(operatingTicks);
data.add(controlType.ordinal()); data.add(controlType.ordinal());
data.add(isRecipe);
if(formula != null) if(formula != null)
{ {
@ -517,8 +567,15 @@ public class TileEntityFormulaicAssemblicator extends TileEntityElectricBlock im
for(int i = 0; i < 9; i++) for(int i = 0; i < 9; i++)
{ {
if(formula.input[i] != null)
{
data.add(true);
data.add(formula.input[i]); data.add(formula.input[i]);
} }
else {
data.add(false);
}
}
} }
else { else {
data.add(false); data.add(false);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB