Removed a bit of unneeded code in the Wood PPipe

@King_Lemming this will break compat with RS Cells because you're doing
it wrong. Don't use powerRequest() like that and don't ignore the return
of receiveEnergy().

PS. It was already broken because the cell was just throwing power away
because it was ignoring the return of receiveEnergy().
This commit is contained in:
CovertJaguar 2013-06-21 16:42:51 -07:00
parent f85015a61c
commit fc0df8e84f
2 changed files with 22 additions and 17 deletions

View file

@ -1,12 +1,10 @@
/** /**
* Copyright (c) SpaceToad, 2011 * Copyright (c) SpaceToad, 2011 http://www.mod-buildcraft.com
* http://www.mod-buildcraft.com *
* * BuildCraft is distributed under the terms of the Minecraft Mod Public License
* BuildCraft is distributed under the terms of the Minecraft Mod Public * 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://www.mod-buildcraft.com/MMPL-1.0.txt * http://www.mod-buildcraft.com/MMPL-1.0.txt
*/ */
package buildcraft.api.power; package buildcraft.api.power;
import net.minecraftforge.common.ForgeDirection; import net.minecraftforge.common.ForgeDirection;
@ -19,6 +17,14 @@ public interface IPowerReceptor {
public void doWork(); public void doWork();
/**
* Used to request power from pipes. The return cannot be relied on to be
* anything more than a approximate guide to the power needed. When
* transferring power, you much check the return value of
* PowerProvider.receiverEnergy().
*
* @param from
* @return
*/
public int powerRequest(ForgeDirection from); public int powerRequest(ForgeDirection from);
} }

View file

@ -1,11 +1,10 @@
/** /**
* BuildCraft is open-source. It is distributed under the terms of the * BuildCraft is open-source. It is distributed under the terms of the
* BuildCraft Open Source License. It grants rights to read, modify, compile * BuildCraft Open Source License. It grants rights to read, modify, compile or
* or run the code. It does *NOT* grant the right to redistribute this software * run the code. It does *NOT* grant the right to redistribute this software or
* or its modifications in any form, binary or source, except if expressively * its modifications in any form, binary or source, except if expressively
* granted by the copyright holder. * granted by the copyright holder.
*/ */
package buildcraft.transport.pipes; package buildcraft.transport.pipes;
import net.minecraft.inventory.IInventory; import net.minecraft.inventory.IInventory;
@ -36,7 +35,6 @@ import cpw.mods.fml.relauncher.SideOnly;
public class PipeItemsWood extends Pipe implements IPowerReceptor { public class PipeItemsWood extends Pipe implements IPowerReceptor {
private IPowerProvider powerProvider; private IPowerProvider powerProvider;
protected int standardIconIndex = PipeIconProvider.PipeItemsWood_Standard; protected int standardIconIndex = PipeIconProvider.PipeItemsWood_Standard;
protected int solidIconIndex = PipeIconProvider.PipeAllWood_Solid; protected int solidIconIndex = PipeIconProvider.PipeAllWood_Solid;
@ -130,8 +128,9 @@ public class PipeItemsWood extends Pipe implements IPowerReceptor {
} }
/** /**
* Return the itemstack that can be if something can be extracted from this inventory, null if none. On certain cases, the extractable slot depends on the * Return the itemstack that can be if something can be extracted from this
* position of the pipe. * inventory, null if none. On certain cases, the extractable slot depends
* on the position of the pipe.
*/ */
public ItemStack[] checkExtract(IInventory inventory, boolean doRemove, ForgeDirection from) { public ItemStack[] checkExtract(IInventory inventory, boolean doRemove, ForgeDirection from) {
@ -152,7 +151,7 @@ public class PipeItemsWood extends Pipe implements IPowerReceptor {
ItemStack result = checkExtractGeneric(inv, doRemove, from); ItemStack result = checkExtractGeneric(inv, doRemove, from);
if (result != null) if (result != null)
return new ItemStack[] { result }; return new ItemStack[]{result};
} }
return null; return null;
@ -181,7 +180,7 @@ public class PipeItemsWood extends Pipe implements IPowerReceptor {
@Override @Override
public int powerRequest(ForgeDirection from) { public int powerRequest(ForgeDirection from) {
return getPowerProvider().getMaxEnergyReceived(); return 0;
} }
@Override @Override