Merge branch 'M3gaFr3ak-patch-1' into 6.0.x
This commit is contained in:
commit
1f21a80d70
3 changed files with 20 additions and 19 deletions
|
@ -1,15 +1,15 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2014, Prototik and the BuildFactory Team
|
* Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
|
||||||
* http://buildfactory.org/
|
* http://www.mod-buildcraft.com
|
||||||
*
|
*
|
||||||
* BuildFactory is distributed under the terms of the Minecraft Mod Public
|
* BuildCraft is distributed under the terms of the Minecraft Mod Public
|
||||||
* License 1.0, or MMPL. Please check the contents of the license located in
|
* License 1.0, or MMPL. Please check the contents of the license located in
|
||||||
* http://buildfactory.org/license
|
* http://www.mod-buildcraft.com/MMPL-1.0.txt
|
||||||
*/
|
*/
|
||||||
package buildcraft.api.mj;
|
package buildcraft.api.mj;
|
||||||
|
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
public interface ISidedBatteryProvider extends IBatteryProvider {
|
public interface ISidedBatteryProvider {
|
||||||
IBatteryObject getMjBattery(String kind, ForgeDirection direction);
|
IBatteryObject getMjBattery(String kind, ForgeDirection direction);
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,22 +65,22 @@ public final class MjAPI {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (o instanceof IBatteryProvider) {
|
IBatteryObject battery = null;
|
||||||
IBatteryObject battery;
|
|
||||||
|
|
||||||
if (o instanceof ISidedBatteryProvider) {
|
if (o instanceof ISidedBatteryProvider) {
|
||||||
battery = ((ISidedBatteryProvider) o).getMjBattery(kind, side);
|
battery = ((ISidedBatteryProvider) o).getMjBattery(kind, side);
|
||||||
if (battery == null && side != ForgeDirection.UNKNOWN) {
|
if (battery == null && side != ForgeDirection.UNKNOWN) {
|
||||||
battery = ((ISidedBatteryProvider) o).getMjBattery(kind, ForgeDirection.UNKNOWN);
|
battery = ((ISidedBatteryProvider) o).getMjBattery(kind, ForgeDirection.UNKNOWN);
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
|
||||||
|
if (o instanceof IBatteryProvider) {
|
||||||
battery = ((IBatteryProvider) o).getMjBattery(kind);
|
battery = ((IBatteryProvider) o).getMjBattery(kind);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (battery != null) {
|
if (battery != null) {
|
||||||
return battery;
|
return battery;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
BatteryField f = getMjBatteryField(o.getClass(), kind, side);
|
BatteryField f = getMjBatteryField(o.getClass(), kind, side);
|
||||||
if (f == null && side != ForgeDirection.UNKNOWN) {
|
if (f == null && side != ForgeDirection.UNKNOWN) {
|
||||||
|
|
|
@ -204,7 +204,8 @@ public class TileTank extends TileBuildCraft implements IFluidHandler {
|
||||||
if (resource == null) {
|
if (resource == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (!resource.isFluidEqual(tank.getFluid())) {
|
TileTank bottom = getBottomTank();
|
||||||
|
if (!resource.isFluidEqual(bottom.tank.getFluid())) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return drain(from, resource.amount, doDrain);
|
return drain(from, resource.amount, doDrain);
|
||||||
|
|
Loading…
Reference in a new issue