Merge branch '6.0.x' into 6.1.x

This commit is contained in:
SpaceToad 2014-05-18 21:39:02 +02:00
commit 625b21719d
5 changed files with 24 additions and 15 deletions

View file

@ -22,7 +22,7 @@ apply plugin: 'forge' // adds the forge dependency
apply plugin: 'maven' // for uploading to a maven repo
apply plugin: 'checkstyle'
version = "6.0.14"
version = "6.0.15"
group= "com.mod-buildcraft"
archivesBaseName = "buildcraft" // the name that all artifacts will use as a base. artifacts names follow this pattern: [baseName]-[appendix]-[version]-[classifier].[extension]

View file

@ -0,0 +1,2 @@
#1827 fixed power distribution [SpaceToad]
#1826 fixed wooden engines not powering pipes [SpaceToad]

View file

@ -1,2 +1,2 @@
1.6.4:BuildCraft:4.2.2
1.7.2:BuildCraft:6.0.14
1.7.2:BuildCraft:6.0.15

View file

@ -278,15 +278,18 @@ public abstract class TileEngine extends TileBuildCraft implements IPowerRecepto
private double getPowerToExtract() {
TileEntity tile = getTileBuffer(orientation).getTile();
if (tile instanceof IPowerReceptor) {
IBatteryObject battery = MjAPI.getMjBattery(tile, MjAPI.DEFAULT_POWER_FRAMEWORK, orientation.getOpposite());
if (battery != null) {
return extractEnergy(0, battery.getEnergyRequested(), false);
} else if (tile instanceof IPowerReceptor) {
PowerReceiver receptor = ((IPowerReceptor) tile)
.getPowerReceiver(orientation.getOpposite());
return extractEnergy(receptor.getMinEnergyReceived(),
receptor.getMaxEnergyReceived(), false);
} else {
return extractEnergy(0, MjAPI.getMjBattery(tile, MjAPI.DEFAULT_POWER_FRAMEWORK, orientation.getOpposite())
.getEnergyRequested(), false);
return 0;
}
}
@ -295,7 +298,12 @@ public abstract class TileEngine extends TileBuildCraft implements IPowerRecepto
if (isPoweredTile(tile, orientation)) {
double extracted = getPowerToExtract();
if (tile instanceof IPowerReceptor) {
IBatteryObject battery = MjAPI.getMjBattery(tile, MjAPI.DEFAULT_POWER_FRAMEWORK, orientation.getOpposite());
if (battery != null) {
battery.addEnergy(extractEnergy(0, battery.maxReceivedPerCycle(),
true));
} else if (tile instanceof IPowerReceptor) {
PowerReceiver receptor = ((IPowerReceptor) tile)
.getPowerReceiver(orientation.getOpposite());
@ -306,11 +314,6 @@ public abstract class TileEngine extends TileBuildCraft implements IPowerRecepto
extractEnergy(receptor.getMinEnergyReceived(), needed, true);
}
} else {
IBatteryObject battery = MjAPI.getMjBattery(tile, MjAPI.DEFAULT_POWER_FRAMEWORK, orientation.getOpposite());
battery.addEnergy(extractEnergy(0, battery.maxReceivedPerCycle(),
true));
}
}
}
@ -519,10 +522,12 @@ public abstract class TileEngine extends TileBuildCraft implements IPowerRecepto
public boolean isPoweredTile(TileEntity tile, ForgeDirection side) {
if (tile == null) {
return false;
} else if (MjAPI.getMjBattery(tile, MjAPI.DEFAULT_POWER_FRAMEWORK, orientation.getOpposite()) != null) {
return true;
} else if (tile instanceof IPowerReceptor) {
return ((IPowerReceptor) tile).getPowerReceiver(side.getOpposite()) != null;
} else {
return MjAPI.getMjBattery(tile, MjAPI.DEFAULT_POWER_FRAMEWORK, orientation.getOpposite()) != null;
return false;
}
}

View file

@ -180,7 +180,9 @@ public class PipeTransportPower extends PipeTransport {
double totalPowerQuery = 0;
for (int out = 0; out < 6; ++out) {
totalPowerQuery += powerQuery[out];
if (internalPower[out] == 0) {
totalPowerQuery += powerQuery[out];
}
}
// STEP 2 - sends the power to all directions and computes the actual
@ -190,7 +192,7 @@ public class PipeTransportPower extends PipeTransport {
if (totalPowerContained > 0) {
for (int out = 0; out < 6; ++out) {
if (powerQuery[out] > 0) {
if (powerQuery[out] > 0 && internalPower[out] == 0) {
double powerConsumed = powerQuery[out] / totalPowerQuery * totalPowerContained;
if (tiles[out] instanceof TileGenericPipe) {
@ -264,7 +266,7 @@ public class PipeTransportPower extends PipeTransport {
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
TileEntity tile = tiles [dir.ordinal()];
if (!(tile instanceof TileGenericPipe)) {
if (!(tile instanceof TileGenericPipe && ((TileGenericPipe) tile).pipe.transport instanceof PipeTransportPower)) {
PowerReceiver prov = getReceiverOnSide(dir);
if (prov != null) {
double request = prov.powerRequest();