Cleanup getMaxEnergy

This commit is contained in:
Tom Elfring committed 2017-07-17 14:44:38 +02:00
1 parent f1e273ff5f
commit 84271c04d9
2 files changed
+23 -23

No files matched your search

@@ -698,26 +698,13 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
{
MachineType machineType = MachineType.get(Block.getBlockFromItem(itemStack.getItem()), itemStack.getItemDamage());
if(machineType == MachineType.BASIC_FACTORY || machineType == MachineType.ADVANCED_FACTORY || machineType == MachineType.ELITE_FACTORY)
if(machineType.isFactory())
{
// 200*tier.processes*recipeType.getEnergyUsage(); // From TileEntityFactory
RecipeType recipeType = RecipeType.values()[getRecipeType(itemStack)];
int tierProcess;
if (machineType == MachineType.BASIC_FACTORY)
{
tierProcess = Tier.FactoryTier.BASIC.processes;
}
else if (machineType == MachineType.ADVANCED_FACTORY)
{
tierProcess = Tier.FactoryTier.ADVANCED.processes;
}
else {
tierProcess = Tier.FactoryTier.ELITE.processes;
}
int tierProcess = machineType.factoryTier.processes;
double baseMaxEnergy = 200 * tierProcess * recipeType.getEnergyUsage();
return MekanismUtils.getMaxEnergy(itemStack, baseMaxEnergy);
}