Fix BackupCommand
Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
Ursprung
78defd65e6
Commit
2d16f7adee
@ -100,6 +100,9 @@ AUTOSTART_MESSAGE_RESULT2 = §eZeitdifferenz in ticks §7bis 60 Sekunden§8:§e
|
|||||||
AUTOSTART_MESSAGE_RESULT3 = §7Positiv, wenn zu wenig, negativ wenn zu viel
|
AUTOSTART_MESSAGE_RESULT3 = §7Positiv, wenn zu wenig, negativ wenn zu viel
|
||||||
|
|
||||||
# Backup
|
# Backup
|
||||||
|
BACKUP_HELP_1=§7/backup create §8- §7Erstelle ein Backup der Region
|
||||||
|
BACKUP_HELP_2=§7/backup load §e[§7BackupName§e] §8- §7 Lade ein Backup
|
||||||
|
BACKUP_HELP_3=§7/backup list §8- §7Liste alle Backups der Region auf
|
||||||
BACKUP_REGION_NO_REGION=§cDu bist in keiner Region
|
BACKUP_REGION_NO_REGION=§cDu bist in keiner Region
|
||||||
BACKUP_NO_PERMS=§cDu darfst hier nicht das Backup System verwenden
|
BACKUP_NO_PERMS=§cDu darfst hier nicht das Backup System verwenden
|
||||||
BACKUP_CREATE_SUCCESS=§7Das Backup wurde erstellt
|
BACKUP_CREATE_SUCCESS=§7Das Backup wurde erstellt
|
||||||
|
@ -46,7 +46,9 @@ public class BackupCommand extends SWCommand {
|
|||||||
@Register(help = true)
|
@Register(help = true)
|
||||||
public void genericHelp(Player p, String... args) {
|
public void genericHelp(Player p, String... args) {
|
||||||
BauSystem.MESSAGE.sendPrefixless("COMMAND_HELP_HEAD", p, "Backup");
|
BauSystem.MESSAGE.sendPrefixless("COMMAND_HELP_HEAD", p, "Backup");
|
||||||
BauSystem.MESSAGE.sendPrefixless("DETONATOR_HELP_1", p);
|
BauSystem.MESSAGE.sendPrefixless("BACKUP_HELP_1", p);
|
||||||
|
BauSystem.MESSAGE.sendPrefixless("BACKUP_HELP_2", p);
|
||||||
|
BauSystem.MESSAGE.sendPrefixless("BACKUP_HELP_3", p);
|
||||||
}
|
}
|
||||||
|
|
||||||
static boolean checkGlobalRegion(Region region, Player p) {
|
static boolean checkGlobalRegion(Region region, Player p) {
|
||||||
@ -91,7 +93,7 @@ public class BackupCommand extends SWCommand {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
File backupFile = region.getBackupFile(backupName);
|
File backupFile = region.getBackupFile(backupName.replace('_', ' '));
|
||||||
if (backupFile == null) {
|
if (backupFile == null) {
|
||||||
BauSystem.MESSAGE.send("BACKUP_LOAD_FAILURE", p);
|
BauSystem.MESSAGE.send("BACKUP_LOAD_FAILURE", p);
|
||||||
return;
|
return;
|
||||||
@ -108,7 +110,7 @@ public class BackupCommand extends SWCommand {
|
|||||||
}
|
}
|
||||||
BauSystem.MESSAGE.send("BACKUP_LIST_HEAD", p);
|
BauSystem.MESSAGE.send("BACKUP_LIST_HEAD", p);
|
||||||
listBackup(p).forEach(s -> {
|
listBackup(p).forEach(s -> {
|
||||||
BauSystem.MESSAGE.send("BACKUP_LIST_ENTRY", p, "/backup load " + s, new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/backup load " + s), s);
|
BauSystem.MESSAGE.send("BACKUP_LIST_ENTRY", p, "/backup load " + s, new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/backup load " + s.replace('_', ' ')), s);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -123,7 +125,7 @@ public class BackupCommand extends SWCommand {
|
|||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
return region.listBackup().stream().map(s -> s.substring(0, s.length() - 6)).collect(Collectors.toList());
|
return region.listBackup().stream().map(s -> s.substring(0, s.length() - 6).replace(' ', '_')).collect(Collectors.toList());
|
||||||
} catch (NullPointerException e) {
|
} catch (NullPointerException e) {
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren