diff --git a/api/buildcraft/api/mj/ISidedBatteryProvider.java b/api/buildcraft/api/mj/ISidedBatteryProvider.java index 3ffc8584..46adb69d 100644 --- a/api/buildcraft/api/mj/ISidedBatteryProvider.java +++ b/api/buildcraft/api/mj/ISidedBatteryProvider.java @@ -1,15 +1,15 @@ /** - * Copyright (c) 2014, Prototik and the BuildFactory Team - * http://buildfactory.org/ + * Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team + * 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 - * http://buildfactory.org/license + * http://www.mod-buildcraft.com/MMPL-1.0.txt */ package buildcraft.api.mj; import net.minecraftforge.common.util.ForgeDirection; -public interface ISidedBatteryProvider extends IBatteryProvider { +public interface ISidedBatteryProvider { IBatteryObject getMjBattery(String kind, ForgeDirection direction); } diff --git a/api/buildcraft/api/mj/MjAPI.java b/api/buildcraft/api/mj/MjAPI.java index 08cb2dc5..1a64b803 100755 --- a/api/buildcraft/api/mj/MjAPI.java +++ b/api/buildcraft/api/mj/MjAPI.java @@ -65,21 +65,21 @@ public final class MjAPI { 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) { - IBatteryObject battery; + battery = ((IBatteryProvider) o).getMjBattery(kind); + } - if (o instanceof ISidedBatteryProvider) { - battery = ((ISidedBatteryProvider) o).getMjBattery(kind, side); - if (battery == null && side != ForgeDirection.UNKNOWN) { - battery = ((ISidedBatteryProvider) o).getMjBattery(kind, ForgeDirection.UNKNOWN); - } - } else { - battery = ((IBatteryProvider) o).getMjBattery(kind); - } - - if (battery != null) { - return battery; - } + if (battery != null) { + return battery; } BatteryField f = getMjBatteryField(o.getClass(), kind, side);