mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-26 23:13:21 +00:00
#481 Can't make normal glass in furnace mode unless two stacks in furnace bug.
Also added recipe for 'Quite Clear Glass' -> glass to allow easy conversion for recipes.
This commit is contained in:
1 parent
733a819578
commit
12ca033fb4
4 files changed
+32
-18
No files matched your search
@@ -84,7 +84,6 @@ public abstract class AbstractPoweredTaskEntity extends AbstractMachineEntity im
|
||||
return requiresClientSync;
|
||||
}
|
||||
|
||||
|
||||
float chance = random.nextFloat();
|
||||
// Then see if we need to start a new one
|
||||
IMachineRecipe nextRecipe = canStartNextTask(chance);
|
||||
@@ -103,7 +102,6 @@ public abstract class AbstractPoweredTaskEntity extends AbstractMachineEntity im
|
||||
powerHandler.setEnergy(powerHandler.getEnergyStored() - used);
|
||||
currentTask.update(used);
|
||||
|
||||
|
||||
// then check if we are done
|
||||
if(currentTask.isComplete()) {
|
||||
taskComplete();
|
||||
@@ -157,18 +155,20 @@ public abstract class AbstractPoweredTaskEntity extends AbstractMachineEntity im
|
||||
}
|
||||
|
||||
protected IMachineRecipe canStartNextTask(float chance) {
|
||||
|
||||
IMachineRecipe nextRecipe = MachineRecipeRegistry.instance.getRecipeForInputs(getMachineName(), getInputs());
|
||||
if(nextRecipe == null) {
|
||||
return null; // no template
|
||||
}
|
||||
|
||||
// make sure we have room for the next output
|
||||
return canInsertResult(chance, nextRecipe) ? nextRecipe : null;
|
||||
}
|
||||
|
||||
protected boolean canInsertResult(float chance, IMachineRecipe nextRecipe) {
|
||||
|
||||
// if we have an empty output, all good
|
||||
for (int i = slotDefinition.minOutputSlot; i <= slotDefinition.maxOutputSlot; i++) {
|
||||
if(inventory[i] == null) {
|
||||
return nextRecipe;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,11 +189,11 @@ public abstract class AbstractPoweredTaskEntity extends AbstractMachineEntity im
|
||||
canMerge += getNumCanMerge(outStack, result);
|
||||
}
|
||||
if(canMerge < result.stackSize) {
|
||||
return null;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return nextRecipe;
|
||||
return true;
|
||||
}
|
||||
|
||||
protected boolean hasInputStacks() {
|
||||
|
||||
Reference in new issue
Block a user