mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-24 00:26:16 +02:00
Rewriten how dependency is handled
This commit is contained in:
parent
b512d8f732
commit
aad9974baf
10 changed files with 56 additions and 19 deletions
|
|
@ -0,0 +1,29 @@
|
|||
package xyz.alexcrea.cuanvil.dependency
|
||||
|
||||
import org.bukkit.Bukkit
|
||||
import xyz.alexcrea.cuanvil.dependency.protocolib.NoProtocoLib
|
||||
import xyz.alexcrea.cuanvil.dependency.protocolib.PacketManager
|
||||
import xyz.alexcrea.cuanvil.dependency.protocolib.ProtocoLibWrapper
|
||||
|
||||
object DependencyManager {
|
||||
|
||||
lateinit var packetManager: PacketManager
|
||||
var enchantmentSquaredCompatibility: EnchantmentSquaredDependency? = null;
|
||||
|
||||
fun loadDependency(){
|
||||
val pluginManager = Bukkit.getPluginManager();
|
||||
|
||||
// ProtocolLib dependency
|
||||
packetManager =
|
||||
if(pluginManager.isPluginEnabled("ProtocolLib")) ProtocoLibWrapper();
|
||||
else NoProtocoLib();
|
||||
|
||||
// Enchantment Squared dependency
|
||||
enchantmentSquaredCompatibility =
|
||||
if(pluginManager.isPluginEnabled("EnchantsSquared")) EnchantmentSquaredDependency()
|
||||
else null
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue