Advertisement
CmdEngineer

Untitled

Oct 20th, 2017
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.77 KB | None | 0 0
  1.                 String pp = Pastebin.getContents(txtFile.getText());
  2.                 NBTTagCompound nbt = new NBTTagCompound();
  3.                 NBTTagCompound data = new NBTTagCompound();
  4.                 try {
  5.                     data = JsonToNBT.getTagFromJson(pp.split("<=Data=>")[1]);
  6.                     nbt = JsonToNBT.getTagFromJson(pp.split("<=Data=>")[0]);
  7.                 } catch (NBTException e) {
  8.                     e.printStackTrace();
  9.                 }
  10.                 File newFile = new File(nbt.getString("name"), nbt.getString("app"), data);
  11.                 System.out.println(newFile.getName());
  12.                 System.out.println(newFile.getOpeningApp());
  13.                 Dialog.SaveFile dialog = new Dialog.SaveFile(PasteFile.this, newFile);
  14.                 dialog.setResponseHandler((success, file) -> {
  15.                     if(success){
  16.                         txtFile.clear();
  17.                         return true;
  18.                     }
  19.                     return false;
  20.                 });
  21.                 dialog.openDialog(dialog);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement