diff options
author | Äkwav <16632490+Ekwav@users.noreply.github.com> | 2023-02-26 17:01:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-26 17:01:07 +0100 |
commit | 96eda0751f26e81d8788d62264dc74dd28358d66 (patch) | |
tree | 0849d793a630ed005c4b897de049384474d4861a /src/main/java/de/torui/coflsky/minecraft_integration | |
parent | 8f3bce7d6fe41e85f2654f7557bbb564305e58b5 (diff) | |
download | COFL-96eda0751f26e81d8788d62264dc74dd28358d66.tar.gz COFL-96eda0751f26e81d8788d62264dc74dd28358d66.tar.bz2 COFL-96eda0751f26e81d8788d62264dc74dd28358d66.zip |
fixed location, patched purse commands (#93)
* fixed location, patched purse commands
* revert chat format
* revert overlooked line
* bump session length
Diffstat (limited to 'src/main/java/de/torui/coflsky/minecraft_integration')
-rw-r--r-- | src/main/java/de/torui/coflsky/minecraft_integration/CoflSessionManager.java | 2 | ||||
-rw-r--r-- | src/main/java/de/torui/coflsky/minecraft_integration/PlayerDataProvider.java | 28 |
2 files changed, 25 insertions, 5 deletions
diff --git a/src/main/java/de/torui/coflsky/minecraft_integration/CoflSessionManager.java b/src/main/java/de/torui/coflsky/minecraft_integration/CoflSessionManager.java index cab0c15..9a4edea 100644 --- a/src/main/java/de/torui/coflsky/minecraft_integration/CoflSessionManager.java +++ b/src/main/java/de/torui/coflsky/minecraft_integration/CoflSessionManager.java @@ -86,7 +86,7 @@ public class CoflSessionManager { } public static boolean isValidSession(CoflSession session) { - if(session.timestampCreated.plus(Duration.ofDays(14)).isAfter(ZonedDateTime.now())) { + if(session.timestampCreated.plus(Duration.ofDays(180)).isAfter(ZonedDateTime.now())) { return true; } return false; diff --git a/src/main/java/de/torui/coflsky/minecraft_integration/PlayerDataProvider.java b/src/main/java/de/torui/coflsky/minecraft_integration/PlayerDataProvider.java index ede60ce..352aded 100644 --- a/src/main/java/de/torui/coflsky/minecraft_integration/PlayerDataProvider.java +++ b/src/main/java/de/torui/coflsky/minecraft_integration/PlayerDataProvider.java @@ -14,10 +14,20 @@ import net.minecraft.client.Minecraft; public class PlayerDataProvider { - private static class UUIDHelper { - public String id; - public String name; - } + private static class UUIDHelper { + public String id; + public String name; + } + + public static class PlayerPosition + { + public double X; + public double Y; + public double Z; + public float Yaw; + public float Pitch; + + } public static String getActivePlayerUUID() { try { @@ -65,5 +75,15 @@ public class PlayerDataProvider { String username = Minecraft.getSessionInfo().get("X-Minecraft-Username"); return username; } + + public static PlayerPosition getPlayerPosition() { + PlayerPosition pos = new PlayerPosition(); + pos.X = Minecraft.getMinecraft().thePlayer.posX; + pos.Y = Minecraft.getMinecraft().thePlayer.posY; + pos.Z = Minecraft.getMinecraft().thePlayer.posZ; + pos.Yaw = Minecraft.getMinecraft().thePlayer.rotationYaw; + pos.Pitch = Minecraft.getMinecraft().thePlayer.rotationPitch; + return pos; + } } |