Fixed Induction Matrix computer integration

This commit is contained in:
aidancbrady 2015-11-25 10:34:49 -07:00
parent 2640cbd50b
commit a14b0d77ad

View file

@ -1,29 +1,21 @@
package mekanism.common.tile;
import io.netty.buffer.ByteBuf;
import java.util.ArrayList;
import mekanism.api.MekanismConfig.general;
import mekanism.api.energy.IStrictEnergyStorage;
import mekanism.common.Mekanism;
import mekanism.common.content.matrix.MatrixCache;
import mekanism.common.content.matrix.MatrixUpdateProtocol;
import mekanism.common.content.matrix.SynchronizedMatrixData;
import mekanism.common.integration.IComputerIntegration;
import mekanism.common.multiblock.MultiblockManager;
import mekanism.common.util.ChargeUtils;
import mekanism.common.util.LangUtils;
import mekanism.common.util.MekanismUtils;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.common.Optional.Interface;
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;
@Interface(iface = "dan200.computercraft.api.peripheral.IPeripheral", modid = "ComputerCraft")
public class TileEntityInductionCasing extends TileEntityMultiblock<SynchronizedMatrixData> implements IStrictEnergyStorage, IPeripheral
import java.util.ArrayList;
public class TileEntityInductionCasing extends TileEntityMultiblock<SynchronizedMatrixData> implements IStrictEnergyStorage, IComputerIntegration
{
public int clientCells;
public int clientProviders;
@ -169,25 +161,16 @@ public class TileEntityInductionCasing extends TileEntityMultiblock<Synchronized
return structure != null ? structure.storageCap : 0;
}
@Override
@Method(modid = "ComputerCraft")
public String getType()
{
return "InductionMatrix";
}
public static final String[] NAMES = new String[] {"getStored", "getMaxEnergy", "getLastInput", "getLastOutput", "getTransferCap"};
public static final String[] methods = new String[] {"getStored", "getMaxEnergy", "getLastInput", "getLastOutput", "getTransferCap"};
@Override
@Method(modid = "ComputerCraft")
public String[] getMethodNames()
public String[] getMethods()
{
return NAMES;
return methods;
}
@Override
@Method(modid = "ComputerCraft")
public Object[] callMethod(IComputerAccess computer, ILuaContext context, int method, Object[] arguments) throws LuaException, InterruptedException
public Object[] invoke(int method, Object[] arguments) throws Exception
{
if(structure == null)
{
@ -210,19 +193,4 @@ public class TileEntityInductionCasing extends TileEntityMultiblock<Synchronized
return new Object[] {"Unknown command."};
}
}
@Override
@Method(modid = "ComputerCraft")
public boolean equals(IPeripheral other)
{
return this == other;
}
@Override
@Method(modid = "ComputerCraft")
public void attach(IComputerAccess computer) {}
@Override
@Method(modid = "ComputerCraft")
public void detach(IComputerAccess computer) {}
}