Fusion reactor fixes & rewrite, energy fixes.
This commit is contained in:
parent
fe64b8ccf7
commit
06fad2264f
13 changed files with 279 additions and 386 deletions
|
@ -101,19 +101,11 @@ public class TileIDSU extends TilePowerAcceptorProducer implements IWrenchable {
|
|||
|
||||
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(
|
||||
|
@ -124,6 +116,16 @@ public class TileIDSU extends TilePowerAcceptorProducer implements IWrenchable {
|
|||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAcceptEnergy(EnumFacing direction) {
|
||||
return getFacingEnum() != direction;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideEnergy(EnumFacing direction) {
|
||||
return getFacingEnum() == direction;
|
||||
}
|
||||
|
||||
|
||||
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) {
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue