mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-02 06:28:49 +00:00
fixed NPE 🤦
reformat code using standard IntelliJ code style scheme RedisEconomy stable version
This commit is contained in:
1 parent
69e1a5e083
commit
ee7b6dc77c
4 files changed
+12
-11
No files matched your search
+1
-1
@@ -5,7 +5,7 @@ dependencies {
|
||||
implementation 'io.papermc:paperlib:1.0.7'
|
||||
implementation 'me.lucko:commodore:2.2'
|
||||
implementation 'net.kyori:adventure-platform-bukkit:4.1.2'
|
||||
implementation 'com.github.Emibergo02:RedisEconomy:master-SNAPSHOT'
|
||||
implementation 'com.github.Emibergo02:RedisEconomy:1.0-SNAPSHOT'
|
||||
|
||||
compileOnly 'org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT'
|
||||
compileOnly 'org.jetbrains:annotations:23.0.0'
|
||||
|
||||
@@ -174,10 +174,10 @@ public class BukkitHuskHomes extends JavaPlugin implements HuskHomes {
|
||||
|
||||
// Register plugin hooks (Economy, Maps, Plan)
|
||||
this.pluginHooks = new HashSet<>();
|
||||
if(settings.economy)
|
||||
if (settings.economy)
|
||||
if (Bukkit.getPluginManager().getPlugin("RedisEconomy") != null) {
|
||||
pluginHooks.add(new RedisEconomyHook(this));
|
||||
}else if (Bukkit.getPluginManager().getPlugin("Vault") != null) {
|
||||
} else if (Bukkit.getPluginManager().getPlugin("Vault") != null) {
|
||||
pluginHooks.add(new VaultEconomyHook(this));
|
||||
}
|
||||
if (settings.doMapHook) {
|
||||
|
||||
@@ -15,11 +15,12 @@ public class RedisEconomyHook extends VaultEconomyHook {
|
||||
|
||||
@Override
|
||||
public boolean initialize() throws HuskHomesInitializationException {
|
||||
RedisEconomyAPI api=RedisEconomyAPI.getAPI();
|
||||
if(api!=null){
|
||||
economy=api.getCurrencyByName(plugin.getSettings().currencyName);
|
||||
return true;
|
||||
}else
|
||||
return super.initialize();
|
||||
RedisEconomyAPI api = RedisEconomyAPI.getAPI();
|
||||
if (api != null) {
|
||||
economy = api.getCurrencyByName(plugin.getSettings().redis_economy_name);
|
||||
if (economy != null)
|
||||
return true;
|
||||
}
|
||||
return super.initialize();
|
||||
}
|
||||
}
|
||||
@@ -216,8 +216,8 @@ public class Settings {
|
||||
public boolean economy = false;
|
||||
|
||||
@YamlComment("Use this currency for payments (works only with RedisEconomy), defaults to Vault currency")
|
||||
@YamlKey("economy.currency")
|
||||
public String currencyName="vault";
|
||||
@YamlKey("economy.currency_name")
|
||||
public String redis_economy_name = "vault";
|
||||
|
||||
@YamlKey("economy.free_home_slots")
|
||||
public int freeHomeSlots = 5;
|
||||
|
||||
Reference in new issue
Block a user