diff --git a/gradle.properties b/gradle.properties index 3643993..7e33d9b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,14 +1,14 @@ # Done to increase the memory available to gradle. org.gradle.jvmargs=-Xmx1G - minecraft_version=20w06a - yarn_mappings=20w06a+build.15 + minecraft_version=1.15.2 + yarn_mappings=1.15.2+build.14 loader_version=0.7.8+build.184 #Fabric api - fabric_version=0.4.32+build.296-1.16 + fabric_version=0.4.32+build.292-1.15 # Mod Properties - mod_version = 1.0.2-20w06a + mod_version = 1.0.3-1.15 maven_group = net.szum123321 archives_base_name = textile_backup \ No newline at end of file diff --git a/src/main/java/net/szum123321/textile_backup/ConfigHandler.java b/src/main/java/net/szum123321/textile_backup/ConfigHandler.java index dac3ea4..a727fde 100644 --- a/src/main/java/net/szum123321/textile_backup/ConfigHandler.java +++ b/src/main/java/net/szum123321/textile_backup/ConfigHandler.java @@ -1,3 +1,21 @@ +/* + A simple backup mod for Fabric + Copyright (C) 2020 Szum123321 + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + package net.szum123321.textile_backup; import blue.endless.jankson.Comment; diff --git a/src/main/java/net/szum123321/textile_backup/TextileBackup.java b/src/main/java/net/szum123321/textile_backup/TextileBackup.java index c069507..6918974 100644 --- a/src/main/java/net/szum123321/textile_backup/TextileBackup.java +++ b/src/main/java/net/szum123321/textile_backup/TextileBackup.java @@ -1,3 +1,21 @@ +/* + A simple backup mod for Fabric + Copyright (C) 2020 Szum123321 + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + package net.szum123321.textile_backup; import com.mojang.brigadier.builder.LiteralArgumentBuilder; diff --git a/src/main/java/net/szum123321/textile_backup/commands/CleanupCommand.java b/src/main/java/net/szum123321/textile_backup/commands/CleanupCommand.java index 7fef555..d6feaa0 100644 --- a/src/main/java/net/szum123321/textile_backup/commands/CleanupCommand.java +++ b/src/main/java/net/szum123321/textile_backup/commands/CleanupCommand.java @@ -1,3 +1,21 @@ +/* + `A simple backup mod for Fabric + Copyright (C) 2020 Szum123321 + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + package net.szum123321.textile_backup.commands; import com.mojang.brigadier.builder.LiteralArgumentBuilder; diff --git a/src/main/java/net/szum123321/textile_backup/commands/StartBackupCommand.java b/src/main/java/net/szum123321/textile_backup/commands/StartBackupCommand.java index e3b8019..1650d38 100644 --- a/src/main/java/net/szum123321/textile_backup/commands/StartBackupCommand.java +++ b/src/main/java/net/szum123321/textile_backup/commands/StartBackupCommand.java @@ -1,3 +1,21 @@ +/* + A simple backup mod for Fabric + Copyright (C) 2020 Szum123321 + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + package net.szum123321.textile_backup.commands; import com.mojang.brigadier.builder.LiteralArgumentBuilder; diff --git a/src/main/java/net/szum123321/textile_backup/core/BackupHelper.java b/src/main/java/net/szum123321/textile_backup/core/BackupHelper.java index d30b1fa..7ac4bd7 100644 --- a/src/main/java/net/szum123321/textile_backup/core/BackupHelper.java +++ b/src/main/java/net/szum123321/textile_backup/core/BackupHelper.java @@ -1,3 +1,21 @@ +/* + A simple backup mod for Fabric + Copyright (C) 2020 Szum123321 + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + package net.szum123321.textile_backup.core; import net.fabricmc.loader.api.FabricLoader; @@ -14,12 +32,24 @@ import java.util.Arrays; public class BackupHelper { public static File getBackupRootPath(){ - return FabricLoader - .getInstance() - .getGameDirectory() - .toPath() - .resolve(TextileBackup.config.path) - .toFile(); + File path = new File(TextileBackup.config.path); + + if(!path.exists()){ + try{ + path.mkdirs(); + }catch(Exception e){ + TextileBackup.logger.error(e.getMessage()); + + return FabricLoader + .getInstance() + .getGameDirectory() + .toPath() + .resolve(TextileBackup.config.path) + .toFile(); + } + } + + return path; } public static void log(String s, ServerCommandSource ctx){ @@ -94,7 +124,8 @@ public class BackupHelper { Arrays.sort(file); for(int i = 0; i < var1; i++){ - file[i].deleteOnExit(); + file[i].delete(); + } } } diff --git a/src/main/java/net/szum123321/textile_backup/core/Compressor.java b/src/main/java/net/szum123321/textile_backup/core/Compressor.java index e71e758..87f71fb 100644 --- a/src/main/java/net/szum123321/textile_backup/core/Compressor.java +++ b/src/main/java/net/szum123321/textile_backup/core/Compressor.java @@ -1,3 +1,21 @@ +/* + A simple backup mod for Fabric + Copyright (C) 2020 Szum123321 + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + package net.szum123321.textile_backup.core; import net.minecraft.server.command.ServerCommandSource; diff --git a/src/main/java/net/szum123321/textile_backup/core/MakeBackupThread.java b/src/main/java/net/szum123321/textile_backup/core/MakeBackupThread.java index 5216c85..582a25d 100644 --- a/src/main/java/net/szum123321/textile_backup/core/MakeBackupThread.java +++ b/src/main/java/net/szum123321/textile_backup/core/MakeBackupThread.java @@ -1,9 +1,26 @@ +/* + A simple backup mod for Fabric + Copyright (C) 2020 Szum123321 + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + package net.szum123321.textile_backup.core; import net.minecraft.server.MinecraftServer; import net.minecraft.server.command.ServerCommandSource; import net.minecraft.world.dimension.DimensionType; -import net.szum123321.textile_backup.TextileBackup; import java.io.File; import java.io.IOException; diff --git a/src/main/java/net/szum123321/textile_backup/mixin/MinecraftServerMixin.java b/src/main/java/net/szum123321/textile_backup/mixin/MinecraftServerMixin.java index e968287..780e861 100644 --- a/src/main/java/net/szum123321/textile_backup/mixin/MinecraftServerMixin.java +++ b/src/main/java/net/szum123321/textile_backup/mixin/MinecraftServerMixin.java @@ -1,7 +1,23 @@ +/* + A simple backup mod for Fabric + Copyright (C) 2020 Szum123321 + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + package net.szum123321.textile_backup.mixin; -import net.fabricmc.fabric.impl.tag.extension.FabricTagHooks; -import net.fabricmc.loader.api.FabricLoader; import net.minecraft.server.MinecraftServer; import net.minecraft.server.PlayerManager; import net.szum123321.textile_backup.TextileBackup; diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 571ea75..3dee8a0 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -29,6 +29,6 @@ "depends": { "fabricloader": ">=0.7.2", "fabric": "*", - "minecraft": "1.16.*" + "minecraft": "1.15" } }