diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecomobs/category/spawning/SpawnMethodFactories.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecomobs/category/spawning/SpawnMethodFactories.kt index 95036ed..b1a6d85 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecomobs/category/spawning/SpawnMethodFactories.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecomobs/category/spawning/SpawnMethodFactories.kt @@ -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() { init { - register(SpawnMethodFactoryNatural) + register(SpawnMethodFactoryReplace) } } diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecomobs/category/spawning/impl/SpawnMethodFactoryNatural.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecomobs/category/spawning/impl/SpawnMethodFactoryReplace.kt similarity index 90% rename from eco-core/core-plugin/src/main/kotlin/com/willfp/ecomobs/category/spawning/impl/SpawnMethodFactoryNatural.kt rename to eco-core/core-plugin/src/main/kotlin/com/willfp/ecomobs/category/spawning/impl/SpawnMethodFactoryReplace.kt index d530fe2..0170eba 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecomobs/category/spawning/impl/SpawnMethodFactoryNatural.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecomobs/category/spawning/impl/SpawnMethodFactoryReplace.kt @@ -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) } } } diff --git a/eco-core/core-plugin/src/main/resources/categories/_example.yml b/eco-core/core-plugin/src/main/resources/categories/_example.yml index a600c21..c7a22b0 100644 --- a/eco-core/core-plugin/src/main/resources/categories/_example.yml +++ b/eco-core/core-plugin/src/main/resources/categories/_example.yml @@ -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