mirror of
https://github.com/Auxilor/EcoMobs.git
synced 2025-12-20 07:29:21 +00:00
Renamed natural to replace
This commit is contained in:
@@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user