Applied-Energistics-2-tiler.../parts/layers/LayerIPowerReceptor.java

37 lines
869 B
Java
Raw Normal View History

2014-05-27 19:15:49 +02:00
package appeng.parts.layers;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import appeng.api.parts.IPart;
import appeng.api.parts.IPartHost;
import appeng.api.parts.LayerBase;
import buildcraft.api.power.IPowerReceptor;
import buildcraft.api.power.PowerHandler;
import buildcraft.api.power.PowerHandler.PowerReceiver;
public class LayerIPowerReceptor extends LayerBase implements IPowerReceptor
{
@Override
public PowerReceiver getPowerReceiver(ForgeDirection side)
{
IPart part = getPart( side );
if ( part instanceof IPowerReceptor )
return ((IPowerReceptor) part).getPowerReceiver( side );
return null;
}
@Override
public void doWork(PowerHandler workProvider)
{
// do nothing, this seems pointless.
}
@Override
public World getWorld()
{
return ((IPartHost) this).getTile().getWorldObj();
}
}