9
0
mirror of https://github.com/Auxilor/EcoBits.git synced 2025-12-19 15:09:19 +00:00

Improved vault

This commit is contained in:
Auxilor
2022-11-21 20:29:25 +00:00
parent c581620954
commit 7a67713a9d
4 changed files with 16 additions and 4 deletions

View File

@@ -1,8 +1,11 @@
package com.willfp.ecobits
import com.sun.tools.javac.jvm.ByteCodes.ret
import com.willfp.eco.core.EcoPlugin
import com.willfp.eco.core.command.impl.PluginCommand
import com.willfp.eco.core.integrations.IntegrationLoader
import com.willfp.ecobits.commands.CommandEcoBits
import com.willfp.ecobits.integrations.IntegrationVault
import org.bukkit.event.Listener
class EcoBitsPlugin : EcoPlugin() {
@@ -20,6 +23,12 @@ class EcoBitsPlugin : EcoPlugin() {
)
}
override fun loadIntegrationLoaders(): List<IntegrationLoader> {
return listOf(
IntegrationLoader("Vault") { IntegrationVault.isVaultPresent = true }
)
}
companion object {
@JvmStatic
lateinit var instance: EcoBitsPlugin

View File

@@ -83,7 +83,7 @@ class Currency(
Prices.registerPriceFactory(PriceFactoryCurrency(this))
if (isRegisteredWithVault) {
if (isRegisteredWithVault && IntegrationVault.isVaultPresent) {
Bukkit.getServer().servicesManager.register(
Economy::class.java,
IntegrationVault(this),

View File

@@ -8,7 +8,6 @@ import net.milkbowl.vault.economy.Economy
import net.milkbowl.vault.economy.EconomyResponse
import org.bukkit.Bukkit
import org.bukkit.OfflinePlayer
import java.math.BigDecimal
@Suppress("DEPRECATION")
class IntegrationVault(
@@ -337,4 +336,9 @@ class IntegrationVault(
override fun getBanks(): MutableList<String> {
return mutableListOf()
}
companion object {
var isVaultPresent: Boolean = false
internal set
}
}

View File

@@ -21,5 +21,4 @@ currencies:
max: -1 # The maximum balance, set to -1 if no max.
payable: false # If players should be able to use /ecobits pay to pay other players
decimal: true # If decimal amounts are allowed rather than just integer amounts
vault: true # If this currency should be registered with vault
vault: false # If this currency should be registered with vault