Skip to content

Commit

Permalink
2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
codedcosmos committed Aug 30, 2020
1 parent 966421d commit 16b7e09
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
}

group 'codedcosmos'
version '2.0'
version '2.1'
mainClassName = 'codedcosmos.enderbot.core.EnderBot'

sourceCompatibility = 1.8
Expand Down
2 changes: 1 addition & 1 deletion res/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: EnderBot
version: 2.0
version: 2.1
author: codedcosmos
main: codedcosmos.enderbot.plugin.MinecraftPlugin
api-version: 1.16
Expand Down
11 changes: 11 additions & 0 deletions src/codedcosmos/enderbot/core/ConfigManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ public class ConfigManager {
public static int world_backups_frequency_in_days;
public static boolean world_backups_enabled;

public static String world_name;

// Censored Config values
public static String discord_bot_token;

Expand All @@ -54,6 +56,8 @@ public static HashMap<String, String> getDefault() {
// Defines if the game will be backed up at all
defaults.put("world-backups-enabled", "False");

// Defines if the game will be backed up at all
defaults.put("world_name", "world");

// Discord Developer API bot token
defaults.put("discord_bot_token", "");
Expand Down Expand Up @@ -134,6 +138,13 @@ public static void load() {
}
Log.print("Loaded 'world-backups-enabled' as " + world_backups_enabled);

world_name = prop.getProperty("world_name");
if (world_name == null) {
Log.printErr("Failed to load config 'world_name");
Log.printErr("Setting it as default!");
world_name = "world";
}
Log.print("Loaded 'minecraft-ingame-channel-name' as " + world_name);


// Censored Values
Expand Down
2 changes: 1 addition & 1 deletion src/codedcosmos/enderbot/core/EnderBot.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

public class EnderBot {

private static final String VERSION = "2.0";
private static final String VERSION = "2.1";

public static void load() {
ConfigManager.load();
Expand Down
4 changes: 2 additions & 2 deletions src/codedcosmos/enderbot/utils/GoogleDrive.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,13 @@ public void run() {

DateTimeFormatter dtf = DateTimeFormatter.ofPattern(DATE_FORMAT);
LocalDateTime now = LocalDateTime.now();
String filename = "world-"+dtf.format(now)+".zip";
String filename = ConfigManager.world_name+"-"+dtf.format(now)+".zip";

try {
// Create zip
FileUtils.mkdirIfMissing(BACKUP_PATH);
FileUtils.clearDirectory(BACKUP_PATH);
FileUtils.zip("world", BACKUP_PATH+"/"+filename);
FileUtils.zip(ConfigManager.world_name, BACKUP_PATH+"/"+filename);

// Append to archive log
Writer output = new BufferedWriter(new FileWriter(EXPORT_LOG, true));
Expand Down

0 comments on commit 16b7e09

Please sign in to comment.