Fusion reactor fixes & rewrite, energy fixes.
This commit is contained in:
parent
fe64b8ccf7
commit
06fad2264f
13 changed files with 279 additions and 386 deletions
|
@ -72,19 +72,11 @@ public class TileLesu extends TilePowerAcceptorProducer {// TODO wrench
|
|||
|
||||
if (!worldObj.isRemote && getEnergy() > 0) {
|
||||
double maxOutput = getEnergy() > getMaxOutput() ? getMaxOutput() : getEnergy();
|
||||
for(EnumFacing facing : EnumFacing.VALUES) {
|
||||
double disposed = emitEnergy(facing, maxOutput);
|
||||
if(disposed != 0) {
|
||||
maxOutput -= disposed;
|
||||
useEnergy(disposed);
|
||||
if (maxOutput == 0) return;
|
||||
}
|
||||
}
|
||||
double disposed = emitEnergy(getFacingEnum(), maxOutput);
|
||||
if (maxOutput != 0 && disposed != 0) useEnergy(disposed);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//TODO move to RebornCore
|
||||
public double emitEnergy(EnumFacing enumFacing, double amount) {
|
||||
BlockPos pos = getPos().offset(enumFacing);
|
||||
EnergyUtils.PowerNetReceiver receiver = EnergyUtils.getReceiver(
|
||||
|
@ -95,6 +87,16 @@ public class TileLesu extends TilePowerAcceptorProducer {// TODO wrench
|
|||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAcceptEnergy(EnumFacing direction) {
|
||||
return getFacingEnum() != direction;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideEnergy(EnumFacing direction) {
|
||||
return getFacingEnum() == direction;
|
||||
}
|
||||
|
||||
|
||||
public double getEuChange() {
|
||||
if (euChange == -1) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue