mirror of
https://github.com/Auxilor/EcoBits.git
synced 2025-12-20 15:39:29 +00:00
Improved vault
This commit is contained in:
@@ -1,8 +1,11 @@
|
|||||||
package com.willfp.ecobits
|
package com.willfp.ecobits
|
||||||
|
|
||||||
|
import com.sun.tools.javac.jvm.ByteCodes.ret
|
||||||
import com.willfp.eco.core.EcoPlugin
|
import com.willfp.eco.core.EcoPlugin
|
||||||
import com.willfp.eco.core.command.impl.PluginCommand
|
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.commands.CommandEcoBits
|
||||||
|
import com.willfp.ecobits.integrations.IntegrationVault
|
||||||
import org.bukkit.event.Listener
|
import org.bukkit.event.Listener
|
||||||
|
|
||||||
class EcoBitsPlugin : EcoPlugin() {
|
class EcoBitsPlugin : EcoPlugin() {
|
||||||
@@ -20,6 +23,12 @@ class EcoBitsPlugin : EcoPlugin() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun loadIntegrationLoaders(): List<IntegrationLoader> {
|
||||||
|
return listOf(
|
||||||
|
IntegrationLoader("Vault") { IntegrationVault.isVaultPresent = true }
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
lateinit var instance: EcoBitsPlugin
|
lateinit var instance: EcoBitsPlugin
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ class Currency(
|
|||||||
|
|
||||||
Prices.registerPriceFactory(PriceFactoryCurrency(this))
|
Prices.registerPriceFactory(PriceFactoryCurrency(this))
|
||||||
|
|
||||||
if (isRegisteredWithVault) {
|
if (isRegisteredWithVault && IntegrationVault.isVaultPresent) {
|
||||||
Bukkit.getServer().servicesManager.register(
|
Bukkit.getServer().servicesManager.register(
|
||||||
Economy::class.java,
|
Economy::class.java,
|
||||||
IntegrationVault(this),
|
IntegrationVault(this),
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import net.milkbowl.vault.economy.Economy
|
|||||||
import net.milkbowl.vault.economy.EconomyResponse
|
import net.milkbowl.vault.economy.EconomyResponse
|
||||||
import org.bukkit.Bukkit
|
import org.bukkit.Bukkit
|
||||||
import org.bukkit.OfflinePlayer
|
import org.bukkit.OfflinePlayer
|
||||||
import java.math.BigDecimal
|
|
||||||
|
|
||||||
@Suppress("DEPRECATION")
|
@Suppress("DEPRECATION")
|
||||||
class IntegrationVault(
|
class IntegrationVault(
|
||||||
@@ -337,4 +336,9 @@ class IntegrationVault(
|
|||||||
override fun getBanks(): MutableList<String> {
|
override fun getBanks(): MutableList<String> {
|
||||||
return mutableListOf()
|
return mutableListOf()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
var isVaultPresent: Boolean = false
|
||||||
|
internal set
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,5 +21,4 @@ currencies:
|
|||||||
max: -1 # The maximum balance, set to -1 if no max.
|
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
|
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
|
decimal: true # If decimal amounts are allowed rather than just integer amounts
|
||||||
|
vault: false # If this currency should be registered with vault
|
||||||
vault: true # If this currency should be registered with vault
|
|
||||||
|
|||||||
Reference in New Issue
Block a user