mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-25 14:24:35 +00:00
Add CC IPeripheralProvider to Bounding, EnergyCube and Generator blocks
This commit is contained in:
1 parent
799f49d9b6
commit
91dbb7fcd6
3 files changed
+57
-4
No files matched your search
@@ -33,8 +33,12 @@ import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import buildcraft.api.tools.IToolWrench;
|
||||
import dan200.computercraft.api.peripheral.IPeripheral;
|
||||
import dan200.computercraft.api.peripheral.IPeripheralProvider;
|
||||
|
||||
import cpw.mods.fml.common.ModAPIManager;
|
||||
import cpw.mods.fml.common.Optional.Interface;
|
||||
import cpw.mods.fml.common.Optional.Method;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -46,7 +50,8 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
* @author AidanBrady
|
||||
*
|
||||
*/
|
||||
public class BlockEnergyCube extends BlockContainer
|
||||
@Interface(iface = "dan200.computercraft.api.peripheral.IPeripheralProvider", modid = "ComputerCraft")
|
||||
public class BlockEnergyCube extends BlockContainer implements IPeripheralProvider
|
||||
{
|
||||
public IIcon[][] icons = new IIcon[256][256];
|
||||
|
||||
@@ -354,4 +359,18 @@ public class BlockEnergyCube extends BlockContainer
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Method(modid = "ComputerCraft")
|
||||
public IPeripheral getPeripheral(World world, int x, int y, int z, int side)
|
||||
{
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
|
||||
if(te != null && te instanceof IPeripheral)
|
||||
{
|
||||
return (IPeripheral)te;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user