mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-04 22:16:22 +00:00
Remove RedisEconomy hook due to instability (#447)
This commit is contained in:
1 parent
c3b37d87b7
commit
377e46ff92
10 files changed
+2
-68
No files matched your search
@@ -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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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/
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in new issue
Block a user