Cleaner CC support with a separate peripheral handler

This commit is contained in:
aidancbrady committed 2015-07-20 12:28:18 -07:00
1 parent 728e497dd1
commit c7fe1f86eb
18 files changed
+132 -654

No files matched your search

@@ -4,10 +4,6 @@ import cofh.api.energy.IEnergyHandler;
import cpw.mods.fml.common.Optional.Interface;
import cpw.mods.fml.common.Optional.InterfaceList;
import cpw.mods.fml.common.Optional.Method;
import dan200.computercraft.api.lua.ILuaContext;
import dan200.computercraft.api.lua.LuaException;
import dan200.computercraft.api.peripheral.IComputerAccess;
import dan200.computercraft.api.peripheral.IPeripheral;
import ic2.api.energy.tile.IEnergySink;
import mekanism.api.Coord4D;
import mekanism.api.IFilterAccess;
@@ -391,38 +387,6 @@ public class TileEntityAdvancedBoundingBlock extends TileEntityBoundingBlock imp
}
}
@Override
@Method(modid = "ComputerCraft")
public String getType()
{
if(getInv() == null)
{
return null;
}
return getInv().getType();
}
@Override
@Method(modid = "ComputerCraft")
public String[] getMethodNames()
{
return getMethods();
}
@Override
@Method(modid = "ComputerCraft")
public Object[] callMethod(IComputerAccess computer, ILuaContext context, int method, Object[] arguments) throws LuaException, InterruptedException
{
try {
return invoke(method, arguments);
} catch(NoSuchMethodException e) {
return new Object[] {"Unknown command."};
} finally {
return new Object[] {"Error."};
}
}
@Override
public String[] getMethods()
{
@@ -445,37 +409,6 @@ public class TileEntityAdvancedBoundingBlock extends TileEntityBoundingBlock imp
return getInv().invoke(method, arguments);
}
@Override
@Method(modid = "ComputerCraft")
public void attach(IComputerAccess computer)
{
if(getInv() == null)
{
return;
}
getInv().attach(computer);
}
@Override
@Method(modid = "ComputerCraft")
public void detach(IComputerAccess computer)
{
if(getInv() == null)
{
return;
}
getInv().detach(computer);
}
@Override
@Method(modid = "ComputerCraft")
public boolean equals(IPeripheral other)
{
return this == other;
}
@Override
public NBTTagCompound getFilterData(NBTTagCompound nbtTags)
{