put it in the right place

This commit is contained in:
Leijurv 2018-08-23 14:40:42 -07:00
parent b3189721a6
commit 559bc46702
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A

View File

@ -53,6 +53,7 @@ public enum WorldProvider implements Helper {
public final void initWorld(WorldClient world) { public final void initWorld(WorldClient world) {
int dimensionID = world.provider.getDimensionType().getId(); int dimensionID = world.provider.getDimensionType().getId();
File directory; File directory;
File readme;
IntegratedServer integratedServer = mc.getIntegratedServer(); IntegratedServer integratedServer = mc.getIntegratedServer();
if (integratedServer != null) { if (integratedServer != null) {
WorldServer localServerWorld = integratedServer.getWorld(dimensionID); WorldServer localServerWorld = integratedServer.getWorld(dimensionID);
@ -66,16 +67,19 @@ public enum WorldProvider implements Helper {
} }
directory = new File(directory, "baritone"); directory = new File(directory, "baritone");
readme = directory;
} else { } else {
//remote //remote
directory = new File(Baritone.INSTANCE.getDir(), mc.getCurrentServerData().serverIP); directory = new File(Baritone.INSTANCE.getDir(), mc.getCurrentServerData().serverIP);
readme = Baritone.INSTANCE.getDir();
} }
// lol wtf is this baritone folder in my minecraft? // lol wtf is this baritone folder in my minecraft save?
try (FileOutputStream out = new FileOutputStream(new File(directory, "readme.txt"))) { try (FileOutputStream out = new FileOutputStream(new File(readme, "readme.txt"))) {
// good thing we have a readme // good thing we have a readme
out.write("https://github.com/cabaletta/baritone\n".getBytes()); out.write("https://github.com/cabaletta/baritone\n".getBytes());
} catch (IOException ex) {} } catch (IOException ex) {}
directory = new File(directory, "DIM" + dimensionID); directory = new File(directory, "DIM" + dimensionID);
Path dir = directory.toPath(); Path dir = directory.toPath();
if (!Files.exists(dir)) { if (!Files.exists(dir)) {