Program: 10332
Project: 10332
Buggy source:
/** 
 * Creates an NBT list of all tile entities in this chunk, importing tile entities as needed.
 */
public NBTTagList getTileEntityList(Chunk chunk){
  NBTTagList tileEntityList=new NBTTagList();
  if (!WDLPluginChannels.canSaveTileEntities(chunk)) {
    return tileEntityList;
  }
  Map<BlockPos,TileEntity> chunkTEMap=chunk.getTileEntityMap();
  Map<BlockPos,NBTTagCompound> oldTEMap=getOldTileEntities(chunk);
  Map<BlockPos,TileEntity> newTEMap=WDL.newTileEntities.get(chunk.getPos());
  if (newTEMap == null) {
    newTEMap=new HashMap<BlockPos,TileEntity>();
  }
  Set<BlockPos> allTELocations=new HashSet<BlockPos>();
  allTELocations.addAll(chunkTEMap.keySet());
  allTELocations.addAll(oldTEMap.keySet());
  allTELocations.addAll(newTEMap.keySet());
  for (  BlockPos pos : allTELocations) {
    if (newTEMap.containsKey(pos)) {
      NBTTagCompound compound=new NBTTagCompound();
      TileEntity te=newTEMap.get(pos);
      try {
        te.writeToNBT(compound);
      }
 catch (      Exception e) {
        WDLMessages.chatMessageTranslated(WDLMessageTypes.ERROR,"String_Node_Str",te,pos,chunk.xPosition,chunk.zPosition,e);
        logger.warn("String_Node_Str" + compound);
        continue;
      }
      String entityType=compound.getString("String_Node_Str") + "String_Node_Str" + te.getClass().getCanonicalName()+ "String_Node_Str";
      WDLMessages.chatMessageTranslated(WDLMessageTypes.LOAD_TILE_ENTITY,"String_Node_Str",entityType,pos);
      editTileEntity(pos,compound,TileEntityCreationMode.NEW);
      tileEntityList.appendTag(compound);
    }
 else     if (oldTEMap.containsKey(pos)) {
      NBTTagCompound compound=oldTEMap.get(pos);
      String entityType=compound.getString("String_Node_Str");
      WDLMessages.chatMessageTranslated(WDLMessageTypes.LOAD_TILE_ENTITY,"String_Node_Str",entityType,pos);
      editTileEntity(pos,compound,TileEntityCreationMode.IMPORTED);
      tileEntityList.appendTag(compound);
    }
 else     if (chunkTEMap.containsKey(pos)) {
      TileEntity te=chunkTEMap.get(pos);
      NBTTagCompound compound=new NBTTagCompound();
      try {
        te.writeToNBT(compound);
      }
 catch (      Exception e) {
        WDLMessages.chatMessageTranslated(WDLMessageTypes.ERROR,"String_Node_Str",te,pos,chunk.xPosition,chunk.zPosition,e);
        logger.warn("String_Node_Str" + compound);
        continue;
      }
      editTileEntity(pos,compound,TileEntityCreationMode.EXISTING);
      tileEntityList.appendTag(compound);
    }
  }
  return tileEntityList;
}

Fixed version (ground truth):
/** 
 * Creates an NBT list of all tile entities in this chunk, importing tile entities as needed.
 */
public NBTTagList getTileEntityList(Chunk chunk){
  NBTTagList tileEntityList=new NBTTagList();
  if (!WDLPluginChannels.canSaveTileEntities(chunk)) {
    return tileEntityList;
  }
  Map<BlockPos,TileEntity> chunkTEMap=chunk.getTileEntityMap();
  Map<BlockPos,NBTTagCompound> oldTEMap=getOldTileEntities(chunk);
  Map<BlockPos,TileEntity> newTEMap=WDL.newTileEntities.get(chunk.getPos());
  if (newTEMap == null) {
    newTEMap=new HashMap<BlockPos,TileEntity>();
  }
  Set<BlockPos> allTELocations=new HashSet<BlockPos>();
  allTELocations.addAll(chunkTEMap.keySet());
  allTELocations.addAll(oldTEMap.keySet());
  allTELocations.addAll(newTEMap.keySet());
  for (  BlockPos pos : allTELocations) {
    if (newTEMap.containsKey(pos)) {
      NBTTagCompound compound=new NBTTagCompound();
      TileEntity te=newTEMap.get(pos);
      try {
        te.writeToNBT(compound);
      }
 catch (      Exception e) {
        WDLMessages.chatMessageTranslated(WDLMessageTypes.ERROR,"String_Node_Str",te,pos,chunk.x,chunk.z,e);
        logger.warn("String_Node_Str" + compound);
        continue;
      }
      String entityType=compound.getString("String_Node_Str") + "String_Node_Str" + te.getClass().getCanonicalName()+ "String_Node_Str";
      WDLMessages.chatMessageTranslated(WDLMessageTypes.LOAD_TILE_ENTITY,"String_Node_Str",entityType,pos);
      editTileEntity(pos,compound,TileEntityCreationMode.NEW);
      tileEntityList.appendTag(compound);
    }
 else     if (oldTEMap.containsKey(pos)) {
      NBTTagCompound compound=oldTEMap.get(pos);
      String entityType=compound.getString("String_Node_Str");
      WDLMessages.chatMessageTranslated(WDLMessageTypes.LOAD_TILE_ENTITY,"String_Node_Str",entityType,pos);
      editTileEntity(pos,compound,TileEntityCreationMode.IMPORTED);
      tileEntityList.appendTag(compound);
    }
 else     if (chunkTEMap.containsKey(pos)) {
      TileEntity te=chunkTEMap.get(pos);
      NBTTagCompound compound=new NBTTagCompound();
      try {
        te.writeToNBT(compound);
      }
 catch (      Exception e) {
        WDLMessages.chatMessageTranslated(WDLMessageTypes.ERROR,"String_Node_Str",te,pos,chunk.x,chunk.z,e);
        logger.warn("String_Node_Str" + compound);
        continue;
      }
      editTileEntity(pos,compound,TileEntityCreationMode.EXISTING);
      tileEntityList.appendTag(compound);
    }
  }
  return tileEntityList;
}