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

Added 'none' spawn method

This commit is contained in:
Auxilor
2023-11-12 13:26:53 +00:00
parent 88729b226b
commit e15366e1b2
3 changed files with 38 additions and 0 deletions

View File

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

View File

@@ -0,0 +1,33 @@
package com.willfp.ecomobs.category.spawning.impl
import com.willfp.eco.core.EcoPlugin
import com.willfp.eco.core.config.interfaces.Config
import com.willfp.eco.core.entities.Entities
import com.willfp.ecomobs.category.MobCategory
import com.willfp.ecomobs.category.spawning.SpawnMethod
import com.willfp.ecomobs.category.spawning.SpawnMethodFactory
import com.willfp.ecomobs.mob.SpawnReason
import com.willfp.libreforge.enumValueOfOrNull
import org.bukkit.entity.EntityType
import org.bukkit.event.EventHandler
import org.bukkit.event.EventPriority
import org.bukkit.event.Listener
import org.bukkit.event.entity.CreatureSpawnEvent
object SpawnMethodFactoryNone : SpawnMethodFactory("replace") {
override fun create(category: MobCategory, config: Config, plugin: EcoPlugin): SpawnMethod {
return SpawnMethodNone(category, config, plugin)
}
class SpawnMethodNone(
category: MobCategory, config: Config, plugin: EcoPlugin
) : SpawnMethod(category, config, plugin) {
override fun onStart() {
}
override fun onStop() {
}
}
}

View File

@@ -14,6 +14,9 @@ spawning:
# custom
# Uses the EcoMobs spawning system.
# none
# Disables natural spawning
type: replace
# Options for replace spawning