Placed UE higher in priority for energy production
This commit is contained in:
parent
07332ca245
commit
41415ab683
2 changed files with 24 additions and 24 deletions
|
@ -246,7 +246,7 @@ public class Mekanism
|
||||||
public static double FROM_IC2;
|
public static double FROM_IC2;
|
||||||
public static double FROM_BC;
|
public static double FROM_BC;
|
||||||
public static double FROM_TE;
|
public static double FROM_TE;
|
||||||
public static double FROM_UE = 1000;
|
public static double FROM_UE = 1/TO_UE;
|
||||||
|
|
||||||
//Usage Configuration
|
//Usage Configuration
|
||||||
public static double enrichmentChamberUsage;
|
public static double enrichmentChamberUsage;
|
||||||
|
|
|
@ -305,6 +305,29 @@ public final class CableUtils
|
||||||
IStrictEnergyAcceptor acceptor = (IStrictEnergyAcceptor)tileEntity;
|
IStrictEnergyAcceptor acceptor = (IStrictEnergyAcceptor)tileEntity;
|
||||||
sendingEnergy -= (sendingEnergy - acceptor.transferEnergyToAcceptor(side.getOpposite(), sendingEnergy));
|
sendingEnergy -= (sendingEnergy - acceptor.transferEnergyToAcceptor(side.getOpposite(), sendingEnergy));
|
||||||
}
|
}
|
||||||
|
else if(tileEntity instanceof IConductor)
|
||||||
|
{
|
||||||
|
ForgeDirection outputDirection = side;
|
||||||
|
float provide = from.getProvide(outputDirection);
|
||||||
|
|
||||||
|
if(provide > 0)
|
||||||
|
{
|
||||||
|
IElectricityNetwork outputNetwork = ElectricityHelper.getNetworkFromTileEntity(tileEntity, outputDirection);
|
||||||
|
|
||||||
|
if(outputNetwork != null)
|
||||||
|
{
|
||||||
|
ElectricityPack request = outputNetwork.getRequest(from);
|
||||||
|
|
||||||
|
if(request.getWatts() > 0)
|
||||||
|
{
|
||||||
|
float ueSend = (float)(sendingEnergy*Mekanism.TO_UE);
|
||||||
|
ElectricityPack sendPack = ElectricityPack.min(ElectricityPack.getFromWatts(ueSend, from.getVoltage()), ElectricityPack.getFromWatts(provide, from.getVoltage()));
|
||||||
|
float rejectedPower = outputNetwork.produce(sendPack, from);
|
||||||
|
sendingEnergy -= (sendPack.getWatts() - rejectedPower)*Mekanism.FROM_UE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
else if(tileEntity instanceof IEnergyHandler)
|
else if(tileEntity instanceof IEnergyHandler)
|
||||||
{
|
{
|
||||||
IEnergyHandler handler = (IEnergyHandler)tileEntity;
|
IEnergyHandler handler = (IEnergyHandler)tileEntity;
|
||||||
|
@ -334,29 +357,6 @@ public final class CableUtils
|
||||||
sendingEnergy -= sent;
|
sendingEnergy -= sent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(tileEntity instanceof IConductor)
|
|
||||||
{
|
|
||||||
ForgeDirection outputDirection = side;
|
|
||||||
float provide = from.getProvide(outputDirection);
|
|
||||||
|
|
||||||
if(provide > 0)
|
|
||||||
{
|
|
||||||
IElectricityNetwork outputNetwork = ElectricityHelper.getNetworkFromTileEntity(tileEntity, outputDirection);
|
|
||||||
|
|
||||||
if(outputNetwork != null)
|
|
||||||
{
|
|
||||||
ElectricityPack request = outputNetwork.getRequest(from);
|
|
||||||
|
|
||||||
if(request.getWatts() > 0)
|
|
||||||
{
|
|
||||||
float ueSend = (float)(sendingEnergy*Mekanism.TO_UE);
|
|
||||||
ElectricityPack sendPack = ElectricityPack.min(ElectricityPack.getFromWatts(ueSend, from.getVoltage()), ElectricityPack.getFromWatts(provide, from.getVoltage()));
|
|
||||||
float rejectedPower = outputNetwork.produce(sendPack, from);
|
|
||||||
sendingEnergy -= (sendPack.getWatts() - rejectedPower)*Mekanism.FROM_UE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return sendingEnergy;
|
return sendingEnergy;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue