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:
parent
f85015a61c
commit
fc0df8e84f
2 changed files with 22 additions and 17 deletions
|
@ -1,12 +1,10 @@
|
|||
/**
|
||||
* Copyright (c) SpaceToad, 2011
|
||||
* http://www.mod-buildcraft.com
|
||||
*
|
||||
* 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
|
||||
/**
|
||||
* Copyright (c) SpaceToad, 2011 http://www.mod-buildcraft.com
|
||||
*
|
||||
* 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://www.mod-buildcraft.com/MMPL-1.0.txt
|
||||
*/
|
||||
|
||||
package buildcraft.api.power;
|
||||
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
|
@ -19,6 +17,14 @@ public interface IPowerReceptor {
|
|||
|
||||
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);
|
||||
|
||||
}
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
/**
|
||||
* BuildCraft is open-source. It is distributed under the terms of the
|
||||
* BuildCraft Open Source License. It grants rights to read, modify, compile
|
||||
* or run the code. It does *NOT* grant the right to redistribute this software
|
||||
* or its modifications in any form, binary or source, except if expressively
|
||||
* BuildCraft Open Source License. It grants rights to read, modify, compile or
|
||||
* run the code. It does *NOT* grant the right to redistribute this software or
|
||||
* its modifications in any form, binary or source, except if expressively
|
||||
* granted by the copyright holder.
|
||||
*/
|
||||
|
||||
package buildcraft.transport.pipes;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
|
@ -36,7 +35,6 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||
public class PipeItemsWood extends Pipe implements IPowerReceptor {
|
||||
|
||||
private IPowerProvider powerProvider;
|
||||
|
||||
protected int standardIconIndex = PipeIconProvider.PipeItemsWood_Standard;
|
||||
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
|
||||
* position of the pipe.
|
||||
* 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 position of the pipe.
|
||||
*/
|
||||
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);
|
||||
|
||||
if (result != null)
|
||||
return new ItemStack[] { result };
|
||||
return new ItemStack[]{result};
|
||||
}
|
||||
|
||||
return null;
|
||||
|
@ -181,7 +180,7 @@ public class PipeItemsWood extends Pipe implements IPowerReceptor {
|
|||
|
||||
@Override
|
||||
public int powerRequest(ForgeDirection from) {
|
||||
return getPowerProvider().getMaxEnergyReceived();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue