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
+10 -76

No files matched your search

-1
View File
@@ -13,7 +13,6 @@ dependencies {
compileOnly 'net.william278:Annotaml:2.0.1' compileOnly 'net.william278:Annotaml:2.0.1'
compileOnly 'net.william278:DesertWell:2.0.4' compileOnly 'net.william278:DesertWell:2.0.4'
compileOnly 'com.github.MilkBowl:VaultAPI:1.7.1' compileOnly 'com.github.MilkBowl:VaultAPI:1.7.1'
compileOnly 'com.github.Emibergo02:RedisEconomy:3.4-SNAPSHOT'
compileOnly 'me.clip:placeholderapi:2.11.3' compileOnly 'me.clip:placeholderapi:2.11.3'
compileOnly 'net.essentialsx:EssentialsX:2.20.0' compileOnly 'net.essentialsx:EssentialsX:2.20.0'
@@ -35,7 +35,6 @@ import net.william278.huskhomes.database.SqLiteDatabase;
import net.william278.huskhomes.event.BukkitEventDispatcher; import net.william278.huskhomes.event.BukkitEventDispatcher;
import net.william278.huskhomes.hook.Hook; import net.william278.huskhomes.hook.Hook;
import net.william278.huskhomes.hook.PlaceholderAPIHook; import net.william278.huskhomes.hook.PlaceholderAPIHook;
import net.william278.huskhomes.hook.RedisEconomyHook;
import net.william278.huskhomes.hook.VaultEconomyHook; import net.william278.huskhomes.hook.VaultEconomyHook;
import net.william278.huskhomes.importer.EssentialsXImporter; import net.william278.huskhomes.importer.EssentialsXImporter;
import net.william278.huskhomes.listener.BukkitEventListener; import net.william278.huskhomes.listener.BukkitEventListener;
@@ -218,13 +217,9 @@ public class BukkitHuskHomes extends JavaPlugin implements HuskHomes, BukkitTask
HuskHomes.super.registerHooks(); HuskHomes.super.registerHooks();
// Hooks // Hooks
if (getSettings().doEconomy()) { if (getSettings().doEconomy() && isDependencyLoaded("Vault")) {
if (isDependencyLoaded("RedisEconomy")) {
getHooks().add(new RedisEconomyHook(this));
} else if (isDependencyLoaded("Vault")) {
getHooks().add(new VaultEconomyHook(this)); getHooks().add(new VaultEconomyHook(this));
} }
}
if (isDependencyLoaded("PlaceholderAPI")) { if (isDependencyLoaded("PlaceholderAPI")) {
getHooks().add(new PlaceholderAPIHook(this)); 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();
}
}
+8 -9
View File
@@ -7,7 +7,6 @@ version: '${version}'
api-version: '1.16' api-version: '1.16'
softdepend: softdepend:
- Vault - Vault
- RedisEconomy
- PlaceholderAPI - PlaceholderAPI
- dynmap - dynmap
- BlueMap - BlueMap
@@ -25,44 +24,44 @@ commands:
usage: /<command> <name> usage: /<command> <name>
homelist: homelist:
usage: /<command> [player] [page] usage: /<command> [player] [page]
aliases: [homes] aliases: [ homes ]
delhome: delhome:
usage: /<command> <name> usage: /<command> <name>
edithome: edithome:
usage: /<command> <name> [rename|description|relocate|privacy] [args] usage: /<command> <name> [rename|description|relocate|privacy] [args]
phome: phome:
usage: /<command> [<owner_name>.<home_name>] usage: /<command> [<owner_name>.<home_name>]
aliases: [publichome] aliases: [ publichome ]
phomelist: phomelist:
usage: /<command> [page] usage: /<command> [page]
aliases: [publichomelist, phomes] aliases: [ publichomelist, phomes ]
warp: warp:
usage: /<command> <name> usage: /<command> <name>
setwarp: setwarp:
usage: /<command> <name> usage: /<command> <name>
warplist: warplist:
usage: /<command> [page] usage: /<command> [page]
aliases: [warps] aliases: [ warps ]
delwarp: delwarp:
usage: /<command> <name> usage: /<command> <name>
editwarp: editwarp:
usage: /<command> <name> [rename|description|relocate] [args] usage: /<command> <name> [rename|description|relocate] [args]
tp: tp:
usage: /<command> <target> [destination] usage: /<command> <target> [destination]
aliases: [tpo] aliases: [ tpo ]
tphere: tphere:
usage: /<command> <player> usage: /<command> <player>
aliases: [tpohere] aliases: [ tpohere ]
tpa: tpa:
usage: /<command> <player> usage: /<command> <player>
tpahere: tpahere:
usage: /<command> <player> usage: /<command> <player>
tpaccept: tpaccept:
usage: /<command> [player] usage: /<command> [player]
aliases: [tpyes] aliases: [ tpyes ]
tpdecline: tpdecline:
usage: /<command> [player] usage: /<command> [player]
aliases: [tpdeny, tpno] aliases: [ tpdeny, tpno ]
rtp: rtp:
usage: /<command> [player] [world] usage: /<command> [player] [world]
tpignore: tpignore:
@@ -271,10 +271,6 @@ public class Settings {
@YamlKey("economy.enabled") @YamlKey("economy.enabled")
private boolean economy = false; private boolean economy = false;
@YamlComment("Use this currency for payments (works only with RedisEconomy), defaults to Vault currency")
@YamlKey("economy.redis_economy_name")
private String redisEconomyName = "vault";
@YamlComment("Specify how many homes players can set for free, before they need to pay for more slots") @YamlComment("Specify how many homes players can set for free, before they need to pay for more slots")
@YamlKey("economy.free_home_slots") @YamlKey("economy.free_home_slots")
private int freeHomeSlots = 5; private int freeHomeSlots = 5;
@@ -536,10 +532,6 @@ public class Settings {
return economy; return economy;
} }
public String getRedisEconomyName() {
return redisEconomyName;
}
public int getFreeHomeSlots() { public int getFreeHomeSlots() {
return freeHomeSlots; return freeHomeSlots;
} }
@@ -28,7 +28,6 @@ import java.time.Duration;
import java.time.Instant; import java.time.Instant;
import java.util.Optional; import java.util.Optional;
import java.util.StringJoiner; import java.util.StringJoiner;
import java.util.logging.Level;
/** /**
* Class for validating and performing economy and cooldown transactions involving {@link Action}s * Class for validating and performing economy and cooldown transactions involving {@link Action}s
-2
View File
@@ -136,8 +136,6 @@ cooldowns:
economy: economy:
# Enable economy plugin integration (requires Vault) # Enable economy plugin integration (requires Vault)
enabled: false enabled: false
# Use this currency for payments (works only with RedisEconomy), defaults to Vault currency
redis_economy_name: vault
# Specify how many homes players can set for free, before they need to pay for more slots # Specify how many homes players can set for free, before they need to pay for more slots
free_home_slots: 5 free_home_slots: 5
# Charge money for perform certain actions. Docs: https://william278.net/docs/huskhomes/economy-hook/ # Charge money for perform certain actions. Docs: https://william278.net/docs/huskhomes/economy-hook/
+1 -1
View File
@@ -6,7 +6,7 @@ HuskHomes supports restricting certain actions behind an economic cost. Players
> **Applies to:** Spigot, Paper > **Applies to:** Spigot, Paper
To enable the Economy Hook on Sponge server, install both [Vault](https://www.spigotmc.org/resources/vault.34315/) and a compatible economy plugin. Extended support for [RedisEconomy](https://github.com/Emibergo02/RedisEconomy) is also provided, and the `redis_economy_name` setting can be used to specify the currency to use for transactions. Then, set `enabled` to `true` under the `economy` section of [`config.yml`](config-files). To enable the Economy Hook on Sponge server, install both [Vault](https://www.spigotmc.org/resources/vault.34315/) and a compatible economy plugin. Then, set `enabled` to `true` under the `economy` section of [`config.yml`](config-files).
</details> </details>
<details> <details>
-1
View File
@@ -15,7 +15,6 @@ dependencies {
compileOnly 'net.william278:DesertWell:2.0.4' compileOnly 'net.william278:DesertWell:2.0.4'
compileOnly 'me.lucko:commodore:2.2' compileOnly 'me.lucko:commodore:2.2'
compileOnly 'com.github.MilkBowl:VaultAPI:1.7.1' compileOnly 'com.github.MilkBowl:VaultAPI:1.7.1'
compileOnly 'com.github.Emibergo02:RedisEconomy:3.4-SNAPSHOT'
compileOnly 'me.clip:placeholderapi:2.11.3' compileOnly 'me.clip:placeholderapi:2.11.3'
} }
@@ -13,10 +13,6 @@ dependencies:
load: BEFORE load: BEFORE
required: false required: false
join-classpath: true join-classpath: true
RedisEconomy:
load: BEFORE
required: false
join-classpath: true
PlaceholderAPI: PlaceholderAPI:
load: BEFORE load: BEFORE
required: false required: false