Moved LivingServer duck interface to core package
parent
1141c3500a
commit
d28123aacc
|
@ -1,4 +1,4 @@
|
||||||
package net.szum123321.textile_backup;
|
package net.szum123321.textile_backup.core;
|
||||||
|
|
||||||
public interface LivingServer {
|
public interface LivingServer {
|
||||||
boolean isAlive();
|
boolean isAlive();
|
|
@ -19,7 +19,7 @@
|
||||||
package net.szum123321.textile_backup.mixin;
|
package net.szum123321.textile_backup.mixin;
|
||||||
|
|
||||||
import net.minecraft.server.MinecraftServer;
|
import net.minecraft.server.MinecraftServer;
|
||||||
import net.szum123321.textile_backup.LivingServer;
|
import net.szum123321.textile_backup.core.LivingServer;
|
||||||
import net.szum123321.textile_backup.TextileBackup;
|
import net.szum123321.textile_backup.TextileBackup;
|
||||||
import net.szum123321.textile_backup.core.create.BackupContext;
|
import net.szum123321.textile_backup.core.create.BackupContext;
|
||||||
import net.szum123321.textile_backup.core.create.BackupHelper;
|
import net.szum123321.textile_backup.core.create.BackupHelper;
|
||||||
|
@ -34,16 +34,17 @@ public class MinecraftServerMixin implements LivingServer {
|
||||||
|
|
||||||
@Inject(method = "shutdown", at = @At(value = "INVOKE_ASSIGN", target = "Lnet/minecraft/server/MinecraftServer;save(ZZZ)Z"))
|
@Inject(method = "shutdown", at = @At(value = "INVOKE_ASSIGN", target = "Lnet/minecraft/server/MinecraftServer;save(ZZZ)Z"))
|
||||||
public void onFinalWorldSave(CallbackInfo ci) {
|
public void onFinalWorldSave(CallbackInfo ci) {
|
||||||
if (TextileBackup.CONFIG.shutdownBackup && TextileBackup.globalShutdownBackupFlag.get())
|
if (TextileBackup.CONFIG.shutdownBackup && TextileBackup.globalShutdownBackupFlag.get()) {
|
||||||
TextileBackup.executorService.submit(
|
TextileBackup.executorService.submit(
|
||||||
BackupHelper.create(
|
BackupHelper.create(
|
||||||
new BackupContext.Builder()
|
new BackupContext.Builder()
|
||||||
.setServer((MinecraftServer)(Object) this)
|
.setServer((MinecraftServer) (Object) this)
|
||||||
.setInitiator(BackupContext.BackupInitiator.Shutdown)
|
.setInitiator(BackupContext.BackupInitiator.Shutdown)
|
||||||
.setComment("shutdown")
|
.setComment("shutdown")
|
||||||
.build()
|
.build()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
isAlive = false;
|
isAlive = false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue