Search in sources :

Example 11 with XNetBlobData

use of mcjty.xnet.multiblock.XNetBlobData in project XNet by McJty.

the class CommandCheck method execute.

@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) {
    XNetBlobData data = XNetBlobData.getBlobData(server.getEntityWorld());
    data.getWorldBlob(sender.getEntityWorld()).checkNetwork(server.getEntityWorld());
}
Also used : XNetBlobData(mcjty.xnet.multiblock.XNetBlobData)

Example 12 with XNetBlobData

use of mcjty.xnet.multiblock.XNetBlobData in project XNet by McJty.

the class CommandDump method execute.

@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) {
    XNetBlobData data = XNetBlobData.getBlobData(server.getEntityWorld());
    data.getWorldBlob(sender.getEntityWorld()).dump();
}
Also used : XNetBlobData(mcjty.xnet.multiblock.XNetBlobData)

Example 13 with XNetBlobData

use of mcjty.xnet.multiblock.XNetBlobData in project XNet by McJty.

the class CommandRebuild method execute.

@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) {
    XNetBlobData data = XNetBlobData.getBlobData(server.getEntityWorld());
    data.getWorldBlob(sender.getEntityWorld()).recalculateNetwork();
}
Also used : XNetBlobData(mcjty.xnet.multiblock.XNetBlobData)

Example 14 with XNetBlobData

use of mcjty.xnet.multiblock.XNetBlobData in project XNet by McJty.

the class ControllerBlock method breakBlock.

@Override
public void breakBlock(World world, BlockPos pos, IBlockState state) {
    if (!world.isRemote) {
        XNetBlobData blobData = XNetBlobData.getBlobData(world);
        WorldBlob worldBlob = blobData.getWorldBlob(world);
        worldBlob.removeCableSegment(pos);
        blobData.save(world);
    }
    super.breakBlock(world, pos, state);
}
Also used : XNetBlobData(mcjty.xnet.multiblock.XNetBlobData) WorldBlob(mcjty.xnet.multiblock.WorldBlob)

Aggregations

XNetBlobData (mcjty.xnet.multiblock.XNetBlobData)14 WorldBlob (mcjty.xnet.multiblock.WorldBlob)10 ColorId (mcjty.xnet.multiblock.ColorId)5 NetworkId (mcjty.xnet.api.keys.NetworkId)3 TileEntity (net.minecraft.tileentity.TileEntity)3 ConsumerId (mcjty.xnet.api.keys.ConsumerId)2 ConnectorBlock (mcjty.xnet.blocks.cables.ConnectorBlock)2 CableColor (mcjty.xnet.blocks.generic.CableColor)2 EnumFacing (net.minecraft.util.EnumFacing)2 ConnectorTileEntity (mcjty.xnet.blocks.cables.ConnectorTileEntity)1 GenericCableBlock (mcjty.xnet.blocks.generic.GenericCableBlock)1 BlobId (mcjty.xnet.multiblock.BlobId)1 Block (net.minecraft.block.Block)1 IBlockState (net.minecraft.block.state.IBlockState)1 EntityPlayer (net.minecraft.entity.player.EntityPlayer)1 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)1 BlockPos (net.minecraft.util.math.BlockPos)1 TextComponentString (net.minecraft.util.text.TextComponentString)1 World (net.minecraft.world.World)1