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

View File

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

View File

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