MythicMobs integration uses apiHelper where possible
This commit is contained in:
@@ -8,17 +8,18 @@ import io.lumine.xikage.mythicmobs.MythicMobs
|
|||||||
class CustomEntitiesMythicMobs : CustomEntitiesWrapper {
|
class CustomEntitiesMythicMobs : CustomEntitiesWrapper {
|
||||||
override fun registerAllEntities() {
|
override fun registerAllEntities() {
|
||||||
val mobManager = MythicMobs.inst().mobManager
|
val mobManager = MythicMobs.inst().mobManager
|
||||||
|
val api = MythicMobs.inst().apiHelper
|
||||||
|
|
||||||
for (id in mobManager.mobNames) {
|
for (id in mobManager.mobNames) {
|
||||||
val key = NamespacedKeyUtils.create("mythicmobs", id.lowercase())
|
val key = NamespacedKeyUtils.create("mythicmobs", id.lowercase())
|
||||||
CustomEntity(
|
CustomEntity(
|
||||||
key,
|
key,
|
||||||
{
|
{
|
||||||
val entityId = mobManager.getMythicMobInstance(it)?.type?.entityType ?: return@CustomEntity false
|
val entityId = api.getMythicMobInstance(it)?.type?.entityType ?: return@CustomEntity false
|
||||||
entityId.equals(id, ignoreCase = true)
|
entityId.equals(id, ignoreCase = true)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
MythicMobs.inst().apiHelper.spawnMythicMob(id, it)
|
api.spawnMythicMob(id, it)
|
||||||
}
|
}
|
||||||
).register()
|
).register()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user