From fc05e4b17af7daa8a4c996c28ec0580a2d7d4f50 Mon Sep 17 00:00:00 2001 From: William Date: Mon, 10 Jun 2024 15:22:36 +0100 Subject: [PATCH] fix: only MySQL being supported on Fabric --- .../main/java/net/william278/husksync/FabricHuskSync.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/fabric/src/main/java/net/william278/husksync/FabricHuskSync.java b/fabric/src/main/java/net/william278/husksync/FabricHuskSync.java index 6bb4f5ae..e6a82452 100644 --- a/fabric/src/main/java/net/william278/husksync/FabricHuskSync.java +++ b/fabric/src/main/java/net/william278/husksync/FabricHuskSync.java @@ -47,7 +47,9 @@ import net.william278.husksync.config.Server; import net.william278.husksync.config.Settings; import net.william278.husksync.data.*; import net.william278.husksync.database.Database; +import net.william278.husksync.database.MongoDbDatabase; import net.william278.husksync.database.MySqlDatabase; +import net.william278.husksync.database.PostgresDatabase; import net.william278.husksync.event.FabricEventDispatcher; import net.william278.husksync.hook.PlanHook; import net.william278.husksync.listener.EventListener; @@ -169,7 +171,11 @@ public class FabricHuskSync implements DedicatedServerModInitializer, HuskSync, // Initialize the database initialize(getSettings().getDatabase().getType().getDisplayName() + " database connection", (plugin) -> { - this.database = new MySqlDatabase(this); + this.database = switch (settings.getDatabase().getType()) { + case MYSQL, MARIADB -> new MySqlDatabase(this); + case POSTGRES -> new PostgresDatabase(this); + case MONGO -> new MongoDbDatabase(this); + }; this.database.initialize(); });