Search in sources :

Example 1 with TileEntityProxy

use of minechem.tileentity.prefab.TileEntityProxy in project Minechem by iopleke.

the class BlueprintProjectorTileEntity method setBlock.

private void setBlock(int x, int y, int z, LocalPosition position, int structureId, HashMap<Integer, BlueprintBlock> blockLookup, TileEntity managerTileEntity) {
    Pos3 worldPos = position.getLocalPos(x, y, z);
    if (structureId == MinechemBlueprint.wildcard) {
        return;
    }
    if (structureId == air) {
        worldObj.setBlockToAir(worldPos.x, worldPos.y, worldPos.z);
    } else {
        BlueprintBlock blueprintBlock = blockLookup.get(structureId);
        if (blueprintBlock.type == Type.MANAGER) {
            return;
        }
        worldObj.setBlock(worldPos.x, worldPos.y, worldPos.z, blueprintBlock.block, blueprintBlock.metadata, 3);
        if (blueprintBlock.type == Type.PROXY) {
            TileEntity te = worldObj.getTileEntity(worldPos.x, worldPos.y, worldPos.z);
            if (te instanceof TileEntityProxy) {
                TileEntityProxy proxy = (TileEntityProxy) te;
            }
        }
    }
}
Also used : BlueprintBlock(minechem.item.blueprint.BlueprintBlock) GhostBlockTileEntity(minechem.tileentity.multiblock.ghostblock.GhostBlockTileEntity) FusionTileEntity(minechem.tileentity.multiblock.fusion.FusionTileEntity) MultiBlockTileEntity(minechem.tileentity.multiblock.MultiBlockTileEntity) MinechemTileEntity(minechem.tileentity.prefab.MinechemTileEntity) TileEntity(net.minecraft.tileentity.TileEntity) TileEntityProxy(minechem.tileentity.prefab.TileEntityProxy) Pos3(minechem.utils.LocalPosition.Pos3)

Example 2 with TileEntityProxy

use of minechem.tileentity.prefab.TileEntityProxy in project Minechem by iopleke.

the class MultiBlockTileEntity method linkProxy.

private void linkProxy(int x, int y, int z) {
    int worldX = xCoord + offsetX + x;
    int worldY = yCoord + offsetY + y;
    int worldZ = zCoord + offsetZ + z;
    HashMap<Integer, BlueprintBlock> lut = blueprint.getBlockLookup();
    TileEntity tileEntity = worldObj.getTileEntity(worldX, worldY, worldZ);
    if (tileEntity != null && tileEntity instanceof TileEntityProxy) {
        ((TileEntityProxy) tileEntity).setManager(this);
    }
}
Also used : BlueprintBlock(minechem.item.blueprint.BlueprintBlock) TileEntity(net.minecraft.tileentity.TileEntity) TileEntityProxy(minechem.tileentity.prefab.TileEntityProxy) MinechemBlueprint(minechem.item.blueprint.MinechemBlueprint)

Example 3 with TileEntityProxy

use of minechem.tileentity.prefab.TileEntityProxy in project Minechem by iopleke.

the class MultiBlockTileEntity method unlinkProxy.

private void unlinkProxy(int x, int y, int z) {
    int worldX = xCoord + offsetX + x;
    int worldY = yCoord + offsetY + y;
    int worldZ = zCoord + offsetZ + z;
    TileEntity tileEntity = worldObj.getTileEntity(worldX, worldY, worldZ);
    if (tileEntity != null && tileEntity instanceof TileEntityProxy) {
        ((TileEntityProxy) tileEntity).setManager(null);
    }
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) TileEntityProxy(minechem.tileentity.prefab.TileEntityProxy) MinechemBlueprint(minechem.item.blueprint.MinechemBlueprint)

Aggregations

TileEntityProxy (minechem.tileentity.prefab.TileEntityProxy)3 TileEntity (net.minecraft.tileentity.TileEntity)3 BlueprintBlock (minechem.item.blueprint.BlueprintBlock)2 MinechemBlueprint (minechem.item.blueprint.MinechemBlueprint)2 MultiBlockTileEntity (minechem.tileentity.multiblock.MultiBlockTileEntity)1 FusionTileEntity (minechem.tileentity.multiblock.fusion.FusionTileEntity)1 GhostBlockTileEntity (minechem.tileentity.multiblock.ghostblock.GhostBlockTileEntity)1 MinechemTileEntity (minechem.tileentity.prefab.MinechemTileEntity)1 Pos3 (minechem.utils.LocalPosition.Pos3)1