Formulaic Assemblicators are cool!
This commit is contained in:
parent
9c8e392638
commit
ca7fc4aaf4
5 changed files with 79 additions and 24 deletions
|
@ -15,6 +15,7 @@ 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.client.render.MekanismRenderer;
|
import mekanism.client.render.MekanismRenderer;
|
||||||
|
import mekanism.client.sound.SoundHandler;
|
||||||
import mekanism.common.Mekanism;
|
import mekanism.common.Mekanism;
|
||||||
import mekanism.common.inventory.container.ContainerFormulaicAssemblicator;
|
import mekanism.common.inventory.container.ContainerFormulaicAssemblicator;
|
||||||
import mekanism.common.item.ItemCraftingFormula;
|
import mekanism.common.item.ItemCraftingFormula;
|
||||||
|
@ -67,6 +68,11 @@ public class GuiFormulaicAssemblicator extends GuiMekanism
|
||||||
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(xAxis >= 44 && xAxis <= 60 && yAxis >= 75 && yAxis <= 91)
|
||||||
|
{
|
||||||
|
drawCreativeTabHoveringText(LangUtils.localize("gui.fillEmpty"), xAxis, yAxis);
|
||||||
|
}
|
||||||
|
|
||||||
if(xAxis >= 7 && xAxis <= 21 && yAxis >= 45 && yAxis <= 59)
|
if(xAxis >= 7 && xAxis <= 21 && yAxis >= 45 && yAxis <= 59)
|
||||||
{
|
{
|
||||||
drawCreativeTabHoveringText(LangUtils.localize("gui.encodeFormula"), xAxis, yAxis);
|
drawCreativeTabHoveringText(LangUtils.localize("gui.encodeFormula"), xAxis, yAxis);
|
||||||
|
@ -102,6 +108,20 @@ public class GuiFormulaicAssemblicator extends GuiMekanism
|
||||||
int xAxis = mouseX - guiWidth;
|
int xAxis = mouseX - guiWidth;
|
||||||
int yAxis = mouseY - guiHeight;
|
int yAxis = mouseY - guiHeight;
|
||||||
|
|
||||||
|
if(!tileEntity.autoMode)
|
||||||
|
{
|
||||||
|
if(xAxis >= 44 && xAxis <= 60 && yAxis >= 75 && yAxis <= 91)
|
||||||
|
{
|
||||||
|
drawTexturedModalRect(guiWidth + 44, guiHeight + 75, 176 + 62, 0, 16, 16);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
drawTexturedModalRect(guiWidth + 44, guiHeight + 75, 176 + 62, 16, 16, 16);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
drawTexturedModalRect(guiWidth + 44, guiHeight + 75, 176 + 62, 32, 16, 16);
|
||||||
|
}
|
||||||
|
|
||||||
if(!tileEntity.autoMode && tileEntity.isRecipe)
|
if(!tileEntity.autoMode && tileEntity.isRecipe)
|
||||||
{
|
{
|
||||||
if(canEncode())
|
if(canEncode())
|
||||||
|
@ -114,6 +134,9 @@ public class GuiFormulaicAssemblicator extends GuiMekanism
|
||||||
drawTexturedModalRect(guiWidth + 7, guiHeight + 45, 176, 14, 14, 14);
|
drawTexturedModalRect(guiWidth + 7, guiHeight + 45, 176, 14, 14, 14);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
drawTexturedModalRect(guiWidth + 7, guiHeight + 45, 176, 28, 14, 14);
|
||||||
|
}
|
||||||
|
|
||||||
if(xAxis >= 71 && xAxis <= 87 && yAxis >= 75 && yAxis <= 91)
|
if(xAxis >= 71 && xAxis <= 87 && yAxis >= 75 && yAxis <= 91)
|
||||||
{
|
{
|
||||||
|
@ -203,33 +226,52 @@ public class GuiFormulaicAssemblicator extends GuiMekanism
|
||||||
int xAxis = (mouseX - (width - xSize) / 2);
|
int xAxis = (mouseX - (width - xSize) / 2);
|
||||||
int yAxis = (mouseY - (height - ySize) / 2);
|
int yAxis = (mouseY - (height - ySize) / 2);
|
||||||
|
|
||||||
if(!tileEntity.autoMode && tileEntity.isRecipe)
|
if(!tileEntity.autoMode)
|
||||||
{
|
{
|
||||||
if(canEncode())
|
if(xAxis >= 44 && xAxis <= 60 && yAxis >= 75 && yAxis <= 91)
|
||||||
{
|
{
|
||||||
if(xAxis >= 7 && xAxis <= 21 && yAxis >= 45 && yAxis <= 59)
|
SoundHandler.playSound("gui.button.press");
|
||||||
|
|
||||||
|
ArrayList data = new ArrayList();
|
||||||
|
data.add(4);
|
||||||
|
|
||||||
|
Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(tileEntity), data));
|
||||||
|
}
|
||||||
|
|
||||||
|
if(tileEntity.isRecipe)
|
||||||
|
{
|
||||||
|
if(canEncode())
|
||||||
{
|
{
|
||||||
|
if(xAxis >= 7 && xAxis <= 21 && yAxis >= 45 && yAxis <= 59)
|
||||||
|
{
|
||||||
|
SoundHandler.playSound("gui.button.press");
|
||||||
|
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
SoundHandler.playSound("gui.button.press");
|
||||||
|
|
||||||
ArrayList data = new ArrayList();
|
ArrayList data = new ArrayList();
|
||||||
data.add(1);
|
data.add(2);
|
||||||
|
|
||||||
|
Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(tileEntity), data));
|
||||||
|
}
|
||||||
|
|
||||||
|
if(xAxis >= 89 && xAxis <= 105 && yAxis >= 75 && yAxis <= 91)
|
||||||
|
{
|
||||||
|
SoundHandler.playSound("gui.button.press");
|
||||||
|
|
||||||
|
ArrayList data = new ArrayList();
|
||||||
|
data.add(3);
|
||||||
|
|
||||||
Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(tileEntity), data));
|
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));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -237,6 +279,8 @@ public class GuiFormulaicAssemblicator extends GuiMekanism
|
||||||
{
|
{
|
||||||
if(xAxis >= 107 && xAxis <= 123 && yAxis >= 75 && yAxis <= 91)
|
if(xAxis >= 107 && xAxis <= 123 && yAxis >= 75 && yAxis <= 91)
|
||||||
{
|
{
|
||||||
|
SoundHandler.playSound("gui.button.press");
|
||||||
|
|
||||||
ArrayList data = new ArrayList();
|
ArrayList data = new ArrayList();
|
||||||
data.add(0);
|
data.add(0);
|
||||||
|
|
||||||
|
|
|
@ -520,7 +520,7 @@ public class Mekanism
|
||||||
"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[] {
|
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
|
"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.BasicBlock, 1, 8), Character.valueOf('C'), Blocks.chest
|
||||||
}));
|
}));
|
||||||
CraftingManager.getInstance().getRecipeList().add(new ShapelessMekanismRecipe(new ItemStack(MekanismItems.CraftingFormula), new Object[] {
|
CraftingManager.getInstance().getRecipeList().add(new ShapelessMekanismRecipe(new ItemStack(MekanismItems.CraftingFormula), new Object[] {
|
||||||
Items.paper, MekanismUtils.getControlCircuit(BaseTier.BASIC)
|
Items.paper, MekanismUtils.getControlCircuit(BaseTier.BASIC)
|
||||||
|
|
|
@ -344,11 +344,11 @@ public class TileEntityFormulaicAssemblicator extends TileEntityElectricBlock im
|
||||||
while(craftSingle());
|
while(craftSingle());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void moveItemsToInput()
|
private void moveItemsToInput(boolean forcePush)
|
||||||
{
|
{
|
||||||
for(int i = 27; i <= 35; i++)
|
for(int i = 27; i <= 35; i++)
|
||||||
{
|
{
|
||||||
if(inventory[i] != null && formula != null && !formula.isIngredientInPos(worldObj, inventory[i], i-27))
|
if(inventory[i] != null && (forcePush || (formula != null && !formula.isIngredientInPos(worldObj, inventory[i], i-27))))
|
||||||
{
|
{
|
||||||
inventory[i] = tryMoveToInput(inventory[i]);
|
inventory[i] = tryMoveToInput(inventory[i]);
|
||||||
}
|
}
|
||||||
|
@ -364,7 +364,7 @@ public class TileEntityFormulaicAssemblicator extends TileEntityElectricBlock im
|
||||||
}
|
}
|
||||||
else if(formula != null)
|
else if(formula != null)
|
||||||
{
|
{
|
||||||
moveItemsToInput();
|
moveItemsToInput(false);
|
||||||
autoMode = true;
|
autoMode = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -547,6 +547,16 @@ public class TileEntityFormulaicAssemblicator extends TileEntityElectricBlock im
|
||||||
{
|
{
|
||||||
craftAll();
|
craftAll();
|
||||||
}
|
}
|
||||||
|
else if(type == 4)
|
||||||
|
{
|
||||||
|
if(formula != null)
|
||||||
|
{
|
||||||
|
moveItemsToGrid();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
moveItemsToInput(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 7.1 KiB |
|
@ -536,6 +536,7 @@ gui.encodeFormula=Encode Formula
|
||||||
gui.autoModeToggle=Turn Auto-Mode
|
gui.autoModeToggle=Turn Auto-Mode
|
||||||
gui.craftSingle=Craft Single Item
|
gui.craftSingle=Craft Single Item
|
||||||
gui.craftAvailable=Craft Available Items
|
gui.craftAvailable=Craft Available Items
|
||||||
|
gui.fillEmpty=Fill/Empty Grid
|
||||||
|
|
||||||
gui.reactor.injectionRate=Injection Rate
|
gui.reactor.injectionRate=Injection Rate
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue