9
0
mirror of https://github.com/Auxilor/EcoMobs.git synced 2025-12-19 15:09:17 +00:00

Renamed natural to replace

This commit is contained in:
Auxilor
2023-11-11 17:39:07 +00:00
parent 3caa2d8a47
commit 88729b226b
3 changed files with 12 additions and 11 deletions

View File

@@ -1,10 +1,10 @@
package com.willfp.ecomobs.category.spawning
import com.willfp.eco.core.registry.Registry
import com.willfp.ecomobs.category.spawning.impl.SpawnMethodFactoryNatural
import com.willfp.ecomobs.category.spawning.impl.SpawnMethodFactoryReplace
object SpawnMethodFactories : Registry<SpawnMethodFactory>() {
init {
register(SpawnMethodFactoryNatural)
register(SpawnMethodFactoryReplace)
}
}

View File

@@ -14,12 +14,12 @@ import org.bukkit.event.EventPriority
import org.bukkit.event.Listener
import org.bukkit.event.entity.CreatureSpawnEvent
object SpawnMethodFactoryNatural : SpawnMethodFactory("natural") {
object SpawnMethodFactoryReplace : SpawnMethodFactory("replace") {
override fun create(category: MobCategory, config: Config, plugin: EcoPlugin): SpawnMethod {
return SpawnMethodNormal(category, config, plugin)
return SpawnMethodReplace(category, config, plugin)
}
class SpawnMethodNormal(
class SpawnMethodReplace(
category: MobCategory,
config: Config,
plugin: EcoPlugin
@@ -53,9 +53,9 @@ object SpawnMethodFactoryNatural : SpawnMethodFactory("natural") {
val mob = category.mobs.randomOrNull() ?: return
mob.spawn(event.entity.location, SpawnReason.NATURAL)
event.isCancelled = true
event.entity.remove()
mob.spawn(event.entity.location, SpawnReason.NATURAL)
}
}
}

View File

@@ -7,16 +7,17 @@
spawning:
# Available methods:
# natural
# replace
# Uses the vanilla spawning system to spawn the mob, by replacing
# the vanilla mob with the custom mob when it spawns.
# custom
# Uses the EcoMobs spawning system.
type: natural
# Options for natural spawning
natural:
type: replace
# Options for replace spawning
replace:
# The vanilla mobs to replace
replace:
- zombie