mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-12-28 20:17:55 +01:00
Set mongodb uuid representation (#3324)
This commit is contained in:
parent
4bdcca6566
commit
8ed63159ce
@ -68,6 +68,7 @@ import net.luckperms.api.node.Node;
|
||||
import net.luckperms.api.node.NodeBuilder;
|
||||
|
||||
import org.bson.Document;
|
||||
import org.bson.UuidRepresentation;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.ArrayList;
|
||||
@ -111,8 +112,11 @@ public class MongoStorage implements StorageImplementation {
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
MongoClientOptions.Builder options = MongoClientOptions.builder()
|
||||
.uuidRepresentation(UuidRepresentation.JAVA_LEGACY);
|
||||
|
||||
if (!Strings.isNullOrEmpty(this.connectionUri)) {
|
||||
this.mongoClient = new MongoClient(new MongoClientURI(this.connectionUri));
|
||||
this.mongoClient = new MongoClient(new MongoClientURI(this.connectionUri, options));
|
||||
} else {
|
||||
MongoCredential credential = null;
|
||||
if (!Strings.isNullOrEmpty(this.configuration.getUsername())) {
|
||||
@ -129,9 +133,9 @@ public class MongoStorage implements StorageImplementation {
|
||||
ServerAddress address = new ServerAddress(host, port);
|
||||
|
||||
if (credential == null) {
|
||||
this.mongoClient = new MongoClient(address);
|
||||
this.mongoClient = new MongoClient(address, options.build());
|
||||
} else {
|
||||
this.mongoClient = new MongoClient(address, credential, MongoClientOptions.builder().build());
|
||||
this.mongoClient = new MongoClient(address, credential, options.build());
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user