integrate map directory

This commit is contained in:
Leijurv
2018-08-22 15:43:44 -07:00
parent 9746ed26be
commit b2e69efbf2
3 changed files with 22 additions and 20 deletions
@@ -31,6 +31,10 @@ public class WorldData {
this.waypoints = new Waypoints(directory.resolve("waypoints")); this.waypoints = new Waypoints(directory.resolve("waypoints"));
} }
public Path getMapDirectory() {
return directory.resolve("map");
}
void onClose() { void onClose() {
new Thread() { new Thread() {
public void run() { public void run() {
+2 -3
View File
@@ -1,14 +1,13 @@
package baritone.map; package baritone.map;
import baritone.Baritone;
import baritone.behavior.Behavior; import baritone.behavior.Behavior;
import baritone.chunk.WorldProvider;
import baritone.event.events.ChunkEvent; import baritone.event.events.ChunkEvent;
import net.minecraft.util.math.ChunkPos; import net.minecraft.util.math.ChunkPos;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;
import java.awt.*; import java.awt.*;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.Path; import java.nio.file.Path;
@@ -63,7 +62,7 @@ public class Map extends Behavior {
} }
public Path getImagePath() { public Path getImagePath() {
return new File(new File(Baritone.INSTANCE.getDir(), "map"), "full-map.png").toPath(); return WorldProvider.INSTANCE.getCurrentWorld().getMapDirectory().resolve("full-map.png");
} }
} }
+3 -4
View File
@@ -1,6 +1,6 @@
package baritone.map; package baritone.map;
import baritone.Baritone; import baritone.chunk.WorldProvider;
import baritone.utils.BlockStateInterface; import baritone.utils.BlockStateInterface;
import baritone.utils.pathing.BetterBlockPos; import baritone.utils.pathing.BetterBlockPos;
import net.minecraft.block.material.MapColor; import net.minecraft.block.material.MapColor;
@@ -12,7 +12,6 @@ import net.minecraft.world.chunk.Chunk;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;
import java.awt.*; import java.awt.*;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.Path; import java.nio.file.Path;
@@ -54,7 +53,7 @@ public class MapChunk {
} }
public Path getImagePath() { public Path getImagePath() {
return new File(new File(Baritone.INSTANCE.getDir(), "map"), "chunk" + chunk.x + "-" + chunk.z + ".png").toPath(); return WorldProvider.INSTANCE.getCurrentWorld().getMapDirectory().resolve("chunk" + chunk.x + "-" + chunk.z + ".png");
} }
public Chunk getChunk() { public Chunk getChunk() {
@@ -65,7 +64,7 @@ public class MapChunk {
* getColor is a re-implementation of the Minecraft ItemMap's * getColor is a re-implementation of the Minecraft ItemMap's
* surface mapping system. This is significantly less convoluted * surface mapping system. This is significantly less convoluted
* than the poorly de-obfuscated code. * than the poorly de-obfuscated code.
* * <p>
* We perform shading of the given coordinate relative to the * We perform shading of the given coordinate relative to the
* position one to the north of the coordinate, as can be seen * position one to the north of the coordinate, as can be seen
* in Minecraft's maps. * in Minecraft's maps.