From 9dcb7e812f88db200d7355fa90c14efd442e7e88 Mon Sep 17 00:00:00 2001 From: foxikle Date: Sun, 17 Nov 2024 21:02:27 -0500 Subject: [PATCH] HOTFIX --- build.gradle.kts | 4 ++-- .../java/dev/foxikle/customnpcs/internal/FileManager.java | 8 +++++++- core/src/main/resources/npcs.yml | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 47f82ec0..3c445cd6 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -46,7 +46,7 @@ dependencies { implementation(project(":v1_20_R1", "reobf")) } -var pluginVersion = "1.7-pre8" +var pluginVersion = "1.7-pre9" allprojects { group = "dev.foxikle" @@ -128,7 +128,7 @@ tasks { archiveClassifier.set("") relocate("org.bstats", "dev.foxikle.dependencies.bstats") // This is used to place the file into a test server's plugin directory. - //destinationDirectory.set(file(providers.gradleProperty("plugin_dir").get())) + destinationDirectory.set(file(providers.gradleProperty("plugin_dir").get())) } } diff --git a/core/src/main/java/dev/foxikle/customnpcs/internal/FileManager.java b/core/src/main/java/dev/foxikle/customnpcs/internal/FileManager.java index 21ced7e1..bf0fb448 100644 --- a/core/src/main/java/dev/foxikle/customnpcs/internal/FileManager.java +++ b/core/src/main/java/dev/foxikle/customnpcs/internal/FileManager.java @@ -40,6 +40,7 @@ import java.io.File; import java.io.IOException; import java.nio.file.Path; +import java.time.Instant; import java.util.*; import java.util.logging.Level; @@ -194,6 +195,7 @@ public boolean createFiles() { return false; } yml.set("version", "1.3"); + version = "1.3"; plugin.getLogger().warning("Adding delay to old actions."); for (UUID u : getNPCIds()) { @@ -227,6 +229,7 @@ public boolean createFiles() { return false; } yml.set("version", "1.4"); + version = "1.4"; Set npcs = yml.getKeys(false); for (String npc : npcs) { @@ -262,6 +265,7 @@ public boolean createFiles() { } yml.set("version", "1.5"); + version = "1.5"; Set npcs = yml.getKeys(false); for (String npc : npcs) { @@ -286,6 +290,7 @@ public boolean createFiles() { } yml.set("version", "1.6"); + version = "1.6"; Set npcs = yml.getKeys(false); for (String npc : npcs) { if (npc.equals("version")) continue; // it's a key @@ -310,6 +315,7 @@ public boolean createFiles() { return false; } yml.set("version", "1.7"); + version = "1.7"; Set npcs = yml.getKeys(false); for (String npc : npcs) { @@ -578,7 +584,7 @@ public void remove(UUID uuid) { private BackupResult createBackup(File file) { YamlConfiguration yml = YamlConfiguration.loadConfiguration(file); - File f = new File(PARENT_DIRECTORY, new Date().toString().replace(" ", "_").replace(":", "_") + "_backup_of_" + file.getName()); + File f = new File(PARENT_DIRECTORY, new Date().toString().replace(" ", "_").replace(":", "_") + "_backup_of_" + file.getName() + Instant.now().hashCode()); try { if (f.createNewFile()) { yml.save(f); diff --git a/core/src/main/resources/npcs.yml b/core/src/main/resources/npcs.yml index f13d9eb9..45d790fe 100644 --- a/core/src/main/resources/npcs.yml +++ b/core/src/main/resources/npcs.yml @@ -1,3 +1,3 @@ # Do not edit this file. Foxikle is not responsible for any data loss. -version: 1.6 +version: 1.8 # DO NOT, under ANY circumstances modify the 'version' field. Doing so can cause catastrophic data loss. \ No newline at end of file