|
|
|
@ -20,21 +20,12 @@ object BMData {
|
|
|
|
|
|
|
|
|
|
fun begin() {
|
|
|
|
|
stop()
|
|
|
|
|
println(Config.enabledMobs)
|
|
|
|
|
Config.world.entities.forEach { en ->
|
|
|
|
|
if (!Config.enabledMobs.contains(en.type.toString().toUpperCase())) {
|
|
|
|
|
if (!Config.enabledMobs.contains(en.type.toString().toUpperCase()) || en !is LivingEntity) {
|
|
|
|
|
return@forEach
|
|
|
|
|
}
|
|
|
|
|
en.remove()
|
|
|
|
|
val blood = en.world.spawnEntity(en.location, EntityType.ZOMBIE).apply {
|
|
|
|
|
(this as Zombie).isBaby = true
|
|
|
|
|
customName = "§cBlood ${en.name}"
|
|
|
|
|
isCustomNameVisible = true
|
|
|
|
|
}
|
|
|
|
|
val disguise = MobDisguise(DisguiseType.valueOf(en.type.name))
|
|
|
|
|
disguise.entity = blood
|
|
|
|
|
disguise.startDisguise()
|
|
|
|
|
transformed[disguise] = en as LivingEntity
|
|
|
|
|
if (en.customName != null) return@forEach
|
|
|
|
|
animalSpawn(en)
|
|
|
|
|
}
|
|
|
|
|
if (Config.chargedCreepers) Config.world.entities.filter { it is Creeper }.forEach {
|
|
|
|
|
(it as Creeper).isPowered = true
|
|
|
|
@ -50,7 +41,6 @@ object BMData {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fun stop() {
|
|
|
|
|
println("stopping...")
|
|
|
|
|
running = false
|
|
|
|
|
transformed.forEach { (d, e) ->
|
|
|
|
|
d.entity.remove()
|
|
|
|
@ -64,4 +54,17 @@ object BMData {
|
|
|
|
|
creepers.forEach { it.isPowered = false }
|
|
|
|
|
creepers.clear()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fun animalSpawn(en: LivingEntity) {
|
|
|
|
|
en.remove()
|
|
|
|
|
val blood = en.world.spawnEntity(en.location, EntityType.ZOMBIE).apply {
|
|
|
|
|
(this as Zombie).isBaby = true
|
|
|
|
|
customName = Config.bloodAnimalName.replace("%t%", en.name).c
|
|
|
|
|
isCustomNameVisible = true
|
|
|
|
|
}
|
|
|
|
|
val disguise = MobDisguise(DisguiseType.valueOf(en.type.name))
|
|
|
|
|
disguise.entity = blood
|
|
|
|
|
disguise.startDisguise()
|
|
|
|
|
transformed[disguise] = en
|
|
|
|
|
}
|
|
|
|
|
}
|