-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed: singlePlayer backups do not independent
- Loading branch information
1 parent
3dcf220
commit f5721d1
Showing
11 changed files
with
137 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 0 additions & 39 deletions
39
src/main/java/dev/skydynamic/quickbackupmulti/mixin/MinecraftServerMixin.java
This file was deleted.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
src/main/java/dev/skydynamic/quickbackupmulti/mixin/MinecraftServer_ClientMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package dev.skydynamic.quickbackupmulti.mixin; | ||
|
||
import dev.skydynamic.quickbackupmulti.utils.config.Config; | ||
import net.fabricmc.api.EnvType; | ||
import net.fabricmc.api.Environment; | ||
import net.minecraft.server.MinecraftServer; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
import java.nio.file.Path; | ||
|
||
import static dev.skydynamic.quickbackupmulti.utils.QbmManager.createBackupDir; | ||
|
||
@Environment(EnvType.CLIENT) | ||
@Mixin(MinecraftServer.class) | ||
public abstract class MinecraftServer_ClientMixin { | ||
|
||
@Inject(method = "loadWorld", at = @At("RETURN")) | ||
private void initQuickBackupMultiClient(CallbackInfo ci) { | ||
MinecraftServer server = (MinecraftServer) (Object) this; | ||
Config.TEMP_CONFIG.setServerValue(server); | ||
String worldName = server.getSaveProperties().getLevelName(); | ||
Config.TEMP_CONFIG.setWorldName(worldName); | ||
Path backupDir = Path.of(System.getProperty("user.dir") + "/QuickBackupMulti/").resolve(worldName); | ||
createBackupDir(backupDir); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
src/main/java/dev/skydynamic/quickbackupmulti/mixin/MinecraftServer_ServerMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package dev.skydynamic.quickbackupmulti.mixin; | ||
|
||
import net.fabricmc.api.Environment; | ||
import net.fabricmc.api.EnvType; | ||
import net.minecraft.server.MinecraftServer; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
import java.nio.file.Path; | ||
|
||
import static dev.skydynamic.quickbackupmulti.utils.QbmManager.createBackupDir; | ||
|
||
@Environment(EnvType.SERVER) | ||
@Mixin(MinecraftServer.class) | ||
public abstract class MinecraftServer_ServerMixin { | ||
@Inject(method = "loadWorld", at = @At("RETURN")) | ||
private void initQuickBackupMulti(CallbackInfo ci) { | ||
Path backupDir = Path.of(System.getProperty("user.dir") + "/QuickBackupMulti/"); | ||
createBackupDir(backupDir); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.