Skip to content

Commit

Permalink
Bump Teams
Browse files Browse the repository at this point in the history
  • Loading branch information
PeachesMLG committed Oct 21, 2023
1 parent 632b859 commit f87eb50
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 29 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ dependencies {
implementation("org.jetbrains:annotations:24.0.1")
implementation("com.j256.ormlite:ormlite-core:6.1")
implementation("com.j256.ormlite:ormlite-jdbc:6.1")
implementation("com.iridium:IridiumTeams:2.2.2")
implementation("com.iridium:IridiumTeams:2.2.3")

// Other dependencies that are not required or already available at runtime
compileOnly("org.projectlombok:lombok:1.18.26")
Expand Down
28 changes: 0 additions & 28 deletions src/main/java/com/iridium/iridiumskyblock/IridiumSkyblock.java
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ public void registerListeners() {

@Override
public void loadConfigs() {
backupConfigs("backup");
this.configuration = getPersist().load(Configuration.class);
this.messages = getPersist().load(Messages.class);
this.commands = getPersist().load(Commands.class);
Expand Down Expand Up @@ -275,33 +274,6 @@ private void saveFile(File parent, String name) {
}
}

private void backupConfigs(String backupFolderName) {

getLogger().info("Attempting to create backup of configuration files...");

File pluginFolder = new File(getDataFolder().getPath());
File backupFolder = new File(pluginFolder.getPath() + File.separator + backupFolderName);
if (!backupFolder.exists()) backupFolder.mkdir();

File[] configFiles = pluginFolder.listFiles((dir, name) -> name.endsWith(".yml") || name.endsWith(".db"));

if(configFiles == null) {
getLogger().info("No files found.");
return;
}

for (File configFile : configFiles) {
File backupFile = new File(backupFolder, configFile.getName());

try {
Files.copy(configFile.toPath(), backupFile.toPath(), StandardCopyOption.REPLACE_EXISTING);
} catch (IOException exception) {
getLogger().warning("Could not copy " + configFile.getName() + " to " + backupFile.getAbsolutePath());
}
}
getLogger().info("Backup successful, check " + backupFolder.getPath() + ".");
}

@Override
public ChunkGenerator getDefaultWorldGenerator(String worldName, String id) {
return this.chunkGenerator;
Expand Down

0 comments on commit f87eb50

Please sign in to comment.