Skip to content

Commit a4cfc08

Browse files
committed
Update UserTable to replace Instant with Date fields and downgrade Minecraft version in runServer task
1 parent 10f2f98 commit a4cfc08

File tree

1 file changed

+7
-5
lines changed
  • eternalcore-core/src/main/java/com/eternalcode/core/user/database

1 file changed

+7
-5
lines changed

eternalcore-core/src/main/java/com/eternalcode/core/user/database/UserTable.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import com.j256.ormlite.field.DataType;
55
import com.j256.ormlite.field.DatabaseField;
66
import com.j256.ormlite.table.DatabaseTable;
7+
import java.util.Date;
78
import java.time.Instant;
89
import java.util.UUID;
910

@@ -17,26 +18,27 @@ class UserTable {
1718
private String name;
1819

1920
@DatabaseField(columnName = "last_seen", dataType = DataType.DATE_STRING)
20-
private Instant lastSeen;
21+
private Date lastSeen;
2122

2223
@DatabaseField(columnName = "account_created", dataType = DataType.DATE_STRING)
23-
private Instant accountCreated;
24+
private Date accountCreated;
2425

2526
UserTable() {
2627
}
2728

28-
UserTable(UUID uniqueId, String name, Instant lastSeen, Instant accountCreated) {
29+
UserTable(UUID uniqueId, String name, Date lastSeen, Date accountCreated) {
2930
this.uniqueId = uniqueId;
3031
this.name = name;
3132
this.lastSeen = lastSeen;
3233
this.accountCreated = accountCreated;
3334
}
3435

3536
User toUser() {
36-
return new User(this.uniqueId, this.name, this.lastSeen, this.accountCreated);
37+
return new User(this.uniqueId, this.name, this.lastSeen.toInstant(), this.accountCreated.toInstant());
3738
}
3839

3940
static UserTable from(User user) {
40-
return new UserTable(user.getUniqueId(), user.getName(), user.getLastSeen(), user.getAccountCreated());
41+
return new UserTable(user.getUniqueId(), user.getName(), Date.from(user.getLastSeen()),
42+
Date.from(user.getAccountCreated()));
4143
}
4244
}

0 commit comments

Comments
 (0)