Program: 12554
Project: 12554
Buggy source:
public void renderSchematicToSingleChunk(ResourceLocation resource,World world,BlockPos origin,int chunkX,int chunkZ,EnumFacing rotation,boolean flip){
  if (rotation == EnumFacing.DOWN || rotation == EnumFacing.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=origin.getX();
  final int maxX=minX + schematic.getWidth();
  final int minY=origin.getY();
  final int maxY=minY + schematic.getHeight();
  final int minZ=origin.getZ();
  final int maxZ=minZ + 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 {
          BlockPos worldCoord=new BlockPos(x,y,z);
          BlockPos schematicCoord=new BlockPos(schematicX,schematicY,schematicZ);
          PreSetBlockEvent event=new PreSetBlockEvent(schematic,world,worldCoord,schematicCoord);
          if (setBlockEventListeners != null) {
            for (            final IPreSetBlockEventListener listener : setBlockEventListeners) {
              listener.preBlockSet(event);
            }
          }
          if (event.blockState != null && c.setBlockState(worldCoord,event.blockState) != null) {
            world.markBlockForUpdate(new BlockPos(x,y,z));
            final NBTTagCompound tileEntityData=schematic.getTileEntity(schematicCoord);
            final Block block=event.blockState.getBlock();
            if (block.hasTileEntity(event.blockState) && tileEntityData != null) {
              TileEntity tileEntity=TileEntity.createAndLoadEntity(tileEntityData);
              c.addTileEntity(new BlockPos(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,BlockPos origin,int chunkX,int chunkZ,EnumFacing rotation,boolean flip){
  if (rotation == EnumFacing.DOWN || rotation == EnumFacing.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=origin.getX();
  final int maxX=minX + schematic.getWidth();
  final int minY=origin.getY();
  final int maxY=minY + schematic.getHeight();
  final int minZ=origin.getZ();
  final int maxZ=minZ + 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 {
          BlockPos worldCoord=new BlockPos(x,y,z);
          BlockPos schematicCoord=new BlockPos(schematicX,schematicY,schematicZ);
          PreSetBlockEvent event=new PreSetBlockEvent(schematic,world,worldCoord,schematicCoord);
          if (event.blockState != null && setBlockEventListeners != null) {
            for (            final IPreSetBlockEventListener listener : setBlockEventListeners) {
              listener.preBlockSet(event);
            }
          }
          if (event.shouldSetBlock() && event.blockState != null && c.setBlockState(worldCoord,event.blockState) != null) {
            world.markBlockForUpdate(new BlockPos(x,y,z));
            final NBTTagCompound tileEntityData=schematic.getTileEntity(schematicCoord);
            final Block block=event.blockState.getBlock();
            if (block.hasTileEntity(event.blockState) && tileEntityData != null) {
              TileEntity tileEntity=TileEntity.createAndLoadEntity(tileEntityData);
              c.addTileEntity(new BlockPos(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();
}