Removed Layers from API - I'm sick of people commenting on it.

This commit is contained in:
AlgorithmX2
2014-05-27 12:06:55 -05:00
parent ea936d3b72
commit eb8e8da0a2
11 changed files with 811 additions and 0 deletions
+61
View File
@@ -0,0 +1,61 @@
package appeng.api.parts.layers;
import net.minecraftforge.common.util.ForgeDirection;
import appeng.api.parts.IPart;
import appeng.api.parts.LayerBase;
import cofh.api.energy.IEnergyHandler;
public class LayerIEnergyHandler extends LayerBase implements IEnergyHandler
{
@Override
public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate)
{
IPart part = getPart( from );
if ( part instanceof IEnergyHandler )
return ((IEnergyHandler) part).receiveEnergy( from, maxReceive, simulate );
return 0;
}
@Override
public int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate)
{
IPart part = getPart( from );
if ( part instanceof IEnergyHandler )
return ((IEnergyHandler) part).extractEnergy( from, maxExtract, simulate );
return 0;
}
@Override
public int getEnergyStored(ForgeDirection from)
{
IPart part = getPart( from );
if ( part instanceof IEnergyHandler )
return ((IEnergyHandler) part).getEnergyStored( from );
return 0;
}
@Override
public int getMaxEnergyStored(ForgeDirection from)
{
IPart part = getPart( from );
if ( part instanceof IEnergyHandler )
return ((IEnergyHandler) part).getMaxEnergyStored( from );
return 0;
}
@Override
public boolean canConnectEnergy(ForgeDirection from)
{
IPart part = getPart( from );
if ( part instanceof IEnergyHandler )
return ((IEnergyHandler) part).canConnectEnergy( from );
return false;
}
}