Reduce redundancy, remove some reflection

This commit is contained in:
Draycia committed 2020-09-25 01:45:35 -07:00
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