forked from RepoMirrors/kami-blue
improved LogUtil
This commit is contained in:
parent
a4a8e1fa17
commit
e56e1c8cc4
|
@ -10,15 +10,25 @@ import java.io.IOException;
|
||||||
* Created by S-B99 on 18/02/20
|
* Created by S-B99 on 18/02/20
|
||||||
*/
|
*/
|
||||||
public class LogUtil {
|
public class LogUtil {
|
||||||
public static void writePlayerCoords(String locationName) {
|
public static int[] getCurrentCoord(boolean chunk) {
|
||||||
Minecraft mc = Minecraft.getMinecraft();
|
Minecraft mc = Minecraft.getMinecraft();
|
||||||
writeCoords((int) mc.player.posX, (int) mc.player.posY, (int) mc.player.posZ, locationName);
|
int[] currentCoords = {(int) mc.player.posX, (int) mc.player.posY, (int) mc.player.posZ};
|
||||||
|
if (chunk == true) {
|
||||||
|
int[] chunkCoords = {currentCoords[0]/16, currentCoords[1], currentCoords[2]/16}
|
||||||
|
return chunkCoords;
|
||||||
|
} else {
|
||||||
|
return currentCoords;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void writeCoords(int x, int y, int z, String locationName) {
|
public static void writePlayerCoords(String locationName, boolean chunk) {
|
||||||
|
writeCoords(getCurrentCoord(chunk), "chunk: " + chunk + ", " + locationName);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void writeCoords(int[] xyz, String locationName) {
|
||||||
try {
|
try {
|
||||||
FileWriter fW = new FileWriter("KAMIBlueCoords.txt", true);
|
FileWriter fW = new FileWriter("KAMIBlueCoords.txt", true);
|
||||||
fW.write(formatter(x, y, z, locationName));
|
fW.write(formatter(xyz[0], xyz[1], xyz[2], locationName));
|
||||||
fW.close();
|
fW.close();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
Loading…
Reference in New Issue