Skip to content

Commit

Permalink
Fix /backup start counting as auto when ran from console
Browse files Browse the repository at this point in the history
  • Loading branch information
Lyfts committed Feb 6, 2024
1 parent a926c41 commit 10a945c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/main/java/serverutils/backups/Backups.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import net.minecraft.client.Minecraft;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.server.MinecraftServer;
import net.minecraft.world.WorldServer;

Expand Down Expand Up @@ -36,7 +35,7 @@ public static void init() {

public static boolean run(ICommandSender ics, String customName) {
if (thread != null) return false;
boolean auto = !(ics instanceof EntityPlayerMP);
boolean auto = ics == null;

if (auto && !ServerUtilitiesConfig.backups.enable_backups) return false;

Expand All @@ -47,7 +46,7 @@ public static boolean run(ICommandSender ics, String customName) {
if (!hasOnlinePlayers() && !hadPlayer) return true;
hadPlayer = false;
}
ServerUtilitiesNotifications.backupNotification(BACKUP_START, "cmd.backup_start", ics.getCommandSenderName());
ServerUtilitiesNotifications.backupNotification(BACKUP_START, "cmd.backup_start");

try {
for (int i = 0; i < server.worldServers.length; ++i) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public void onServerTick(TickEvent.ServerTickEvent event) {
}

if (Backups.nextBackup > 0L && Backups.nextBackup <= now) {
Backups.run(universe.server, "");
Backups.run(null, "");
}

if (Backups.thread != null && Backups.thread.isDone) {
Expand Down

0 comments on commit 10a945c

Please sign in to comment.