This commit is contained in:
Bella 2020-02-18 10:17:54 -05:00
parent 8e1dd00a65
commit a8ede8925d
2 changed files with 36 additions and 2 deletions

View File

@ -53,8 +53,6 @@ public class KamiGUI extends GUI {
public static ColourHolder primaryColour = new ColourHolder(29, 29, 29);
//public static OperatingSystemMXBean bean = (com.sun.management.OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean();
public KamiGUI() {
super(new KamiTheme());
theme = getTheme();

View File

@ -0,0 +1,36 @@
package me.zeroeightsix.kami.util;
import net.minecraft.client.Minecraft;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
/**
* @author S-B99
* Created by S-B99 on 18/02/20
*/
public class LogUtil {
private static String COORDS_FILE_NAME = "KAMIBlueCoords.txt";
private static final File coordsFileName = new File(COORDS_FILE_NAME);
public static void writePlayerCoords(String locationName) {
Minecraft mc = Minecraft.getMinecraft();
writeTo((int) mc.player.posX, (int) mc.player.posY, (int) mc.player.posZ, locationName);
}
public static void writeTo(int x, int y, int z, String locationName) {
try {
FileWriter fw = new FileWriter(COORDS_FILE_NAME);
fw.write(formatter(x, y, z, locationName));
fw.close();
System.out.println("Successfully wrote to the file.");
} catch (IOException e) {
e.printStackTrace();
}
}
private static String formatter(int x, int y, int z, String locationName) {
return x + ", " + y + ", " + z + ", " + locationName + "\n";
}
}