mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-03 06:28:54 +00:00
Reduce redundancy, remove some reflection
This commit is contained in:
1 parent
18c6fd7e2b
commit
3a69d0d74b
7 files changed
+38
-95
No files matched your search
@@ -139,13 +139,13 @@ public final class CarbonChatBukkit extends JavaPlugin implements CarbonChat {
|
||||
if (storageType == CarbonSettings.StorageType.MYSQL) {
|
||||
this.logger().info("Enabling MySQL storage!");
|
||||
final SQLCredentials credentials = this.carbonSettings().sqlCredentials();
|
||||
this.userService = new MySQLUserService<>(BukkitChatUser.class, this, credentials, supplier);
|
||||
this.userService = new MySQLUserService<>(this, credentials, supplier, BukkitChatUser::new);
|
||||
} else if (storageType == CarbonSettings.StorageType.JSON) {
|
||||
this.logger().info("Enabling JSON storage!");
|
||||
this.userService = new JSONUserService<>(BukkitChatUser.class, this, supplier);
|
||||
this.userService = new JSONUserService<>(BukkitChatUser.class, this, supplier, BukkitChatUser::new);
|
||||
} else {
|
||||
this.logger().error("Invalid storage type selected! Falling back to JSON.");
|
||||
this.userService = new JSONUserService<>(BukkitChatUser.class, this, supplier);
|
||||
this.userService = new JSONUserService<>(BukkitChatUser.class, this, supplier, BukkitChatUser::new);
|
||||
}
|
||||
|
||||
// Setup listeners
|
||||
|
||||
Reference in new issue
Block a user