aboutsummaryrefslogtreecommitdiff
path: root/src/net/brysonsteck/Resurrection/player
diff options
context:
space:
mode:
authorBryson Steck <steck.bryson@gmail.com>2021-07-04 21:23:50 -0600
committerBryson Steck <steck.bryson@gmail.com>2021-07-04 21:23:50 -0600
commit6c39053bdf64ac130daee2bf3b44ce1c025b4dbd (patch)
treeb97f2291591e053490ee7c3470406d4581344ade /src/net/brysonsteck/Resurrection/player
parenta83fcc7f5206c6c2b07e7340b97d738f86f3f8c1 (diff)
downloadresurrection-6c39053bdf64ac130daee2bf3b44ce1c025b4dbd.tar
resurrection-6c39053bdf64ac130daee2bf3b44ce1c025b4dbd.tar.gz
resurrection-6c39053bdf64ac130daee2bf3b44ce1c025b4dbd.tar.bz2
fixed time formatting
Diffstat (limited to 'src/net/brysonsteck/Resurrection/player')
-rw-r--r--src/net/brysonsteck/Resurrection/player/PlayerData.java4
-rw-r--r--src/net/brysonsteck/Resurrection/player/TimeCheck.java4
2 files changed, 5 insertions, 3 deletions
diff --git a/src/net/brysonsteck/Resurrection/player/PlayerData.java b/src/net/brysonsteck/Resurrection/player/PlayerData.java
index 4201cb3..512c94f 100644
--- a/src/net/brysonsteck/Resurrection/player/PlayerData.java
+++ b/src/net/brysonsteck/Resurrection/player/PlayerData.java
@@ -13,7 +13,7 @@ public class PlayerData {
public void saveData(String write) {
try {
- FileWriter writer = new FileWriter("playerData.resurrection");
+ FileWriter writer = new FileWriter("plugins/playerData.resurrection");
writer.write(write);
writer.close();
} catch (IOException e) {
@@ -25,7 +25,7 @@ public class PlayerData {
public void readData() {
try {
rawData = "";
- BufferedReader reader = new BufferedReader(new FileReader("playerData.resurrection"));
+ BufferedReader reader = new BufferedReader(new FileReader("plugins/playerData.resurrection"));
String line = "";
String[] playerData;
while (true) {
diff --git a/src/net/brysonsteck/Resurrection/player/TimeCheck.java b/src/net/brysonsteck/Resurrection/player/TimeCheck.java
index f1cf004..dc989ea 100644
--- a/src/net/brysonsteck/Resurrection/player/TimeCheck.java
+++ b/src/net/brysonsteck/Resurrection/player/TimeCheck.java
@@ -10,9 +10,11 @@ public class TimeCheck {
}
public String formatTime() {
+ long hours = TimeUnit.MILLISECONDS.toHours(millis);
+
String formattedTime = String.format("%d hrs, %d min, %d sec",
TimeUnit.MILLISECONDS.toHours(millis),
- TimeUnit.MILLISECONDS.toMinutes(millis),
+ TimeUnit.MILLISECONDS.toMinutes(millis) - TimeUnit.HOURS.toMinutes(TimeUnit.MILLISECONDS.toHours(millis)),
TimeUnit.MILLISECONDS.toSeconds(millis) -
TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(millis)));
return formattedTime;