Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: HorizonsEndMC/Ion
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: d6c7e18203a4e04662cc08df80e135b87cb0327c
Choose a base ref
..
head repository: HorizonsEndMC/Ion
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 02572d59ac010d8cb3ec9c2319c95f55565f16e4
Choose a head ref
Showing with 2 additions and 2 deletions.
  1. +2 −2 ...er/src/main/kotlin/net/horizonsend/ion/server/features/world/environment/mobs/CustomMobSpawner.kt
Original file line number Diff line number Diff line change
@@ -21,14 +21,14 @@ class CustomMobSpawner(val world: IonWorld, mobs: List<WorldSettings.SpawnedMob>
if (event.entity !is Monster) return
if (event.entity.persistentDataContainer.get(CUSTOM_ENTITY, BOOLEAN) == true) return

event.isCancelled = true

val location = event.location

val mob = mobs.weightedRandomOrNull { it.spawningWeight } ?: return

if (!mob.function.get()) return

event.isCancelled = true

val name = mob.namePool.entries.weightedRandomOrNull { it.value }

world.world.spawnEntity(location, mob.getEntityType(), CreatureSpawnEvent.SpawnReason.NATURAL) { entity ->