diff --git a/build.gradle b/build.gradle index 1ee87f02..bbf88865 100755 --- a/build.gradle +++ b/build.gradle @@ -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] diff --git a/buildcraft_resources/changelog/6.0.15 b/buildcraft_resources/changelog/6.0.15 new file mode 100755 index 00000000..4d31f451 --- /dev/null +++ b/buildcraft_resources/changelog/6.0.15 @@ -0,0 +1,2 @@ +#1827 fixed power distribution [SpaceToad] +#1826 fixed wooden engines not powering pipes [SpaceToad] \ No newline at end of file diff --git a/buildcraft_resources/versions.txt b/buildcraft_resources/versions.txt index 610eee1e..2c3276cc 100755 --- a/buildcraft_resources/versions.txt +++ b/buildcraft_resources/versions.txt @@ -1,2 +1,2 @@ 1.6.4:BuildCraft:4.2.2 -1.7.2:BuildCraft:6.0.14 \ No newline at end of file +1.7.2:BuildCraft:6.0.15 \ No newline at end of file diff --git a/common/buildcraft/energy/TileEngine.java b/common/buildcraft/energy/TileEngine.java index 1aa5e887..1ac3f073 100644 --- a/common/buildcraft/energy/TileEngine.java +++ b/common/buildcraft/energy/TileEngine.java @@ -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; } } diff --git a/common/buildcraft/transport/PipeTransportPower.java b/common/buildcraft/transport/PipeTransportPower.java index 9fd37d81..70d32599 100644 --- a/common/buildcraft/transport/PipeTransportPower.java +++ b/common/buildcraft/transport/PipeTransportPower.java @@ -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();