9
0
mirror of https://github.com/Auxilor/EcoMobs.git synced 2025-12-20 15:39:31 +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 package com.willfp.ecomobs.category.spawning
import com.willfp.eco.core.registry.Registry 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>() { object SpawnMethodFactories : Registry<SpawnMethodFactory>() {
init { 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.Listener
import org.bukkit.event.entity.CreatureSpawnEvent import org.bukkit.event.entity.CreatureSpawnEvent
object SpawnMethodFactoryNatural : SpawnMethodFactory("natural") { object SpawnMethodFactoryReplace : SpawnMethodFactory("replace") {
override fun create(category: MobCategory, config: Config, plugin: EcoPlugin): SpawnMethod { 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, category: MobCategory,
config: Config, config: Config,
plugin: EcoPlugin plugin: EcoPlugin
@@ -53,9 +53,9 @@ object SpawnMethodFactoryNatural : SpawnMethodFactory("natural") {
val mob = category.mobs.randomOrNull() ?: return 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: spawning:
# Available methods: # Available methods:
# natural # replace
# Uses the vanilla spawning system to spawn the mob, by replacing # Uses the vanilla spawning system to spawn the mob, by replacing
# the vanilla mob with the custom mob when it spawns. # the vanilla mob with the custom mob when it spawns.
# custom # custom
# Uses the EcoMobs spawning system. # Uses the EcoMobs spawning system.
type: natural
# Options for natural spawning type: replace
natural:
# Options for replace spawning
replace:
# The vanilla mobs to replace # The vanilla mobs to replace
replace: replace:
- zombie - zombie