mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-27 23:33:08 +00:00
A few Formulaic Assemblicator fixes
This commit is contained in:
1 parent
b3954b88ee
commit
44d9aa506f
5 files changed
+40
-29
No files matched your search
@@ -182,11 +182,8 @@ public class GuiFormulaicAssemblicator extends GuiMekanism
|
||||
drawTexturedModalRect(guiWidth + 86, guiHeight + 43, 176, 48, display, 16);
|
||||
}
|
||||
|
||||
if(tileEntity.isRecipe)
|
||||
{
|
||||
mc.renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiSlot.png"));
|
||||
drawTexturedModalRect(guiWidth + 90, guiHeight + 25, 2, 39, 14, 12);
|
||||
}
|
||||
mc.renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiSlot.png"));
|
||||
drawTexturedModalRect(guiWidth + 90, guiHeight + 25, tileEntity.isRecipe ? 2 : 20, 39, 14, 12);
|
||||
|
||||
if(tileEntity.formula != null)
|
||||
{
|
||||
|
||||
@@ -35,7 +35,7 @@ public class RecipeFormula
|
||||
}
|
||||
}
|
||||
|
||||
public boolean matches(World world, ItemStack[] input, int start)
|
||||
public boolean matches(World world, ItemStack[] newInput, int start)
|
||||
{
|
||||
resetToRecipe();
|
||||
|
||||
@@ -43,7 +43,7 @@ public class RecipeFormula
|
||||
|
||||
for(int i = 0; i < 9; i++)
|
||||
{
|
||||
dummy.setInventorySlotContents(i, input[start+i]);
|
||||
dummy.setInventorySlotContents(i, newInput[start+i]);
|
||||
}
|
||||
|
||||
IRecipe newRecipe = RecipeUtils.getRecipeFromGrid(dummy, world);
|
||||
|
||||
@@ -139,6 +139,8 @@ public abstract class TileEntityContainerBlock extends TileEntityBasicBlock impl
|
||||
{
|
||||
itemstack.stackSize = getInventoryStackLimit();
|
||||
}
|
||||
|
||||
markDirty();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -51,6 +51,7 @@ public class TileEntityFormulaicAssemblicator extends TileEntityElectricBlock im
|
||||
public int pulseOperations;
|
||||
|
||||
public RecipeFormula formula;
|
||||
public RecipeFormula prevFormula;
|
||||
|
||||
public RedstoneControl controlType = RedstoneControl.DISABLED;
|
||||
|
||||
@@ -59,7 +60,7 @@ public class TileEntityFormulaicAssemblicator extends TileEntityElectricBlock im
|
||||
public TileComponentConfig configComponent;
|
||||
public TileComponentSecurity securityComponent;
|
||||
|
||||
public TileEntityFormulaicAssemblicator()
|
||||
public TileEntityFormulaicAssemblicator()
|
||||
{
|
||||
super("FormulaicAssemblicator", MachineType.FORMULAIC_ASSEMBLICATOR.baseEnergy);
|
||||
|
||||
@@ -135,29 +136,17 @@ public class TileEntityFormulaicAssemblicator extends TileEntityElectricBlock im
|
||||
formula = null;
|
||||
}
|
||||
|
||||
if(formula != prevFormula)
|
||||
{
|
||||
prevFormula = formula;
|
||||
markDirty();
|
||||
}
|
||||
|
||||
if(autoMode && formula == null)
|
||||
{
|
||||
toggleAutoMode();
|
||||
}
|
||||
|
||||
if(formula == null)
|
||||
{
|
||||
if(autoMode)
|
||||
{
|
||||
toggleAutoMode();
|
||||
}
|
||||
|
||||
for(int i = 0; i < 9; i++)
|
||||
{
|
||||
dummyInv.setInventorySlotContents(i, inventory[27+i]);
|
||||
}
|
||||
|
||||
isRecipe = MekanismUtils.findMatchingRecipe(dummyInv, worldObj) != null;
|
||||
}
|
||||
else {
|
||||
isRecipe = formula.matches(worldObj, inventory, 27);
|
||||
}
|
||||
|
||||
if(autoMode && formula != null && ((controlType == RedstoneControl.PULSE && pulseOperations > 0) || MekanismUtils.canFunction(this)))
|
||||
{
|
||||
boolean canOperate = true;
|
||||
@@ -201,6 +190,25 @@ public class TileEntityFormulaicAssemblicator extends TileEntityElectricBlock im
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void markDirty()
|
||||
{
|
||||
super.markDirty();
|
||||
|
||||
if(formula == null)
|
||||
{
|
||||
for(int i = 0; i < 9; i++)
|
||||
{
|
||||
dummyInv.setInventorySlotContents(i, inventory[27+i]);
|
||||
}
|
||||
|
||||
isRecipe = MekanismUtils.findMatchingRecipe(dummyInv, worldObj) != null;
|
||||
}
|
||||
else {
|
||||
isRecipe = formula.matches(worldObj, inventory, 27);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean doSingleCraft()
|
||||
{
|
||||
for(int i = 0; i < 9; i++)
|
||||
@@ -295,6 +303,8 @@ public class TileEntityFormulaicAssemblicator extends TileEntityElectricBlock im
|
||||
|
||||
private boolean moveItemsToGrid()
|
||||
{
|
||||
boolean ret = true;
|
||||
|
||||
for(int i = 27; i <= 35; i++)
|
||||
{
|
||||
if(formula.isIngredientInPos(worldObj, inventory[i], i-27))
|
||||
@@ -309,7 +319,7 @@ public class TileEntityFormulaicAssemblicator extends TileEntityElectricBlock im
|
||||
|
||||
if(inventory[i] != null)
|
||||
{
|
||||
return false;
|
||||
ret = false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -336,12 +346,12 @@ public class TileEntityFormulaicAssemblicator extends TileEntityElectricBlock im
|
||||
|
||||
if(!found)
|
||||
{
|
||||
return false;
|
||||
ret = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
return ret;
|
||||
}
|
||||
|
||||
private void craftAll()
|
||||
@@ -358,6 +368,8 @@ public class TileEntityFormulaicAssemblicator extends TileEntityElectricBlock im
|
||||
inventory[i] = tryMoveToInput(inventory[i]);
|
||||
}
|
||||
}
|
||||
|
||||
markDirty();
|
||||
}
|
||||
|
||||
private void toggleAutoMode()
|
||||
|
||||
Reference in new issue
Block a user