From 578f3d1151ffb97d4a991ee1580207d9f3995090 Mon Sep 17 00:00:00 2001 From: Qekly Date: Sun, 28 Jan 2024 23:58:53 -0300 Subject: [PATCH] chore: modify some logs and invert storage type check --- plugin/src/main/java/com/aivruu/homes/HomesPlugin.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/plugin/src/main/java/com/aivruu/homes/HomesPlugin.java b/plugin/src/main/java/com/aivruu/homes/HomesPlugin.java index 6799c5e..e77120c 100644 --- a/plugin/src/main/java/com/aivruu/homes/HomesPlugin.java +++ b/plugin/src/main/java/com/aivruu/homes/HomesPlugin.java @@ -34,8 +34,8 @@ public final class HomesPlugin extends JavaPlugin implements Homes { public void onLoad() { Provider.load(this); this.logger = getComponentLogger(); - this.logger.info(ComponentUtils.parse("Prepare plugin internal components, loading service models.")); - this.logger.info(ComponentUtils.parse("Loading service manager.")); + this.logger.info(ComponentUtils.parse("Prepare plugin internal components.")); + this.logger.info(ComponentUtils.parse("Loading configuration models.")); final Path pluginFolder = this.getDataFolder().toPath(); final ValueObjectConfigResult configStatus = ValueObjectConfigManager.INSTANCE.loadConfig(pluginFolder); final ValueObjectConfigResult messageStatus = ValueObjectConfigManager.INSTANCE.loadMessages(pluginFolder); @@ -49,12 +49,14 @@ public void onLoad() { this.repository = new PlayerModelRepository(); this.homeAggregate = new HomeAggregate(this.repository); this.homeTeleportManager = new HomeTeleportManager(this.homeAggregate); - if (!this.config.dataFormat.equals("JSON")) { + if (this.config.dataFormat.equals("JSON")) { this.data = new JsonModelData(this.getDataFolder(), this.config); + this.logger.info(ComponentUtils.parse("JSON storage initialized.")); } else if (this.config.dataFormat.equals("MONGODB")) { this.data = new MongoDBModelData(); + this.logger.info(ComponentUtils.parse("MongoDB storage initialized.")); } else { - this.logger.error(ComponentUtils.parse("Unknown storage type detected in configuration. Illegal type ", Placeholder.parsed("data-type", this.config.dataFormat))); + this.logger.error(ComponentUtils.parse("Unknown storage type detected in configuration. Illegal type ''", Placeholder.parsed("data-type", this.config.dataFormat))); this.setEnabled(false); } }