Fixed outputting BuildCraft power if UE network is detected

This commit is contained in:
Calclavia 2013-09-13 18:07:42 +08:00
parent a9e27ec097
commit 20e864b1e0
3 changed files with 14 additions and 6 deletions

@ -1 +1 @@
Subproject commit f21e3d7d7eff0987e4c0be3e6f3842ab87b42ba1
Subproject commit 115975fe78dfbc13ceb280507a156a489b66a774

View file

@ -123,7 +123,7 @@ public class TileEntityBattery extends TileEntityUniversalElectrical implements
{
PacketDispatcher.sendPacketToPlayer(PacketHandler.getTileEntityPacket(this, this.getNetworkedData(new ArrayList()).toArray()), (Player) player);
}
this.produce();
}
}
@ -596,13 +596,22 @@ public class TileEntityBattery extends TileEntityUniversalElectrical implements
@Override
public float getRequest(ForgeDirection direction)
{
return Math.min(this.getMaxEnergyStored() - this.getEnergyStored(), this.transferThreshold);
if (this.getInputDirections().contains(direction))
{
return Math.min(this.getMaxEnergyStored() - this.getEnergyStored(), this.transferThreshold);
}
return 0;
}
@Override
public float getProvide(ForgeDirection direction)
{
return Math.min(this.getEnergyStored(), this.transferThreshold);
if (this.getOutputDirections().contains(direction))
{
return Math.min(this.getEnergyStored(), this.transferThreshold);
}
return 0;
}
@Override

View file

@ -93,9 +93,8 @@ public class TileEntityTesla extends TileEntityUniversalElectrical implements IT
{
this.produce();
if ((this.doTransfer || this.worldObj.isRemote) && this.ticks % (5 + this.worldObj.rand.nextInt(2)) == 0 && this.getEnergyStored() > 0 && !this.worldObj.isBlockIndirectlyGettingPowered(this.xCoord, this.yCoord, this.zCoord))
if (this.doTransfer && this.ticks % (5 + this.worldObj.rand.nextInt(2)) == 0 && this.getEnergyStored() > 0 && !this.worldObj.isBlockIndirectlyGettingPowered(this.xCoord, this.yCoord, this.zCoord))
{
final TileEntityTesla topTesla = this.getTopTelsa();
final Vector3 topTeslaVector = new Vector3(topTesla);