Skip to content

Commit

Permalink
Merge pull request #311 from NOVA-Team/file-extension/nbt
Browse files Browse the repository at this point in the history
Change MCRetentionManager file extension to .nbt
  • Loading branch information
ExE-Boss committed Oct 23, 2017
2 parents 6ee0f33 + e985ec8 commit 297857e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public void load(String filename, Storable storable) {
*/
public boolean saveFile(File file, NBTTagCompound data) {
try {
File tempFile = new File(file.getParent(), file.getName() + "_tmp.dat");
File tempFile = new File(file.getParent(), file.getName().replaceFirst("\\.nbt$", ".tmp.nbt"));

CompressedStreamTools.writeCompressed(data, new FileOutputStream(tempFile));

Expand All @@ -95,7 +95,7 @@ public boolean saveFile(File file, NBTTagCompound data) {
}

public boolean saveFile(File saveDirectory, String filename, NBTTagCompound data) {
return saveFile(new File(saveDirectory, filename + ".dat"), data);
return saveFile(new File(saveDirectory, filename + ".nbt"), data);
}

public boolean saveFile(String filename, NBTTagCompound data) {
Expand Down Expand Up @@ -123,7 +123,7 @@ public NBTTagCompound loadFile(File file) {
* @return The NBT data
*/
public NBTTagCompound loadFile(File saveDirectory, String filename) {
return loadFile(new File(saveDirectory, filename + ".dat"));
return loadFile(new File(saveDirectory, filename + ".nbt"));
}

public NBTTagCompound loadFile(String filename) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public void load(String filename, Storable storable) {
*/
public boolean saveFile(File file, NBTTagCompound data) {
try {
File tempFile = new File(file.getParent(), file.getName() + "_tmp.dat");
File tempFile = new File(file.getParent(), file.getName().replaceFirst("\\.nbt$", ".tmp.nbt"));

CompressedStreamTools.writeCompressed(data, new FileOutputStream(tempFile));

Expand All @@ -95,7 +95,7 @@ public boolean saveFile(File file, NBTTagCompound data) {
}

public boolean saveFile(File saveDirectory, String filename, NBTTagCompound data) {
return saveFile(new File(saveDirectory, filename + ".dat"), data);
return saveFile(new File(saveDirectory, filename + ".nbt"), data);
}

public boolean saveFile(String filename, NBTTagCompound data) {
Expand Down Expand Up @@ -123,7 +123,7 @@ public NBTTagCompound loadFile(File file) {
* @return The NBT data
*/
public NBTTagCompound loadFile(File saveDirectory, String filename) {
return loadFile(new File(saveDirectory, filename + ".dat"));
return loadFile(new File(saveDirectory, filename + ".nbt"));
}

public NBTTagCompound loadFile(String filename) {
Expand Down

0 comments on commit 297857e

Please sign in to comment.