Closes #593 Updating RF Integration to use version 1.7.10R1.0.2
The new update contained a split of the IEnergyHandler into the IEnergyReceiver and IEnergyProvider. Since all tiles in AE2 are basically IEnergyReceivers we use them and changed the detection of opposing tile entities from IEnergyHandler to IEnergyReceiver
This commit is contained in:
@@ -21,7 +21,12 @@ package appeng.parts.layers;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.api.parts.IPart;
|
||||
import appeng.api.parts.LayerBase;
|
||||
|
||||
import cofh.api.energy.IEnergyConnection;
|
||||
import cofh.api.energy.IEnergyHandler;
|
||||
import cofh.api.energy.IEnergyProvider;
|
||||
import cofh.api.energy.IEnergyReceiver;
|
||||
|
||||
|
||||
public class LayerIEnergyHandler extends LayerBase implements IEnergyHandler
|
||||
{
|
||||
@@ -29,9 +34,9 @@ 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 );
|
||||
IPart part = this.getPart( from );
|
||||
if ( part instanceof IEnergyReceiver )
|
||||
return ((IEnergyReceiver) part).receiveEnergy( from, maxReceive, simulate );
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -39,9 +44,9 @@ public class LayerIEnergyHandler extends LayerBase implements IEnergyHandler
|
||||
@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 );
|
||||
IPart part = this.getPart( from );
|
||||
if ( part instanceof IEnergyProvider )
|
||||
return ((IEnergyProvider) part).extractEnergy( from, maxExtract, simulate );
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -49,9 +54,9 @@ public class LayerIEnergyHandler extends LayerBase implements IEnergyHandler
|
||||
@Override
|
||||
public int getEnergyStored(ForgeDirection from)
|
||||
{
|
||||
IPart part = getPart( from );
|
||||
if ( part instanceof IEnergyHandler )
|
||||
return ((IEnergyHandler) part).getEnergyStored( from );
|
||||
IPart part = this.getPart( from );
|
||||
if ( part instanceof IEnergyProvider )
|
||||
return ((IEnergyProvider) part).getEnergyStored( from );
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -59,9 +64,9 @@ public class LayerIEnergyHandler extends LayerBase implements IEnergyHandler
|
||||
@Override
|
||||
public int getMaxEnergyStored(ForgeDirection from)
|
||||
{
|
||||
IPart part = getPart( from );
|
||||
if ( part instanceof IEnergyHandler )
|
||||
return ((IEnergyHandler) part).getMaxEnergyStored( from );
|
||||
IPart part = this.getPart( from );
|
||||
if ( part instanceof IEnergyProvider )
|
||||
return ((IEnergyProvider) part).getMaxEnergyStored( from );
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -69,9 +74,9 @@ public class LayerIEnergyHandler extends LayerBase implements IEnergyHandler
|
||||
@Override
|
||||
public boolean canConnectEnergy(ForgeDirection from)
|
||||
{
|
||||
IPart part = getPart( from );
|
||||
if ( part instanceof IEnergyHandler )
|
||||
return ((IEnergyHandler) part).canConnectEnergy( from );
|
||||
IPart part = this.getPart( from );
|
||||
if ( part instanceof IEnergyConnection )
|
||||
return ((IEnergyConnection) part).canConnectEnergy( from );
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user