Merge branch 'M3gaFr3ak-patch-1' into 6.0.x

This commit is contained in:
SpaceToad 2014-05-12 23:19:00 +02:00
commit 1f21a80d70
3 changed files with 20 additions and 19 deletions

View file

@ -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);
} }

View file

@ -65,21 +65,21 @@ public final class MjAPI {
return null; return null;
} }
IBatteryObject battery = null;
if (o instanceof ISidedBatteryProvider) {
battery = ((ISidedBatteryProvider) o).getMjBattery(kind, side);
if (battery == null && side != ForgeDirection.UNKNOWN) {
battery = ((ISidedBatteryProvider) o).getMjBattery(kind, ForgeDirection.UNKNOWN);
}
}
if (o instanceof IBatteryProvider) { if (o instanceof IBatteryProvider) {
IBatteryObject battery; battery = ((IBatteryProvider) o).getMjBattery(kind);
}
if (o instanceof ISidedBatteryProvider) { if (battery != null) {
battery = ((ISidedBatteryProvider) o).getMjBattery(kind, side); return battery;
if (battery == null && side != ForgeDirection.UNKNOWN) {
battery = ((ISidedBatteryProvider) o).getMjBattery(kind, ForgeDirection.UNKNOWN);
}
} else {
battery = ((IBatteryProvider) o).getMjBattery(kind);
}
if (battery != null) {
return battery;
}
} }
BatteryField f = getMjBatteryField(o.getClass(), kind, side); BatteryField f = getMjBatteryField(o.getClass(), kind, side);

View file

@ -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);