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

-1
View File
@@ -13,7 +13,6 @@ dependencies {
compileOnly 'net.william278:Annotaml:2.0.1'
compileOnly 'net.william278:DesertWell:2.0.4'
compileOnly 'com.github.MilkBowl:VaultAPI:1.7.1'
compileOnly 'com.github.Emibergo02:RedisEconomy:3.4-SNAPSHOT'
compileOnly 'me.clip:placeholderapi:2.11.3'
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.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();
}
}
+8 -9
View File
@@ -7,7 +7,6 @@ version: '${version}'
api-version: '1.16'
softdepend:
- Vault
- RedisEconomy
- PlaceholderAPI
- dynmap
- BlueMap
@@ -25,44 +24,44 @@ commands:
usage: /<command> <name>
homelist:
usage: /<command> [player] [page]
aliases: [homes]
aliases: [ homes ]
delhome:
usage: /<command> <name>
edithome:
usage: /<command> <name> [rename|description|relocate|privacy] [args]
phome:
usage: /<command> [<owner_name>.<home_name>]
aliases: [publichome]
aliases: [ publichome ]
phomelist:
usage: /<command> [page]
aliases: [publichomelist, phomes]
aliases: [ publichomelist, phomes ]
warp:
usage: /<command> <name>
setwarp:
usage: /<command> <name>
warplist:
usage: /<command> [page]
aliases: [warps]
aliases: [ warps ]
delwarp:
usage: /<command> <name>
editwarp:
usage: /<command> <name> [rename|description|relocate] [args]
tp:
usage: /<command> <target> [destination]
aliases: [tpo]
aliases: [ tpo ]
tphere:
usage: /<command> <player>
aliases: [tpohere]
aliases: [ tpohere ]
tpa:
usage: /<command> <player>
tpahere:
usage: /<command> <player>
tpaccept:
usage: /<command> [player]
aliases: [tpyes]
aliases: [ tpyes ]
tpdecline:
usage: /<command> [player]
aliases: [tpdeny, tpno]
aliases: [ tpdeny, tpno ]
rtp:
usage: /<command> [player] [world]
tpignore:
@@ -271,10 +271,6 @@ public class Settings {
@YamlKey("economy.enabled")
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")
@YamlKey("economy.free_home_slots")
private int freeHomeSlots = 5;
@@ -536,10 +532,6 @@ public class Settings {
return economy;
}
public String getRedisEconomyName() {
return redisEconomyName;
}
public int getFreeHomeSlots() {
return freeHomeSlots;
}
@@ -28,7 +28,6 @@ import java.time.Duration;
import java.time.Instant;
import java.util.Optional;
import java.util.StringJoiner;
import java.util.logging.Level;
/**
* Class for validating and performing economy and cooldown transactions involving {@link Action}s
-2
View File
@@ -136,8 +136,6 @@ cooldowns:
economy:
# Enable economy plugin integration (requires Vault)
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
free_home_slots: 5
# 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
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>
-1
View File
@@ -15,7 +15,6 @@ dependencies {
compileOnly 'net.william278:DesertWell:2.0.4'
compileOnly 'me.lucko:commodore:2.2'
compileOnly 'com.github.MilkBowl:VaultAPI:1.7.1'
compileOnly 'com.github.Emibergo02:RedisEconomy:3.4-SNAPSHOT'
compileOnly 'me.clip:placeholderapi:2.11.3'
}
@@ -13,10 +13,6 @@ dependencies:
load: BEFORE
required: false
join-classpath: true
RedisEconomy:
load: BEFORE
required: false
join-classpath: true
PlaceholderAPI:
load: BEFORE
required: false