public int getUniqueDataId(String var1) {
      Short var2 = (Short)this.idCounts.get(var1);
      if(var2 == null) {
         var2 = Short.valueOf((short)0);
      } else {
         var2 = Short.valueOf((short)(var2.shortValue() + 1));
      }

      this.idCounts.put(var1, var2);
      if(this.saveHandler == null) {
         return var2.shortValue();
      } else {
         try {
            File var3 = this.saveHandler.func_28113_a("idcounts");
            if(var3 != null) {
               NBTTagCompound var4 = new NBTTagCompound();
               Iterator var5 = this.idCounts.keySet().iterator();

               while(var5.hasNext()) {
                  String var6 = (String)var5.next();
                  short var7 = ((Short)this.idCounts.get(var6)).shortValue();
                  var4.setShort(var6, var7);
               }

               DataOutputStream var9 = new DataOutputStream(new FileOutputStream(var3));
               CompressedStreamTools.func_1139_a(var4, var9);
               var9.close();
            }
         } catch (Exception var8) {
            var8.printStackTrace();
         }

         return var2.shortValue();
      }
   }