Fix rollback

inspect + y-value byte overflow
This commit is contained in:
Jesse Boyd 2016-08-28 01:06:09 +10:00
parent 5baa99ec80
commit ce140a95c7
3 changed files with 4 additions and 4 deletions

View File

@ -111,8 +111,7 @@ public class MainUtil {
}
}
public static long traverse(Path path, final RunnableVal2<Path, BasicFileAttributes> onEach) {
final AtomicLong size = new AtomicLong(0);
public static void traverse(Path path, final RunnableVal2<Path, BasicFileAttributes> onEach) {
try {
Files.walkFileTree(path, new SimpleFileVisitor<Path>() {
@Override public FileVisitResult
@ -133,7 +132,6 @@ public class MainUtil {
catch (IOException e) {
throw new AssertionError ("walkFileTree will not throw IOException if the FileVisitor does not");
}
return size.get();
}
public static File getFile(File base, String path) {

View File

@ -139,7 +139,9 @@ public class HistoryCommands {
World world = player.getWorld();
WorldVector origin = player.getPosition();
Vector bot = origin.subtract(radius, radius, radius);
bot.setY(Math.max(0, bot.getY()));
Vector top = origin.add(radius, radius, radius);
top.setY(Math.min(255, top.getY()));
RollbackDatabase database = DBHandler.IMP.getDatabase(world);
final AtomicInteger count = new AtomicInteger();
database.getPotentialEdits(other, System.currentTimeMillis() - timeDiff, bot, top, new RunnableVal<DiskStorageHistory>() {

View File

@ -52,7 +52,7 @@ public class ToolCommands {
}
@Command(
aliases = { "/inspect", "/i" },
aliases = { "inspect", "i" },
usage = "",
desc = "Inspect edits within a radius",
help =