├── .gitattributes ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── feature_request.md │ └── version-request.md └── workflows │ ├── build.yml │ ├── download.test.yml │ ├── publish.yml │ └── target.yml ├── .gitignore ├── LICENSE ├── README.md ├── build-all.sh ├── core ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── src │ └── main │ ├── java │ └── computer │ │ └── heather │ │ └── advancedbackups │ │ ├── cli │ │ ├── AdvancedBackupsCLI.java │ │ ├── CLIIOHelpers.java │ │ └── IllegalBackupException.java │ │ ├── core │ │ ├── ABCore.java │ │ ├── CoreCommandSystem.java │ │ ├── backups │ │ │ ├── BackupCheckEnum.java │ │ │ ├── BackupStatusInstance.java │ │ │ ├── BackupTimer.java │ │ │ ├── BackupWrapper.java │ │ │ ├── ThreadedBackup.java │ │ │ └── gson │ │ │ │ ├── BackupManifest.java │ │ │ │ ├── DifferentialManifest.java │ │ │ │ └── HashList.java │ │ └── config │ │ │ ├── ClientConfigManager.java │ │ │ ├── ConfigManager.java │ │ │ └── ConfigTypes.java │ │ └── interfaces │ │ └── IClientContactor.java │ └── resources │ ├── advancedbackups-client-properties.txt │ ├── advancedbackups-properties.txt │ ├── advancedbackups-readme.txt │ └── assets │ └── advancedbackups │ └── lang │ ├── en_us.json │ └── en_us.lang ├── fabric ├── 1.18 │ ├── README.md │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ │ └── main │ │ ├── java │ │ └── computer │ │ │ └── heather │ │ │ └── advancedbackups │ │ │ ├── AdvancedBackups.java │ │ │ ├── AdvancedBackupsCommand.java │ │ │ ├── client │ │ │ ├── AdvancedBackupsClientCommand.java │ │ │ ├── BackupToast.java │ │ │ ├── ClientContactor.java │ │ │ ├── ClientWrapper.java │ │ │ └── ColourHelper.java │ │ │ └── network │ │ │ ├── NetworkHandler.java │ │ │ ├── PacketBackupStatus.java │ │ │ └── PacketToastSubscribe.java │ │ └── resources │ │ ├── fabric.mod.json │ │ └── pack.mcmeta ├── 1.19.2 │ ├── README.md │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ │ └── main │ │ ├── java │ │ └── computer │ │ │ └── heather │ │ │ └── advancedbackups │ │ │ ├── AdvancedBackups.java │ │ │ ├── AdvancedBackupsCommand.java │ │ │ ├── client │ │ │ ├── AdvancedBackupsClientCommand.java │ │ │ ├── BackupToast.java │ │ │ ├── ClientContactor.java │ │ │ ├── ClientWrapper.java │ │ │ └── ColourHelper.java │ │ │ └── network │ │ │ ├── NetworkHandler.java │ │ │ ├── PacketBackupStatus.java │ │ │ └── PacketToastSubscribe.java │ │ └── resources │ │ ├── fabric.mod.json │ │ └── pack.mcmeta ├── 1.19.3 │ ├── README.md │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ │ └── main │ │ ├── java │ │ └── computer │ │ │ └── heather │ │ │ └── advancedbackups │ │ │ ├── AdvancedBackups.java │ │ │ ├── AdvancedBackupsCommand.java │ │ │ ├── client │ │ │ ├── AdvancedBackupsClientCommand.java │ │ │ ├── BackupToast.java │ │ │ ├── ClientContactor.java │ │ │ ├── ClientWrapper.java │ │ │ └── ColourHelper.java │ │ │ └── network │ │ │ ├── NetworkHandler.java │ │ │ ├── PacketBackupStatus.java │ │ │ └── PacketToastSubscribe.java │ │ └── resources │ │ ├── advancedbackups.accesswidener │ │ ├── fabric.mod.json │ │ └── pack.mcmeta ├── 1.20.2 │ ├── README.md │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ │ └── main │ │ ├── java │ │ └── computer │ │ │ └── heather │ │ │ └── advancedbackups │ │ │ ├── AdvancedBackups.java │ │ │ ├── AdvancedBackupsCommand.java │ │ │ ├── client │ │ │ ├── AdvancedBackupsClientCommand.java │ │ │ ├── BackupToast.java │ │ │ ├── ClientContactor.java │ │ │ ├── ClientWrapper.java │ │ │ └── ColourHelper.java │ │ │ └── network │ │ │ ├── NetworkHandler.java │ │ │ ├── PacketBackupStatus.java │ │ │ └── PacketToastSubscribe.java │ │ └── resources │ │ ├── advancedbackups.accesswidener │ │ ├── fabric.mod.json │ │ └── pack.mcmeta ├── 1.20.6 │ ├── README.md │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ │ └── main │ │ ├── java │ │ └── computer │ │ │ └── heather │ │ │ └── advancedbackups │ │ │ ├── AdvancedBackups.java │ │ │ ├── AdvancedBackupsCommand.java │ │ │ ├── client │ │ │ ├── AdvancedBackupsClientCommand.java │ │ │ ├── BackupToast.java │ │ │ ├── ClientContactor.java │ │ │ ├── ClientWrapper.java │ │ │ └── ColourHelper.java │ │ │ └── network │ │ │ ├── NetworkHandler.java │ │ │ ├── PacketBackupStatus.java │ │ │ └── PacketToastSubscribe.java │ │ └── resources │ │ ├── advancedbackups.accesswidener │ │ ├── fabric.mod.json │ │ └── pack.mcmeta ├── 1.20 │ ├── README.md │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ │ └── main │ │ ├── java │ │ └── computer │ │ │ └── heather │ │ │ └── advancedbackups │ │ │ ├── AdvancedBackups.java │ │ │ ├── AdvancedBackupsCommand.java │ │ │ ├── client │ │ │ ├── AdvancedBackupsClientCommand.java │ │ │ ├── BackupToast.java │ │ │ ├── ClientContactor.java │ │ │ ├── ClientWrapper.java │ │ │ └── ColourHelper.java │ │ │ └── network │ │ │ ├── NetworkHandler.java │ │ │ ├── PacketBackupStatus.java │ │ │ └── PacketToastSubscribe.java │ │ └── resources │ │ ├── advancedbackups.accesswidener │ │ ├── fabric.mod.json │ │ └── pack.mcmeta ├── 1.21.2 │ ├── README.md │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ │ └── main │ │ ├── java │ │ └── computer │ │ │ └── heather │ │ │ └── advancedbackups │ │ │ ├── AdvancedBackups.java │ │ │ ├── AdvancedBackupsCommand.java │ │ │ ├── client │ │ │ ├── AdvancedBackupsClientCommand.java │ │ │ ├── BackupToast.java │ │ │ ├── ClientContactor.java │ │ │ ├── ClientWrapper.java │ │ │ └── ColourHelper.java │ │ │ └── network │ │ │ ├── NetworkHandler.java │ │ │ ├── PacketBackupStatus.java │ │ │ └── PacketToastSubscribe.java │ │ └── resources │ │ ├── advancedbackups.accesswidener │ │ ├── fabric.mod.json │ │ └── pack.mcmeta └── 1.21 │ ├── README.md │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ └── main │ ├── java │ └── computer │ │ └── heather │ │ └── advancedbackups │ │ ├── AdvancedBackups.java │ │ ├── AdvancedBackupsCommand.java │ │ ├── client │ │ ├── AdvancedBackupsClientCommand.java │ │ ├── BackupToast.java │ │ ├── ClientContactor.java │ │ ├── ClientWrapper.java │ │ └── ColourHelper.java │ │ └── network │ │ ├── NetworkHandler.java │ │ ├── PacketBackupStatus.java │ │ └── PacketToastSubscribe.java │ └── resources │ ├── advancedbackups.accesswidener │ ├── fabric.mod.json │ └── pack.mcmeta ├── forge ├── 1.12 │ ├── README.md │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ │ └── main │ │ ├── java │ │ └── computer │ │ │ └── heather │ │ │ └── advancedbackups │ │ │ ├── AdvancedBackups.java │ │ │ ├── AdvancedBackupsCommand.java │ │ │ ├── client │ │ │ ├── BackupToast.java │ │ │ ├── ClientBridge.java │ │ │ ├── ClientContactor.java │ │ │ └── ColourHelper.java │ │ │ └── network │ │ │ ├── NetworkHandler.java │ │ │ ├── PacketBackupStatus.java │ │ │ ├── PacketToastSubscribe.java │ │ │ └── PacketToastTest.java │ │ └── resources │ │ ├── mcmod.info │ │ └── pack.mcmeta ├── 1.16 │ ├── README.md │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ │ └── main │ │ ├── java │ │ └── computer │ │ │ └── heather │ │ │ └── advancedbackups │ │ │ ├── AdvancedBackups.java │ │ │ ├── AdvancedBackupsCommand.java │ │ │ ├── client │ │ │ ├── BackupToast.java │ │ │ ├── ClientContactor.java │ │ │ └── ClientWrapper.java │ │ │ └── network │ │ │ ├── NetworkHandler.java │ │ │ ├── PacketBackupStatus.java │ │ │ └── PacketToastSubscribe.java │ │ └── resources │ │ ├── META-INF │ │ ├── accesstransformer.cfg │ │ └── mods.toml │ │ └── pack.mcmeta ├── 1.18 │ ├── README.md │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ │ └── main │ │ ├── java │ │ └── computer │ │ │ └── heather │ │ │ └── advancedbackups │ │ │ ├── AdvancedBackups.java │ │ │ ├── AdvancedBackupsCommand.java │ │ │ ├── client │ │ │ ├── BackupToast.java │ │ │ ├── ClientContactor.java │ │ │ ├── ClientWrapper.java │ │ │ └── ColourHelper.java │ │ │ └── network │ │ │ ├── NetworkHandler.java │ │ │ ├── PacketBackupStatus.java │ │ │ └── PacketToastSubscribe.java │ │ └── resources │ │ ├── META-INF │ │ └── mods.toml │ │ └── pack.mcmeta ├── 1.19.2 │ ├── README.md │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ │ └── main │ │ ├── java │ │ └── computer │ │ │ └── heather │ │ │ └── advancedbackups │ │ │ ├── AdvancedBackups.java │ │ │ ├── AdvancedBackupsCommand.java │ │ │ ├── client │ │ │ ├── AdvancedBackupsClientCommand.java │ │ │ ├── BackupToast.java │ │ │ ├── ClientContactor.java │ │ │ ├── ClientWrapper.java │ │ │ └── ColourHelper.java │ │ │ └── network │ │ │ ├── NetworkHandler.java │ │ │ ├── PacketBackupStatus.java │ │ │ └── PacketToastSubscribe.java │ │ └── resources │ │ ├── META-INF │ │ └── mods.toml │ │ └── pack.mcmeta ├── 1.19.3 │ ├── README.md │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ │ └── main │ │ ├── java │ │ └── computer │ │ │ └── heather │ │ │ └── advancedbackups │ │ │ ├── AdvancedBackups.java │ │ │ ├── AdvancedBackupsCommand.java │ │ │ ├── client │ │ │ ├── AdvancedBackupsClientCommand.java │ │ │ ├── BackupToast.java │ │ │ ├── ClientContactor.java │ │ │ ├── ClientWrapper.java │ │ │ └── ColourHelper.java │ │ │ └── network │ │ │ ├── NetworkHandler.java │ │ │ ├── PacketBackupStatus.java │ │ │ └── PacketToastSubscribe.java │ │ └── resources │ │ ├── META-INF │ │ ├── accesstransformer.cfg │ │ └── mods.toml │ │ └── pack.mcmeta ├── 1.20.2 │ ├── README.md │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ │ └── main │ │ ├── java │ │ └── computer │ │ │ └── heather │ │ │ └── advancedbackups │ │ │ ├── AdvancedBackups.java │ │ │ ├── AdvancedBackupsCommand.java │ │ │ ├── client │ │ │ ├── AdvancedBackupsClientCommand.java │ │ │ ├── BackupToast.java │ │ │ ├── ClientContactor.java │ │ │ ├── ClientWrapper.java │ │ │ └── ColourHelper.java │ │ │ └── network │ │ │ ├── NetworkHandler.java │ │ │ ├── PacketBackupStatus.java │ │ │ └── PacketToastSubscribe.java │ │ └── resources │ │ ├── META-INF │ │ ├── accesstransformer.cfg │ │ └── mods.toml │ │ └── pack.mcmeta ├── 1.20.6 │ ├── README.md │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ │ └── main │ │ ├── java │ │ └── computer │ │ │ └── heather │ │ │ └── advancedbackups │ │ │ ├── AdvancedBackups.java │ │ │ ├── AdvancedBackupsCommand.java │ │ │ ├── client │ │ │ ├── AdvancedBackupsClientCommand.java │ │ │ ├── BackupToast.java │ │ │ ├── ClientContactor.java │ │ │ ├── ClientWrapper.java │ │ │ └── ColourHelper.java │ │ │ └── network │ │ │ ├── NetworkHandler.java │ │ │ ├── PacketBackupStatus.java │ │ │ └── PacketToastSubscribe.java │ │ └── resources │ │ ├── META-INF │ │ ├── accesstransformer.cfg │ │ └── mods.toml │ │ └── pack.mcmeta ├── 1.20 │ ├── README.md │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ │ └── main │ │ ├── java │ │ └── computer │ │ │ └── heather │ │ │ └── advancedbackups │ │ │ ├── AdvancedBackups.java │ │ │ ├── AdvancedBackupsCommand.java │ │ │ ├── client │ │ │ ├── AdvancedBackupsClientCommand.java │ │ │ ├── BackupToast.java │ │ │ ├── ClientContactor.java │ │ │ ├── ClientWrapper.java │ │ │ └── ColourHelper.java │ │ │ └── network │ │ │ ├── NetworkHandler.java │ │ │ ├── PacketBackupStatus.java │ │ │ └── PacketToastSubscribe.java │ │ └── resources │ │ ├── META-INF │ │ ├── accesstransformer.cfg │ │ └── mods.toml │ │ └── pack.mcmeta └── 1.7.10 │ ├── README.md │ ├── build.gradle.kts │ ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle.kts │ └── src │ └── main │ ├── java │ └── computer │ │ └── heather │ │ └── advancedbackups │ │ ├── AdvancedBackups.java │ │ ├── AdvancedBackupsCommand.java │ │ ├── client │ │ ├── ABClientContactor.java │ │ └── ABClientRenderer.java │ │ └── network │ │ ├── NetworkHandler.java │ │ ├── PacketBackupStatus.java │ │ ├── PacketClientReload.java │ │ └── PacketToastSubscribe.java │ └── resources │ ├── mcmod.info │ └── pack.mcmeta ├── global.properties ├── neoforge ├── 1.20.2 │ ├── README.md │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ │ └── main │ │ ├── java │ │ └── computer │ │ │ └── heather │ │ │ └── advancedbackups │ │ │ ├── AdvancedBackups.java │ │ │ ├── AdvancedBackupsCommand.java │ │ │ ├── client │ │ │ ├── AdvancedBackupsClientCommand.java │ │ │ ├── BackupToast.java │ │ │ ├── ClientContactor.java │ │ │ ├── ClientWrapper.java │ │ │ └── ColourHelper.java │ │ │ └── network │ │ │ ├── NetworkHandler.java │ │ │ ├── PacketBackupStatus.java │ │ │ └── PacketToastSubscribe.java │ │ └── resources │ │ ├── META-INF │ │ ├── accesstransformer.cfg │ │ └── mods.toml │ │ └── pack.mcmeta ├── 1.20.4 │ ├── README.md │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ │ └── main │ │ ├── java │ │ └── computer │ │ │ └── heather │ │ │ └── advancedbackups │ │ │ ├── AdvancedBackups.java │ │ │ ├── AdvancedBackupsCommand.java │ │ │ ├── client │ │ │ ├── AdvancedBackupsClientCommand.java │ │ │ ├── BackupToast.java │ │ │ ├── ClientContactor.java │ │ │ ├── ClientWrapper.java │ │ │ └── ColourHelper.java │ │ │ └── network │ │ │ ├── NetworkHandler.java │ │ │ ├── PacketBackupStatus.java │ │ │ └── PacketToastSubscribe.java │ │ └── resources │ │ ├── META-INF │ │ ├── accesstransformer.cfg │ │ └── mods.toml │ │ └── pack.mcmeta ├── 1.20.6 │ ├── README.md │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ │ └── main │ │ ├── java │ │ └── computer │ │ │ └── heather │ │ │ └── advancedbackups │ │ │ ├── AdvancedBackups.java │ │ │ ├── AdvancedBackupsCommand.java │ │ │ ├── client │ │ │ ├── AdvancedBackupsClientCommand.java │ │ │ ├── BackupToast.java │ │ │ ├── ClientContactor.java │ │ │ ├── ClientWrapper.java │ │ │ └── ColourHelper.java │ │ │ └── network │ │ │ ├── NetworkHandler.java │ │ │ ├── PacketBackupStatus.java │ │ │ └── PacketToastSubscribe.java │ │ └── resources │ │ ├── META-INF │ │ ├── accesstransformer.cfg │ │ └── neoforge.mods.toml │ │ └── pack.mcmeta ├── 1.21.2 │ ├── README.md │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ │ └── main │ │ ├── java │ │ └── computer │ │ │ └── heather │ │ │ └── advancedbackups │ │ │ ├── AdvancedBackups.java │ │ │ ├── AdvancedBackupsCommand.java │ │ │ ├── client │ │ │ ├── AdvancedBackupsClientCommand.java │ │ │ ├── BackupToast.java │ │ │ ├── ClientContactor.java │ │ │ ├── ClientWrapper.java │ │ │ └── ColourHelper.java │ │ │ └── network │ │ │ ├── NetworkHandler.java │ │ │ ├── PacketBackupStatus.java │ │ │ └── PacketToastSubscribe.java │ │ └── resources │ │ ├── META-INF │ │ ├── accesstransformer.cfg │ │ └── neoforge.mods.toml │ │ └── pack.mcmeta └── 1.21 │ ├── README.md │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ └── main │ ├── java │ └── computer │ │ └── heather │ │ └── advancedbackups │ │ ├── AdvancedBackups.java │ │ ├── AdvancedBackupsCommand.java │ │ ├── client │ │ ├── AdvancedBackupsClientCommand.java │ │ ├── BackupToast.java │ │ ├── ClientContactor.java │ │ ├── ClientWrapper.java │ │ └── ColourHelper.java │ │ └── network │ │ ├── NetworkHandler.java │ │ ├── PacketBackupStatus.java │ │ └── PacketToastSubscribe.java │ └── resources │ ├── META-INF │ ├── accesstransformer.cfg │ └── neoforge.mods.toml │ └── pack.mcmeta └── spigot └── 1.21 ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── settings.gradle └── src └── main ├── java └── computer │ └── heather │ └── AdvancedBackups │ ├── AdvancedBackups.java │ ├── AdvancedBackupsCommand.java │ └── network │ ├── ClientContactor.java │ └── PacketListener.java └── resources └── plugin.yml /.gitattributes: -------------------------------------------------------------------------------- 1 | # 2 | # https://help.github.com/articles/dealing-with-line-endings/ 3 | # 4 | # Linux shell scripts should use lf 5 | gradlew text eol=lf 6 | *.sh text eol=lf 7 | 8 | # These are Windows script files and should use crlf 9 | *.bat text eol=crlf 10 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: 'Bug report : ' 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Versioning (please complete the following information):** 27 | - OS: [e.g. Debian] 28 | - Minecraft Version(s): [e.g 1.18, 1.12] 29 | - Modloader(s): [e.g. Forge] 30 | - Mod Version: [e.g 1.0] 31 | 32 | **Additional context** 33 | Add any other context about the problem here. 34 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an new feature 4 | title: 'Feature request : FEATURE' 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/version-request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Version Request 3 | about: Request a port to a new minecraft version or modloader. 4 | title: 'Version request : **VERSION**' 5 | labels: Version request 6 | assignees: '' 7 | 8 | --- 9 | 10 | **New Minecraft version :** 11 | 12 | **New modloader :** 13 | 14 | *Please ensure you have checked that this is not currently a supported version. Remove this text.* 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # eclipse 2 | bin 3 | *.launch 4 | .settings 5 | .metadata 6 | .classpath 7 | .project 8 | eclipse 9 | 10 | # idea 11 | out 12 | *.ipr 13 | *.iws 14 | *.iml 15 | .idea 16 | 17 | # vscode 18 | .vscode 19 | 20 | # gradle 21 | build 22 | .gradle 23 | 24 | # other 25 | run 26 | runs 27 | forge*changelog.txt 28 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2023, Heather White 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, this 9 | list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | 3. Neither the name of the copyright holder nor the names of its 16 | contributors may be used to endorse or promote products derived from 17 | this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 23 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /build-all.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ "$#" -ne 1 ]; then 4 | echo "Usage: $0 " 5 | exit 1 6 | fi 7 | 8 | root=$(pwd) 9 | 10 | # This will fail silently (but deadly) if there's ever a modloader that's lexicographically before "core" 11 | find . -maxdepth 3 -type f -name 'build.gradle' | sed -r 's|/[^/]+$||' | sort \ 12 | | while read -r folder; do 13 | echo -e "\n\e[1;104m Building $folder... \e[0m" 14 | cd "$folder" || exit 1 15 | 16 | # Older Gradle versions are naughty and consume stdin for some reason 17 | ./gradlew -Pversion=$1 build < /dev/null 18 | 19 | cd "$root" || exit 1 20 | done 21 | -------------------------------------------------------------------------------- /core/gradle.properties: -------------------------------------------------------------------------------- 1 | # Sets default memory used for gradle commands. Can be overridden by user or command line properties. 2 | # This is required to provide enough memory for the Minecraft decompilation process. 3 | org.gradle.jvmargs=-Xmx3G 4 | org.gradle.daemon=false -------------------------------------------------------------------------------- /core/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeatherComputer/AdvancedBackups/01d74672e44b67ceb5e4bd0a18b861ebe0bfcaf0/core/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /core/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /core/src/main/java/computer/heather/advancedbackups/cli/IllegalBackupException.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.cli; 2 | 3 | public class IllegalBackupException extends Exception { 4 | 5 | public IllegalBackupException(String string) { 6 | super(string); 7 | } 8 | 9 | } -------------------------------------------------------------------------------- /core/src/main/java/computer/heather/advancedbackups/core/backups/BackupCheckEnum.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.core.backups; 2 | 3 | public enum BackupCheckEnum { 4 | SUCCESS, 5 | DISABLED, 6 | NOACTIVITY, 7 | TOORECENT; 8 | 9 | public boolean success() { 10 | switch (this) { 11 | case SUCCESS: 12 | return true; 13 | default: 14 | return false; 15 | } 16 | } 17 | 18 | 19 | public String getCheckMessage() { 20 | switch (this) { 21 | case SUCCESS: 22 | return "Checks successful!"; 23 | case DISABLED: 24 | return "Backups are disabled!"; 25 | case NOACTIVITY: 26 | return "Player activity is required, but none have been active!"; 27 | case TOORECENT: 28 | return "The time since the last backup is less than the minimum time specified in config!"; 29 | default: 30 | return "You should not see this message, report a bug!"; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /core/src/main/java/computer/heather/advancedbackups/core/backups/BackupStatusInstance.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.core.backups; 2 | 3 | public class BackupStatusInstance { 4 | 5 | private static BackupStatusInstance instance = null; 6 | 7 | private State state = State.INVALID; 8 | 9 | private int progress = -1; 10 | private int max = -1; 11 | 12 | private long age; 13 | 14 | 15 | public static synchronized void setInstance(BackupStatusInstance instance) { 16 | BackupStatusInstance.instance = instance; 17 | } 18 | 19 | public static synchronized BackupStatusInstance getInstanceCopy() { 20 | return instance == null ? null : copyInstance(instance); 21 | } 22 | 23 | private static synchronized BackupStatusInstance copyInstance(BackupStatusInstance in) { 24 | BackupStatusInstance other = new BackupStatusInstance(); 25 | other.setMax(in.getMax()); 26 | other.setProgress(in.getProgress()); 27 | other.setState(in.getState()); 28 | other.setAge(in.getAge()); 29 | return other; 30 | 31 | } 32 | 33 | public State getState() { 34 | return this.state; 35 | } 36 | 37 | public void setState(State state) { 38 | this.state = state; 39 | } 40 | 41 | public int getProgress() { 42 | return this.progress; 43 | } 44 | 45 | public void setProgress(int progress) { 46 | this.progress = progress; 47 | } 48 | 49 | public int getMax() { 50 | return this.max; 51 | } 52 | 53 | public void setMax(int max) { 54 | this.max = max; 55 | } 56 | 57 | public long getAge() { 58 | return this.age; 59 | } 60 | 61 | public void setAge(long age) { 62 | this.age = age; 63 | } 64 | 65 | 66 | public static enum State { 67 | 68 | STARTING, 69 | STARTED, 70 | COMPLETE, 71 | FAILED, 72 | CANCELLED, 73 | //This one's used for a default, and should never be encountered! 74 | INVALID; 75 | 76 | } 77 | 78 | 79 | } -------------------------------------------------------------------------------- /core/src/main/java/computer/heather/advancedbackups/core/backups/gson/DifferentialManifest.java: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | UNUSED - ONLY EXISTS FOR BACKWARDS COMPAT REASONS 4 | 5 | */ 6 | 7 | 8 | package computer.heather.advancedbackups.core.backups.gson; 9 | 10 | import java.util.ArrayList; 11 | import java.util.List; 12 | 13 | public class DifferentialManifest { 14 | private List complete; 15 | private List partial; 16 | private int chain; 17 | private long lastFull; 18 | private long lastPartial; 19 | 20 | 21 | public List getComplete() { 22 | return complete; 23 | } 24 | 25 | 26 | public void setComplete(List complete) { 27 | this.complete = complete; 28 | } 29 | 30 | 31 | public List getPartial() { 32 | return partial; 33 | } 34 | 35 | 36 | public void setPartial(List partial) { 37 | this.partial = partial; 38 | } 39 | 40 | 41 | public int getChain() { 42 | return chain; 43 | } 44 | 45 | 46 | public void setChain(int chain) { 47 | this.chain = chain; 48 | } 49 | 50 | 51 | public long getLastFull() { 52 | return lastFull; 53 | } 54 | 55 | 56 | public void setLastFull(long lastFull) { 57 | this.lastFull = lastFull; 58 | } 59 | 60 | 61 | public long getLastPartial() { 62 | return Math.max(lastFull, lastPartial); 63 | } 64 | 65 | 66 | public void setLastPartial(long lastPartial) { 67 | this.lastPartial = lastPartial; 68 | } 69 | 70 | 71 | public static DifferentialManifest defaultValues() { 72 | DifferentialManifest manifest = new DifferentialManifest(); 73 | manifest.complete = new ArrayList<>(); 74 | manifest.partial = new ArrayList<>(); 75 | manifest.chain = 0; 76 | manifest.lastFull = 0; 77 | manifest.lastPartial = 0; 78 | return manifest; 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /core/src/main/java/computer/heather/advancedbackups/core/backups/gson/HashList.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.core.backups.gson; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | public class HashList { 7 | private Map hashes; 8 | 9 | public HashList() { 10 | hashes = new HashMap<>(); 11 | } 12 | 13 | public Map getHashes() { 14 | return hashes; 15 | } 16 | 17 | public void setHashes(Map hashes) { 18 | this.hashes = hashes; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /core/src/main/resources/advancedbackups-readme.txt: -------------------------------------------------------------------------------- 1 | LOADING A BACKUP 2 | 3 | - Run the script found in the backups folder to start the restoration tool. 4 | - Follow the prompts 5 | 6 | 7 | 8 | TROUBLESHOOTING 9 | 10 | - You need Java 8 or newer on your PATH to run the restore script. If it's failing, this is a good first thing to check. 11 | - When using the bash script, you may need to use chmod to make it executable 12 | 13 | 14 | 15 | DOCUMENTATION 16 | 17 | All documentation is available at https://github.com/HeatherComputer/AdvancedBackups#usage 18 | 19 | 20 | 21 | MANUAL BACKUP RESTORATION - FULL BACKUP 22 | 23 | - Stop the world 24 | - Make a manual backup of it 25 | - Empty the world's folder 26 | 27 | For complete zip backups, full differentials or full incrementals, you can simply copy the contents of the zip / folder over into the world folder. 28 | 29 | For partial differential backups, you will first need to select the most recent full backup that is BEFORE your selected partial and restore that, then you can restore the partial. 30 | 31 | For partial incremental backups, you will need to select the most recent full backup that is BEFORE your selected partial and restore that. 32 | You will then need to restore every single partial backup after that full backup, moving towards more recent backup, until you reach your chosen backup. 33 | Once you have restored your chosen backup, you are done. 34 | 35 | 36 | 37 | MANUAL BACKUP RESTORATION - SINGLE FILE 38 | 39 | - Stop the world 40 | - Make a manual backup of the file you want to restore (if present) 41 | - Delete the file you want to restore (if present) 42 | 43 | For complete zip backups, full differentials or full incrementals, look inside the backup for your chosen file and copy it into place in the world's folder. 44 | 45 | For partial differential backups, look inside your chosen backup - if it is not present, it has not changed since the most recent differential, so get the file from that. 46 | 47 | For partial incremental backups, look inside your chosen backup - if it is not present, check the previous partial and rinse and repeat until you find the file you need. 48 | -------------------------------------------------------------------------------- /core/src/main/resources/assets/advancedbackups/lang/en_us.json: -------------------------------------------------------------------------------- 1 | { 2 | "advancedbackups.backup_starting" : "Backup starting!", 3 | "advancedbackups.progress": "Backup ongoing: %1$s%%", 4 | "advancedbackups.backup_failed": "Backup failed!\nCheck log for more info.", 5 | "advancedbackups.backup_finished": "Backup complete!", 6 | "advancedbackups.backup_cancelled": "Backup cancelled!" 7 | } 8 | -------------------------------------------------------------------------------- /core/src/main/resources/assets/advancedbackups/lang/en_us.lang: -------------------------------------------------------------------------------- 1 | advancedbackups.backup_starting=Backup starting! 2 | advancedbackups.progress=Backup ongoing: %s%% 3 | advancedbackups.backup_failed=Backup failed!\nCheck log for more info. 4 | advancedbackups.backup_cancelled=Backup cancelled! 5 | advancedbackups.backup_finished=Backup complete! -------------------------------------------------------------------------------- /fabric/1.18/README.md: -------------------------------------------------------------------------------- 1 | # Fabric - 1.18 2 | 3 | This is the branch specifically for fabric 1.18. 4 | Any differences will be listed below. For full documentation, see the `core` branch. 5 | -------------------------------------------------------------------------------- /fabric/1.18/gradle.properties: -------------------------------------------------------------------------------- 1 | # Done to increase the memory available to gradle. 2 | org.gradle.jvmargs=-Xmx1G 3 | org.gradle.parallel=true 4 | 5 | # Fabric Properties 6 | # check these on https://fabricmc.net/develop 7 | minecraft_version=1.18.2 8 | yarn_mappings=1.18.2+build.4 9 | loader_version=0.14.19 10 | 11 | # Mod Properties 12 | version=2.0 13 | maven_group=computer.heather.advancedbackups 14 | archives_base_name=advanced-backups 15 | modloaderName =fabric 16 | minecraftVersion =1.18 17 | 18 | # Dependencies 19 | fabric_version=0.76.0+1.18.2 20 | 21 | 22 | -------------------------------------------------------------------------------- /fabric/1.18/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeatherComputer/AdvancedBackups/01d74672e44b67ceb5e4bd0a18b861ebe0bfcaf0/fabric/1.18/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /fabric/1.18/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /fabric/1.18/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { 4 | name = 'Fabric' 5 | url = 'https://maven.fabricmc.net/' 6 | } 7 | mavenCentral() 8 | gradlePluginPortal() 9 | } 10 | } 11 | 12 | rootProject.name = 'fabric-1.18' 13 | -------------------------------------------------------------------------------- /fabric/1.18/src/main/java/computer/heather/advancedbackups/client/ColourHelper.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.client; 2 | 3 | //A colour helper, loosely based on that of vanilla 1.16. 4 | //What is the fabric 1.18 equivalent..? 5 | public class ColourHelper { 6 | 7 | public static int alpha(int in) { 8 | return in >>> 24; 9 | } 10 | 11 | public static int red(int in) { 12 | return in >> 16 & 255; 13 | } 14 | 15 | public static int green(int in) { 16 | return in >> 8 & 255; 17 | } 18 | 19 | public static int blue(int in) { 20 | return in & 255; 21 | } 22 | 23 | public static int colour(int a, int r, int g, int b) { 24 | return a << 24 | r << 16 | g << 8 | b; 25 | } 26 | 27 | public static int colour(int a, long r, long g, long b) { 28 | return colour(a, (int) r, (int) g, (int) b); 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /fabric/1.18/src/main/java/computer/heather/advancedbackups/network/NetworkHandler.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking; 4 | import net.fabricmc.fabric.api.networking.v1.PacketByteBufs; 5 | import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking; 6 | import net.minecraft.server.network.ServerPlayerEntity; 7 | import net.minecraft.util.Identifier; 8 | 9 | public class NetworkHandler { 10 | 11 | public static final Identifier STATUS_PACKET_ID = new Identifier("advancedbackups", "backup_status"); 12 | public static final Identifier TOAST_SUBSCRIBE_ID = new Identifier("advancedbackups", "toast_subscribe"); 13 | 14 | 15 | public static void sendToClient(ServerPlayerEntity player, PacketBackupStatus packet) { 16 | 17 | ServerPlayNetworking.send(player, STATUS_PACKET_ID, packet.write(PacketByteBufs.create())); 18 | 19 | } 20 | 21 | 22 | } 23 | -------------------------------------------------------------------------------- /fabric/1.18/src/main/java/computer/heather/advancedbackups/network/PacketToastSubscribe.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import computer.heather.advancedbackups.AdvancedBackups; 4 | import net.fabricmc.fabric.api.networking.v1.PacketSender; 5 | import net.minecraft.network.PacketByteBuf; 6 | import net.minecraft.server.MinecraftServer; 7 | import net.minecraft.server.network.ServerPlayNetworkHandler; 8 | import net.minecraft.server.network.ServerPlayerEntity; 9 | 10 | public class PacketToastSubscribe { 11 | 12 | public boolean enable; 13 | 14 | 15 | public PacketToastSubscribe(boolean enable) { 16 | this.enable = enable; 17 | } 18 | 19 | public PacketToastSubscribe() { 20 | 21 | } 22 | 23 | public void read(PacketByteBuf buf) { 24 | enable = buf.readBoolean(); 25 | } 26 | 27 | public PacketByteBuf write(PacketByteBuf buf) { 28 | buf.writeBoolean(enable); 29 | 30 | return buf; 31 | 32 | } 33 | 34 | 35 | public static void handle(MinecraftServer server, ServerPlayerEntity player, ServerPlayNetworkHandler handler, PacketByteBuf buf, PacketSender responseSender) { 36 | 37 | PacketToastSubscribe message = new PacketToastSubscribe(); 38 | message.read(buf); 39 | 40 | 41 | server.execute(() -> { 42 | if (message.enable && !AdvancedBackups.players.contains(player.getUuidAsString())) { 43 | AdvancedBackups.players.add(player.getUuidAsString()); 44 | } 45 | else if (!message.enable) { 46 | AdvancedBackups.players.remove(player.getUuidAsString()); 47 | } 48 | 49 | }); 50 | 51 | 52 | 53 | 54 | 55 | } 56 | 57 | 58 | 59 | } 60 | -------------------------------------------------------------------------------- /fabric/1.18/src/main/resources/fabric.mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "schemaVersion": 1, 3 | "id": "advancedbackups", 4 | "version": "${version}", 5 | "name": "Advanced Backups", 6 | "description": "An extremely advanced backup mod.\n\nSupports many backup types.\n\nConfig file and github contain documentation.", 7 | "authors": [ 8 | "Mommy Heather" 9 | ], 10 | "contact": { 11 | "homepage": "https://github.com/HeatherComputer/advancedbackups" 12 | }, 13 | "license": "BSD", 14 | "icon": "assets/advanced-backups/icon.png", 15 | "environment": "*", 16 | "entrypoints": { 17 | "main": [ 18 | "computer.heather.advancedbackups.AdvancedBackups" 19 | ], 20 | "client": [ 21 | "computer.heather.advancedbackups.client.ClientWrapper" 22 | ] 23 | }, 24 | "depends": { 25 | "fabricloader": ">=0.14.19", 26 | "minecraft": "~1.18.2", 27 | "java": ">=17", 28 | "fabric-api": "*" 29 | } 30 | } -------------------------------------------------------------------------------- /fabric/1.18/src/main/resources/pack.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "pack": { 3 | "description": "advancedbackups resources", 4 | "pack_format": 9, 5 | "forge:resource_pack_format": 8, 6 | "forge:data_pack_format": 9 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fabric/1.19.2/README.md: -------------------------------------------------------------------------------- 1 | # Fabric - 1.19 2 | 3 | This is the branch specifically for fabric 1.19. 4 | Any differences will be listed below. For full documentation, see the `core` branch. 5 | -------------------------------------------------------------------------------- /fabric/1.19.2/gradle.properties: -------------------------------------------------------------------------------- 1 | # Done to increase the memory available to gradle. 2 | org.gradle.jvmargs=-Xmx1G 3 | org.gradle.parallel=true 4 | 5 | # Fabric Properties 6 | # check these on https://fabricmc.net/develop 7 | minecraft_version=1.19.2 8 | yarn_mappings=1.19.2+build.28 9 | loader_version=0.14.22 10 | 11 | # Mod Properties 12 | version=2.0 13 | maven_group=computer.heather.advancedbackups 14 | archives_base_name=advanced-backups 15 | modloaderName =fabric 16 | minecraftVersion =1.19.2 17 | 18 | # Dependencies 19 | fabric_version=0.76.1+1.19.2 20 | 21 | 22 | -------------------------------------------------------------------------------- /fabric/1.19.2/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeatherComputer/AdvancedBackups/01d74672e44b67ceb5e4bd0a18b861ebe0bfcaf0/fabric/1.19.2/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /fabric/1.19.2/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /fabric/1.19.2/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { 4 | name = 'Fabric' 5 | url = 'https://maven.fabricmc.net/' 6 | } 7 | mavenCentral() 8 | gradlePluginPortal() 9 | } 10 | } 11 | 12 | rootProject.name = 'fabric-1.19.2' 13 | -------------------------------------------------------------------------------- /fabric/1.19.2/src/main/java/computer/heather/advancedbackups/client/ColourHelper.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.client; 2 | 3 | //A colour helper, loosely based on that of vanilla 1.16. 4 | //What is the modern equivalent..? 5 | public class ColourHelper { 6 | 7 | public static int alpha(int in) { 8 | return in >>> 24; 9 | } 10 | 11 | public static int red(int in) { 12 | return in >> 16 & 255; 13 | } 14 | 15 | public static int green(int in) { 16 | return in >> 8 & 255; 17 | } 18 | 19 | public static int blue(int in) { 20 | return in & 255; 21 | } 22 | 23 | public static int colour(int a, int r, int g, int b) { 24 | return a << 24 | r << 16 | g << 8 | b; 25 | } 26 | 27 | public static int colour(int a, long r, long g, long b) { 28 | return colour(a, (int) r, (int) g, (int) b); 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /fabric/1.19.2/src/main/java/computer/heather/advancedbackups/network/NetworkHandler.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking; 4 | import net.fabricmc.fabric.api.networking.v1.PacketByteBufs; 5 | import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking; 6 | import net.minecraft.server.network.ServerPlayerEntity; 7 | import net.minecraft.util.Identifier; 8 | 9 | public class NetworkHandler { 10 | 11 | public static Identifier STATUS_PACKET_ID = new Identifier("advancedbackups", "backup_status"); 12 | public static final Identifier TOAST_SUBSCRIBE_ID = new Identifier("advancedbackups", "toast_subscribe"); 13 | 14 | 15 | public static void sendToClient(ServerPlayerEntity player, PacketBackupStatus packet) { 16 | 17 | ServerPlayNetworking.send(player, STATUS_PACKET_ID, packet.write(PacketByteBufs.create())); 18 | 19 | } 20 | 21 | 22 | 23 | } 24 | -------------------------------------------------------------------------------- /fabric/1.19.2/src/main/java/computer/heather/advancedbackups/network/PacketBackupStatus.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import net.minecraft.network.PacketByteBuf; 4 | 5 | public class PacketBackupStatus { 6 | 7 | public boolean starting; 8 | public boolean started; 9 | public boolean failed; 10 | public boolean finished; 11 | public boolean cancelled; 12 | 13 | public int progress; 14 | public int max; 15 | 16 | 17 | public PacketBackupStatus(boolean starting, boolean started, boolean failed, boolean finished, boolean cancelled, int progress, 18 | int max) { 19 | this.starting = starting; 20 | this.started = started; 21 | this.failed = failed; 22 | this.finished = finished; 23 | this.cancelled = cancelled; 24 | this.progress = progress; 25 | this.max = max; 26 | } 27 | 28 | public PacketBackupStatus() { 29 | 30 | } 31 | 32 | public void read(PacketByteBuf buf) { 33 | starting = buf.readBoolean(); 34 | started = buf.readBoolean(); 35 | failed = buf.readBoolean(); 36 | finished = buf.readBoolean(); 37 | cancelled = buf.readBoolean(); 38 | 39 | progress = buf.readInt(); 40 | max = buf.readInt(); 41 | } 42 | 43 | public PacketByteBuf write(PacketByteBuf buf) { 44 | buf.writeBoolean(starting); 45 | buf.writeBoolean(started); 46 | buf.writeBoolean(failed); 47 | buf.writeBoolean(finished); 48 | buf.writeBoolean(cancelled); 49 | 50 | buf.writeInt(progress); 51 | buf.writeInt(max); 52 | 53 | return buf; 54 | 55 | } 56 | 57 | 58 | } 59 | -------------------------------------------------------------------------------- /fabric/1.19.2/src/main/java/computer/heather/advancedbackups/network/PacketToastSubscribe.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import computer.heather.advancedbackups.AdvancedBackups; 4 | import net.fabricmc.fabric.api.networking.v1.PacketSender; 5 | import net.minecraft.network.PacketByteBuf; 6 | import net.minecraft.server.MinecraftServer; 7 | import net.minecraft.server.network.ServerPlayNetworkHandler; 8 | import net.minecraft.server.network.ServerPlayerEntity; 9 | 10 | public class PacketToastSubscribe { 11 | 12 | public boolean enable; 13 | 14 | 15 | public PacketToastSubscribe(boolean enable) { 16 | this.enable = enable; 17 | } 18 | 19 | public PacketToastSubscribe() { 20 | 21 | } 22 | 23 | public void read(PacketByteBuf buf) { 24 | enable = buf.readBoolean(); 25 | } 26 | 27 | public PacketByteBuf write(PacketByteBuf buf) { 28 | buf.writeBoolean(enable); 29 | 30 | return buf; 31 | 32 | } 33 | 34 | 35 | public static void handle(MinecraftServer server, ServerPlayerEntity player, ServerPlayNetworkHandler handler, PacketByteBuf buf, PacketSender responseSender) { 36 | 37 | PacketToastSubscribe message = new PacketToastSubscribe(); 38 | message.read(buf); 39 | 40 | 41 | server.execute(() -> { 42 | if (message.enable && !AdvancedBackups.players.contains(player.getUuidAsString())) { 43 | AdvancedBackups.players.add(player.getUuidAsString()); 44 | } 45 | else if (!message.enable) { 46 | AdvancedBackups.players.remove(player.getUuidAsString()); 47 | } 48 | 49 | }); 50 | 51 | 52 | 53 | 54 | 55 | } 56 | 57 | 58 | 59 | } -------------------------------------------------------------------------------- /fabric/1.19.2/src/main/resources/fabric.mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "schemaVersion": 1, 3 | "id": "advancedbackups", 4 | "version": "${version}", 5 | "name": "Advanced Backups", 6 | "description": "An extremely advanced backup mod.\n\nSupports many backup types.\n\nConfig file and github contain documentation.", 7 | "authors": [ 8 | "Mommy Heather" 9 | ], 10 | "contact": { 11 | "homepage": "https://github.com/HeatherComputer/advancedbackups" 12 | }, 13 | "license": "BSD", 14 | "icon": "assets/advanced-backups/icon.png", 15 | "environment": "*", 16 | "entrypoints": { 17 | "main": [ 18 | "computer.heather.advancedbackups.AdvancedBackups" 19 | ], 20 | "client": [ 21 | "computer.heather.advancedbackups.client.ClientWrapper" 22 | ] 23 | }, 24 | "depends": { 25 | "fabricloader": ">=0.14.22", 26 | "minecraft": "~1.19.2", 27 | "java": ">=17", 28 | "fabric-api": "*" 29 | } 30 | } -------------------------------------------------------------------------------- /fabric/1.19.2/src/main/resources/pack.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "pack": { 3 | "description": "advancedbackups resources", 4 | "pack_format": 9, 5 | "forge:resource_pack_format": 8, 6 | "forge:data_pack_format": 9 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fabric/1.19.3/README.md: -------------------------------------------------------------------------------- 1 | # Fabric - 1.19.3 2 | 3 | This is the branch specifically for fabric 1.19.3 / 1.19.4 4 | Any differences will be listed below. For full documentation, see the `core` branch. 5 | -------------------------------------------------------------------------------- /fabric/1.19.3/gradle.properties: -------------------------------------------------------------------------------- 1 | # Done to increase the memory available to gradle. 2 | org.gradle.jvmargs=-Xmx1G 3 | org.gradle.parallel=true 4 | 5 | # Fabric Properties 6 | # check these on https://fabricmc.net/develop 7 | minecraft_version=1.19.4 8 | yarn_mappings=1.19.4+build.2 9 | loader_version=0.14.24 10 | 11 | # Mod Properties 12 | version=2.0 13 | maven_group=computer.heather.advancedbackups 14 | archives_base_name=advanced-backups 15 | modloaderName =fabric 16 | minecraftVersion =1.19.3 17 | 18 | # Dependencies 19 | fabric_version=0.87.1+1.19.4 20 | 21 | 22 | -------------------------------------------------------------------------------- /fabric/1.19.3/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeatherComputer/AdvancedBackups/01d74672e44b67ceb5e4bd0a18b861ebe0bfcaf0/fabric/1.19.3/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /fabric/1.19.3/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /fabric/1.19.3/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { 4 | name = 'Fabric' 5 | url = 'https://maven.fabricmc.net/' 6 | } 7 | mavenCentral() 8 | gradlePluginPortal() 9 | } 10 | } 11 | 12 | rootProject.name = 'fabric-1.19.3' 13 | -------------------------------------------------------------------------------- /fabric/1.19.3/src/main/java/computer/heather/advancedbackups/client/ColourHelper.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.client; 2 | 3 | //A colour helper, loosely based on that of vanilla 1.16. 4 | //What is the modern equivalent..? 5 | public class ColourHelper { 6 | 7 | public static int alpha(int in) { 8 | return in >>> 24; 9 | } 10 | 11 | public static int red(int in) { 12 | return in >> 16 & 255; 13 | } 14 | 15 | public static int green(int in) { 16 | return in >> 8 & 255; 17 | } 18 | 19 | public static int blue(int in) { 20 | return in & 255; 21 | } 22 | 23 | public static int colour(int a, int r, int g, int b) { 24 | return a << 24 | r << 16 | g << 8 | b; 25 | } 26 | 27 | public static int colour(int a, long r, long g, long b) { 28 | return colour(a, (int) r, (int) g, (int) b); 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /fabric/1.19.3/src/main/java/computer/heather/advancedbackups/network/NetworkHandler.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import net.fabricmc.fabric.api.networking.v1.PacketByteBufs; 4 | import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking; 5 | import net.minecraft.server.network.ServerPlayerEntity; 6 | import net.minecraft.util.Identifier; 7 | 8 | public class NetworkHandler { 9 | 10 | public static Identifier STATUS_PACKET_ID = new Identifier("advancedbackups", "backup_status"); 11 | public static final Identifier TOAST_SUBSCRIBE_ID = new Identifier("advancedbackups", "toast_subscribe"); 12 | 13 | 14 | public static void sendToClient(ServerPlayerEntity player, PacketBackupStatus packet) { 15 | 16 | ServerPlayNetworking.send(player, STATUS_PACKET_ID, packet.write(PacketByteBufs.create())); 17 | 18 | } 19 | 20 | 21 | 22 | } 23 | -------------------------------------------------------------------------------- /fabric/1.19.3/src/main/java/computer/heather/advancedbackups/network/PacketBackupStatus.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import net.minecraft.network.PacketByteBuf; 4 | 5 | public class PacketBackupStatus { 6 | 7 | public boolean starting; 8 | public boolean started; 9 | public boolean failed; 10 | public boolean finished; 11 | public boolean cancelled; 12 | 13 | public int progress; 14 | public int max; 15 | 16 | 17 | public PacketBackupStatus(boolean starting, boolean started, boolean failed, boolean finished, boolean cancelled, int progress, 18 | int max) { 19 | this.starting = starting; 20 | this.started = started; 21 | this.failed = failed; 22 | this.finished = finished; 23 | this.cancelled = cancelled; 24 | this.progress = progress; 25 | this.max = max; 26 | } 27 | 28 | public PacketBackupStatus() { 29 | 30 | } 31 | 32 | public void read(PacketByteBuf buf) { 33 | starting = buf.readBoolean(); 34 | started = buf.readBoolean(); 35 | failed = buf.readBoolean(); 36 | finished = buf.readBoolean(); 37 | cancelled = buf.readBoolean(); 38 | 39 | progress = buf.readInt(); 40 | max = buf.readInt(); 41 | } 42 | 43 | public PacketByteBuf write(PacketByteBuf buf) { 44 | buf.writeBoolean(starting); 45 | buf.writeBoolean(started); 46 | buf.writeBoolean(failed); 47 | buf.writeBoolean(finished); 48 | buf.writeBoolean(cancelled); 49 | 50 | buf.writeInt(progress); 51 | buf.writeInt(max); 52 | 53 | return buf; 54 | 55 | } 56 | 57 | 58 | } 59 | -------------------------------------------------------------------------------- /fabric/1.19.3/src/main/java/computer/heather/advancedbackups/network/PacketToastSubscribe.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import computer.heather.advancedbackups.AdvancedBackups; 4 | import net.fabricmc.fabric.api.networking.v1.PacketSender; 5 | import net.minecraft.network.PacketByteBuf; 6 | import net.minecraft.server.MinecraftServer; 7 | import net.minecraft.server.network.ServerPlayNetworkHandler; 8 | import net.minecraft.server.network.ServerPlayerEntity; 9 | 10 | public class PacketToastSubscribe { 11 | 12 | public boolean enable; 13 | 14 | 15 | public PacketToastSubscribe(boolean enable) { 16 | this.enable = enable; 17 | } 18 | 19 | public PacketToastSubscribe() { 20 | 21 | } 22 | 23 | public void read(PacketByteBuf buf) { 24 | enable = buf.readBoolean(); 25 | } 26 | 27 | public PacketByteBuf write(PacketByteBuf buf) { 28 | buf.writeBoolean(enable); 29 | 30 | return buf; 31 | 32 | } 33 | 34 | 35 | public static void handle(MinecraftServer server, ServerPlayerEntity player, ServerPlayNetworkHandler handler, PacketByteBuf buf, PacketSender responseSender) { 36 | 37 | PacketToastSubscribe message = new PacketToastSubscribe(); 38 | message.read(buf); 39 | 40 | 41 | server.execute(() -> { 42 | if (message.enable && !AdvancedBackups.players.contains(player.getUuidAsString())) { 43 | AdvancedBackups.players.add(player.getUuidAsString()); 44 | } 45 | else if (!message.enable) { 46 | AdvancedBackups.players.remove(player.getUuidAsString()); 47 | } 48 | 49 | }); 50 | 51 | 52 | 53 | 54 | 55 | } 56 | 57 | 58 | 59 | } -------------------------------------------------------------------------------- /fabric/1.19.3/src/main/resources/advancedbackups.accesswidener: -------------------------------------------------------------------------------- 1 | accessWidener v2 named 2 | 3 | #Required for commands for now, should rework this at some point 4 | accessible field net/minecraft/client/network/ClientPlayNetworkHandler lastSeenMessagesCollector Lnet/minecraft/network/message/LastSeenMessagesCollector; -------------------------------------------------------------------------------- /fabric/1.19.3/src/main/resources/fabric.mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "schemaVersion": 1, 3 | "id": "advancedbackups", 4 | "version": "${version}", 5 | "accessWidener" : "advancedbackups.accesswidener", 6 | "name": "Advanced Backups", 7 | "description": "An extremely advanced backup mod.\n\nSupports many backup types.\n\nConfig file and github contain documentation.", 8 | "authors": [ 9 | "Mommy Heather" 10 | ], 11 | "contact": { 12 | "homepage": "https://github.com/HeatherComputer/advancedbackups" 13 | }, 14 | "license": "BSD", 15 | "icon": "assets/advanced-backups/icon.png", 16 | "environment": "*", 17 | "entrypoints": { 18 | "main": [ 19 | "computer.heather.advancedbackups.AdvancedBackups" 20 | ], 21 | "client": [ 22 | "computer.heather.advancedbackups.client.ClientWrapper" 23 | ] 24 | }, 25 | "depends": { 26 | "fabricloader": ">=0.14.22", 27 | "minecraft": ">=1.19.3", 28 | "java": ">=17", 29 | "fabric-api": "*" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /fabric/1.19.3/src/main/resources/pack.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "pack": { 3 | "description": "advancedbackups resources", 4 | "pack_format": 9, 5 | "forge:resource_pack_format": 8, 6 | "forge:data_pack_format": 9 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fabric/1.20.2/README.md: -------------------------------------------------------------------------------- 1 | # Fabric - 1.20.2 2 | 3 | This is the branch specifically for fabric 1.20.2. 4 | Any differences will be listed below. For full documentation, see the `core` branch. 5 | -------------------------------------------------------------------------------- /fabric/1.20.2/gradle.properties: -------------------------------------------------------------------------------- 1 | # Done to increase the memory available to gradle. 2 | org.gradle.jvmargs=-Xmx1G 3 | org.gradle.parallel=true 4 | 5 | # Fabric Properties 6 | # check these on https://fabricmc.net/develop 7 | minecraft_version=1.20.2 8 | yarn_mappings=1.20.2+build.4 9 | loader_version=0.14.24 10 | 11 | # Mod Properties 12 | version=2.0 13 | mod_version=2.0 14 | maven_group=computer.heather.advancedbackups 15 | archives_base_name=advancedbackups 16 | modloaderName =fabric 17 | minecraftVersion =1.20.2 18 | 19 | # Dependencies 20 | fabric_version=0.90.4+1.20.2 21 | 22 | -------------------------------------------------------------------------------- /fabric/1.20.2/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeatherComputer/AdvancedBackups/01d74672e44b67ceb5e4bd0a18b861ebe0bfcaf0/fabric/1.20.2/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /fabric/1.20.2/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /fabric/1.20.2/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { 4 | name = 'Fabric' 5 | url = 'https://maven.fabricmc.net/' 6 | } 7 | mavenCentral() 8 | gradlePluginPortal() 9 | } 10 | } 11 | 12 | rootProject.name = 'fabric-1.20.2' 13 | -------------------------------------------------------------------------------- /fabric/1.20.2/src/main/java/computer/heather/advancedbackups/client/ColourHelper.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.client; 2 | 3 | //A colour helper, loosely based on that of vanilla 1.16. 4 | //What is the modern equivalent..? 5 | public class ColourHelper { 6 | 7 | public static int alpha(int in) { 8 | return in >>> 24; 9 | } 10 | 11 | public static int red(int in) { 12 | return in >> 16 & 255; 13 | } 14 | 15 | public static int green(int in) { 16 | return in >> 8 & 255; 17 | } 18 | 19 | public static int blue(int in) { 20 | return in & 255; 21 | } 22 | 23 | public static int colour(int a, int r, int g, int b) { 24 | return a << 24 | r << 16 | g << 8 | b; 25 | } 26 | 27 | public static int colour(int a, long r, long g, long b) { 28 | return colour(a, (int) r, (int) g, (int) b); 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /fabric/1.20.2/src/main/java/computer/heather/advancedbackups/network/NetworkHandler.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking; 4 | import net.fabricmc.fabric.api.networking.v1.PacketByteBufs; 5 | import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking; 6 | import net.minecraft.server.network.ServerPlayerEntity; 7 | import net.minecraft.util.Identifier; 8 | 9 | public class NetworkHandler { 10 | 11 | public static Identifier STATUS_PACKET_ID = new Identifier("advancedbackups", "backup_status"); 12 | public static final Identifier TOAST_SUBSCRIBE_ID = new Identifier("advancedbackups", "toast_subscribe"); 13 | 14 | 15 | public static void sendToClient(ServerPlayerEntity player, PacketBackupStatus packet) { 16 | 17 | ServerPlayNetworking.send(player, STATUS_PACKET_ID, packet.write(PacketByteBufs.create())); 18 | 19 | } 20 | 21 | 22 | 23 | } 24 | -------------------------------------------------------------------------------- /fabric/1.20.2/src/main/java/computer/heather/advancedbackups/network/PacketBackupStatus.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import net.minecraft.network.PacketByteBuf; 4 | 5 | public class PacketBackupStatus { 6 | 7 | public boolean starting; 8 | public boolean started; 9 | public boolean failed; 10 | public boolean finished; 11 | public boolean cancelled; 12 | 13 | public int progress; 14 | public int max; 15 | 16 | 17 | public PacketBackupStatus(boolean starting, boolean started, boolean failed, boolean finished, boolean cancelled, int progress, 18 | int max) { 19 | this.starting = starting; 20 | this.started = started; 21 | this.failed = failed; 22 | this.finished = finished; 23 | this.cancelled = cancelled; 24 | this.progress = progress; 25 | this.max = max; 26 | } 27 | 28 | public PacketBackupStatus() { 29 | 30 | } 31 | 32 | public void read(PacketByteBuf buf) { 33 | starting = buf.readBoolean(); 34 | started = buf.readBoolean(); 35 | failed = buf.readBoolean(); 36 | finished = buf.readBoolean(); 37 | cancelled = buf.readBoolean(); 38 | 39 | progress = buf.readInt(); 40 | max = buf.readInt(); 41 | } 42 | 43 | public PacketByteBuf write(PacketByteBuf buf) { 44 | buf.writeBoolean(starting); 45 | buf.writeBoolean(started); 46 | buf.writeBoolean(failed); 47 | buf.writeBoolean(finished); 48 | buf.writeBoolean(cancelled); 49 | 50 | buf.writeInt(progress); 51 | buf.writeInt(max); 52 | 53 | return buf; 54 | 55 | } 56 | 57 | 58 | } 59 | -------------------------------------------------------------------------------- /fabric/1.20.2/src/main/java/computer/heather/advancedbackups/network/PacketToastSubscribe.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import computer.heather.advancedbackups.AdvancedBackups; 4 | import net.fabricmc.fabric.api.networking.v1.PacketSender; 5 | import net.minecraft.network.PacketByteBuf; 6 | import net.minecraft.server.MinecraftServer; 7 | import net.minecraft.server.network.ServerPlayNetworkHandler; 8 | import net.minecraft.server.network.ServerPlayerEntity; 9 | 10 | public class PacketToastSubscribe { 11 | 12 | public boolean enable; 13 | 14 | 15 | public PacketToastSubscribe(boolean enable) { 16 | this.enable = enable; 17 | } 18 | 19 | public PacketToastSubscribe() { 20 | 21 | } 22 | 23 | public void read(PacketByteBuf buf) { 24 | enable = buf.readBoolean(); 25 | } 26 | 27 | public PacketByteBuf write(PacketByteBuf buf) { 28 | buf.writeBoolean(enable); 29 | 30 | return buf; 31 | 32 | } 33 | 34 | 35 | public static void handle(MinecraftServer server, ServerPlayerEntity player, ServerPlayNetworkHandler handler, PacketByteBuf buf, PacketSender responseSender) { 36 | 37 | PacketToastSubscribe message = new PacketToastSubscribe(); 38 | message.read(buf); 39 | 40 | 41 | server.execute(() -> { 42 | if (message.enable && !AdvancedBackups.players.contains(player.getUuidAsString())) { 43 | AdvancedBackups.players.add(player.getUuidAsString()); 44 | } 45 | else if (!message.enable) { 46 | AdvancedBackups.players.remove(player.getUuidAsString()); 47 | } 48 | 49 | }); 50 | 51 | 52 | 53 | 54 | 55 | } 56 | 57 | 58 | 59 | } -------------------------------------------------------------------------------- /fabric/1.20.2/src/main/resources/advancedbackups.accesswidener: -------------------------------------------------------------------------------- 1 | accessWidener v2 named 2 | 3 | #Required for commands for now, should rework this at some point 4 | accessible field net/minecraft/client/network/ClientPlayNetworkHandler lastSeenMessagesCollector Lnet/minecraft/network/message/LastSeenMessagesCollector; -------------------------------------------------------------------------------- /fabric/1.20.2/src/main/resources/fabric.mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "schemaVersion": 1, 3 | "id": "advancedbackups", 4 | "version": "${version}", 5 | "accessWidener" : "advancedbackups.accesswidener", 6 | "name": "Advanced Backups", 7 | "description": "An extremely advanced backup mod.\n\nSupports many backup types.\n\nConfig file and github contain documentation.", 8 | "authors": [ 9 | "Mommy Heather" 10 | ], 11 | "contact": { 12 | "homepage": "https://github.com/HeatherComputer/advancedbackups" 13 | }, 14 | "license": "BSD", 15 | "icon": "assets/advanced-backups/icon.png", 16 | "environment": "*", 17 | "entrypoints": { 18 | "main": [ 19 | "computer.heather.advancedbackups.AdvancedBackups" 20 | ], 21 | "client": [ 22 | "computer.heather.advancedbackups.client.ClientWrapper" 23 | ] 24 | }, 25 | "depends": { 26 | "fabricloader": ">=0.14.22", 27 | "minecraft": ">=1.20", 28 | "java": ">=17", 29 | "fabric-api": "*" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /fabric/1.20.2/src/main/resources/pack.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "pack": { 3 | "description": "advancedbackups resources", 4 | "pack_format": 9, 5 | "forge:resource_pack_format": 8, 6 | "forge:data_pack_format": 9 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fabric/1.20.6/README.md: -------------------------------------------------------------------------------- 1 | # Fabric - 1.20.6 2 | 3 | This is the branch specifically for fabric 1.20.6. 4 | Any differences will be listed below. For full documentation, see the `core` branch. 5 | -------------------------------------------------------------------------------- /fabric/1.20.6/gradle.properties: -------------------------------------------------------------------------------- 1 | # Done to increase the memory available to gradle. 2 | org.gradle.jvmargs=-Xmx1G 3 | org.gradle.parallel=true 4 | 5 | # Fabric Properties 6 | # check these on https://fabricmc.net/develop 7 | minecraft_version=1.20.5 8 | yarn_mappings=1.20.5+build.1 9 | loader_version=0.15.10 10 | 11 | # Mod Properties 12 | version=2.0 13 | mod_version=2.0 14 | maven_group=computer.heather.advancedbackups 15 | archives_base_name=advancedbackups 16 | modloaderName =fabric 17 | #We support 1.20.6, but it shouldn't be used so we won't show in the jar name. 18 | minecraftVersion =1.20.6 19 | 20 | # Dependencies 21 | fabric_version=0.97.5+1.20.5 22 | 23 | -------------------------------------------------------------------------------- /fabric/1.20.6/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeatherComputer/AdvancedBackups/01d74672e44b67ceb5e4bd0a18b861ebe0bfcaf0/fabric/1.20.6/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /fabric/1.20.6/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /fabric/1.20.6/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { 4 | name = 'Fabric' 5 | url = 'https://maven.fabricmc.net/' 6 | } 7 | mavenCentral() 8 | gradlePluginPortal() 9 | } 10 | } 11 | 12 | rootProject.name = 'fabric-1.20.6' 13 | -------------------------------------------------------------------------------- /fabric/1.20.6/src/main/java/computer/heather/advancedbackups/client/ColourHelper.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.client; 2 | 3 | //A colour helper, loosely based on that of vanilla 1.16. 4 | //What is the modern equivalent..? 5 | public class ColourHelper { 6 | 7 | public static int alpha(int in) { 8 | return in >>> 24; 9 | } 10 | 11 | public static int red(int in) { 12 | return in >> 16 & 255; 13 | } 14 | 15 | public static int green(int in) { 16 | return in >> 8 & 255; 17 | } 18 | 19 | public static int blue(int in) { 20 | return in & 255; 21 | } 22 | 23 | public static int colour(int a, int r, int g, int b) { 24 | return a << 24 | r << 16 | g << 8 | b; 25 | } 26 | 27 | public static int colour(int a, long r, long g, long b) { 28 | return colour(a, (int) r, (int) g, (int) b); 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /fabric/1.20.6/src/main/java/computer/heather/advancedbackups/network/NetworkHandler.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking; 4 | import net.minecraft.server.network.ServerPlayerEntity; 5 | 6 | public class NetworkHandler { 7 | 8 | public static void sendToClient(ServerPlayerEntity player, PacketBackupStatus packet) { 9 | 10 | ServerPlayNetworking.send(player, packet); 11 | 12 | } 13 | 14 | 15 | 16 | } 17 | -------------------------------------------------------------------------------- /fabric/1.20.6/src/main/java/computer/heather/advancedbackups/network/PacketBackupStatus.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import net.minecraft.network.PacketByteBuf; 4 | import net.minecraft.network.codec.PacketCodec; 5 | import net.minecraft.network.packet.CustomPayload; 6 | 7 | public record PacketBackupStatus(boolean starting, boolean started, boolean failed, boolean finished, boolean cancelled, int progress, int max) implements CustomPayload { 8 | 9 | public static final Id ID = CustomPayload.id("advancedbackups:backup_status"); 10 | 11 | public static final PacketCodec CODEC = PacketCodec.of((packet, buf) -> { 12 | buf.writeBoolean(packet.starting); 13 | buf.writeBoolean(packet.started); 14 | buf.writeBoolean(packet.failed); 15 | buf.writeBoolean(packet.finished); 16 | buf.writeBoolean(packet.cancelled); 17 | buf.writeInt(packet.progress); 18 | buf.writeInt(packet.max); 19 | }, 20 | 21 | buf -> new PacketBackupStatus( 22 | buf.readBoolean(), 23 | buf.readBoolean(), 24 | buf.readBoolean(), 25 | buf.readBoolean(), 26 | buf.readBoolean(), 27 | buf.readInt(), 28 | buf.readInt() 29 | )); 30 | 31 | 32 | @Override 33 | public Id getId() { 34 | return ID; 35 | } 36 | 37 | 38 | } 39 | -------------------------------------------------------------------------------- /fabric/1.20.6/src/main/java/computer/heather/advancedbackups/network/PacketToastSubscribe.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import computer.heather.advancedbackups.AdvancedBackups; 4 | import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking; 5 | import net.minecraft.network.PacketByteBuf; 6 | import net.minecraft.network.codec.PacketCodec; 7 | import net.minecraft.network.codec.PacketCodecs; 8 | import net.minecraft.network.packet.CustomPayload; 9 | import net.minecraft.server.network.ServerPlayerEntity; 10 | 11 | public record PacketToastSubscribe(boolean enable) implements CustomPayload { 12 | 13 | public static final Id ID = CustomPayload.id("advancedbackups:toast_subscribe"); 14 | 15 | public PacketToastSubscribe(boolean enable) { 16 | this.enable = enable; 17 | } 18 | 19 | public static final PacketCodec CODEC = PacketCodec.tuple(PacketCodecs.BOOL, PacketToastSubscribe::enable, PacketToastSubscribe::new); 20 | 21 | 22 | public static void handle(PacketToastSubscribe message, ServerPlayNetworking.Context context) { 23 | 24 | ServerPlayerEntity player = context.player(); 25 | 26 | if (message.enable() && !AdvancedBackups.players.contains(player.getUuidAsString())) { 27 | AdvancedBackups.players.add(player.getUuidAsString()); 28 | } 29 | else if (!message.enable()) { 30 | AdvancedBackups.players.remove(player.getUuidAsString()); 31 | } 32 | 33 | } 34 | 35 | 36 | 37 | @Override 38 | public Id getId() { 39 | return ID; 40 | } 41 | 42 | 43 | 44 | } -------------------------------------------------------------------------------- /fabric/1.20.6/src/main/resources/advancedbackups.accesswidener: -------------------------------------------------------------------------------- 1 | accessWidener v2 named 2 | 3 | #Required for commands for now, should rework this at some point 4 | accessible field net/minecraft/client/network/ClientPlayNetworkHandler lastSeenMessagesCollector Lnet/minecraft/network/message/LastSeenMessagesCollector; -------------------------------------------------------------------------------- /fabric/1.20.6/src/main/resources/fabric.mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "schemaVersion": 1, 3 | "id": "advancedbackups", 4 | "version": "${version}", 5 | "accessWidener" : "advancedbackups.accesswidener", 6 | "name": "Advanced Backups", 7 | "description": "An extremely advanced backup mod.\n\nSupports many backup types.\n\nConfig file and github contain documentation.", 8 | "authors": [ 9 | "Mommy Heather" 10 | ], 11 | "contact": { 12 | "homepage": "https://github.com/HeatherComputer/advancedbackups" 13 | }, 14 | "license": "BSD", 15 | "icon": "assets/advanced-backups/icon.png", 16 | "environment": "*", 17 | "entrypoints": { 18 | "main": [ 19 | "computer.heather.advancedbackups.AdvancedBackups" 20 | ], 21 | "client": [ 22 | "computer.heather.advancedbackups.client.ClientWrapper" 23 | ] 24 | }, 25 | "depends": { 26 | "fabricloader": ">=0.15.10", 27 | "minecraft": ">=1.20.5", 28 | "java": ">=21", 29 | "fabric-api": "*" 30 | } 31 | } -------------------------------------------------------------------------------- /fabric/1.20.6/src/main/resources/pack.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "pack": { 3 | "description": "advancedbackups resources", 4 | "pack_format": 9, 5 | "forge:resource_pack_format": 8, 6 | "forge:data_pack_format": 9 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fabric/1.20/README.md: -------------------------------------------------------------------------------- 1 | # Fabric - 1.20 2 | 3 | This is the branch specifically for fabric 1.20. 4 | Any differences will be listed below. For full documentation, see the `core` branch. 5 | -------------------------------------------------------------------------------- /fabric/1.20/gradle.properties: -------------------------------------------------------------------------------- 1 | # Done to increase the memory available to gradle. 2 | org.gradle.jvmargs=-Xmx1G 3 | org.gradle.parallel=true 4 | 5 | # Fabric Properties 6 | # check these on https://fabricmc.net/develop 7 | minecraft_version=1.20 8 | yarn_mappings=1.20+build.1 9 | loader_version=0.14.22 10 | 11 | # Mod Properties 12 | version=2.0 13 | mod_version=2.0 14 | maven_group=computer.heather.advancedbackups 15 | archives_base_name=advancedbackups 16 | modloaderName =fabric 17 | minecraftVersion =1.20 18 | 19 | # Dependencies 20 | fabric_version=0.83.0+1.20 21 | 22 | 23 | -------------------------------------------------------------------------------- /fabric/1.20/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeatherComputer/AdvancedBackups/01d74672e44b67ceb5e4bd0a18b861ebe0bfcaf0/fabric/1.20/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /fabric/1.20/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /fabric/1.20/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { 4 | name = 'Fabric' 5 | url = 'https://maven.fabricmc.net/' 6 | } 7 | mavenCentral() 8 | gradlePluginPortal() 9 | } 10 | } 11 | 12 | rootProject.name = 'fabric-1.20' 13 | -------------------------------------------------------------------------------- /fabric/1.20/src/main/java/computer/heather/advancedbackups/client/ColourHelper.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.client; 2 | 3 | //A colour helper, loosely based on that of vanilla 1.16. 4 | //What is the modern equivalent..? 5 | public class ColourHelper { 6 | 7 | public static int alpha(int in) { 8 | return in >>> 24; 9 | } 10 | 11 | public static int red(int in) { 12 | return in >> 16 & 255; 13 | } 14 | 15 | public static int green(int in) { 16 | return in >> 8 & 255; 17 | } 18 | 19 | public static int blue(int in) { 20 | return in & 255; 21 | } 22 | 23 | public static int colour(int a, int r, int g, int b) { 24 | return a << 24 | r << 16 | g << 8 | b; 25 | } 26 | 27 | public static int colour(int a, long r, long g, long b) { 28 | return colour(a, (int) r, (int) g, (int) b); 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /fabric/1.20/src/main/java/computer/heather/advancedbackups/network/NetworkHandler.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking; 4 | import net.fabricmc.fabric.api.networking.v1.PacketByteBufs; 5 | import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking; 6 | import net.minecraft.server.network.ServerPlayerEntity; 7 | import net.minecraft.util.Identifier; 8 | 9 | public class NetworkHandler { 10 | 11 | public static Identifier STATUS_PACKET_ID = new Identifier("advancedbackups", "backup_status"); 12 | public static final Identifier TOAST_SUBSCRIBE_ID = new Identifier("advancedbackups", "toast_subscribe"); 13 | 14 | 15 | public static void sendToClient(ServerPlayerEntity player, PacketBackupStatus packet) { 16 | 17 | ServerPlayNetworking.send(player, STATUS_PACKET_ID, packet.write(PacketByteBufs.create())); 18 | 19 | } 20 | 21 | 22 | 23 | } 24 | -------------------------------------------------------------------------------- /fabric/1.20/src/main/java/computer/heather/advancedbackups/network/PacketBackupStatus.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import net.minecraft.network.PacketByteBuf; 4 | 5 | public class PacketBackupStatus { 6 | 7 | public boolean starting; 8 | public boolean started; 9 | public boolean failed; 10 | public boolean finished; 11 | public boolean cancelled; 12 | 13 | public int progress; 14 | public int max; 15 | 16 | 17 | public PacketBackupStatus(boolean starting, boolean started, boolean failed, boolean finished, boolean cancelled, int progress, 18 | int max) { 19 | this.starting = starting; 20 | this.started = started; 21 | this.failed = failed; 22 | this.finished = finished; 23 | this.cancelled = cancelled; 24 | this.progress = progress; 25 | this.max = max; 26 | } 27 | 28 | public PacketBackupStatus() { 29 | 30 | } 31 | 32 | public void read(PacketByteBuf buf) { 33 | starting = buf.readBoolean(); 34 | started = buf.readBoolean(); 35 | failed = buf.readBoolean(); 36 | finished = buf.readBoolean(); 37 | cancelled = buf.readBoolean(); 38 | 39 | progress = buf.readInt(); 40 | max = buf.readInt(); 41 | } 42 | 43 | public PacketByteBuf write(PacketByteBuf buf) { 44 | buf.writeBoolean(starting); 45 | buf.writeBoolean(started); 46 | buf.writeBoolean(failed); 47 | buf.writeBoolean(finished); 48 | buf.writeBoolean(cancelled); 49 | 50 | buf.writeInt(progress); 51 | buf.writeInt(max); 52 | 53 | return buf; 54 | 55 | } 56 | 57 | 58 | } 59 | -------------------------------------------------------------------------------- /fabric/1.20/src/main/java/computer/heather/advancedbackups/network/PacketToastSubscribe.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import computer.heather.advancedbackups.AdvancedBackups; 4 | import net.fabricmc.fabric.api.networking.v1.PacketSender; 5 | import net.minecraft.network.PacketByteBuf; 6 | import net.minecraft.server.MinecraftServer; 7 | import net.minecraft.server.network.ServerPlayNetworkHandler; 8 | import net.minecraft.server.network.ServerPlayerEntity; 9 | 10 | public class PacketToastSubscribe { 11 | 12 | public boolean enable; 13 | 14 | 15 | public PacketToastSubscribe(boolean enable) { 16 | this.enable = enable; 17 | } 18 | 19 | public PacketToastSubscribe() { 20 | 21 | } 22 | 23 | public void read(PacketByteBuf buf) { 24 | enable = buf.readBoolean(); 25 | } 26 | 27 | public PacketByteBuf write(PacketByteBuf buf) { 28 | buf.writeBoolean(enable); 29 | 30 | return buf; 31 | 32 | } 33 | 34 | 35 | public static void handle(MinecraftServer server, ServerPlayerEntity player, ServerPlayNetworkHandler handler, PacketByteBuf buf, PacketSender responseSender) { 36 | 37 | PacketToastSubscribe message = new PacketToastSubscribe(); 38 | message.read(buf); 39 | 40 | 41 | server.execute(() -> { 42 | if (message.enable && !AdvancedBackups.players.contains(player.getUuidAsString())) { 43 | AdvancedBackups.players.add(player.getUuidAsString()); 44 | } 45 | else if (!message.enable) { 46 | AdvancedBackups.players.remove(player.getUuidAsString()); 47 | } 48 | 49 | }); 50 | 51 | 52 | 53 | 54 | 55 | } 56 | 57 | 58 | 59 | } -------------------------------------------------------------------------------- /fabric/1.20/src/main/resources/advancedbackups.accesswidener: -------------------------------------------------------------------------------- 1 | accessWidener v2 named 2 | 3 | #Required for commands for now, should rework this at some point 4 | accessible field net/minecraft/client/network/ClientPlayNetworkHandler lastSeenMessagesCollector Lnet/minecraft/network/message/LastSeenMessagesCollector; -------------------------------------------------------------------------------- /fabric/1.20/src/main/resources/fabric.mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "schemaVersion": 1, 3 | "id": "advancedbackups", 4 | "version": "${version}", 5 | "accessWidener" : "advancedbackups.accesswidener", 6 | "name": "Advanced Backups", 7 | "description": "An extremely advanced backup mod.\n\nSupports many backup types.\n\nConfig file and github contain documentation.", 8 | "authors": [ 9 | "Mommy Heather" 10 | ], 11 | "contact": { 12 | "homepage": "https://github.com/HeatherComputer/advancedbackups" 13 | }, 14 | "license": "BSD", 15 | "icon": "assets/advanced-backups/icon.png", 16 | "environment": "*", 17 | "entrypoints": { 18 | "main": [ 19 | "computer.heather.advancedbackups.AdvancedBackups" 20 | ], 21 | "client": [ 22 | "computer.heather.advancedbackups.client.ClientWrapper" 23 | ] 24 | }, 25 | "depends": { 26 | "fabricloader": ">=0.14.22", 27 | "minecraft": ">=1.20", 28 | "java": ">=17", 29 | "fabric-api": "*" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /fabric/1.20/src/main/resources/pack.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "pack": { 3 | "description": "advancedbackups resources", 4 | "pack_format": 9, 5 | "forge:resource_pack_format": 8, 6 | "forge:data_pack_format": 9 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fabric/1.21.2/README.md: -------------------------------------------------------------------------------- 1 | # Fabric - 1.21 2 | 3 | This is the branch specifically for fabric 1.21. 4 | Any differences will be listed below. For full documentation, see the `core` branch. 5 | -------------------------------------------------------------------------------- /fabric/1.21.2/gradle.properties: -------------------------------------------------------------------------------- 1 | # Done to increase the memory available to gradle. 2 | org.gradle.jvmargs=-Xmx1G 3 | org.gradle.parallel=true 4 | 5 | # Fabric Properties 6 | # check these on https://fabricmc.net/develop 7 | minecraft_version=1.21.2 8 | yarn_mappings=1.21.2+build.1 9 | loader_version=0.16.9 10 | 11 | # Mod Properties 12 | version=2.0 13 | mod_version=2.0 14 | maven_group=computer.heather.advancedbackups 15 | archives_base_name=advancedbackups 16 | modloaderName =fabric 17 | 18 | minecraftVersion =1.21.2 19 | 20 | # Dependencies 21 | fabric_version=0.106.1+1.21.2 22 | 23 | -------------------------------------------------------------------------------- /fabric/1.21.2/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeatherComputer/AdvancedBackups/01d74672e44b67ceb5e4bd0a18b861ebe0bfcaf0/fabric/1.21.2/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /fabric/1.21.2/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /fabric/1.21.2/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { 4 | name = 'Fabric' 5 | url = 'https://maven.fabricmc.net/' 6 | } 7 | mavenCentral() 8 | gradlePluginPortal() 9 | } 10 | } 11 | 12 | rootProject.name = 'fabric-1.21' 13 | -------------------------------------------------------------------------------- /fabric/1.21.2/src/main/java/computer/heather/advancedbackups/client/ColourHelper.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.client; 2 | 3 | //A colour helper, loosely based on that of vanilla 1.16. 4 | //What is the modern equivalent..? 5 | public class ColourHelper { 6 | 7 | public static int alpha(int in) { 8 | return in >>> 24; 9 | } 10 | 11 | public static int red(int in) { 12 | return in >> 16 & 255; 13 | } 14 | 15 | public static int green(int in) { 16 | return in >> 8 & 255; 17 | } 18 | 19 | public static int blue(int in) { 20 | return in & 255; 21 | } 22 | 23 | public static int colour(int a, int r, int g, int b) { 24 | return a << 24 | r << 16 | g << 8 | b; 25 | } 26 | 27 | public static int colour(int a, long r, long g, long b) { 28 | return colour(a, (int) r, (int) g, (int) b); 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /fabric/1.21.2/src/main/java/computer/heather/advancedbackups/network/NetworkHandler.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking; 4 | import net.minecraft.server.network.ServerPlayerEntity; 5 | 6 | public class NetworkHandler { 7 | 8 | public static void sendToClient(ServerPlayerEntity player, PacketBackupStatus packet) { 9 | 10 | ServerPlayNetworking.send(player, packet); 11 | 12 | } 13 | 14 | 15 | 16 | } 17 | -------------------------------------------------------------------------------- /fabric/1.21.2/src/main/java/computer/heather/advancedbackups/network/PacketBackupStatus.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import net.minecraft.network.PacketByteBuf; 4 | import net.minecraft.network.codec.PacketCodec; 5 | import net.minecraft.network.packet.CustomPayload; 6 | import net.minecraft.util.Identifier; 7 | 8 | public record PacketBackupStatus(boolean starting, boolean started, boolean failed, boolean finished, boolean cancelled, int progress, int max) implements CustomPayload { 9 | 10 | public static final Id ID = new CustomPayload.Id(Identifier.of("advancedbackups:backup_status")); 11 | 12 | public static final PacketCodec CODEC = PacketCodec.of((packet, buf) -> { 13 | buf.writeBoolean(packet.starting); 14 | buf.writeBoolean(packet.started); 15 | buf.writeBoolean(packet.failed); 16 | buf.writeBoolean(packet.finished); 17 | buf.writeBoolean(packet.cancelled); 18 | buf.writeInt(packet.progress); 19 | buf.writeInt(packet.max); 20 | }, 21 | 22 | buf -> new PacketBackupStatus( 23 | buf.readBoolean(), 24 | buf.readBoolean(), 25 | buf.readBoolean(), 26 | buf.readBoolean(), 27 | buf.readBoolean(), 28 | buf.readInt(), 29 | buf.readInt() 30 | )); 31 | 32 | 33 | @Override 34 | public Id getId() { 35 | return ID; 36 | } 37 | 38 | 39 | } 40 | -------------------------------------------------------------------------------- /fabric/1.21.2/src/main/java/computer/heather/advancedbackups/network/PacketToastSubscribe.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import computer.heather.advancedbackups.AdvancedBackups; 4 | import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking; 5 | import net.minecraft.network.PacketByteBuf; 6 | import net.minecraft.network.codec.PacketCodec; 7 | import net.minecraft.network.codec.PacketCodecs; 8 | import net.minecraft.network.packet.CustomPayload; 9 | import net.minecraft.server.network.ServerPlayerEntity; 10 | import net.minecraft.util.Identifier; 11 | 12 | public record PacketToastSubscribe(boolean enable) implements CustomPayload { 13 | 14 | public static final Id ID = new CustomPayload.Id(Identifier.of("advancedbackups:toast_subscribe")); 15 | 16 | public PacketToastSubscribe(boolean enable) { 17 | this.enable = enable; 18 | } 19 | 20 | public static final PacketCodec CODEC = PacketCodec.tuple(PacketCodecs.BOOL, PacketToastSubscribe::enable, PacketToastSubscribe::new); 21 | 22 | 23 | public static void handle(PacketToastSubscribe message, ServerPlayNetworking.Context context) { 24 | 25 | ServerPlayerEntity player = context.player(); 26 | 27 | if (message.enable() && !AdvancedBackups.players.contains(player.getUuidAsString())) { 28 | AdvancedBackups.players.add(player.getUuidAsString()); 29 | } 30 | else if (!message.enable()) { 31 | AdvancedBackups.players.remove(player.getUuidAsString()); 32 | } 33 | 34 | } 35 | 36 | 37 | 38 | @Override 39 | public Id getId() { 40 | return ID; 41 | } 42 | 43 | 44 | 45 | } -------------------------------------------------------------------------------- /fabric/1.21.2/src/main/resources/advancedbackups.accesswidener: -------------------------------------------------------------------------------- 1 | accessWidener v2 named 2 | 3 | #Required for commands for now, should rework this at some point 4 | accessible field net/minecraft/client/network/ClientPlayNetworkHandler lastSeenMessagesCollector Lnet/minecraft/network/message/LastSeenMessagesCollector; -------------------------------------------------------------------------------- /fabric/1.21.2/src/main/resources/fabric.mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "schemaVersion": 1, 3 | "id": "advancedbackups", 4 | "version": "${version}", 5 | "accessWidener" : "advancedbackups.accesswidener", 6 | "name": "Advanced Backups", 7 | "description": "An extremely advanced backup mod.\n\nSupports many backup types.\n\nConfig file and github contain documentation.", 8 | "authors": [ 9 | "Mommy Heather" 10 | ], 11 | "contact": { 12 | "homepage": "https://github.com/HeatherComputer/advancedbackups" 13 | }, 14 | "license": "BSD", 15 | "icon": "assets/advanced-backups/icon.png", 16 | "environment": "*", 17 | "entrypoints": { 18 | "main": [ 19 | "computer.heather.advancedbackups.AdvancedBackups" 20 | ], 21 | "client": [ 22 | "computer.heather.advancedbackups.client.ClientWrapper" 23 | ] 24 | }, 25 | "depends": { 26 | "fabricloader": ">=0.15.10", 27 | "minecraft": ">=1.21.2", 28 | "java": ">=21", 29 | "fabric-api": "*" 30 | } 31 | } -------------------------------------------------------------------------------- /fabric/1.21.2/src/main/resources/pack.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "pack": { 3 | "description": "advancedbackups resources", 4 | "pack_format": 9, 5 | "forge:resource_pack_format": 8, 6 | "forge:data_pack_format": 9 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fabric/1.21/README.md: -------------------------------------------------------------------------------- 1 | # Fabric - 1.21 2 | 3 | This is the branch specifically for fabric 1.21. 4 | Any differences will be listed below. For full documentation, see the `core` branch. 5 | -------------------------------------------------------------------------------- /fabric/1.21/gradle.properties: -------------------------------------------------------------------------------- 1 | # Done to increase the memory available to gradle. 2 | org.gradle.jvmargs=-Xmx1G 3 | org.gradle.parallel=true 4 | 5 | # Fabric Properties 6 | # check these on https://fabricmc.net/develop 7 | minecraft_version=1.21 8 | yarn_mappings=1.21+build.2 9 | loader_version=0.15.11 10 | 11 | # Mod Properties 12 | version=2.0 13 | mod_version=2.0 14 | maven_group=computer.heather.advancedbackups 15 | archives_base_name=advancedbackups 16 | modloaderName =fabric 17 | #We support 1.20.6, but it shouldn't be used so we won't show in the jar name. 18 | minecraftVersion =1.21 19 | 20 | # Dependencies 21 | fabric_version=0.100.3+1.21 22 | 23 | -------------------------------------------------------------------------------- /fabric/1.21/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeatherComputer/AdvancedBackups/01d74672e44b67ceb5e4bd0a18b861ebe0bfcaf0/fabric/1.21/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /fabric/1.21/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /fabric/1.21/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { 4 | name = 'Fabric' 5 | url = 'https://maven.fabricmc.net/' 6 | } 7 | mavenCentral() 8 | gradlePluginPortal() 9 | } 10 | } 11 | 12 | rootProject.name = 'fabric-1.21' 13 | -------------------------------------------------------------------------------- /fabric/1.21/src/main/java/computer/heather/advancedbackups/client/ColourHelper.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.client; 2 | 3 | //A colour helper, loosely based on that of vanilla 1.16. 4 | //What is the modern equivalent..? 5 | public class ColourHelper { 6 | 7 | public static int alpha(int in) { 8 | return in >>> 24; 9 | } 10 | 11 | public static int red(int in) { 12 | return in >> 16 & 255; 13 | } 14 | 15 | public static int green(int in) { 16 | return in >> 8 & 255; 17 | } 18 | 19 | public static int blue(int in) { 20 | return in & 255; 21 | } 22 | 23 | public static int colour(int a, int r, int g, int b) { 24 | return a << 24 | r << 16 | g << 8 | b; 25 | } 26 | 27 | public static int colour(int a, long r, long g, long b) { 28 | return colour(a, (int) r, (int) g, (int) b); 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /fabric/1.21/src/main/java/computer/heather/advancedbackups/network/NetworkHandler.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking; 4 | import net.minecraft.server.network.ServerPlayerEntity; 5 | 6 | public class NetworkHandler { 7 | 8 | public static void sendToClient(ServerPlayerEntity player, PacketBackupStatus packet) { 9 | 10 | ServerPlayNetworking.send(player, packet); 11 | 12 | } 13 | 14 | 15 | 16 | } 17 | -------------------------------------------------------------------------------- /fabric/1.21/src/main/java/computer/heather/advancedbackups/network/PacketBackupStatus.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import net.minecraft.network.PacketByteBuf; 4 | import net.minecraft.network.codec.PacketCodec; 5 | import net.minecraft.network.packet.CustomPayload; 6 | import net.minecraft.util.Identifier; 7 | 8 | public record PacketBackupStatus(boolean starting, boolean started, boolean failed, boolean finished, boolean cancelled, int progress, int max) implements CustomPayload { 9 | 10 | public static final Id ID = new CustomPayload.Id(Identifier.of("advancedbackups:backup_status")); 11 | 12 | public static final PacketCodec CODEC = PacketCodec.of((packet, buf) -> { 13 | buf.writeBoolean(packet.starting); 14 | buf.writeBoolean(packet.started); 15 | buf.writeBoolean(packet.failed); 16 | buf.writeBoolean(packet.finished); 17 | buf.writeBoolean(packet.cancelled); 18 | buf.writeInt(packet.progress); 19 | buf.writeInt(packet.max); 20 | }, 21 | 22 | buf -> new PacketBackupStatus( 23 | buf.readBoolean(), 24 | buf.readBoolean(), 25 | buf.readBoolean(), 26 | buf.readBoolean(), 27 | buf.readBoolean(), 28 | buf.readInt(), 29 | buf.readInt() 30 | )); 31 | 32 | 33 | @Override 34 | public Id getId() { 35 | return ID; 36 | } 37 | 38 | 39 | } 40 | -------------------------------------------------------------------------------- /fabric/1.21/src/main/java/computer/heather/advancedbackups/network/PacketToastSubscribe.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import computer.heather.advancedbackups.AdvancedBackups; 4 | import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking; 5 | import net.minecraft.network.PacketByteBuf; 6 | import net.minecraft.network.codec.PacketCodec; 7 | import net.minecraft.network.codec.PacketCodecs; 8 | import net.minecraft.network.packet.CustomPayload; 9 | import net.minecraft.server.network.ServerPlayerEntity; 10 | import net.minecraft.util.Identifier; 11 | 12 | public record PacketToastSubscribe(boolean enable) implements CustomPayload { 13 | 14 | public static final Id ID = new CustomPayload.Id(Identifier.of("advancedbackups:toast_subscribe")); 15 | 16 | public PacketToastSubscribe(boolean enable) { 17 | this.enable = enable; 18 | } 19 | 20 | public static final PacketCodec CODEC = PacketCodec.tuple(PacketCodecs.BOOL, PacketToastSubscribe::enable, PacketToastSubscribe::new); 21 | 22 | 23 | public static void handle(PacketToastSubscribe message, ServerPlayNetworking.Context context) { 24 | 25 | ServerPlayerEntity player = context.player(); 26 | 27 | if (message.enable() && !AdvancedBackups.players.contains(player.getUuidAsString())) { 28 | AdvancedBackups.players.add(player.getUuidAsString()); 29 | } 30 | else if (!message.enable()) { 31 | AdvancedBackups.players.remove(player.getUuidAsString()); 32 | } 33 | 34 | } 35 | 36 | 37 | 38 | @Override 39 | public Id getId() { 40 | return ID; 41 | } 42 | 43 | 44 | 45 | } -------------------------------------------------------------------------------- /fabric/1.21/src/main/resources/advancedbackups.accesswidener: -------------------------------------------------------------------------------- 1 | accessWidener v2 named 2 | 3 | #Required for commands for now, should rework this at some point 4 | accessible field net/minecraft/client/network/ClientPlayNetworkHandler lastSeenMessagesCollector Lnet/minecraft/network/message/LastSeenMessagesCollector; -------------------------------------------------------------------------------- /fabric/1.21/src/main/resources/fabric.mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "schemaVersion": 1, 3 | "id": "advancedbackups", 4 | "version": "${version}", 5 | "accessWidener" : "advancedbackups.accesswidener", 6 | "name": "Advanced Backups", 7 | "description": "An extremely advanced backup mod.\n\nSupports many backup types.\n\nConfig file and github contain documentation.", 8 | "authors": [ 9 | "Mommy Heather" 10 | ], 11 | "contact": { 12 | "homepage": "https://github.com/HeatherComputer/advancedbackups" 13 | }, 14 | "license": "BSD", 15 | "icon": "assets/advanced-backups/icon.png", 16 | "environment": "*", 17 | "entrypoints": { 18 | "main": [ 19 | "computer.heather.advancedbackups.AdvancedBackups" 20 | ], 21 | "client": [ 22 | "computer.heather.advancedbackups.client.ClientWrapper" 23 | ] 24 | }, 25 | "depends": { 26 | "fabricloader": ">=0.15.10", 27 | "minecraft": ">=1.20.6", 28 | "java": ">=21", 29 | "fabric-api": "*" 30 | } 31 | } -------------------------------------------------------------------------------- /fabric/1.21/src/main/resources/pack.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "pack": { 3 | "description": "advancedbackups resources", 4 | "pack_format": 9, 5 | "forge:resource_pack_format": 8, 6 | "forge:data_pack_format": 9 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /forge/1.12/README.md: -------------------------------------------------------------------------------- 1 | # Forge - 1.12 2 | 3 | This is the branch specifically for forge 1.12. 4 | Any differences will be listed below. For full documentation, see the `core` branch. 5 | 6 | 7 | - Flush config value is ignored, but this is meaningless for most users as in most cases it should be kept at the default `false` 8 | -------------------------------------------------------------------------------- /forge/1.12/gradle.properties: -------------------------------------------------------------------------------- 1 | # Sets default memory used for gradle commands. Can be overridden by user or command line properties. 2 | # This is required to provide enough memory for the Minecraft decompilation process. 3 | org.gradle.jvmargs=-Xmx3G 4 | org.gradle.daemon=false 5 | 6 | modloaderName =forge 7 | minecraftVersion =1.12 -------------------------------------------------------------------------------- /forge/1.12/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeatherComputer/AdvancedBackups/01d74672e44b67ceb5e4bd0a18b861ebe0bfcaf0/forge/1.12/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /forge/1.12/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.4-bin.zip 4 | networkTimeout=10000 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /forge/1.12/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { 4 | name 'MinecraftForge' 5 | url 'https://maven.minecraftforge.net/' 6 | } 7 | } 8 | } 9 | 10 | rootProject.name = 'forge-1.12' 11 | -------------------------------------------------------------------------------- /forge/1.12/src/main/java/computer/heather/advancedbackups/client/ClientBridge.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.client; 2 | 3 | import computer.heather.advancedbackups.core.CoreCommandSystem; 4 | import computer.heather.advancedbackups.network.PacketBackupStatus; 5 | import net.minecraft.client.Minecraft; 6 | import net.minecraftforge.client.event.ClientChatEvent; 7 | 8 | public class ClientBridge { 9 | 10 | public static void handle(PacketBackupStatus message) { 11 | 12 | Minecraft.getMinecraft().addScheduledTask(() -> { 13 | BackupToast.starting = message.starting; 14 | BackupToast.started = message.started; 15 | BackupToast.failed = message.failed; 16 | BackupToast.finished = message.finished; 17 | BackupToast.cancelled = message.cancelled; 18 | 19 | BackupToast.progress = message.progress; 20 | BackupToast.max = message.max; 21 | 22 | if (!BackupToast.exists) { 23 | BackupToast.exists = true; 24 | Minecraft.getMinecraft().getToastGui().add(new BackupToast()); 25 | } 26 | 27 | }); 28 | 29 | } 30 | 31 | 32 | public static void onClientChat(ClientChatEvent event) { 33 | if (event.getMessage().equals("/backup reload-client-config")) { 34 | event.setCanceled(true); 35 | CoreCommandSystem.reloadClientConfig(Minecraft.getMinecraft().player::sendChatMessage); 36 | } 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /forge/1.12/src/main/java/computer/heather/advancedbackups/client/ColourHelper.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.client; 2 | 3 | //A colour helper, loosely based on that of vanilla 1.16. 4 | public class ColourHelper { 5 | 6 | public static int alpha(int in) { 7 | return in >>> 24; 8 | } 9 | 10 | public static int red(int in) { 11 | return in >> 16 & 255; 12 | } 13 | 14 | public static int green(int in) { 15 | return in >> 8 & 255; 16 | } 17 | 18 | public static int blue(int in) { 19 | return in & 255; 20 | } 21 | 22 | public static int colour(int a, int r, int g, int b) { 23 | return a << 24 | r << 16 | g << 8 | b; 24 | } 25 | 26 | public static int colour(int a, long r, long g, long b) { 27 | return colour(a, (int) r, (int) g, (int) b); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /forge/1.12/src/main/java/computer/heather/advancedbackups/network/NetworkHandler.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import computer.heather.advancedbackups.AdvancedBackups; 4 | import net.minecraftforge.fml.common.network.NetworkRegistry; 5 | import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper; 6 | import net.minecraftforge.fml.relauncher.Side; 7 | 8 | public class NetworkHandler { 9 | public static SimpleNetworkWrapper HANDLER; 10 | private static int packetId = 0; 11 | 12 | 13 | public static int nextID() { 14 | return packetId++; 15 | } 16 | 17 | public static void registerMessages() { 18 | HANDLER = NetworkRegistry.INSTANCE.newSimpleChannel(AdvancedBackups.MODID); 19 | // Register messages which are sent from the client to the server here: 20 | HANDLER.registerMessage(PacketBackupStatus.Handler.class, PacketBackupStatus.class, nextID(), Side.CLIENT); 21 | HANDLER.registerMessage(PacketToastSubscribe.Handler.class, PacketToastSubscribe.class, nextID(), Side.SERVER); 22 | HANDLER.registerMessage(PacketToastTest.Handler.class, PacketToastTest.class, nextID(), Side.CLIENT); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /forge/1.12/src/main/java/computer/heather/advancedbackups/network/PacketToastSubscribe.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import computer.heather.advancedbackups.AdvancedBackups; 4 | import io.netty.buffer.ByteBuf; 5 | import net.minecraftforge.fml.common.network.simpleimpl.IMessage; 6 | import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; 7 | import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; 8 | 9 | public class PacketToastSubscribe implements IMessage{ 10 | 11 | public boolean enable; 12 | 13 | 14 | public PacketToastSubscribe(boolean enable) { 15 | this.enable = enable; 16 | } 17 | 18 | public PacketToastSubscribe() { 19 | 20 | } 21 | 22 | @Override 23 | public void fromBytes(ByteBuf buf) { 24 | enable = buf.readBoolean(); 25 | } 26 | 27 | @Override 28 | public void toBytes(ByteBuf buf) { 29 | buf.writeBoolean(enable); 30 | } 31 | 32 | 33 | public static class Handler implements IMessageHandler { 34 | 35 | @Override 36 | public IMessage onMessage(PacketToastSubscribe message, MessageContext ctx) { 37 | 38 | String uuid = ctx.getServerHandler().player.getGameProfile().getId().toString(); 39 | 40 | 41 | if (message.enable && !AdvancedBackups.players.contains(uuid)) { 42 | AdvancedBackups.players.add(uuid); 43 | } 44 | else if (!message.enable) { 45 | AdvancedBackups.players.remove(uuid); 46 | } 47 | 48 | 49 | return null; 50 | 51 | } 52 | 53 | } 54 | 55 | 56 | 57 | 58 | } -------------------------------------------------------------------------------- /forge/1.12/src/main/java/computer/heather/advancedbackups/network/PacketToastTest.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import computer.heather.advancedbackups.core.config.ClientConfigManager; 4 | import io.netty.buffer.ByteBuf; 5 | import net.minecraftforge.fml.common.network.simpleimpl.IMessage; 6 | import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; 7 | import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; 8 | 9 | public class PacketToastTest implements IMessage{ 10 | 11 | 12 | 13 | public PacketToastTest(boolean enable) { 14 | 15 | } 16 | 17 | public PacketToastTest() { 18 | 19 | } 20 | 21 | @Override 22 | public void fromBytes(ByteBuf buf) { 23 | 24 | } 25 | 26 | @Override 27 | public void toBytes(ByteBuf buf) { 28 | 29 | } 30 | 31 | 32 | public static class Handler implements IMessageHandler { 33 | 34 | @Override 35 | public IMessage onMessage(PacketToastTest message, MessageContext ctx) { 36 | 37 | ClientConfigManager.loadOrCreateConfig(); 38 | NetworkHandler.HANDLER.sendToServer(new PacketToastSubscribe(ClientConfigManager.showProgress.get())); 39 | 40 | return null; 41 | 42 | } 43 | 44 | } 45 | 46 | 47 | 48 | 49 | } -------------------------------------------------------------------------------- /forge/1.12/src/main/resources/mcmod.info: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "modid": "advancedbackups", 4 | "name": "Advanced Backups", 5 | "description": "Powerful backup mod.", 6 | "version": "${mod_version}", 7 | "url": "https://github.com/HeatherComputer/AdvancedBackups", 8 | "updateUrl": "", 9 | "authorList": ["Heather White"], 10 | "credits": "", 11 | "logoFile": "", 12 | "screenshots": [], 13 | "dependencies": [] 14 | } 15 | ] 16 | -------------------------------------------------------------------------------- /forge/1.12/src/main/resources/pack.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "pack": { 3 | "description": "examplemod resources", 4 | "pack_format": 3, 5 | "_comment": "A pack_format of 3 should be used starting with Minecraft 1.11. All resources, including language files, should be lowercase (eg: en_us.lang). A pack_format of 2 will load your mod resources with LegacyV2Adapter, which requires language files to have uppercase letters (eg: en_US.lang)." 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /forge/1.16/README.md: -------------------------------------------------------------------------------- 1 | # Forge - 1.16 2 | 3 | This is the branch specifically for forge 1.16. 4 | Any differences will be listed below. For full documentation, see the `core` branch. 5 | -------------------------------------------------------------------------------- /forge/1.16/gradle.properties: -------------------------------------------------------------------------------- 1 | # Sets default memory used for gradle commands. Can be overridden by user or command line properties. 2 | # This is required to provide enough memory for the Minecraft decompilation process. 3 | org.gradle.jvmargs=-Xmx3G 4 | org.gradle.daemon=false 5 | 6 | modloaderName =forge 7 | minecraftVersion =1.16 -------------------------------------------------------------------------------- /forge/1.16/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeatherComputer/AdvancedBackups/01d74672e44b67ceb5e4bd0a18b861ebe0bfcaf0/forge/1.16/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /forge/1.16/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.4-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /forge/1.16/gradlew: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeatherComputer/AdvancedBackups/01d74672e44b67ceb5e4bd0a18b861ebe0bfcaf0/forge/1.16/gradlew -------------------------------------------------------------------------------- /forge/1.16/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'forge-1.16' 2 | -------------------------------------------------------------------------------- /forge/1.16/src/main/java/computer/heather/advancedbackups/network/NetworkHandler.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import net.minecraft.entity.player.ServerPlayerEntity; 4 | import net.minecraft.util.ResourceLocation; 5 | import net.minecraftforge.fml.network.NetworkDirection; 6 | import net.minecraftforge.fml.network.NetworkRegistry; 7 | import net.minecraftforge.fml.network.simple.SimpleChannel; 8 | 9 | public class NetworkHandler { 10 | 11 | private static final String PROTOCOL_VERSION = "1"; 12 | private static int id = 0; 13 | private static int id() { 14 | return id++; 15 | } 16 | 17 | public static final SimpleChannel INSTANCE = NetworkRegistry.newSimpleChannel( 18 | new ResourceLocation("advancedbackups", "main"), 19 | () -> PROTOCOL_VERSION, 20 | (version) -> true, 21 | (version) -> true 22 | ); 23 | 24 | 25 | public static void register() { 26 | INSTANCE.messageBuilder(PacketBackupStatus.class, id()) 27 | .encoder(PacketBackupStatus::toBytes) 28 | .decoder(buf -> new PacketBackupStatus(buf)) 29 | .consumer(PacketBackupStatus::handle) 30 | .add(); 31 | 32 | INSTANCE.messageBuilder(PacketToastSubscribe.class, id()) 33 | .encoder(PacketToastSubscribe::toBytes) 34 | .decoder(buf -> new PacketToastSubscribe(buf)) 35 | .consumer(PacketToastSubscribe::handle) 36 | .add(); 37 | } 38 | 39 | public static void sendToClient(ServerPlayerEntity player, Object packet) { 40 | INSTANCE.sendTo(packet, player.connection.connection, NetworkDirection.PLAY_TO_CLIENT); 41 | } 42 | 43 | public static void sendToServer(Object packet) { 44 | INSTANCE.sendToServer(packet); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /forge/1.16/src/main/java/computer/heather/advancedbackups/network/PacketBackupStatus.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import java.util.function.Supplier; 4 | 5 | import computer.heather.advancedbackups.client.ClientWrapper; 6 | import net.minecraft.network.PacketBuffer; 7 | import net.minecraftforge.fml.network.NetworkEvent; 8 | 9 | public class PacketBackupStatus { 10 | 11 | public boolean starting; 12 | public boolean started; 13 | 14 | public boolean failed; 15 | public boolean finished; 16 | 17 | public boolean cancelled; 18 | 19 | public int progress; 20 | public int max; 21 | 22 | 23 | public PacketBackupStatus(boolean starting, boolean started, boolean failed, boolean finished, boolean cancelled, int progress, 24 | int max) { 25 | this.starting = starting; 26 | this.started = started; 27 | this.failed = failed; 28 | this.finished = finished; 29 | this.cancelled = cancelled; 30 | this.progress = progress; 31 | this.max = max; 32 | } 33 | 34 | 35 | public PacketBackupStatus(PacketBuffer buf) { 36 | starting = buf.readBoolean(); 37 | started = buf.readBoolean(); 38 | failed = buf.readBoolean(); 39 | finished = buf.readBoolean(); 40 | cancelled = buf.readBoolean(); 41 | 42 | progress = buf.readInt(); 43 | max = buf.readInt(); 44 | } 45 | 46 | public void toBytes(PacketBuffer buf) { 47 | buf.writeBoolean(starting); 48 | buf.writeBoolean(started); 49 | buf.writeBoolean(failed); 50 | buf.writeBoolean(finished); 51 | buf.writeBoolean(cancelled); 52 | 53 | buf.writeInt(progress); 54 | buf.writeInt(max); 55 | } 56 | 57 | public boolean handle(Supplier ctx) { 58 | ClientWrapper.handle(ctx, this); 59 | ctx.get().setPacketHandled(true); 60 | return true; 61 | 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /forge/1.16/src/main/java/computer/heather/advancedbackups/network/PacketToastSubscribe.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import java.util.function.Supplier; 4 | 5 | import computer.heather.advancedbackups.AdvancedBackups; 6 | import net.minecraft.network.PacketBuffer; 7 | import net.minecraftforge.fml.network.NetworkDirection; 8 | import net.minecraftforge.fml.network.NetworkEvent; 9 | 10 | public class PacketToastSubscribe { 11 | 12 | private boolean enable; 13 | 14 | public PacketToastSubscribe(boolean enable) { 15 | this.enable = enable; 16 | } 17 | 18 | 19 | public PacketToastSubscribe(PacketBuffer buf) { 20 | enable = buf.readBoolean(); 21 | } 22 | 23 | public void toBytes(PacketBuffer buf) { 24 | buf.writeBoolean(enable); 25 | } 26 | 27 | public boolean handle(Supplier ctx) { 28 | ctx.get().enqueueWork(() -> { 29 | if (enable && !AdvancedBackups.players.contains(ctx.get().getSender().getStringUUID())) { 30 | AdvancedBackups.players.add(ctx.get().getSender().getStringUUID()); 31 | } 32 | else if (!enable) { 33 | AdvancedBackups.players.remove(ctx.get().getSender().getStringUUID()); 34 | } 35 | }); 36 | 37 | return true; 38 | 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /forge/1.16/src/main/resources/META-INF/accesstransformer.cfg: -------------------------------------------------------------------------------- 1 | public net.minecraft.server.MinecraftServer field_71310_m # storageSource -------------------------------------------------------------------------------- /forge/1.16/src/main/resources/pack.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "pack": { 3 | "description": "examplemod resources", 4 | "pack_format": 6, 5 | "_comment": "A pack_format of 6 requires json lang files and some texture changes from 1.16.2. Note: we require v6 pack meta for all mods." 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /forge/1.18/README.md: -------------------------------------------------------------------------------- 1 | # Forge - 1.18 2 | 3 | This is the branch specifically for forge 1.18. 4 | Any differences will be listed below. For full documentation, see the `core` branch. 5 | -------------------------------------------------------------------------------- /forge/1.18/gradle.properties: -------------------------------------------------------------------------------- 1 | # Sets default memory used for gradle commands. Can be overridden by user or command line properties. 2 | # This is required to provide enough memory for the Minecraft decompilation process. 3 | org.gradle.jvmargs=-Xmx3G 4 | org.gradle.daemon=false 5 | 6 | 7 | 8 | modloaderName =forge 9 | minecraftVersion =1.18 -------------------------------------------------------------------------------- /forge/1.18/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeatherComputer/AdvancedBackups/01d74672e44b67ceb5e4bd0a18b861ebe0bfcaf0/forge/1.18/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /forge/1.18/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.4-bin.zip 4 | networkTimeout=10000 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /forge/1.18/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'forge-1.18' 2 | -------------------------------------------------------------------------------- /forge/1.18/src/main/java/computer/heather/advancedbackups/client/ColourHelper.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.client; 2 | 3 | //A colour helper, loosely based on that of vanilla 1.16. 4 | //Where is it in 1.18? 5 | public class ColourHelper { 6 | 7 | public static int alpha(int in) { 8 | return in >>> 24; 9 | } 10 | 11 | public static int red(int in) { 12 | return in >> 16 & 255; 13 | } 14 | 15 | public static int green(int in) { 16 | return in >> 8 & 255; 17 | } 18 | 19 | public static int blue(int in) { 20 | return in & 255; 21 | } 22 | 23 | public static int colour(int a, int r, int g, int b) { 24 | return a << 24 | r << 16 | g << 8 | b; 25 | } 26 | 27 | public static int colour(int a, long r, long g, long b) { 28 | return colour(a, (int) r, (int) g, (int) b); 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /forge/1.18/src/main/java/computer/heather/advancedbackups/network/NetworkHandler.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import net.minecraft.resources.ResourceLocation; 4 | import net.minecraft.server.level.ServerPlayer; 5 | import net.minecraftforge.network.NetworkDirection; 6 | import net.minecraftforge.network.NetworkRegistry; 7 | import net.minecraftforge.network.simple.SimpleChannel; 8 | 9 | public class NetworkHandler { 10 | 11 | private static final String PROTOCOL_VERSION = "1"; 12 | private static int id = 0; 13 | private static int id() { 14 | return id++; 15 | } 16 | 17 | public static final SimpleChannel INSTANCE = NetworkRegistry.newSimpleChannel( 18 | new ResourceLocation("advancedbackups", "main"), 19 | () -> PROTOCOL_VERSION, 20 | (version) -> true, 21 | (version) -> true 22 | ); 23 | 24 | 25 | public static void register() { 26 | INSTANCE.messageBuilder(PacketBackupStatus.class, id()) 27 | .encoder(PacketBackupStatus::toBytes) 28 | .decoder(buf -> new PacketBackupStatus(buf)) 29 | .consumer(PacketBackupStatus::handle) 30 | .add(); 31 | 32 | INSTANCE.messageBuilder(PacketToastSubscribe.class, id()) 33 | .encoder(PacketToastSubscribe::toBytes) 34 | .decoder(buf -> new PacketToastSubscribe(buf)) 35 | .consumer(PacketToastSubscribe::handle) 36 | .add(); 37 | } 38 | 39 | public static void sendToClient(ServerPlayer player, Object packet) { 40 | INSTANCE.sendTo(packet, player.connection.connection, NetworkDirection.PLAY_TO_CLIENT); 41 | } 42 | 43 | public static void sendToServer(Object packet) { 44 | INSTANCE.sendToServer(packet); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /forge/1.18/src/main/java/computer/heather/advancedbackups/network/PacketBackupStatus.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import java.util.function.Supplier; 4 | 5 | import computer.heather.advancedbackups.client.ClientWrapper; 6 | import net.minecraft.network.FriendlyByteBuf; 7 | import net.minecraftforge.fml.LogicalSide; 8 | import net.minecraftforge.network.NetworkEvent; 9 | 10 | public class PacketBackupStatus { 11 | 12 | public boolean starting; 13 | public boolean started; 14 | 15 | public boolean failed; 16 | public boolean finished; 17 | public boolean cancelled; 18 | 19 | public int progress; 20 | public int max; 21 | 22 | 23 | public PacketBackupStatus(boolean starting, boolean started, boolean failed, boolean finished, boolean cancelled, int progress, 24 | int max) { 25 | this.starting = starting; 26 | this.started = started; 27 | this.failed = failed; 28 | this.finished = finished; 29 | this.cancelled = cancelled; 30 | this.progress = progress; 31 | this.max = max; 32 | } 33 | 34 | 35 | public PacketBackupStatus(FriendlyByteBuf buf) { 36 | starting = buf.readBoolean(); 37 | started = buf.readBoolean(); 38 | failed = buf.readBoolean(); 39 | finished = buf.readBoolean(); 40 | cancelled = buf.readBoolean(); 41 | 42 | progress = buf.readInt(); 43 | max = buf.readInt(); 44 | } 45 | 46 | public void toBytes(FriendlyByteBuf buf) { 47 | buf.writeBoolean(starting); 48 | buf.writeBoolean(started); 49 | buf.writeBoolean(failed); 50 | buf.writeBoolean(finished); 51 | buf.writeBoolean(cancelled); 52 | 53 | buf.writeInt(progress); 54 | buf.writeInt(max); 55 | } 56 | 57 | public boolean handle(Supplier ctx) { 58 | ctx.get().enqueueWork(() -> { 59 | if (ctx.get().getDirection().getReceptionSide() == LogicalSide.CLIENT) { 60 | ClientWrapper.handle(this); 61 | } 62 | }); 63 | ctx.get().setPacketHandled(true); 64 | return true; 65 | 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /forge/1.18/src/main/java/computer/heather/advancedbackups/network/PacketToastSubscribe.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import java.util.function.Supplier; 4 | 5 | import computer.heather.advancedbackups.AdvancedBackups; 6 | import net.minecraft.network.FriendlyByteBuf; 7 | import net.minecraftforge.network.NetworkEvent; 8 | 9 | public class PacketToastSubscribe { 10 | 11 | private boolean enable; 12 | 13 | public PacketToastSubscribe(boolean enable) { 14 | this.enable = enable; 15 | } 16 | 17 | 18 | public PacketToastSubscribe(FriendlyByteBuf buf) { 19 | enable = buf.readBoolean(); 20 | } 21 | 22 | public void toBytes(FriendlyByteBuf buf) { 23 | buf.writeBoolean(enable); 24 | } 25 | 26 | public boolean handle(Supplier ctx) { 27 | ctx.get().enqueueWork(() -> { 28 | if (ctx.get().getSender() == null) return; 29 | if (enable && !AdvancedBackups.players.contains(ctx.get().getSender().getStringUUID())) { 30 | AdvancedBackups.players.add(ctx.get().getSender().getStringUUID()); 31 | } 32 | else if (!enable) { 33 | AdvancedBackups.players.remove(ctx.get().getSender().getStringUUID()); 34 | } 35 | }); 36 | 37 | return true; 38 | 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /forge/1.18/src/main/resources/pack.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "pack": { 3 | "description": "advancedbackups resources", 4 | "pack_format": 9, 5 | "forge:resource_pack_format": 8, 6 | "forge:data_pack_format": 9 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /forge/1.19.2/README.md: -------------------------------------------------------------------------------- 1 | # Forge - 1.19 2 | 3 | This is the branch specifically for forge 1.19. 4 | Any differences will be listed below. For full documentation, see the `core` branch. -------------------------------------------------------------------------------- /forge/1.19.2/gradle.properties: -------------------------------------------------------------------------------- 1 | # Sets default memory used for gradle commands. Can be overridden by user or command line properties. 2 | # This is required to provide enough memory for the Minecraft decompilation process. 3 | org.gradle.jvmargs=-Xmx3G 4 | org.gradle.daemon=false 5 | 6 | 7 | 8 | modloaderName =forge 9 | minecraftVersion =1.19.2 -------------------------------------------------------------------------------- /forge/1.19.2/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeatherComputer/AdvancedBackups/01d74672e44b67ceb5e4bd0a18b861ebe0bfcaf0/forge/1.19.2/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /forge/1.19.2/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.4-bin.zip 4 | networkTimeout=10000 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /forge/1.19.2/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | gradlePluginPortal() 4 | maven { url = 'https://maven.minecraftforge.net/' } 5 | } 6 | } 7 | 8 | rootProject.name = 'forge-1.19.2' 9 | -------------------------------------------------------------------------------- /forge/1.19.2/src/main/java/computer/heather/advancedbackups/client/ClientWrapper.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.client; 2 | 3 | import computer.heather.advancedbackups.core.config.ClientConfigManager; 4 | import computer.heather.advancedbackups.network.NetworkHandler; 5 | import computer.heather.advancedbackups.network.PacketBackupStatus; 6 | import computer.heather.advancedbackups.network.PacketToastSubscribe; 7 | import net.minecraft.client.Minecraft; 8 | import net.minecraftforge.client.event.ClientPlayerNetworkEvent; 9 | import net.minecraftforge.client.event.RegisterClientCommandsEvent; 10 | import net.minecraftforge.common.MinecraftForge; 11 | import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; 12 | 13 | public class ClientWrapper { 14 | 15 | public static void handle(PacketBackupStatus packet) { 16 | BackupToast.starting = packet.starting; 17 | BackupToast.started = packet.started; 18 | BackupToast.failed = packet.failed; 19 | BackupToast.finished = packet.finished; 20 | BackupToast.cancelled = packet.cancelled; 21 | 22 | BackupToast.progress = packet.progress; 23 | BackupToast.max = packet.max; 24 | 25 | if (!BackupToast.exists) { 26 | BackupToast.exists = true; 27 | Minecraft.getInstance().getToasts().addToast(new BackupToast()); 28 | } 29 | } 30 | 31 | public static void init(FMLClientSetupEvent e) { 32 | MinecraftForge.EVENT_BUS.addListener(ClientWrapper::registerClientCommands); 33 | MinecraftForge.EVENT_BUS.addListener(ClientWrapper::onServerConnected); 34 | ClientConfigManager.loadOrCreateConfig(); 35 | } 36 | 37 | public static void registerClientCommands(RegisterClientCommandsEvent event) { 38 | AdvancedBackupsClientCommand.register(event.getDispatcher()); 39 | } 40 | 41 | public static void onServerConnected(ClientPlayerNetworkEvent.LoggingIn event) { 42 | NetworkHandler.sendToServer(new PacketToastSubscribe(ClientConfigManager.showProgress.get())); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /forge/1.19.2/src/main/java/computer/heather/advancedbackups/client/ColourHelper.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.client; 2 | 3 | //A colour helper, loosely based on that of vanilla 1.16. 4 | //Where is it in modern? 5 | public class ColourHelper { 6 | 7 | public static int alpha(int in) { 8 | return in >>> 24; 9 | } 10 | 11 | public static int red(int in) { 12 | return in >> 16 & 255; 13 | } 14 | 15 | public static int green(int in) { 16 | return in >> 8 & 255; 17 | } 18 | 19 | public static int blue(int in) { 20 | return in & 255; 21 | } 22 | 23 | public static int colour(int a, int r, int g, int b) { 24 | return a << 24 | r << 16 | g << 8 | b; 25 | } 26 | 27 | public static int colour(int a, long r, long g, long b) { 28 | return colour(a, (int) r, (int) g, (int) b); 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /forge/1.19.2/src/main/java/computer/heather/advancedbackups/network/NetworkHandler.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import net.minecraft.resources.ResourceLocation; 4 | import net.minecraft.server.level.ServerPlayer; 5 | import net.minecraftforge.network.NetworkDirection; 6 | import net.minecraftforge.network.NetworkRegistry; 7 | import net.minecraftforge.network.simple.SimpleChannel; 8 | 9 | public class NetworkHandler { 10 | 11 | private static final String PROTOCOL_VERSION = "1"; 12 | private static int id = 0; 13 | private static int id() { 14 | return id++; 15 | } 16 | 17 | public static final SimpleChannel INSTANCE = NetworkRegistry.newSimpleChannel( 18 | new ResourceLocation("advancedbackups", "main"), 19 | () -> PROTOCOL_VERSION, 20 | (version) -> true, 21 | (version) -> true 22 | ); 23 | 24 | 25 | public static void register() { 26 | INSTANCE.messageBuilder(PacketBackupStatus.class, id()) 27 | .encoder(PacketBackupStatus::toBytes) 28 | .decoder(buf -> new PacketBackupStatus(buf)) 29 | .consumer(PacketBackupStatus::handle) 30 | .add(); 31 | 32 | INSTANCE.messageBuilder(PacketToastSubscribe.class, id()) 33 | .encoder(PacketToastSubscribe::toBytes) 34 | .decoder(buf -> new PacketToastSubscribe(buf)) 35 | .consumer(PacketToastSubscribe::handle) 36 | .add(); 37 | } 38 | 39 | public static void sendToClient(ServerPlayer player, Object packet) { 40 | INSTANCE.sendTo(packet, player.connection.connection, NetworkDirection.PLAY_TO_CLIENT); 41 | } 42 | 43 | public static void sendToServer(Object packet) { 44 | INSTANCE.sendToServer(packet); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /forge/1.19.2/src/main/java/computer/heather/advancedbackups/network/PacketBackupStatus.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import java.util.function.Supplier; 4 | 5 | import computer.heather.advancedbackups.client.ClientWrapper; 6 | import net.minecraft.network.FriendlyByteBuf; 7 | import net.minecraftforge.fml.LogicalSide; 8 | import net.minecraftforge.network.NetworkEvent; 9 | 10 | public class PacketBackupStatus { 11 | 12 | public boolean starting; 13 | public boolean started; 14 | 15 | public boolean failed; 16 | public boolean finished; 17 | public boolean cancelled; 18 | 19 | public int progress; 20 | public int max; 21 | 22 | 23 | public PacketBackupStatus(boolean starting, boolean started, boolean failed, boolean finished, boolean cancelled, int progress, 24 | int max) { 25 | this.starting = starting; 26 | this.started = started; 27 | this.failed = failed; 28 | this.finished = finished; 29 | this.cancelled = cancelled; 30 | this.progress = progress; 31 | this.max = max; 32 | } 33 | 34 | 35 | public PacketBackupStatus(FriendlyByteBuf buf) { 36 | starting = buf.readBoolean(); 37 | started = buf.readBoolean(); 38 | failed = buf.readBoolean(); 39 | finished = buf.readBoolean(); 40 | cancelled = buf.readBoolean(); 41 | 42 | progress = buf.readInt(); 43 | max = buf.readInt(); 44 | } 45 | 46 | public void toBytes(FriendlyByteBuf buf) { 47 | buf.writeBoolean(starting); 48 | buf.writeBoolean(started); 49 | buf.writeBoolean(failed); 50 | buf.writeBoolean(finished); 51 | buf.writeBoolean(cancelled); 52 | 53 | buf.writeInt(progress); 54 | buf.writeInt(max); 55 | } 56 | 57 | public boolean handle(Supplier ctx) { 58 | ctx.get().enqueueWork(() -> { 59 | if (ctx.get().getDirection().getReceptionSide() == LogicalSide.CLIENT) { 60 | ClientWrapper.handle(this); 61 | } 62 | }); 63 | ctx.get().setPacketHandled(true); 64 | return true; 65 | 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /forge/1.19.2/src/main/java/computer/heather/advancedbackups/network/PacketToastSubscribe.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import java.util.function.Supplier; 4 | 5 | import computer.heather.advancedbackups.AdvancedBackups; 6 | import net.minecraft.network.FriendlyByteBuf; 7 | import net.minecraftforge.network.NetworkEvent; 8 | 9 | public class PacketToastSubscribe { 10 | 11 | private boolean enable; 12 | 13 | public PacketToastSubscribe(boolean enable) { 14 | this.enable = enable; 15 | } 16 | 17 | 18 | public PacketToastSubscribe(FriendlyByteBuf buf) { 19 | enable = buf.readBoolean(); 20 | } 21 | 22 | public void toBytes(FriendlyByteBuf buf) { 23 | buf.writeBoolean(enable); 24 | } 25 | 26 | public boolean handle(Supplier ctx) { 27 | ctx.get().enqueueWork(() -> { 28 | if (ctx.get().getSender() == null) return; 29 | if (enable && !AdvancedBackups.players.contains(ctx.get().getSender().getStringUUID())) { 30 | AdvancedBackups.players.add(ctx.get().getSender().getStringUUID()); 31 | } 32 | else if (!enable) { 33 | AdvancedBackups.players.remove(ctx.get().getSender().getStringUUID()); 34 | } 35 | }); 36 | 37 | return true; 38 | 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /forge/1.19.2/src/main/resources/pack.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "pack": { 3 | "description": "advancedbackups resources", 4 | "pack_format": 9, 5 | "forge:resource_pack_format": 8, 6 | "forge:data_pack_format": 9 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /forge/1.19.3/README.md: -------------------------------------------------------------------------------- 1 | # Forge - 1.19.3 2 | 3 | This is the branch specifically for forge 1.19.3 / 1.19.4. 4 | Any differences will be listed below. For full documentation, see the `core` branch. 5 | -------------------------------------------------------------------------------- /forge/1.19.3/gradle.properties: -------------------------------------------------------------------------------- 1 | # Sets default memory used for gradle commands. Can be overridden by user or command line properties. 2 | # This is required to provide enough memory for the Minecraft decompilation process. 3 | org.gradle.jvmargs=-Xmx3G 4 | org.gradle.daemon=false 5 | 6 | 7 | 8 | modloaderName =forge 9 | minecraftVersion =1.19.3 -------------------------------------------------------------------------------- /forge/1.19.3/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeatherComputer/AdvancedBackups/01d74672e44b67ceb5e4bd0a18b861ebe0bfcaf0/forge/1.19.3/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /forge/1.19.3/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /forge/1.19.3/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | gradlePluginPortal() 4 | maven { url = 'https://maven.minecraftforge.net/' } 5 | } 6 | } 7 | 8 | rootProject.name = 'forge-1.19.3' 9 | -------------------------------------------------------------------------------- /forge/1.19.3/src/main/java/computer/heather/advancedbackups/client/ClientWrapper.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.client; 2 | 3 | import computer.heather.advancedbackups.core.config.ClientConfigManager; 4 | import computer.heather.advancedbackups.network.NetworkHandler; 5 | import computer.heather.advancedbackups.network.PacketBackupStatus; 6 | import computer.heather.advancedbackups.network.PacketToastSubscribe; 7 | import net.minecraft.client.Minecraft; 8 | import net.minecraftforge.client.event.ClientPlayerNetworkEvent; 9 | import net.minecraftforge.client.event.RegisterClientCommandsEvent; 10 | import net.minecraftforge.common.MinecraftForge; 11 | import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; 12 | 13 | public class ClientWrapper { 14 | 15 | public static void handle(PacketBackupStatus packet) { 16 | BackupToast.starting = packet.starting; 17 | BackupToast.started = packet.started; 18 | BackupToast.failed = packet.failed; 19 | BackupToast.finished = packet.finished; 20 | BackupToast.cancelled = packet.cancelled; 21 | 22 | BackupToast.progress = packet.progress; 23 | BackupToast.max = packet.max; 24 | 25 | if (!BackupToast.exists) { 26 | BackupToast.exists = true; 27 | Minecraft.getInstance().getToasts().addToast(new BackupToast()); 28 | } 29 | } 30 | 31 | public static void init(FMLClientSetupEvent e) { 32 | MinecraftForge.EVENT_BUS.addListener(ClientWrapper::registerClientCommands); 33 | MinecraftForge.EVENT_BUS.addListener(ClientWrapper::onServerConnected); 34 | ClientConfigManager.loadOrCreateConfig(); 35 | } 36 | 37 | public static void registerClientCommands(RegisterClientCommandsEvent event) { 38 | AdvancedBackupsClientCommand.register(event.getDispatcher()); 39 | } 40 | 41 | public static void onServerConnected(ClientPlayerNetworkEvent.LoggingIn event) { 42 | NetworkHandler.sendToServer(new PacketToastSubscribe(ClientConfigManager.showProgress.get())); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /forge/1.19.3/src/main/java/computer/heather/advancedbackups/client/ColourHelper.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.client; 2 | 3 | //A colour helper, loosely based on that of vanilla 1.16. 4 | //Where is it in modern? 5 | public class ColourHelper { 6 | 7 | public static int alpha(int in) { 8 | return in >>> 24; 9 | } 10 | 11 | public static int red(int in) { 12 | return in >> 16 & 255; 13 | } 14 | 15 | public static int green(int in) { 16 | return in >> 8 & 255; 17 | } 18 | 19 | public static int blue(int in) { 20 | return in & 255; 21 | } 22 | 23 | public static int colour(int a, int r, int g, int b) { 24 | return a << 24 | r << 16 | g << 8 | b; 25 | } 26 | 27 | public static int colour(int a, long r, long g, long b) { 28 | return colour(a, (int) r, (int) g, (int) b); 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /forge/1.19.3/src/main/java/computer/heather/advancedbackups/network/NetworkHandler.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import net.minecraft.resources.ResourceLocation; 4 | import net.minecraft.server.level.ServerPlayer; 5 | import net.minecraftforge.network.NetworkDirection; 6 | import net.minecraftforge.network.NetworkRegistry; 7 | import net.minecraftforge.network.simple.SimpleChannel; 8 | 9 | public class NetworkHandler { 10 | 11 | private static final String PROTOCOL_VERSION = "1"; 12 | private static int id = 0; 13 | private static int id() { 14 | return id++; 15 | } 16 | 17 | public static final SimpleChannel INSTANCE = NetworkRegistry.newSimpleChannel( 18 | new ResourceLocation("advancedbackups", "main"), 19 | () -> PROTOCOL_VERSION, 20 | (version) -> true, 21 | (version) -> true 22 | ); 23 | 24 | 25 | public static void register() { 26 | INSTANCE.messageBuilder(PacketBackupStatus.class, id()) 27 | .encoder(PacketBackupStatus::toBytes) 28 | .decoder(buf -> new PacketBackupStatus(buf)) 29 | .consumer(PacketBackupStatus::handle) 30 | .add(); 31 | 32 | INSTANCE.messageBuilder(PacketToastSubscribe.class, id()) 33 | .encoder(PacketToastSubscribe::toBytes) 34 | .decoder(buf -> new PacketToastSubscribe(buf)) 35 | .consumer(PacketToastSubscribe::handle) 36 | .add(); 37 | } 38 | 39 | public static void sendToClient(ServerPlayer player, Object packet) { 40 | INSTANCE.sendTo(packet, player.connection.connection, NetworkDirection.PLAY_TO_CLIENT); 41 | } 42 | 43 | public static void sendToServer(Object packet) { 44 | INSTANCE.sendToServer(packet); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /forge/1.19.3/src/main/java/computer/heather/advancedbackups/network/PacketBackupStatus.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import java.util.function.Supplier; 4 | 5 | import computer.heather.advancedbackups.client.ClientWrapper; 6 | import net.minecraft.network.FriendlyByteBuf; 7 | import net.minecraftforge.fml.LogicalSide; 8 | import net.minecraftforge.network.NetworkEvent; 9 | 10 | public class PacketBackupStatus { 11 | 12 | public boolean starting; 13 | public boolean started; 14 | 15 | public boolean failed; 16 | public boolean finished; 17 | 18 | public boolean cancelled; 19 | 20 | public int progress; 21 | public int max; 22 | 23 | 24 | public PacketBackupStatus(boolean starting, boolean started, boolean failed, boolean finished, boolean cancelled, int progress, 25 | int max) { 26 | this.starting = starting; 27 | this.started = started; 28 | this.failed = failed; 29 | this.finished = finished; 30 | this.progress = progress; 31 | this.cancelled = cancelled; 32 | this.max = max; 33 | } 34 | 35 | 36 | public PacketBackupStatus(FriendlyByteBuf buf) { 37 | starting = buf.readBoolean(); 38 | started = buf.readBoolean(); 39 | failed = buf.readBoolean(); 40 | finished = buf.readBoolean(); 41 | cancelled = buf.readBoolean(); 42 | 43 | progress = buf.readInt(); 44 | max = buf.readInt(); 45 | } 46 | 47 | public void toBytes(FriendlyByteBuf buf) { 48 | buf.writeBoolean(starting); 49 | buf.writeBoolean(started); 50 | buf.writeBoolean(failed); 51 | buf.writeBoolean(finished); 52 | buf.writeBoolean(cancelled); 53 | 54 | buf.writeInt(progress); 55 | buf.writeInt(max); 56 | } 57 | 58 | public boolean handle(Supplier ctx) { 59 | ctx.get().enqueueWork(() -> { 60 | if (ctx.get().getDirection().getReceptionSide() == LogicalSide.CLIENT) { 61 | ClientWrapper.handle(this); 62 | } 63 | }); 64 | ctx.get().setPacketHandled(true); 65 | return true; 66 | 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /forge/1.19.3/src/main/java/computer/heather/advancedbackups/network/PacketToastSubscribe.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import java.util.function.Supplier; 4 | 5 | import computer.heather.advancedbackups.AdvancedBackups; 6 | import net.minecraft.network.FriendlyByteBuf; 7 | import net.minecraftforge.network.NetworkEvent; 8 | 9 | public class PacketToastSubscribe { 10 | 11 | private boolean enable; 12 | 13 | public PacketToastSubscribe(boolean enable) { 14 | this.enable = enable; 15 | } 16 | 17 | 18 | public PacketToastSubscribe(FriendlyByteBuf buf) { 19 | enable = buf.readBoolean(); 20 | } 21 | 22 | public void toBytes(FriendlyByteBuf buf) { 23 | buf.writeBoolean(enable); 24 | } 25 | 26 | public boolean handle(Supplier ctx) { 27 | ctx.get().enqueueWork(() -> { 28 | if (ctx.get().getSender() == null) return; 29 | if (enable && !AdvancedBackups.players.contains(ctx.get().getSender().getStringUUID())) { 30 | AdvancedBackups.players.add(ctx.get().getSender().getStringUUID()); 31 | } 32 | else if (!enable) { 33 | AdvancedBackups.players.remove(ctx.get().getSender().getStringUUID()); 34 | } 35 | }); 36 | 37 | return true; 38 | 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /forge/1.19.3/src/main/resources/META-INF/accesstransformer.cfg: -------------------------------------------------------------------------------- 1 | public net.minecraft.client.multiplayer.ClientPacketListener f_244346_ # lastSeenMessages -------------------------------------------------------------------------------- /forge/1.19.3/src/main/resources/pack.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "pack": { 3 | "description": "advancedbackups resources", 4 | "pack_format": 9, 5 | "forge:resource_pack_format": 8, 6 | "forge:data_pack_format": 9 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /forge/1.20.2/README.md: -------------------------------------------------------------------------------- 1 | # Forge - 1.20.2 2 | 3 | This is the branch specifically for forge 1.20.2. 4 | Any differences will be listed below. For full documentation, see the `core` branch. 5 | -------------------------------------------------------------------------------- /forge/1.20.2/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeatherComputer/AdvancedBackups/01d74672e44b67ceb5e4bd0a18b861ebe0bfcaf0/forge/1.20.2/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /forge/1.20.2/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /forge/1.20.2/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | gradlePluginPortal() 4 | maven { 5 | name = 'MinecraftForge' 6 | url = 'https://maven.minecraftforge.net/' 7 | } 8 | } 9 | } 10 | 11 | plugins { 12 | id 'org.gradle.toolchains.foojay-resolver-convention' version '0.5.0' 13 | } 14 | 15 | rootProject.name = 'forge-1.20.2' 16 | -------------------------------------------------------------------------------- /forge/1.20.2/src/main/java/computer/heather/advancedbackups/client/ClientWrapper.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.client; 2 | 3 | import computer.heather.advancedbackups.core.config.ClientConfigManager; 4 | import computer.heather.advancedbackups.network.NetworkHandler; 5 | import computer.heather.advancedbackups.network.PacketBackupStatus; 6 | import computer.heather.advancedbackups.network.PacketToastSubscribe; 7 | import net.minecraft.client.Minecraft; 8 | import net.minecraftforge.client.event.ClientPlayerNetworkEvent; 9 | import net.minecraftforge.client.event.RegisterClientCommandsEvent; 10 | import net.minecraftforge.common.MinecraftForge; 11 | import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; 12 | 13 | public class ClientWrapper { 14 | 15 | public static void handle(PacketBackupStatus message) { 16 | 17 | BackupToast.starting = message.starting; 18 | BackupToast.started = message.started; 19 | BackupToast.failed = message.failed; 20 | BackupToast.finished = message.finished; 21 | BackupToast.cancelled = message.cancelled; 22 | 23 | BackupToast.progress = message.progress; 24 | BackupToast.max = message.max; 25 | 26 | if (!BackupToast.exists) { 27 | BackupToast.exists = true; 28 | Minecraft.getInstance().getToasts().addToast(new BackupToast()); 29 | } 30 | } 31 | 32 | public static void init(FMLClientSetupEvent e) { 33 | MinecraftForge.EVENT_BUS.addListener(ClientWrapper::registerClientCommands); 34 | MinecraftForge.EVENT_BUS.addListener(ClientWrapper::onServerConnected); 35 | ClientConfigManager.loadOrCreateConfig(); 36 | } 37 | 38 | public static void registerClientCommands(RegisterClientCommandsEvent event) { 39 | AdvancedBackupsClientCommand.register(event.getDispatcher()); 40 | } 41 | 42 | public static void onServerConnected(ClientPlayerNetworkEvent.LoggingIn event) { 43 | NetworkHandler.INSTANCE.send(new PacketToastSubscribe(ClientConfigManager.showProgress.get()), Minecraft.getInstance().getConnection().getConnection()); 44 | //NetworkHandler.sendToServer(new PacketToastSubscribe(ClientConfigManager.showProgress.get())); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /forge/1.20.2/src/main/java/computer/heather/advancedbackups/client/ColourHelper.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.client; 2 | 3 | //A colour helper, loosely based on that of vanilla 1.16. 4 | //Where is it in modern? 5 | public class ColourHelper { 6 | 7 | public static int alpha(int in) { 8 | return in >>> 24; 9 | } 10 | 11 | public static int red(int in) { 12 | return in >> 16 & 255; 13 | } 14 | 15 | public static int green(int in) { 16 | return in >> 8 & 255; 17 | } 18 | 19 | public static int blue(int in) { 20 | return in & 255; 21 | } 22 | 23 | public static int colour(int a, int r, int g, int b) { 24 | return a << 24 | r << 16 | g << 8 | b; 25 | } 26 | 27 | public static int colour(int a, long r, long g, long b) { 28 | return colour(a, (int) r, (int) g, (int) b); 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /forge/1.20.2/src/main/java/computer/heather/advancedbackups/network/NetworkHandler.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import net.minecraft.resources.ResourceLocation; 4 | import net.minecraft.server.level.ServerPlayer; 5 | import net.minecraftforge.network.ChannelBuilder; 6 | import net.minecraftforge.network.NetworkDirection; 7 | import net.minecraftforge.network.NetworkRegistry; 8 | import net.minecraftforge.network.SimpleChannel; 9 | 10 | public class NetworkHandler { 11 | 12 | private static final String PROTOCOL_VERSION = "1"; 13 | private static int id = 0; 14 | private static int id() { 15 | return id++; 16 | } 17 | 18 | public static final SimpleChannel INSTANCE = ChannelBuilder.named(new ResourceLocation("advancedbackups", "main")).clientAcceptedVersions((status, version) -> true).simpleChannel(); 19 | 20 | 21 | public static void register() { 22 | INSTANCE.messageBuilder(PacketBackupStatus.class, id()) 23 | .encoder(PacketBackupStatus::toBytes) 24 | .decoder(buf -> new PacketBackupStatus(buf)) 25 | .consumerNetworkThread(PacketBackupStatus::handle) 26 | .add(); 27 | INSTANCE.messageBuilder(PacketToastSubscribe.class, id()) 28 | .encoder(PacketToastSubscribe::toBytes) 29 | .decoder(buf -> new PacketToastSubscribe(buf)) 30 | .consumerNetworkThread(PacketToastSubscribe::handle) 31 | .add(); 32 | } 33 | 34 | public static void sendToClient(ServerPlayer player, Object packet) { 35 | INSTANCE.send(packet, player.connection.getConnection()); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /forge/1.20.2/src/main/java/computer/heather/advancedbackups/network/PacketBackupStatus.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import computer.heather.advancedbackups.client.ClientWrapper; 4 | import net.minecraft.network.FriendlyByteBuf; 5 | import net.minecraftforge.event.network.CustomPayloadEvent; 6 | import net.minecraftforge.fml.LogicalSide; 7 | 8 | public class PacketBackupStatus { 9 | 10 | public boolean starting; 11 | public boolean started; 12 | 13 | public boolean failed; 14 | public boolean finished; 15 | public boolean cancelled; 16 | 17 | public int progress; 18 | public int max; 19 | 20 | 21 | public PacketBackupStatus(boolean starting, boolean started, boolean failed, boolean finished, boolean cancelled, int progress, 22 | int max) { 23 | this.starting = starting; 24 | this.started = started; 25 | this.failed = failed; 26 | this.finished = finished; 27 | this.cancelled = cancelled; 28 | this.progress = progress; 29 | this.max = max; 30 | } 31 | 32 | 33 | public PacketBackupStatus(FriendlyByteBuf buf) { 34 | starting = buf.readBoolean(); 35 | started = buf.readBoolean(); 36 | failed = buf.readBoolean(); 37 | finished = buf.readBoolean(); 38 | cancelled = buf.readBoolean(); 39 | 40 | progress = buf.readInt(); 41 | max = buf.readInt(); 42 | } 43 | 44 | public void toBytes(FriendlyByteBuf buf) { 45 | buf.writeBoolean(starting); 46 | buf.writeBoolean(started); 47 | buf.writeBoolean(failed); 48 | buf.writeBoolean(finished); 49 | buf.writeBoolean(cancelled); 50 | 51 | buf.writeInt(progress); 52 | buf.writeInt(max); 53 | } 54 | 55 | public static boolean handle(PacketBackupStatus message, CustomPayloadEvent.Context ctx) { 56 | ctx.enqueueWork(() -> { 57 | if (ctx.getDirection().getReceptionSide() == LogicalSide.CLIENT) { 58 | ClientWrapper.handle(message); 59 | } 60 | }); 61 | ctx.setPacketHandled(true); 62 | return true; 63 | 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /forge/1.20.2/src/main/java/computer/heather/advancedbackups/network/PacketToastSubscribe.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import computer.heather.advancedbackups.AdvancedBackups; 4 | import net.minecraft.network.FriendlyByteBuf; 5 | import net.minecraftforge.event.network.CustomPayloadEvent; 6 | 7 | public class PacketToastSubscribe { 8 | 9 | public boolean enable; 10 | 11 | 12 | public PacketToastSubscribe(boolean enable) { 13 | this.enable = enable; 14 | } 15 | 16 | 17 | public PacketToastSubscribe(FriendlyByteBuf buf) { 18 | enable = buf.readBoolean(); 19 | } 20 | 21 | public void toBytes(FriendlyByteBuf buf) { 22 | buf.writeBoolean(enable); 23 | } 24 | 25 | public static boolean handle(PacketToastSubscribe message, CustomPayloadEvent.Context ctx) { 26 | ctx.enqueueWork(() -> { 27 | if (ctx.getSender() == null) return; 28 | if (message.enable && !AdvancedBackups.players.contains(ctx.getSender().getStringUUID())) { 29 | AdvancedBackups.players.add(ctx.getSender().getStringUUID()); 30 | } 31 | else if (!message.enable) { 32 | AdvancedBackups.players.remove(ctx.getSender().getStringUUID()); 33 | } 34 | }); 35 | ctx.setPacketHandled(true); 36 | return true; 37 | 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /forge/1.20.2/src/main/resources/META-INF/accesstransformer.cfg: -------------------------------------------------------------------------------- 1 | public net.minecraft.client.multiplayer.ClientPacketListener f_244346_ # lastSeenMessages -------------------------------------------------------------------------------- /forge/1.20.2/src/main/resources/pack.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "pack": { 3 | "description": "advancedbackups resources", 4 | "pack_format": 9, 5 | "forge:resource_pack_format": 8, 6 | "forge:data_pack_format": 9 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /forge/1.20.6/README.md: -------------------------------------------------------------------------------- 1 | # Forge - 1.20.6 2 | 3 | This is the branch specifically for forge 1.20.6. 4 | Any differences will be listed below. For full documentation, see the `core` branch. 5 | -------------------------------------------------------------------------------- /forge/1.20.6/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeatherComputer/AdvancedBackups/01d74672e44b67ceb5e4bd0a18b861ebe0bfcaf0/forge/1.20.6/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /forge/1.20.6/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /forge/1.20.6/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | gradlePluginPortal() 4 | maven { 5 | name = 'MinecraftForge' 6 | url = 'https://maven.minecraftforge.net/' 7 | } 8 | } 9 | } 10 | 11 | plugins { 12 | id 'org.gradle.toolchains.foojay-resolver-convention' version '0.7.0' 13 | } 14 | 15 | rootProject.name = 'forge-1.20.6' 16 | -------------------------------------------------------------------------------- /forge/1.20.6/src/main/java/computer/heather/advancedbackups/client/ClientWrapper.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.client; 2 | 3 | import computer.heather.advancedbackups.core.config.ClientConfigManager; 4 | import computer.heather.advancedbackups.network.NetworkHandler; 5 | import computer.heather.advancedbackups.network.PacketBackupStatus; 6 | import computer.heather.advancedbackups.network.PacketToastSubscribe; 7 | import net.minecraft.client.Minecraft; 8 | import net.minecraftforge.client.event.ClientPlayerNetworkEvent; 9 | import net.minecraftforge.client.event.RegisterClientCommandsEvent; 10 | import net.minecraftforge.common.MinecraftForge; 11 | import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; 12 | 13 | public class ClientWrapper { 14 | 15 | public static void handle(PacketBackupStatus message) { 16 | 17 | BackupToast.starting = message.starting; 18 | BackupToast.started = message.started; 19 | BackupToast.failed = message.failed; 20 | BackupToast.finished = message.finished; 21 | BackupToast.cancelled = message.cancelled; 22 | 23 | BackupToast.progress = message.progress; 24 | BackupToast.max = message.max; 25 | 26 | if (!BackupToast.exists) { 27 | BackupToast.exists = true; 28 | Minecraft.getInstance().getToasts().addToast(new BackupToast()); 29 | } 30 | } 31 | 32 | public static void init(FMLClientSetupEvent e) { 33 | MinecraftForge.EVENT_BUS.addListener(ClientWrapper::registerClientCommands); 34 | MinecraftForge.EVENT_BUS.addListener(ClientWrapper::onServerConnected); 35 | ClientConfigManager.loadOrCreateConfig(); 36 | } 37 | 38 | public static void registerClientCommands(RegisterClientCommandsEvent event) { 39 | AdvancedBackupsClientCommand.register(event.getDispatcher()); 40 | } 41 | 42 | public static void onServerConnected(ClientPlayerNetworkEvent.LoggingIn event) { 43 | NetworkHandler.INSTANCE.send(new PacketToastSubscribe(ClientConfigManager.showProgress.get()), Minecraft.getInstance().getConnection().getConnection()); 44 | //NetworkHandler.sendToServer(new PacketToastSubscribe(ClientConfigManager.showProgress.get())); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /forge/1.20.6/src/main/java/computer/heather/advancedbackups/client/ColourHelper.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.client; 2 | 3 | //A colour helper, loosely based on that of vanilla 1.16. 4 | //Where is it in modern? 5 | public class ColourHelper { 6 | 7 | public static int alpha(int in) { 8 | return in >>> 24; 9 | } 10 | 11 | public static int red(int in) { 12 | return in >> 16 & 255; 13 | } 14 | 15 | public static int green(int in) { 16 | return in >> 8 & 255; 17 | } 18 | 19 | public static int blue(int in) { 20 | return in & 255; 21 | } 22 | 23 | public static int colour(int a, int r, int g, int b) { 24 | return a << 24 | r << 16 | g << 8 | b; 25 | } 26 | 27 | public static int colour(int a, long r, long g, long b) { 28 | return colour(a, (int) r, (int) g, (int) b); 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /forge/1.20.6/src/main/java/computer/heather/advancedbackups/network/NetworkHandler.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import net.minecraft.resources.ResourceLocation; 4 | import net.minecraft.server.level.ServerPlayer; 5 | import net.minecraftforge.network.ChannelBuilder; 6 | import net.minecraftforge.network.SimpleChannel; 7 | 8 | public class NetworkHandler { 9 | 10 | private static final String PROTOCOL_VERSION = "1"; 11 | private static int id = 0; 12 | private static int id() { 13 | return id++; 14 | } 15 | 16 | public static final SimpleChannel INSTANCE = ChannelBuilder.named(new ResourceLocation("advancedbackups", "main")).clientAcceptedVersions((status, version) -> true).simpleChannel(); 17 | 18 | 19 | public static void register() { 20 | INSTANCE.messageBuilder(PacketBackupStatus.class, id()) 21 | .encoder(PacketBackupStatus::toBytes) 22 | .decoder(buf -> new PacketBackupStatus(buf)) 23 | .consumerNetworkThread(PacketBackupStatus::handle) 24 | .add(); 25 | INSTANCE.messageBuilder(PacketToastSubscribe.class, id()) 26 | .encoder(PacketToastSubscribe::toBytes) 27 | .decoder(buf -> new PacketToastSubscribe(buf)) 28 | .consumerNetworkThread(PacketToastSubscribe::handle) 29 | .add(); 30 | } 31 | 32 | public static void sendToClient(ServerPlayer player, Object packet) { 33 | INSTANCE.send(packet, player.connection.getConnection()); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /forge/1.20.6/src/main/java/computer/heather/advancedbackups/network/PacketBackupStatus.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import computer.heather.advancedbackups.client.ClientWrapper; 4 | import net.minecraft.network.FriendlyByteBuf; 5 | import net.minecraft.network.protocol.PacketFlow; 6 | import net.minecraftforge.event.network.CustomPayloadEvent; 7 | 8 | public class PacketBackupStatus { 9 | 10 | public boolean starting; 11 | public boolean started; 12 | 13 | public boolean failed; 14 | public boolean finished; 15 | public boolean cancelled; 16 | 17 | public int progress; 18 | public int max; 19 | 20 | 21 | public PacketBackupStatus(boolean starting, boolean started, boolean failed, boolean finished, boolean cancelled, int progress, 22 | int max) { 23 | this.starting = starting; 24 | this.started = started; 25 | this.failed = failed; 26 | this.finished = finished; 27 | this.cancelled = cancelled; 28 | this.progress = progress; 29 | this.max = max; 30 | } 31 | 32 | 33 | public PacketBackupStatus(FriendlyByteBuf buf) { 34 | starting = buf.readBoolean(); 35 | started = buf.readBoolean(); 36 | failed = buf.readBoolean(); 37 | finished = buf.readBoolean(); 38 | cancelled = buf.readBoolean(); 39 | 40 | progress = buf.readInt(); 41 | max = buf.readInt(); 42 | } 43 | 44 | public void toBytes(FriendlyByteBuf buf) { 45 | buf.writeBoolean(starting); 46 | buf.writeBoolean(started); 47 | buf.writeBoolean(failed); 48 | buf.writeBoolean(finished); 49 | buf.writeBoolean(cancelled); 50 | 51 | buf.writeInt(progress); 52 | buf.writeInt(max); 53 | } 54 | 55 | public static boolean handle(PacketBackupStatus message, CustomPayloadEvent.Context ctx) { 56 | ctx.enqueueWork(() -> { 57 | if (ctx.getConnection().getReceiving() == PacketFlow.CLIENTBOUND) { 58 | ClientWrapper.handle(message); 59 | } 60 | }); 61 | ctx.setPacketHandled(true); 62 | return true; 63 | 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /forge/1.20.6/src/main/java/computer/heather/advancedbackups/network/PacketToastSubscribe.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import computer.heather.advancedbackups.AdvancedBackups; 4 | import net.minecraft.network.FriendlyByteBuf; 5 | import net.minecraftforge.event.network.CustomPayloadEvent; 6 | 7 | public class PacketToastSubscribe { 8 | 9 | public boolean enable; 10 | 11 | 12 | public PacketToastSubscribe(boolean enable) { 13 | this.enable = enable; 14 | } 15 | 16 | 17 | public PacketToastSubscribe(FriendlyByteBuf buf) { 18 | enable = buf.readBoolean(); 19 | } 20 | 21 | public void toBytes(FriendlyByteBuf buf) { 22 | buf.writeBoolean(enable); 23 | } 24 | 25 | public static boolean handle(PacketToastSubscribe message, CustomPayloadEvent.Context ctx) { 26 | ctx.enqueueWork(() -> { 27 | if (ctx.getSender() == null) return; 28 | if (message.enable && !AdvancedBackups.players.contains(ctx.getSender().getStringUUID())) { 29 | AdvancedBackups.players.add(ctx.getSender().getStringUUID()); 30 | } 31 | else if (!message.enable) { 32 | AdvancedBackups.players.remove(ctx.getSender().getStringUUID()); 33 | } 34 | }); 35 | ctx.setPacketHandled(true); 36 | return true; 37 | 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /forge/1.20.6/src/main/resources/META-INF/accesstransformer.cfg: -------------------------------------------------------------------------------- 1 | public net.minecraft.client.multiplayer.ClientPacketListener f_244346_ # lastSeenMessages -------------------------------------------------------------------------------- /forge/1.20.6/src/main/resources/pack.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "pack": { 3 | "description": "advancedbackups resources", 4 | "pack_format": 9, 5 | "forge:resource_pack_format": 8, 6 | "forge:data_pack_format": 9 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /forge/1.20/README.md: -------------------------------------------------------------------------------- 1 | # Forge - 1.20 2 | 3 | This is the branch specifically for forge 1.20. 4 | Any differences will be listed below. For full documentation, see the `core` branch. 5 | -------------------------------------------------------------------------------- /forge/1.20/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeatherComputer/AdvancedBackups/01d74672e44b67ceb5e4bd0a18b861ebe0bfcaf0/forge/1.20/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /forge/1.20/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /forge/1.20/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | gradlePluginPortal() 4 | maven { 5 | name = 'NeoForged' 6 | url = 'https://maven.neoforged.net/releases' 7 | } 8 | } 9 | } 10 | 11 | plugins { 12 | id 'org.gradle.toolchains.foojay-resolver-convention' version '0.5.0' 13 | } 14 | 15 | rootProject.name = 'forge-1.20' 16 | -------------------------------------------------------------------------------- /forge/1.20/src/main/java/computer/heather/advancedbackups/client/ClientWrapper.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.client; 2 | 3 | import computer.heather.advancedbackups.core.config.ClientConfigManager; 4 | import computer.heather.advancedbackups.network.NetworkHandler; 5 | import computer.heather.advancedbackups.network.PacketBackupStatus; 6 | import computer.heather.advancedbackups.network.PacketToastSubscribe; 7 | import net.minecraft.client.Minecraft; 8 | import net.minecraftforge.client.event.ClientPlayerNetworkEvent; 9 | import net.minecraftforge.client.event.RegisterClientCommandsEvent; 10 | import net.minecraftforge.common.MinecraftForge; 11 | import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; 12 | 13 | public class ClientWrapper { 14 | 15 | public static void handle(PacketBackupStatus packet) { 16 | 17 | BackupToast.starting = packet.starting; 18 | BackupToast.started = packet.started; 19 | BackupToast.failed = packet.failed; 20 | BackupToast.finished = packet.finished; 21 | 22 | BackupToast.cancelled = packet.cancelled; 23 | 24 | BackupToast.progress = packet.progress; 25 | BackupToast.max = packet.max; 26 | 27 | if (!BackupToast.exists) { 28 | BackupToast.exists = true; 29 | Minecraft.getInstance().getToasts().addToast(new BackupToast()); 30 | } 31 | } 32 | 33 | public static void init(FMLClientSetupEvent e) { 34 | MinecraftForge.EVENT_BUS.addListener(ClientWrapper::registerClientCommands); 35 | MinecraftForge.EVENT_BUS.addListener(ClientWrapper::onServerConnected); 36 | ClientConfigManager.loadOrCreateConfig(); 37 | } 38 | 39 | public static void registerClientCommands(RegisterClientCommandsEvent event) { 40 | AdvancedBackupsClientCommand.register(event.getDispatcher()); 41 | } 42 | 43 | public static void onServerConnected(ClientPlayerNetworkEvent.LoggingIn event) { 44 | NetworkHandler.sendToServer(new PacketToastSubscribe(ClientConfigManager.showProgress.get())); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /forge/1.20/src/main/java/computer/heather/advancedbackups/client/ColourHelper.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.client; 2 | 3 | //A colour helper, loosely based on that of vanilla 1.16. 4 | //Where is it in modern? 5 | public class ColourHelper { 6 | 7 | public static int alpha(int in) { 8 | return in >>> 24; 9 | } 10 | 11 | public static int red(int in) { 12 | return in >> 16 & 255; 13 | } 14 | 15 | public static int green(int in) { 16 | return in >> 8 & 255; 17 | } 18 | 19 | public static int blue(int in) { 20 | return in & 255; 21 | } 22 | 23 | public static int colour(int a, int r, int g, int b) { 24 | return a << 24 | r << 16 | g << 8 | b; 25 | } 26 | 27 | public static int colour(int a, long r, long g, long b) { 28 | return colour(a, (int) r, (int) g, (int) b); 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /forge/1.20/src/main/java/computer/heather/advancedbackups/network/NetworkHandler.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import net.minecraft.resources.ResourceLocation; 4 | import net.minecraft.server.level.ServerPlayer; 5 | import net.minecraftforge.network.NetworkDirection; 6 | import net.minecraftforge.network.NetworkRegistry; 7 | import net.minecraftforge.network.simple.SimpleChannel; 8 | 9 | public class NetworkHandler { 10 | 11 | private static final String PROTOCOL_VERSION = "1"; 12 | private static int id = 0; 13 | private static int id() { 14 | return id++; 15 | } 16 | 17 | public static final SimpleChannel INSTANCE = NetworkRegistry.newSimpleChannel( 18 | new ResourceLocation("advancedbackups", "main"), 19 | () -> PROTOCOL_VERSION, 20 | (version) -> true, 21 | (version) -> true 22 | ); 23 | 24 | 25 | public static void register() { 26 | INSTANCE.messageBuilder(PacketBackupStatus.class, id()) 27 | .encoder(PacketBackupStatus::toBytes) 28 | .decoder(buf -> new PacketBackupStatus(buf)) 29 | .consumerNetworkThread(PacketBackupStatus::handle) 30 | .add(); 31 | 32 | INSTANCE.messageBuilder(PacketToastSubscribe.class, id()) 33 | .encoder(PacketToastSubscribe::toBytes) 34 | .decoder(buf -> new PacketToastSubscribe(buf)) 35 | .consumerNetworkThread(PacketToastSubscribe::handle) 36 | .add(); 37 | } 38 | 39 | public static void sendToClient(ServerPlayer player, Object packet) { 40 | INSTANCE.sendTo(packet, player.connection.connection, NetworkDirection.PLAY_TO_CLIENT); 41 | } 42 | 43 | public static void sendToServer(Object packet) { 44 | INSTANCE.sendToServer(packet); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /forge/1.20/src/main/java/computer/heather/advancedbackups/network/PacketToastSubscribe.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import java.util.function.Supplier; 4 | 5 | import computer.heather.advancedbackups.AdvancedBackups; 6 | import net.minecraft.network.FriendlyByteBuf; 7 | import net.minecraftforge.network.NetworkEvent; 8 | 9 | public class PacketToastSubscribe { 10 | 11 | private boolean enable; 12 | 13 | public PacketToastSubscribe(boolean enable) { 14 | this.enable = enable; 15 | } 16 | 17 | 18 | public PacketToastSubscribe(FriendlyByteBuf buf) { 19 | enable = buf.readBoolean(); 20 | } 21 | 22 | public void toBytes(FriendlyByteBuf buf) { 23 | buf.writeBoolean(enable); 24 | } 25 | 26 | public boolean handle(Supplier ctx) { 27 | ctx.get().enqueueWork(() -> { 28 | if (ctx.get().getSender() == null) return; 29 | if (enable && !AdvancedBackups.players.contains(ctx.get().getSender().getStringUUID())) { 30 | AdvancedBackups.players.add(ctx.get().getSender().getStringUUID()); 31 | } 32 | else if (!enable) { 33 | AdvancedBackups.players.remove(ctx.get().getSender().getStringUUID()); 34 | } 35 | }); 36 | 37 | return true; 38 | 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /forge/1.20/src/main/resources/META-INF/accesstransformer.cfg: -------------------------------------------------------------------------------- 1 | public net.minecraft.client.multiplayer.ClientPacketListener f_244346_ # lastSeenMessages -------------------------------------------------------------------------------- /forge/1.20/src/main/resources/pack.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "pack": { 3 | "description": "advancedbackups resources", 4 | "pack_format": 9, 5 | "forge:resource_pack_format": 8, 6 | "forge:data_pack_format": 9 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /forge/1.7.10/README.md: -------------------------------------------------------------------------------- 1 | # Forge - 1.7.10 2 | 3 | This is the branch specifically for forge 1.7.10. 4 | Any differences will be listed below. For full documentation, see the `core` branch. 5 | 6 | 7 | - Backup progress is sent to ops via form of a text overlay, rather than a toast. 8 | - Flush config value is ignored, but this is meaningless for most users as in most cases it should be kept at the default `false` 9 | -------------------------------------------------------------------------------- /forge/1.7.10/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeatherComputer/AdvancedBackups/01d74672e44b67ceb5e4bd0a18b861ebe0bfcaf0/forge/1.7.10/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /forge/1.7.10/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip 4 | networkTimeout=10000 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /forge/1.7.10/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | rootProject.name = "forge-1.7.10" 2 | 3 | pluginManagement { 4 | repositories { 5 | maven { 6 | // RetroFuturaGradle 7 | name = "GTNH Maven" 8 | url = uri("http://jenkins.usrv.eu:8081/nexus/content/groups/public/") 9 | isAllowInsecureProtocol = true 10 | mavenContent { 11 | includeGroup("com.gtnewhorizons") 12 | includeGroup("com.gtnewhorizons.retrofuturagradle") 13 | } 14 | } 15 | gradlePluginPortal() 16 | mavenCentral() 17 | mavenLocal() 18 | } 19 | } 20 | 21 | plugins { 22 | // Automatic toolchain provisioning 23 | id("org.gradle.toolchains.foojay-resolver-convention") version "0.4.0" 24 | } -------------------------------------------------------------------------------- /forge/1.7.10/src/main/java/computer/heather/advancedbackups/network/NetworkHandler.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import computer.heather.advancedbackups.AdvancedBackups; 4 | import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper; 5 | import cpw.mods.fml.relauncher.Side; 6 | 7 | public class NetworkHandler { 8 | 9 | public static final SimpleNetworkWrapper HANDLER = new SimpleNetworkWrapper(AdvancedBackups.MODID); 10 | 11 | public static void init() 12 | { 13 | HANDLER.registerMessage(new PacketBackupStatus.Handler(), PacketBackupStatus.class, 1, Side.CLIENT); 14 | HANDLER.registerMessage(new PacketToastSubscribe.Handler(), PacketToastSubscribe.class, 2, Side.SERVER); 15 | HANDLER.registerMessage(new PacketClientReload.Handler(), PacketClientReload.class, 3, Side.CLIENT); 16 | } 17 | 18 | } 19 | 20 | -------------------------------------------------------------------------------- /forge/1.7.10/src/main/java/computer/heather/advancedbackups/network/PacketClientReload.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import computer.heather.advancedbackups.core.CoreCommandSystem; 4 | import cpw.mods.fml.common.network.simpleimpl.IMessage; 5 | import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; 6 | import cpw.mods.fml.common.network.simpleimpl.MessageContext; 7 | import io.netty.buffer.ByteBuf; 8 | import net.minecraft.client.Minecraft; 9 | 10 | //I hate this. 11 | public class PacketClientReload implements IMessage{ 12 | 13 | 14 | public PacketClientReload(boolean enable) { 15 | 16 | } 17 | 18 | public PacketClientReload () { 19 | 20 | } 21 | 22 | @Override 23 | public void fromBytes(ByteBuf buf) { 24 | 25 | } 26 | 27 | @Override 28 | public void toBytes(ByteBuf buf) { 29 | 30 | } 31 | 32 | 33 | public static class Handler implements IMessageHandler { 34 | 35 | @Override 36 | public IMessage onMessage(PacketClientReload message, MessageContext ctx) { 37 | 38 | CoreCommandSystem.reloadClientConfig(Minecraft.getMinecraft().thePlayer::sendChatMessage); 39 | return null; 40 | 41 | } 42 | 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /forge/1.7.10/src/main/java/computer/heather/advancedbackups/network/PacketToastSubscribe.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import computer.heather.advancedbackups.AdvancedBackups; 4 | import cpw.mods.fml.common.network.simpleimpl.IMessage; 5 | import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; 6 | import cpw.mods.fml.common.network.simpleimpl.MessageContext; 7 | import io.netty.buffer.ByteBuf; 8 | 9 | public class PacketToastSubscribe implements IMessage{ 10 | 11 | private boolean enable; 12 | 13 | public PacketToastSubscribe(boolean enable) { 14 | this.enable = enable; 15 | } 16 | 17 | public PacketToastSubscribe () { 18 | 19 | } 20 | 21 | @Override 22 | public void fromBytes(ByteBuf buf) { 23 | enable = buf.readBoolean(); 24 | } 25 | 26 | @Override 27 | public void toBytes(ByteBuf buf) { 28 | buf.writeBoolean(enable); 29 | } 30 | 31 | 32 | public static class Handler implements IMessageHandler { 33 | 34 | @Override 35 | public IMessage onMessage(PacketToastSubscribe message, MessageContext ctx) { 36 | 37 | String uuid = ctx.getServerHandler().playerEntity.getGameProfile().getId().toString(); 38 | 39 | 40 | if (message.enable && !AdvancedBackups.players.contains(uuid)) { 41 | AdvancedBackups.players.add(uuid); 42 | } 43 | else if (!message.enable) { 44 | AdvancedBackups.players.remove(uuid); 45 | } 46 | 47 | return null; 48 | 49 | } 50 | 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /forge/1.7.10/src/main/resources/mcmod.info: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "modid": "advancedbackups", 4 | "name": "Advanced Backups", 5 | "version": "${modVersion}", 6 | "mcversion": "1.7.10", 7 | "description": "A highly advanced backup mod.", 8 | "url": "https://github.com/HeatherComputer/AdvancedBackups", 9 | "credits": "", 10 | "authorList": ["Heather White"], 11 | "dependencies": [] 12 | } 13 | ] 14 | -------------------------------------------------------------------------------- /forge/1.7.10/src/main/resources/pack.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "pack": { 3 | "description": "advancedbackups resources", 4 | "pack_format": 9, 5 | "forge:resource_pack_format": 8, 6 | "forge:data_pack_format": 9 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /global.properties: -------------------------------------------------------------------------------- 1 | ext { 2 | abCoreLibPath = "../../core/build/libs/advancedbackups-corelib.jar" 3 | } 4 | -------------------------------------------------------------------------------- /neoforge/1.20.2/README.md: -------------------------------------------------------------------------------- 1 | # Neoforge - 1.20.2 2 | 3 | This is the branch specifically for neoforge 1.20.2. 4 | Any differences will be listed below. For full documentation, see the `core` branch. 5 | -------------------------------------------------------------------------------- /neoforge/1.20.2/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeatherComputer/AdvancedBackups/01d74672e44b67ceb5e4bd0a18b861ebe0bfcaf0/neoforge/1.20.2/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /neoforge/1.20.2/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /neoforge/1.20.2/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | gradlePluginPortal() 4 | maven { 5 | name = 'NeoForged' 6 | url = 'https://maven.neoforged.net/releases' 7 | } 8 | } 9 | } 10 | 11 | plugins { 12 | id 'org.gradle.toolchains.foojay-resolver-convention' version '0.5.0' 13 | } 14 | 15 | rootProject.name = 'neoforge-1.20.2' 16 | -------------------------------------------------------------------------------- /neoforge/1.20.2/src/main/java/computer/heather/advancedbackups/client/ClientWrapper.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.client; 2 | 3 | import computer.heather.advancedbackups.core.config.ClientConfigManager; 4 | import computer.heather.advancedbackups.network.NetworkHandler; 5 | import computer.heather.advancedbackups.network.PacketBackupStatus; 6 | import computer.heather.advancedbackups.network.PacketToastSubscribe; 7 | import net.minecraft.client.Minecraft; 8 | import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent; 9 | import net.neoforged.neoforge.client.event.ClientPlayerNetworkEvent; 10 | import net.neoforged.neoforge.client.event.RegisterClientCommandsEvent; 11 | import net.neoforged.neoforge.common.NeoForge; 12 | 13 | public class ClientWrapper { 14 | 15 | public static void handle(PacketBackupStatus packet) { 16 | BackupToast.starting = packet.starting; 17 | BackupToast.started = packet.started; 18 | BackupToast.failed = packet.failed; 19 | BackupToast.finished = packet.finished; 20 | BackupToast.cancelled = packet.cancelled; 21 | 22 | BackupToast.progress = packet.progress; 23 | BackupToast.max = packet.max; 24 | 25 | if (!BackupToast.exists) { 26 | BackupToast.exists = true; 27 | Minecraft.getInstance().getToasts().addToast(new BackupToast()); 28 | } 29 | } 30 | 31 | public static void init(FMLClientSetupEvent e) { 32 | NeoForge.EVENT_BUS.addListener(ClientWrapper::registerClientCommands); 33 | NeoForge.EVENT_BUS.addListener(ClientWrapper::onServerConnected); 34 | ClientConfigManager.loadOrCreateConfig(); 35 | } 36 | 37 | public static void registerClientCommands(RegisterClientCommandsEvent event) { 38 | AdvancedBackupsClientCommand.register(event.getDispatcher()); 39 | } 40 | 41 | public static void onServerConnected(ClientPlayerNetworkEvent.LoggingIn event) { 42 | NetworkHandler.sendToServer(new PacketToastSubscribe(ClientConfigManager.showProgress.get())); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /neoforge/1.20.2/src/main/java/computer/heather/advancedbackups/client/ColourHelper.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.client; 2 | 3 | //A colour helper, loosely based on that of vanilla 1.16. 4 | //Where is it in modern? 5 | public class ColourHelper { 6 | 7 | public static int alpha(int in) { 8 | return in >>> 24; 9 | } 10 | 11 | public static int red(int in) { 12 | return in >> 16 & 255; 13 | } 14 | 15 | public static int green(int in) { 16 | return in >> 8 & 255; 17 | } 18 | 19 | public static int blue(int in) { 20 | return in & 255; 21 | } 22 | 23 | public static int colour(int a, int r, int g, int b) { 24 | return a << 24 | r << 16 | g << 8 | b; 25 | } 26 | 27 | public static int colour(int a, long r, long g, long b) { 28 | return colour(a, (int) r, (int) g, (int) b); 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /neoforge/1.20.2/src/main/java/computer/heather/advancedbackups/network/NetworkHandler.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import net.minecraft.resources.ResourceLocation; 4 | import net.minecraft.server.level.ServerPlayer; 5 | import net.neoforged.neoforge.network.NetworkRegistry; 6 | import net.neoforged.neoforge.network.PlayNetworkDirection; 7 | import net.neoforged.neoforge.network.simple.SimpleChannel; 8 | 9 | public class NetworkHandler { 10 | 11 | private static final String PROTOCOL_VERSION = "1"; 12 | private static int id = 0; 13 | private static int id() { 14 | return id++; 15 | } 16 | 17 | public static final SimpleChannel INSTANCE = NetworkRegistry.newSimpleChannel( 18 | new ResourceLocation("advancedbackups", "main"), 19 | () -> PROTOCOL_VERSION, 20 | (version) -> true, 21 | (version) -> true 22 | ); 23 | 24 | 25 | public static void register() { 26 | INSTANCE.messageBuilder(PacketBackupStatus.class, id()) 27 | .encoder(PacketBackupStatus::toBytes) 28 | .decoder(buf -> new PacketBackupStatus(buf)) 29 | .consumerNetworkThread(PacketBackupStatus::handle) 30 | .add(); 31 | INSTANCE.messageBuilder(PacketToastSubscribe.class, id()) 32 | .encoder(PacketToastSubscribe::toBytes) 33 | .decoder(buf -> new PacketToastSubscribe(buf)) 34 | .consumerNetworkThread(PacketToastSubscribe::handle) 35 | .add(); 36 | } 37 | 38 | public static void sendToClient(ServerPlayer player, Object packet) { 39 | INSTANCE.sendTo(packet, player.connection.connection, PlayNetworkDirection.PLAY_TO_CLIENT); 40 | } 41 | 42 | public static void sendToServer(Object packet) { 43 | INSTANCE.sendToServer(packet); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /neoforge/1.20.2/src/main/java/computer/heather/advancedbackups/network/PacketToastSubscribe.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import java.util.function.Supplier; 4 | 5 | import computer.heather.advancedbackups.AdvancedBackups; 6 | import net.minecraft.network.FriendlyByteBuf; 7 | import net.neoforged.neoforge.network.NetworkEvent; 8 | 9 | public class PacketToastSubscribe { 10 | 11 | private boolean enable; 12 | 13 | public PacketToastSubscribe(boolean enable) { 14 | this.enable = enable; 15 | } 16 | 17 | 18 | public PacketToastSubscribe(FriendlyByteBuf buf) { 19 | enable = buf.readBoolean(); 20 | } 21 | 22 | public void toBytes(FriendlyByteBuf buf) { 23 | buf.writeBoolean(enable); 24 | } 25 | 26 | public boolean handle(NetworkEvent.Context ctx) { 27 | ctx.enqueueWork(() -> { 28 | if (ctx.getSender() == null) return; 29 | if (enable && !AdvancedBackups.players.contains(ctx.getSender().getStringUUID())) { 30 | AdvancedBackups.players.add(ctx.getSender().getStringUUID()); 31 | } 32 | else if (!enable) { 33 | AdvancedBackups.players.remove(ctx.getSender().getStringUUID()); 34 | } 35 | }); 36 | 37 | return true; 38 | 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /neoforge/1.20.2/src/main/resources/META-INF/accesstransformer.cfg: -------------------------------------------------------------------------------- 1 | public net.minecraft.client.multiplayer.ClientPacketListener lastSeenMessages # lastSeenMessages -------------------------------------------------------------------------------- /neoforge/1.20.2/src/main/resources/pack.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "pack": { 3 | "description": "advancedbackups resources", 4 | "pack_format": 9, 5 | "forge:resource_pack_format": 8, 6 | "forge:data_pack_format": 9 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /neoforge/1.20.4/README.md: -------------------------------------------------------------------------------- 1 | # Neoforge - 1.20.4 2 | 3 | This is the branch specifically for neoforge 1.20.4 4 | Any differences will be listed below. For full documentation, see the `core` branch. 5 | -------------------------------------------------------------------------------- /neoforge/1.20.4/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeatherComputer/AdvancedBackups/01d74672e44b67ceb5e4bd0a18b861ebe0bfcaf0/neoforge/1.20.4/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /neoforge/1.20.4/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /neoforge/1.20.4/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | gradlePluginPortal() 4 | maven { 5 | name = 'NeoForged' 6 | url = 'https://maven.neoforged.net/releases' 7 | } 8 | } 9 | } 10 | 11 | plugins { 12 | id 'org.gradle.toolchains.foojay-resolver-convention' version '0.5.0' 13 | } 14 | 15 | rootProject.name = 'neoforge-1.20.4' 16 | -------------------------------------------------------------------------------- /neoforge/1.20.4/src/main/java/computer/heather/advancedbackups/client/ClientWrapper.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.client; 2 | 3 | import computer.heather.advancedbackups.core.config.ClientConfigManager; 4 | import computer.heather.advancedbackups.network.NetworkHandler; 5 | import computer.heather.advancedbackups.network.PacketBackupStatus; 6 | import computer.heather.advancedbackups.network.PacketToastSubscribe; 7 | import net.minecraft.client.Minecraft; 8 | import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent; 9 | import net.neoforged.neoforge.client.event.ClientPlayerNetworkEvent; 10 | import net.neoforged.neoforge.client.event.RegisterClientCommandsEvent; 11 | import net.neoforged.neoforge.common.NeoForge; 12 | 13 | public class ClientWrapper { 14 | 15 | public static void handle(PacketBackupStatus packet) { 16 | BackupToast.starting = packet.starting; 17 | BackupToast.started = packet.started; 18 | BackupToast.failed = packet.failed; 19 | BackupToast.finished = packet.finished; 20 | BackupToast.cancelled = packet.cancelled; 21 | 22 | BackupToast.progress = packet.progress; 23 | BackupToast.max = packet.max; 24 | 25 | if (!BackupToast.exists) { 26 | BackupToast.exists = true; 27 | Minecraft.getInstance().getToasts().addToast(new BackupToast()); 28 | } 29 | } 30 | 31 | public static void init(FMLClientSetupEvent e) { 32 | NeoForge.EVENT_BUS.addListener(ClientWrapper::registerClientCommands); 33 | NeoForge.EVENT_BUS.addListener(ClientWrapper::onServerConnected); 34 | ClientConfigManager.loadOrCreateConfig(); 35 | } 36 | 37 | public static void registerClientCommands(RegisterClientCommandsEvent event) { 38 | AdvancedBackupsClientCommand.register(event.getDispatcher()); 39 | } 40 | 41 | public static void onServerConnected(ClientPlayerNetworkEvent.LoggingIn event) { 42 | NetworkHandler.sendToServer(new PacketToastSubscribe(ClientConfigManager.showProgress.get())); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /neoforge/1.20.4/src/main/java/computer/heather/advancedbackups/client/ColourHelper.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.client; 2 | 3 | //A colour helper, loosely based on that of vanilla 1.16. 4 | //Where is it in modern? 5 | public class ColourHelper { 6 | 7 | public static int alpha(int in) { 8 | return in >>> 24; 9 | } 10 | 11 | public static int red(int in) { 12 | return in >> 16 & 255; 13 | } 14 | 15 | public static int green(int in) { 16 | return in >> 8 & 255; 17 | } 18 | 19 | public static int blue(int in) { 20 | return in & 255; 21 | } 22 | 23 | public static int colour(int a, int r, int g, int b) { 24 | return a << 24 | r << 16 | g << 8 | b; 25 | } 26 | 27 | public static int colour(int a, long r, long g, long b) { 28 | return colour(a, (int) r, (int) g, (int) b); 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /neoforge/1.20.4/src/main/java/computer/heather/advancedbackups/network/NetworkHandler.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import net.minecraft.network.protocol.common.custom.CustomPacketPayload; 4 | import net.minecraft.server.level.ServerPlayer; 5 | import net.neoforged.neoforge.network.PacketDistributor; 6 | import net.neoforged.neoforge.network.event.RegisterPayloadHandlerEvent; 7 | import net.neoforged.neoforge.network.registration.IPayloadRegistrar; 8 | 9 | public class NetworkHandler { 10 | 11 | 12 | public static void onRegisterPayloadHandler(RegisterPayloadHandlerEvent event) { 13 | final IPayloadRegistrar registrar = event.registrar("advancedbackups") 14 | .versioned("1.0") 15 | .optional(); 16 | 17 | registrar.play(PacketToastSubscribe.ID, PacketToastSubscribe::new, handler -> handler 18 | .server(PacketToastSubscribe::handle)); 19 | 20 | registrar.play(PacketBackupStatus.ID, PacketBackupStatus::new, handler -> handler 21 | .client(PacketBackupStatus::handle)); 22 | } 23 | 24 | public static void sendToClient(ServerPlayer player, MSG message) { 25 | PacketDistributor.PLAYER.with(player).send(message); 26 | } 27 | 28 | public static void sendToServer(MSG message) { 29 | PacketDistributor.SERVER.noArg().send(message); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /neoforge/1.20.4/src/main/java/computer/heather/advancedbackups/network/PacketToastSubscribe.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | 4 | import computer.heather.advancedbackups.AdvancedBackups; 5 | import net.minecraft.network.FriendlyByteBuf; 6 | import net.minecraft.network.protocol.common.custom.CustomPacketPayload; 7 | import net.minecraft.resources.ResourceLocation; 8 | import net.neoforged.neoforge.network.handling.PlayPayloadContext; 9 | 10 | public class PacketToastSubscribe implements CustomPacketPayload { 11 | 12 | public static final ResourceLocation ID = new ResourceLocation("advancedbackups", "toast_subscribe"); 13 | 14 | @Override 15 | public ResourceLocation id() { 16 | return ID; 17 | } 18 | 19 | private boolean enable; 20 | 21 | public PacketToastSubscribe(boolean enable) { 22 | this.enable = enable; 23 | } 24 | 25 | 26 | public PacketToastSubscribe(FriendlyByteBuf buf) { 27 | enable = buf.readBoolean(); 28 | } 29 | 30 | @Override 31 | public void write(FriendlyByteBuf buf) { 32 | buf.writeBoolean(enable); 33 | } 34 | 35 | public boolean handle(PlayPayloadContext ctx) { 36 | ctx.workHandler().submitAsync(() -> { 37 | if (!ctx.player().isPresent()) return; 38 | if (enable && !AdvancedBackups.players.contains(ctx.player().get().getStringUUID())) { 39 | AdvancedBackups.players.add(ctx.player().get().getStringUUID()); 40 | } 41 | else if (!enable) { 42 | AdvancedBackups.players.remove(ctx.player().get().getStringUUID()); 43 | } 44 | }); 45 | 46 | return true; 47 | 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /neoforge/1.20.4/src/main/resources/META-INF/accesstransformer.cfg: -------------------------------------------------------------------------------- 1 | public net.minecraft.client.multiplayer.ClientPacketListener lastSeenMessages # lastSeenMessages -------------------------------------------------------------------------------- /neoforge/1.20.4/src/main/resources/pack.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "pack": { 3 | "description": "advancedbackups resources", 4 | "pack_format": 9, 5 | "forge:resource_pack_format": 8, 6 | "forge:data_pack_format": 9 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /neoforge/1.20.6/README.md: -------------------------------------------------------------------------------- 1 | # Neoforge - 1.20.6 2 | 3 | This is the branch specifically for neoforge 1.20.6. 4 | Any differences will be listed below. For full documentation, see the `core` branch. 5 | -------------------------------------------------------------------------------- /neoforge/1.20.6/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeatherComputer/AdvancedBackups/01d74672e44b67ceb5e4bd0a18b861ebe0bfcaf0/neoforge/1.20.6/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /neoforge/1.20.6/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /neoforge/1.20.6/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | gradlePluginPortal() 4 | maven { 5 | name = 'NeoForged' 6 | url = 'https://maven.neoforged.net/releases' 7 | } 8 | } 9 | } 10 | 11 | plugins { 12 | id 'org.gradle.toolchains.foojay-resolver-convention' version '0.5.0' 13 | } 14 | 15 | rootProject.name = 'neoforge-1.20.6' 16 | -------------------------------------------------------------------------------- /neoforge/1.20.6/src/main/java/computer/heather/advancedbackups/client/ColourHelper.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.client; 2 | 3 | //A colour helper, loosely based on that of vanilla 1.16. 4 | //Where is it in modern? 5 | public class ColourHelper { 6 | 7 | public static int alpha(int in) { 8 | return in >>> 24; 9 | } 10 | 11 | public static int red(int in) { 12 | return in >> 16 & 255; 13 | } 14 | 15 | public static int green(int in) { 16 | return in >> 8 & 255; 17 | } 18 | 19 | public static int blue(int in) { 20 | return in & 255; 21 | } 22 | 23 | public static int colour(int a, int r, int g, int b) { 24 | return a << 24 | r << 16 | g << 8 | b; 25 | } 26 | 27 | public static int colour(int a, long r, long g, long b) { 28 | return colour(a, (int) r, (int) g, (int) b); 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /neoforge/1.20.6/src/main/java/computer/heather/advancedbackups/network/NetworkHandler.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | 4 | import net.minecraft.network.protocol.common.custom.CustomPacketPayload; 5 | import net.minecraft.server.level.ServerPlayer; 6 | import net.neoforged.neoforge.network.PacketDistributor; 7 | import net.neoforged.neoforge.network.event.RegisterPayloadHandlersEvent; 8 | import net.neoforged.neoforge.network.registration.PayloadRegistrar; 9 | 10 | public class NetworkHandler { 11 | 12 | 13 | public static void onRegisterPayloadHandler(RegisterPayloadHandlersEvent event) { 14 | final PayloadRegistrar registrar = event.registrar("1").optional(); //this .optional() seems to be required, but will it be a problem for our packets with non-neo servers...? 15 | 16 | registrar.commonToClient(PacketBackupStatus.ID, PacketBackupStatus.CODEC, PacketBackupStatus::handle); 17 | registrar.commonToServer(PacketToastSubscribe.ID, PacketToastSubscribe.CODEC, PacketToastSubscribe::handle); 18 | } 19 | 20 | public static void sendToClient(ServerPlayer player, MSG message) { 21 | PacketDistributor.sendToPlayer(player, message); 22 | } 23 | 24 | 25 | } 26 | -------------------------------------------------------------------------------- /neoforge/1.20.6/src/main/java/computer/heather/advancedbackups/network/PacketBackupStatus.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import computer.heather.advancedbackups.client.BackupToast; 4 | import computer.heather.advancedbackups.client.ClientWrapper; 5 | import net.minecraft.client.Minecraft; 6 | import net.minecraft.network.FriendlyByteBuf; 7 | import net.minecraft.network.codec.StreamCodec; 8 | import net.minecraft.network.protocol.common.custom.CustomPacketPayload; 9 | import net.minecraft.resources.ResourceLocation; 10 | import net.neoforged.neoforge.network.handling.IPayloadContext; 11 | 12 | public record PacketBackupStatus(boolean starting, boolean started, boolean failed, boolean finished, boolean cancelled, int progress, int max) implements CustomPacketPayload { 13 | 14 | public static final CustomPacketPayload.Type ID = new CustomPacketPayload.Type(new ResourceLocation("advancedbackups:backup_status")); 15 | 16 | public static final StreamCodec CODEC = StreamCodec.of((buf, packet) -> { 17 | buf.writeBoolean(packet.starting); 18 | buf.writeBoolean(packet.started); 19 | buf.writeBoolean(packet.failed); 20 | buf.writeBoolean(packet.finished); 21 | buf.writeBoolean(packet.cancelled); 22 | buf.writeInt(packet.progress); 23 | buf.writeInt(packet.max); 24 | }, 25 | 26 | buf -> new PacketBackupStatus( 27 | buf.readBoolean(), 28 | buf.readBoolean(), 29 | buf.readBoolean(), 30 | buf.readBoolean(), 31 | buf.readBoolean(), 32 | buf.readInt(), 33 | buf.readInt() 34 | )); 35 | 36 | 37 | @Override 38 | public CustomPacketPayload.Type type() { 39 | return ID; 40 | } 41 | 42 | public static void handle(PacketBackupStatus packet, IPayloadContext context) { 43 | ClientWrapper.handle(packet, context); 44 | } 45 | 46 | 47 | } 48 | -------------------------------------------------------------------------------- /neoforge/1.20.6/src/main/java/computer/heather/advancedbackups/network/PacketToastSubscribe.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import computer.heather.advancedbackups.AdvancedBackups; 4 | import net.minecraft.network.FriendlyByteBuf; 5 | import net.minecraft.network.codec.ByteBufCodecs; 6 | import net.minecraft.network.codec.StreamCodec; 7 | import net.minecraft.network.protocol.common.custom.CustomPacketPayload; 8 | import net.minecraft.resources.ResourceLocation; 9 | import net.minecraft.world.entity.player.Player; 10 | import net.neoforged.neoforge.network.handling.IPayloadContext; 11 | 12 | public record PacketToastSubscribe(boolean enable) implements CustomPacketPayload { 13 | 14 | public static final CustomPacketPayload.Type ID = new CustomPacketPayload.Type<>(new ResourceLocation("advancedbackups:toast_subscribe")); 15 | 16 | public PacketToastSubscribe(boolean enable) { 17 | this.enable = enable; 18 | } 19 | 20 | public static final StreamCodec CODEC = StreamCodec.composite(ByteBufCodecs.BOOL, PacketToastSubscribe::enable, PacketToastSubscribe::new); 21 | 22 | 23 | public static void handle(PacketToastSubscribe message, IPayloadContext context) { 24 | 25 | Player player = context.player(); 26 | 27 | if (message.enable() && !AdvancedBackups.players.contains(player.getStringUUID())) { 28 | AdvancedBackups.players.add(player.getStringUUID()); 29 | } 30 | else if (!message.enable()) { 31 | AdvancedBackups.players.remove(player.getStringUUID()); 32 | } 33 | 34 | } 35 | 36 | 37 | 38 | @Override 39 | public CustomPacketPayload.Type type() { 40 | return ID; 41 | } 42 | 43 | 44 | 45 | } -------------------------------------------------------------------------------- /neoforge/1.20.6/src/main/resources/META-INF/accesstransformer.cfg: -------------------------------------------------------------------------------- 1 | public net.minecraft.client.multiplayer.ClientPacketListener lastSeenMessages # lastSeenMessages -------------------------------------------------------------------------------- /neoforge/1.20.6/src/main/resources/pack.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "pack": { 3 | "description": "advancedbackups resources", 4 | "pack_format": 9, 5 | "forge:resource_pack_format": 8, 6 | "forge:data_pack_format": 9 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /neoforge/1.21.2/README.md: -------------------------------------------------------------------------------- 1 | # Neoforge - 1.21 2 | 3 | This is the branch specifically for neoforge 1.20.1. 4 | Any differences will be listed below. For full documentation, see the `core` branch. 5 | -------------------------------------------------------------------------------- /neoforge/1.21.2/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeatherComputer/AdvancedBackups/01d74672e44b67ceb5e4bd0a18b861ebe0bfcaf0/neoforge/1.21.2/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /neoforge/1.21.2/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /neoforge/1.21.2/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | mavenLocal() 4 | gradlePluginPortal() 5 | maven { url = 'https://maven.neoforged.net/releases' } 6 | } 7 | } 8 | 9 | plugins { 10 | id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0' 11 | } 12 | 13 | rootProject.name = 'neoforge-1.21.2' 14 | -------------------------------------------------------------------------------- /neoforge/1.21.2/src/main/java/computer/heather/advancedbackups/client/ColourHelper.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.client; 2 | 3 | //A colour helper, loosely based on that of vanilla 1.16. 4 | //Where is it in modern? 5 | public class ColourHelper { 6 | 7 | public static int alpha(int in) { 8 | return in >>> 24; 9 | } 10 | 11 | public static int red(int in) { 12 | return in >> 16 & 255; 13 | } 14 | 15 | public static int green(int in) { 16 | return in >> 8 & 255; 17 | } 18 | 19 | public static int blue(int in) { 20 | return in & 255; 21 | } 22 | 23 | public static int colour(int a, int r, int g, int b) { 24 | return a << 24 | r << 16 | g << 8 | b; 25 | } 26 | 27 | public static int colour(int a, long r, long g, long b) { 28 | return colour(a, (int) r, (int) g, (int) b); 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /neoforge/1.21.2/src/main/java/computer/heather/advancedbackups/network/NetworkHandler.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | 4 | import net.minecraft.network.protocol.common.custom.CustomPacketPayload; 5 | import net.minecraft.server.level.ServerPlayer; 6 | import net.neoforged.neoforge.network.PacketDistributor; 7 | import net.neoforged.neoforge.network.event.RegisterPayloadHandlersEvent; 8 | import net.neoforged.neoforge.network.registration.PayloadRegistrar; 9 | 10 | public class NetworkHandler { 11 | 12 | 13 | public static void onRegisterPayloadHandler(RegisterPayloadHandlersEvent event) { 14 | final PayloadRegistrar registrar = event.registrar("1").optional(); //this .optional() seems to be required, but will it be a problem for our packets with non-neo servers...? 15 | 16 | registrar.commonToClient(PacketBackupStatus.ID, PacketBackupStatus.CODEC, PacketBackupStatus::handle); 17 | registrar.commonToServer(PacketToastSubscribe.ID, PacketToastSubscribe.CODEC, PacketToastSubscribe::handle); 18 | } 19 | 20 | public static void sendToClient(ServerPlayer player, MSG message) { 21 | PacketDistributor.sendToPlayer(player, message); 22 | } 23 | 24 | 25 | } 26 | -------------------------------------------------------------------------------- /neoforge/1.21.2/src/main/java/computer/heather/advancedbackups/network/PacketBackupStatus.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import computer.heather.advancedbackups.client.BackupToast; 4 | import computer.heather.advancedbackups.client.ClientWrapper; 5 | import net.minecraft.client.Minecraft; 6 | import net.minecraft.network.FriendlyByteBuf; 7 | import net.minecraft.network.codec.StreamCodec; 8 | import net.minecraft.network.protocol.common.custom.CustomPacketPayload; 9 | import net.minecraft.resources.ResourceLocation; 10 | import net.neoforged.neoforge.network.handling.IPayloadContext; 11 | 12 | public record PacketBackupStatus(boolean starting, boolean started, boolean failed, boolean finished, boolean cancelled, int progress, int max) implements CustomPacketPayload { 13 | 14 | public static final CustomPacketPayload.Type ID = new CustomPacketPayload.Type(ResourceLocation.parse("advancedbackups:backup_status")); 15 | 16 | public static final StreamCodec CODEC = StreamCodec.of((buf, packet) -> { 17 | buf.writeBoolean(packet.starting); 18 | buf.writeBoolean(packet.started); 19 | buf.writeBoolean(packet.failed); 20 | buf.writeBoolean(packet.finished); 21 | buf.writeBoolean(packet.cancelled); 22 | buf.writeInt(packet.progress); 23 | buf.writeInt(packet.max); 24 | }, 25 | 26 | buf -> new PacketBackupStatus( 27 | buf.readBoolean(), 28 | buf.readBoolean(), 29 | buf.readBoolean(), 30 | buf.readBoolean(), 31 | buf.readBoolean(), 32 | buf.readInt(), 33 | buf.readInt() 34 | )); 35 | 36 | 37 | @Override 38 | public CustomPacketPayload.Type type() { 39 | return ID; 40 | } 41 | 42 | 43 | public static void handle(PacketBackupStatus packet, IPayloadContext context) { 44 | ClientWrapper.handle(packet, context); 45 | } 46 | 47 | 48 | } 49 | -------------------------------------------------------------------------------- /neoforge/1.21.2/src/main/java/computer/heather/advancedbackups/network/PacketToastSubscribe.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import computer.heather.advancedbackups.AdvancedBackups; 4 | import net.minecraft.network.FriendlyByteBuf; 5 | import net.minecraft.network.codec.ByteBufCodecs; 6 | import net.minecraft.network.codec.StreamCodec; 7 | import net.minecraft.network.protocol.common.custom.CustomPacketPayload; 8 | import net.minecraft.resources.ResourceLocation; 9 | import net.minecraft.world.entity.player.Player; 10 | import net.neoforged.neoforge.network.handling.IPayloadContext; 11 | 12 | public record PacketToastSubscribe(boolean enable) implements CustomPacketPayload { 13 | 14 | public static final CustomPacketPayload.Type ID = new CustomPacketPayload.Type<>(ResourceLocation.parse("advancedbackups:toast_subscribe")); 15 | 16 | public PacketToastSubscribe(boolean enable) { 17 | this.enable = enable; 18 | } 19 | 20 | public static final StreamCodec CODEC = StreamCodec.composite(ByteBufCodecs.BOOL, PacketToastSubscribe::enable, PacketToastSubscribe::new); 21 | 22 | 23 | public static void handle(PacketToastSubscribe message, IPayloadContext context) { 24 | 25 | Player player = context.player(); 26 | 27 | if (message.enable() && !AdvancedBackups.players.contains(player.getStringUUID())) { 28 | AdvancedBackups.players.add(player.getStringUUID()); 29 | } 30 | else if (!message.enable()) { 31 | AdvancedBackups.players.remove(player.getStringUUID()); 32 | } 33 | 34 | } 35 | 36 | 37 | 38 | @Override 39 | public CustomPacketPayload.Type type() { 40 | return ID; 41 | } 42 | 43 | 44 | 45 | } -------------------------------------------------------------------------------- /neoforge/1.21.2/src/main/resources/META-INF/accesstransformer.cfg: -------------------------------------------------------------------------------- 1 | public net.minecraft.client.multiplayer.ClientPacketListener lastSeenMessages # lastSeenMessages 2 | public net.minecraft.client.multiplayer.ClientCommonPacketListenerImpl connection # connection -------------------------------------------------------------------------------- /neoforge/1.21.2/src/main/resources/pack.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "pack": { 3 | "description": "advancedbackups resources", 4 | "pack_format": 9, 5 | "forge:resource_pack_format": 8, 6 | "forge:data_pack_format": 9 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /neoforge/1.21/README.md: -------------------------------------------------------------------------------- 1 | # Neoforge - 1.21 2 | 3 | This is the branch specifically for neoforge 1.20.1. 4 | Any differences will be listed below. For full documentation, see the `core` branch. 5 | -------------------------------------------------------------------------------- /neoforge/1.21/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeatherComputer/AdvancedBackups/01d74672e44b67ceb5e4bd0a18b861ebe0bfcaf0/neoforge/1.21/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /neoforge/1.21/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /neoforge/1.21/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | mavenLocal() 4 | gradlePluginPortal() 5 | maven { url = 'https://maven.neoforged.net/releases' } 6 | } 7 | } 8 | 9 | plugins { 10 | id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0' 11 | } 12 | 13 | rootProject.name = 'neoforge-1.21' 14 | -------------------------------------------------------------------------------- /neoforge/1.21/src/main/java/computer/heather/advancedbackups/client/ColourHelper.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.client; 2 | 3 | //A colour helper, loosely based on that of vanilla 1.16. 4 | //Where is it in modern? 5 | public class ColourHelper { 6 | 7 | public static int alpha(int in) { 8 | return in >>> 24; 9 | } 10 | 11 | public static int red(int in) { 12 | return in >> 16 & 255; 13 | } 14 | 15 | public static int green(int in) { 16 | return in >> 8 & 255; 17 | } 18 | 19 | public static int blue(int in) { 20 | return in & 255; 21 | } 22 | 23 | public static int colour(int a, int r, int g, int b) { 24 | return a << 24 | r << 16 | g << 8 | b; 25 | } 26 | 27 | public static int colour(int a, long r, long g, long b) { 28 | return colour(a, (int) r, (int) g, (int) b); 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /neoforge/1.21/src/main/java/computer/heather/advancedbackups/network/NetworkHandler.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | 4 | import net.minecraft.network.protocol.common.custom.CustomPacketPayload; 5 | import net.minecraft.server.level.ServerPlayer; 6 | import net.neoforged.neoforge.network.PacketDistributor; 7 | import net.neoforged.neoforge.network.event.RegisterPayloadHandlersEvent; 8 | import net.neoforged.neoforge.network.registration.PayloadRegistrar; 9 | 10 | public class NetworkHandler { 11 | 12 | 13 | public static void onRegisterPayloadHandler(RegisterPayloadHandlersEvent event) { 14 | final PayloadRegistrar registrar = event.registrar("1").optional(); //this .optional() seems to be required, but will it be a problem for our packets with non-neo servers...? 15 | 16 | registrar.commonToClient(PacketBackupStatus.ID, PacketBackupStatus.CODEC, PacketBackupStatus::handle); 17 | registrar.commonToServer(PacketToastSubscribe.ID, PacketToastSubscribe.CODEC, PacketToastSubscribe::handle); 18 | } 19 | 20 | public static void sendToClient(ServerPlayer player, MSG message) { 21 | PacketDistributor.sendToPlayer(player, message); 22 | } 23 | 24 | 25 | } 26 | -------------------------------------------------------------------------------- /neoforge/1.21/src/main/java/computer/heather/advancedbackups/network/PacketBackupStatus.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import computer.heather.advancedbackups.client.BackupToast; 4 | import computer.heather.advancedbackups.client.ClientWrapper; 5 | import net.minecraft.client.Minecraft; 6 | import net.minecraft.network.FriendlyByteBuf; 7 | import net.minecraft.network.codec.StreamCodec; 8 | import net.minecraft.network.protocol.common.custom.CustomPacketPayload; 9 | import net.minecraft.resources.ResourceLocation; 10 | import net.neoforged.neoforge.network.handling.IPayloadContext; 11 | 12 | public record PacketBackupStatus(boolean starting, boolean started, boolean failed, boolean finished, boolean cancelled, int progress, int max) implements CustomPacketPayload { 13 | 14 | public static final CustomPacketPayload.Type ID = new CustomPacketPayload.Type(ResourceLocation.parse("advancedbackups:backup_status")); 15 | 16 | public static final StreamCodec CODEC = StreamCodec.of((buf, packet) -> { 17 | buf.writeBoolean(packet.starting); 18 | buf.writeBoolean(packet.started); 19 | buf.writeBoolean(packet.failed); 20 | buf.writeBoolean(packet.finished); 21 | buf.writeBoolean(packet.cancelled); 22 | buf.writeInt(packet.progress); 23 | buf.writeInt(packet.max); 24 | }, 25 | 26 | buf -> new PacketBackupStatus( 27 | buf.readBoolean(), 28 | buf.readBoolean(), 29 | buf.readBoolean(), 30 | buf.readBoolean(), 31 | buf.readBoolean(), 32 | buf.readInt(), 33 | buf.readInt() 34 | )); 35 | 36 | 37 | @Override 38 | public CustomPacketPayload.Type type() { 39 | return ID; 40 | } 41 | 42 | 43 | public static void handle(PacketBackupStatus packet, IPayloadContext context) { 44 | ClientWrapper.handle(packet, context); 45 | } 46 | 47 | 48 | } 49 | -------------------------------------------------------------------------------- /neoforge/1.21/src/main/java/computer/heather/advancedbackups/network/PacketToastSubscribe.java: -------------------------------------------------------------------------------- 1 | package computer.heather.advancedbackups.network; 2 | 3 | import computer.heather.advancedbackups.AdvancedBackups; 4 | import net.minecraft.network.FriendlyByteBuf; 5 | import net.minecraft.network.codec.ByteBufCodecs; 6 | import net.minecraft.network.codec.StreamCodec; 7 | import net.minecraft.network.protocol.common.custom.CustomPacketPayload; 8 | import net.minecraft.resources.ResourceLocation; 9 | import net.minecraft.world.entity.player.Player; 10 | import net.neoforged.neoforge.network.handling.IPayloadContext; 11 | 12 | public record PacketToastSubscribe(boolean enable) implements CustomPacketPayload { 13 | 14 | public static final CustomPacketPayload.Type ID = new CustomPacketPayload.Type<>(ResourceLocation.parse("advancedbackups:toast_subscribe")); 15 | 16 | public PacketToastSubscribe(boolean enable) { 17 | this.enable = enable; 18 | } 19 | 20 | public static final StreamCodec CODEC = StreamCodec.composite(ByteBufCodecs.BOOL, PacketToastSubscribe::enable, PacketToastSubscribe::new); 21 | 22 | 23 | public static void handle(PacketToastSubscribe message, IPayloadContext context) { 24 | 25 | Player player = context.player(); 26 | 27 | if (message.enable() && !AdvancedBackups.players.contains(player.getStringUUID())) { 28 | AdvancedBackups.players.add(player.getStringUUID()); 29 | } 30 | else if (!message.enable()) { 31 | AdvancedBackups.players.remove(player.getStringUUID()); 32 | } 33 | 34 | } 35 | 36 | 37 | 38 | @Override 39 | public CustomPacketPayload.Type type() { 40 | return ID; 41 | } 42 | 43 | 44 | 45 | } -------------------------------------------------------------------------------- /neoforge/1.21/src/main/resources/META-INF/accesstransformer.cfg: -------------------------------------------------------------------------------- 1 | public net.minecraft.client.multiplayer.ClientPacketListener lastSeenMessages # lastSeenMessages 2 | public net.minecraft.client.multiplayer.ClientCommonPacketListenerImpl connection # connection -------------------------------------------------------------------------------- /neoforge/1.21/src/main/resources/pack.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "pack": { 3 | "description": "advancedbackups resources", 4 | "pack_format": 9, 5 | "forge:resource_pack_format": 8, 6 | "forge:data_pack_format": 9 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /spigot/1.21/gradle.properties: -------------------------------------------------------------------------------- 1 | version = 0.1-DEV 2 | 3 | 4 | modloaderName =spigot 5 | #We'll target 1.21, if it works on 1.20.6 then *cool* 6 | minecraftVersion =1.21 -------------------------------------------------------------------------------- /spigot/1.21/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeatherComputer/AdvancedBackups/01d74672e44b67ceb5e4bd0a18b861ebe0bfcaf0/spigot/1.21/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /spigot/1.21/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /spigot/1.21/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'spigot-1.21' 2 | -------------------------------------------------------------------------------- /spigot/1.21/src/main/java/computer/heather/AdvancedBackups/network/PacketListener.java: -------------------------------------------------------------------------------- 1 | package computer.heather.AdvancedBackups.network; 2 | 3 | import org.bukkit.entity.Player; 4 | import org.bukkit.plugin.messaging.PluginMessageListener; 5 | 6 | import computer.heather.advancedbackups.core.ABCore; 7 | import computer.heather.AdvancedBackups.AdvancedBackups; 8 | 9 | public class PacketListener implements PluginMessageListener { 10 | 11 | @Override 12 | public void onPluginMessageReceived(String channel, Player player, byte[] message) { 13 | String uuid = player.getUniqueId().toString(); 14 | Boolean subscribe = message[0] != 0; 15 | ABCore.infoLogger.accept("Player has chosen to " + (subscribe ? "accept" : "reject") + " progress updates."); 16 | 17 | if (!AdvancedBackups.players.contains(uuid) && subscribe) { 18 | AdvancedBackups.players.add(uuid); 19 | } 20 | else if (!subscribe) { 21 | AdvancedBackups.players.remove(uuid); 22 | } 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /spigot/1.21/src/main/resources/plugin.yml: -------------------------------------------------------------------------------- 1 | name: AdvancedBackups 2 | version: ${version} 3 | api-version: '1.21' 4 | main: computer.heather.AdvancedBackups.AdvancedBackups 5 | commands: 6 | backup: 7 | description: Commands for Advanced Backups. 8 | usage: /backup start | reload-config | reload-client-config | snapshot | reset-chain 9 | permission: advancedbackups.backup --------------------------------------------------------------------------------