Fix rollback

This commit is contained in:
Jesse Boyd 2016-06-20 14:57:39 +10:00
parent 0d7c0474cc
commit 598928053d
2 changed files with 36 additions and 32 deletions

View File

@ -45,7 +45,7 @@ public class Rollback extends FaweCommand {
}
player.deleteMeta("rollback");
final FaweLocation origin = player.getLocation();
rollback(player, true, Arrays.copyOfRange(args, 1, args.length), new RunnableVal<List<DiskStorageHistory>>() {
rollback(player, !player.hasPermission("fawe.rollback.deep"), Arrays.copyOfRange(args, 1, args.length), new RunnableVal<List<DiskStorageHistory>>() {
@Override
public void run(List<DiskStorageHistory> edits) {
long total = 0;

View File

@ -271,6 +271,7 @@ public class DiskStorageHistory extends FaweStreamChangeSet {
if (summary != null) {
return summary;
}
try {
if (bdFile.exists()) {
int ox = getOriginX();
int oz = getOriginZ();
@ -293,8 +294,8 @@ public class DiskStorageHistory extends FaweStreamChangeSet {
}
byte[] buffer = new byte[9];
int i = 0;
while (!shallow && i < Settings.BUFFER_SIZE) {
i++;
int amount = (Settings.BUFFER_SIZE - HEADER_SIZE) / 9;
while (!shallow && ++i < amount) {
if (gis.read(buffer) == -1) {
fis.close();
gis.close();
@ -310,6 +311,9 @@ public class DiskStorageHistory extends FaweStreamChangeSet {
MainUtil.handleError(e);
}
}
} catch (Exception e) {
e.printStackTrace();
}
return summary;
}