mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-08-28 08:25:56 +02:00
This commit is contained in:
parent
d18ee56ff1
commit
ab47a9df93
3 changed files with 11 additions and 5 deletions
|
|
@ -42,6 +42,7 @@ object DependencyManager {
|
|||
|
||||
var enchantmentSquaredCompatibility: EnchantmentSquaredDependency? = null
|
||||
var ecoEnchantCompatibility: EcoEnchantDependency? = null
|
||||
var hasEcoItem: Boolean = false
|
||||
var excellentEnchantsCompatibility: ExcellentEnchantsDependency? = null
|
||||
|
||||
var disenchantmentCompatibility: DisenchantmentDependency? = null
|
||||
|
|
@ -78,6 +79,10 @@ object DependencyManager {
|
|||
ecoEnchantCompatibility = EcoEnchantDependency(pluginManager.getPlugin("EcoEnchants")!!)
|
||||
ecoEnchantCompatibility!!.disableAnvilListener()
|
||||
}
|
||||
// EcoItem check
|
||||
if (pluginManager.isPluginEnabled("EcoItems")) {
|
||||
hasEcoItem = true
|
||||
}
|
||||
|
||||
// Excellent Enchants dependency
|
||||
if (pluginManager.isPluginEnabled("ExcellentEnchants")) {
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ object MaterialUtil {
|
|||
|
||||
val ItemStack.customType: NamespacedKey
|
||||
get() {
|
||||
if(DependencyManager.ecoEnchantCompatibility != null) {
|
||||
if(DependencyManager.hasEcoItem) {
|
||||
val result = EcoItemDependencyUtil.ecoItemNamespace(this)
|
||||
if(result != null) return result
|
||||
}
|
||||
|
|
@ -43,7 +43,7 @@ object MaterialUtil {
|
|||
|
||||
@Nullable
|
||||
fun getMatFromKey(key: NamespacedKey): Material? {
|
||||
if(DependencyManager.ecoEnchantCompatibility != null) {
|
||||
if(DependencyManager.hasEcoItem) {
|
||||
val result = EcoItemDependencyUtil.ecoItemMaterialFromKey(key)
|
||||
if(result != null) return result
|
||||
}
|
||||
|
|
@ -58,7 +58,7 @@ object MaterialUtil {
|
|||
}
|
||||
|
||||
fun itemFromKey(key: NamespacedKey): ItemStack {
|
||||
if(DependencyManager.ecoEnchantCompatibility != null) {
|
||||
if(DependencyManager.hasEcoItem) {
|
||||
val result = EcoItemDependencyUtil.newEcoItemstack(key)
|
||||
if(result != null) return result
|
||||
}
|
||||
|
|
@ -78,7 +78,7 @@ object MaterialUtil {
|
|||
|
||||
fun getMaterialCount(): Int {
|
||||
var count = Material.entries.size
|
||||
if(DependencyManager.ecoEnchantCompatibility != null) {
|
||||
if(DependencyManager.hasEcoItem) {
|
||||
count += EcoItemDependencyUtil.getItems().size
|
||||
}
|
||||
|
||||
|
|
@ -92,7 +92,7 @@ object MaterialUtil {
|
|||
|
||||
fun getMaterials(): MutableList<NamespacedKey> {
|
||||
val all = ArrayList(Material.entries.map { it.key })
|
||||
if(DependencyManager.ecoEnchantCompatibility != null) {
|
||||
if(DependencyManager.hasEcoItem) {
|
||||
all.addAll(EcoItemDependencyUtil.getItems())
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue