Skip to content

Commit

Permalink
Restored compatability with RB of Bukkit.
Browse files Browse the repository at this point in the history
  • Loading branch information
tgxn committed Sep 28, 2011
1 parent 8e23709 commit 0009e5f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Backup
version: 1.8.1-dev
version: 1.7.2-dev
description: CraftBukkit server Backup plugin.
authors: [Meldanor, gamerx]
main: backup.Main
Expand Down
2 changes: 1 addition & 1 deletion src/res/properties.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ singlebackup: true
## Internal Settings (Read: DO NOT EDIT) ##
###############################################

version: 1.8.1-dev
version: 1.7.2-dev
3 changes: 2 additions & 1 deletion src/threading/BackupTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

package threading;

import org.bukkit.command.ConsoleCommandSender;
import org.bukkit.plugin.Plugin;
import backup.Strings;
import java.io.FileNotFoundException;
Expand Down Expand Up @@ -235,7 +236,7 @@ private void finish() {
@Override
public void run () {
if (properties.getBooleanProp("enableautosave"))
server.dispatchCommand(server.getConsoleSender(), "save-on");
server.dispatchCommand(new ConsoleCommandSender(server), "save-on");
String completedBackupMessage = strings.getString("backupfinished");
if (completedBackupMessage != null && !completedBackupMessage.trim().isEmpty()) {
server.broadcastMessage(completedBackupMessage);
Expand Down
12 changes: 10 additions & 2 deletions src/threading/PrepareBackupTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import backup.Properties;
import backup.Strings;
import java.lang.reflect.Field;
import java.util.Arrays;
import java.util.LinkedList;
import org.bukkit.Server;
Expand Down Expand Up @@ -75,9 +76,15 @@ protected void prepareBackup() {
if (startBackupMessage != null && !startBackupMessage.trim().isEmpty()) {
server.broadcastMessage(startBackupMessage);
}


ConsoleCommandSender ccs;
// Compatible with dev build (more than 857)
//ccs = server.getConsoleSender();

// Compatable with RB. (less than 857)
ccs = new ConsoleCommandSender(server);

// Save to file, and then turn saving off.
ConsoleCommandSender ccs = server.getConsoleSender();
server.dispatchCommand(ccs, "save-all");
server.dispatchCommand(ccs, "save-off");

Expand Down Expand Up @@ -122,6 +129,7 @@ private String[] getToIgnoreWorlds () {
}
return worldNames;
}


public void setBackupName (String backupName) {
this.backupName = backupName;
Expand Down

2 comments on commit 0009e5f

@tgxn
Copy link
Owner Author

@tgxn tgxn commented on 0009e5f Sep 28, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// Compatible with dev build (more than 857)
//ccs = server.getConsoleSender();

// Compatable with RB. (less than 857)
//ccs = new ConsoleCommandSender(server);

How can we remedy this?

@lycano
Copy link

@lycano lycano commented on 0009e5f Sep 28, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well i do have an idea. Will check that today after work (GMT+1). After that ill push to dev =)

Please sign in to comment.