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() {
|
||||
|
||||
@@ -35,15 +35,15 @@ public class AlloyRecipeManager {
|
||||
|
||||
private final List<IAlloyRecipe> recipes = new ArrayList<IAlloyRecipe>();
|
||||
|
||||
private VanillaSmeltingRecipe vanillaRecipe = new VanillaSmeltingRecipe();
|
||||
VanillaSmeltingRecipe vanillaRecipe = new VanillaSmeltingRecipe();
|
||||
|
||||
public AlloyRecipeManager() {
|
||||
}
|
||||
|
||||
public void loadRecipesFromConfig() {
|
||||
|
||||
|
||||
VanillaFurnaceTagHandler tagHandler = new VanillaFurnaceTagHandler();
|
||||
RecipeConfig config = RecipeConfig.loadRecipeConfig(CORE_FILE_NAME, CUSTOM_FILE_NAME, tagHandler);
|
||||
RecipeConfig config = RecipeConfig.loadRecipeConfig(CORE_FILE_NAME, CUSTOM_FILE_NAME, tagHandler);
|
||||
if(config != null) {
|
||||
processConfig(config, tagHandler);
|
||||
} else {
|
||||
@@ -90,7 +90,7 @@ public class AlloyRecipeManager {
|
||||
for (Recipe rec : newRecipes) {
|
||||
addRecipe(new BasicAlloyRecipe(rec));
|
||||
}
|
||||
tagHandler.apply();
|
||||
tagHandler.apply();
|
||||
Log.info("Finished processing Alloy Smelter recipes. " + recipes.size() + " recipes avaliable.");
|
||||
|
||||
}
|
||||
|
||||
@@ -57,14 +57,24 @@ public class TileAlloySmelter extends AbstractPoweredTaskEntity {
|
||||
|
||||
@Override
|
||||
protected IMachineRecipe canStartNextTask(float chance) {
|
||||
IMachineRecipe result = super.canStartNextTask(chance);
|
||||
if(mode == Mode.ALLOY && result instanceof VanillaSmeltingRecipe) {
|
||||
result = null;
|
||||
if(mode == Mode.FURNACE) {
|
||||
VanillaSmeltingRecipe vr = AlloyRecipeManager.getInstance().vanillaRecipe;
|
||||
if(vr.isRecipe(getInputs())) {
|
||||
ItemStack[] res = vr.getCompletedResult(chance, getInputs());
|
||||
if(res == null || res.length == 0) {
|
||||
return null;
|
||||
}
|
||||
return canInsertResult(chance, vr) ? vr : null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
if(mode == Mode.FURNACE && !(result instanceof VanillaSmeltingRecipe)) {
|
||||
result = null;
|
||||
|
||||
IMachineRecipe nextRecipe = MachineRecipeRegistry.instance.getRecipeForInputs(getMachineName(), getInputs());
|
||||
if(nextRecipe == null) {
|
||||
return null; // no template
|
||||
}
|
||||
return result;
|
||||
// make sure we have room for the next output
|
||||
return canInsertResult(chance, nextRecipe) ? nextRecipe : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -37,8 +37,12 @@ public class MaterialRecipes {
|
||||
OreDictionary.registerOre("glass", pureGlass);
|
||||
OreDictionary.registerOre("glassHardened", new ItemStack(ModObject.blockFusedQuartz.actualId, 1, BlockFusedQuartz.Type.FUSED_QUARTZ.ordinal()));
|
||||
|
||||
//Glass panes for compatability
|
||||
//Glass stuff for compatability
|
||||
GameRegistry.addShapedRecipe(new ItemStack(Block.thinGlass), " ", "eee", "eee", 'e', pureGlass);
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(Block.glass), pureGlass);
|
||||
GameRegistry.addShapedRecipe(new ItemStack(Item.glassBottle), " ", "g g", " g ", 'g', pureGlass);
|
||||
|
||||
OreDictionary.registerOre("glass", Block.glass);
|
||||
|
||||
/**
|
||||
* Register AE1's Silicon, remove after AE2 is out.
|
||||
|
||||
Reference in new issue
Block a user