Program: 12564
Project: 12564
Buggy source:
public void renderSchematicToSingleChunk(ResourceLocation resource,World world,int originX,int originY,int originZ,int chunkX,int chunkZ,ForgeDirection rotation,boolean flip){
  if (rotation == ForgeDirection.DOWN || rotation == ForgeDirection.UP) {
    _logger.error("String_Node_Str",resource,rotation);
    return;
  }
  SchematicWorld schematic=loadedSchematics.get(resource);
  if (schematic == null) {
    _logger.error("String_Node_Str",resource);
    return;
  }
  _logger.info(String.format("String_Node_Str",System.currentTimeMillis(),chunkX,chunkZ));
  final int minX=originX;
  final int maxX=originX + schematic.getWidth();
  final int minY=originY;
  final int maxY=originY + schematic.getHeight();
  final int minZ=originZ;
  final int maxZ=originZ + schematic.getLength();
  final int localMinX=minX < (chunkX << 4) ? 0 : (minX & 15);
  final int localMaxX=maxX > ((chunkX << 4) + 15) ? 15 : (maxX & 15);
  final int localMinZ=minZ < (chunkZ << 4) ? 0 : (minZ & 15);
  final int localMaxZ=maxZ > ((chunkZ << 4) + 15) ? 15 : (maxZ & 15);
  Chunk c=world.getChunkFromChunkCoords(chunkX,chunkZ);
  int blockCount=0;
  Block ignore=Blocks.air;
  LinkedList<TileEntity> createdTileEntities=new LinkedList<TileEntity>();
  for (int chunkLocalZ=localMinZ; chunkLocalZ <= localMaxZ; chunkLocalZ++) {
    for (int y=minY; y < maxY; y++) {
      for (int chunkLocalX=localMinX; chunkLocalX <= localMaxX; chunkLocalX++) {
        ++blockCount;
        final int x=chunkLocalX | (chunkX << 4);
        final int z=chunkLocalZ | (chunkZ << 4);
        final int schematicX=x - minX;
        final int schematicY=y - minY;
        final int schematicZ=z - minZ;
        try {
          WorldBlockCoord worldCoord=new WorldBlockCoord(chunkX << 4 | chunkLocalX,y,chunkZ << 4 | chunkLocalZ);
          WorldBlockCoord schematicCoord=new WorldBlockCoord(schematicX,schematicY,schematicZ);
          PreSetBlockEvent event=new PreSetBlockEvent(schematic,world,worldCoord,schematicCoord);
          if (setBlockEventListeners != null) {
            for (            final IPreSetBlockEventListener listener : setBlockEventListeners) {
              listener.preBlockSet(event);
            }
          }
          if (event.block != null && c.func_150807_a(chunkLocalX,y,chunkLocalZ,event.block,event.metadata)) {
            world.markBlockForUpdate(x,y,z);
            final NBTTagCompound tileEntityData=schematic.getTileEntity(schematicX,schematicY,schematicZ);
            if (event.block.hasTileEntity(event.metadata) && tileEntityData != null) {
              TileEntity tileEntity=TileEntity.createAndLoadEntity(tileEntityData);
              c.func_150812_a(chunkLocalX,y,chunkLocalZ,tileEntity);
              tileEntity.getBlockType();
              try {
                tileEntity.validate();
              }
 catch (              Exception e) {
                _logger.error(String.format("String_Node_Str",tileEntity.getClass()),e);
              }
              createdTileEntities.add(tileEntity);
            }
          }
        }
 catch (        Exception e) {
          _logger.error("String_Node_Str",e);
        }
      }
    }
  }
  for (  final TileEntity tileEntity : createdTileEntities) {
    for (    ITileEntityLoadedEvent tileEntityHandler : tileEntityLoadedEventListeners) {
      if (tileEntityHandler.onTileEntityAdded(tileEntity)) {
        break;
      }
    }
  }
  c.enqueueRelightChecks();
  c.setChunkModified();
}

Fixed version (ground truth):
public void renderSchematicToSingleChunk(ResourceLocation resource,World world,int originX,int originY,int originZ,int chunkX,int chunkZ,ForgeDirection rotation,boolean flip){
  if (rotation == ForgeDirection.DOWN || rotation == ForgeDirection.UP) {
    _logger.error("String_Node_Str",resource,rotation);
    return;
  }
  SchematicWorld schematic=loadedSchematics.get(resource);
  if (schematic == null) {
    _logger.error("String_Node_Str",resource);
    return;
  }
  final int minX=originX;
  final int maxX=originX + schematic.getWidth();
  final int minY=originY;
  final int maxY=originY + schematic.getHeight();
  final int minZ=originZ;
  final int maxZ=originZ + schematic.getLength();
  final int localMinX=minX < (chunkX << 4) ? 0 : (minX & 15);
  final int localMaxX=maxX > ((chunkX << 4) + 15) ? 15 : (maxX & 15);
  final int localMinZ=minZ < (chunkZ << 4) ? 0 : (minZ & 15);
  final int localMaxZ=maxZ > ((chunkZ << 4) + 15) ? 15 : (maxZ & 15);
  Chunk c=world.getChunkFromChunkCoords(chunkX,chunkZ);
  int blockCount=0;
  Block ignore=Blocks.air;
  LinkedList<TileEntity> createdTileEntities=new LinkedList<TileEntity>();
  for (int chunkLocalZ=localMinZ; chunkLocalZ <= localMaxZ; chunkLocalZ++) {
    for (int y=minY; y < maxY; y++) {
      for (int chunkLocalX=localMinX; chunkLocalX <= localMaxX; chunkLocalX++) {
        ++blockCount;
        final int x=chunkLocalX | (chunkX << 4);
        final int z=chunkLocalZ | (chunkZ << 4);
        final int schematicX=x - minX;
        final int schematicY=y - minY;
        final int schematicZ=z - minZ;
        try {
          WorldBlockCoord worldCoord=new WorldBlockCoord(chunkX << 4 | chunkLocalX,y,chunkZ << 4 | chunkLocalZ);
          WorldBlockCoord schematicCoord=new WorldBlockCoord(schematicX,schematicY,schematicZ);
          PreSetBlockEvent event=new PreSetBlockEvent(schematic,world,worldCoord,schematicCoord);
          if (setBlockEventListeners != null) {
            for (            final IPreSetBlockEventListener listener : setBlockEventListeners) {
              listener.preBlockSet(event);
            }
          }
          if (event.block != null && c.func_150807_a(chunkLocalX,y,chunkLocalZ,event.block,event.metadata)) {
            world.markBlockForUpdate(x,y,z);
            final NBTTagCompound tileEntityData=schematic.getTileEntity(schematicX,schematicY,schematicZ);
            if (event.block.hasTileEntity(event.metadata) && tileEntityData != null) {
              TileEntity tileEntity=TileEntity.createAndLoadEntity(tileEntityData);
              c.func_150812_a(chunkLocalX,y,chunkLocalZ,tileEntity);
              tileEntity.getBlockType();
              try {
                tileEntity.validate();
              }
 catch (              Exception e) {
                _logger.error(String.format("String_Node_Str",tileEntity.getClass()),e);
              }
              createdTileEntities.add(tileEntity);
            }
          }
        }
 catch (        Exception e) {
          _logger.error("String_Node_Str",e);
        }
      }
    }
  }
  for (  final TileEntity tileEntity : createdTileEntities) {
    for (    ITileEntityLoadedEvent tileEntityHandler : tileEntityLoadedEventListeners) {
      if (tileEntityHandler.onTileEntityAdded(tileEntity)) {
        break;
      }
    }
  }
  c.enqueueRelightChecks();
  c.setChunkModified();
}