From e56fab3f3c18d98d0eaa0fa5ebc09b8647419edc Mon Sep 17 00:00:00 2001 From: Smorki Date: Tue, 11 Aug 2026 19:42:56 +0300 Subject: [PATCH] Fix infinite recursion in ZStorageManager.getType() --- .../fr/maxlego08/essentials/storage/ZStorageManager.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/fr/maxlego08/essentials/storage/ZStorageManager.java b/src/main/java/fr/maxlego08/essentials/storage/ZStorageManager.java index 63155876..51c806e1 100644 --- a/src/main/java/fr/maxlego08/essentials/storage/ZStorageManager.java +++ b/src/main/java/fr/maxlego08/essentials/storage/ZStorageManager.java @@ -27,12 +27,13 @@ public class ZStorageManager extends ZUtils implements StorageManager { private final IStorage iStorage; private final EssentialsPlugin plugin; + private final StorageType storageType; public ZStorageManager(EssentialsPlugin plugin) { this.plugin = plugin; - StorageType storageType = plugin.getConfiguration().getStorageType(); - this.iStorage = switch (storageType) { - case HIKARICP, SQLITE, MYSQL, MARIADB -> new SqlStorage(plugin, storageType); + this.storageType = plugin.getConfiguration().getStorageType(); + this.iStorage = switch (this.storageType) { + case HIKARICP, SQLITE, MYSQL, MARIADB -> new SqlStorage(plugin, this.storageType); default -> new JsonStorage(plugin); }; } @@ -56,7 +57,7 @@ public IStorage getStorage() { @Override public StorageType getType() { - return this.plugin.getStorageManager().getType(); + return this.storageType; } @EventHandler(priority = EventPriority.HIGHEST)