Remove RedisEconomy hook due to instability (#447)

This commit is contained in:
William authored and GitHub committed 2023-06-28 12:29:17 +01:00
1 parent c3b37d87b7
commit 377e46ff92
10 files changed
+11 -77

No files matched your search

@@ -35,7 +35,6 @@ import net.william278.huskhomes.database.SqLiteDatabase;
import net.william278.huskhomes.event.BukkitEventDispatcher;
import net.william278.huskhomes.hook.Hook;
import net.william278.huskhomes.hook.PlaceholderAPIHook;
import net.william278.huskhomes.hook.RedisEconomyHook;
import net.william278.huskhomes.hook.VaultEconomyHook;
import net.william278.huskhomes.importer.EssentialsXImporter;
import net.william278.huskhomes.listener.BukkitEventListener;
@@ -218,12 +217,8 @@ public class BukkitHuskHomes extends JavaPlugin implements HuskHomes, BukkitTask
HuskHomes.super.registerHooks();
// Hooks
if (getSettings().doEconomy()) {
if (isDependencyLoaded("RedisEconomy")) {
getHooks().add(new RedisEconomyHook(this));
} else if (isDependencyLoaded("Vault")) {
getHooks().add(new VaultEconomyHook(this));
}
if (getSettings().doEconomy() && isDependencyLoaded("Vault")) {
getHooks().add(new VaultEconomyHook(this));
}
if (isDependencyLoaded("PlaceholderAPI")) {
getHooks().add(new PlaceholderAPIHook(this));
@@ -1,43 +0,0 @@
/*
* This file is part of HuskHomes, licensed under the Apache License 2.0.
*
* Copyright (c) William278 <[email protected]>
* Copyright (c) contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.william278.huskhomes.hook;
import dev.unnm3d.rediseconomy.api.RedisEconomyAPI;
import net.william278.huskhomes.HuskHomes;
import org.jetbrains.annotations.NotNull;
public class RedisEconomyHook extends VaultEconomyHook {
public RedisEconomyHook(@NotNull HuskHomes plugin) {
super(plugin);
}
@Override
public void initialize() {
RedisEconomyAPI api = RedisEconomyAPI.getAPI();
if (api != null && !plugin.getSettings().getRedisEconomyName().equalsIgnoreCase("vault")) {
economy = api.getCurrencyByName(plugin.getSettings().getRedisEconomyName());
if (economy != null) {
return;
}
}
super.initialize();
}
}