This commit is contained in:
Muramasa 2016-05-23 18:40:01 +01:00
parent 960087a0a8
commit cddca6e2be

View file

@ -26,6 +26,7 @@ import java.util.Collection;
public class GT_MetaTileEntity_DieselEngine extends GT_MetaTileEntity_MultiBlockBase {
protected int fuelConsumption = 0;
protected int fuelRemaining = 0;
protected boolean enableTurboOut = false;
public GT_MetaTileEntity_DieselEngine(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
@ -70,15 +71,18 @@ public class GT_MetaTileEntity_DieselEngine extends GT_MetaTileEntity_MultiBlock
ArrayList<FluidStack> tFluids = getStoredFluids();
Collection<GT_Recipe> tRecipeList = GT_Recipe.GT_Recipe_Map.sDieselFuels.mRecipeList;
//TODO Better method to detect turbine item. This will do for testing.
if(tHatches.size() > 0) {
if (tHatches.get(0).getStackInSlot(0) != null) {
ItemStack hatchStack = tHatches.get(0).getStackInSlot(0);
if (hatchStack.getItem() instanceof GT_MetaGenerated_Tool) { //Has a GT tool
GT_MetaGenerated_Tool hatchTool = (GT_MetaGenerated_Tool) tHatches.get(0).getStackInSlot(0).getItem();
if(GT_MetaGenerated_Tool.getPrimaryMaterial(hatchStack).mDurability > 0) enableTurboOut = true;
}
}
}
//TODO Better method to detect turbine item. This will do for testing.
int baseEUt = GT_MetaGenerated_Tool.getPrimaryMaterial(hatchStack).mDurability > 0 ? 8192 : 2048; //Choose base output
int baseEUt = enableTurboOut ? 8192 : 2048; //Choose base output
if(tFluids.size() > 0 && tRecipeList != null) { //Does input hatch have a diesel fuel?
for (FluidStack hatchFluid1 : tFluids) { //Loops through hatches
for(GT_Recipe aFuel : tRecipeList) { //Loops through diesel fuel recipes
@ -99,9 +103,6 @@ public class GT_MetaTileEntity_DieselEngine extends GT_MetaTileEntity_MultiBlock
}
}
}
}
}
}
return false;
}