Skip to content

Ocean wildlife spawns instead of MythicMobs LEGACY random spawns - #26

Merged
XxFran10xX merged 5 commits into
mainfrom
feat/ocean-wildlife
Nov 22, 2026
Merged

XxFran10xX merged 5 commits into
mainfrom
feat/ocean-wildlife

Conversation

@XxFran10xX

@XxFran10xX XxFran10xX commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Status record

  • Reviewed: Fable 5.2 (medium) APPROVE at 86f0b3b, 5 minor findings; 3 fixed in 21fb6c4 (columns out of reach of the player skipped; a spawn another plugin cancelled is not counted and spends no cooldown; a rule with an unknown Mythic mob is skipped until the next reload), 2 left (see below). Settings-to-config change (21fb6c4..538810b): Fable 5.2 (medium) APPROVE, 4 minors; 2 fixed in a5357ac (reach checked at the chosen spawn block; biome read at the default depth again), 2 left (absurd sweep-seconds overflow, non-numeric level: malformed config only)
  • Second opinion: CodeRabbit asked once at 13:30 UTC, did not review ("Head commit changed"); instead a fresh Opus 5.5 (medium) on the final diff: APPROVE at a5357ac, 4 minors; 1 fixed in 1abb0c0 (entity types that can't be spawned, e.g. PLAYER, are rejected at load), 3 left (see below)
  • Dev-tested: PASS at 1abb0c0 for the change since a5357ac (bundled 11 rules load; a PLAYER rule is skipped with a warning on /infestation reload). PASS at a5357ac for the change since 21fb6c4 (load line Wildlife on: 11 rules, worlds [TFMC_Map]; default kinds still spawn every 10 s at Y 61; squid with below-surface: 6 at Y 57; sweep-seconds: 5 removed them within 9 s of leaving; /infestation reload applies a changed wildlife.yml live; no errors). Earlier: PASS at 21fb6c4 (TFMCDev01 with MythicMobs Generator: NONE and OceanAnimals.yml emptied; bot ~/mmgen-test/wildlife-test.js over deep ocean at 264,3352): one spawn every 10 s per player, 8 kinds (cod, squid, manta, oarfish, jellyfish, shark, orca, salmon) at Y 61, each kind's 30 s cooldown held, at most 5 aquatic mobs near the bot; none left 30 s after the bot moved away (ocean chunks kept loaded); no spawns inland; Dev allocation 0.13 GB/s with two players at sea (LEGACY: 0.95 GB/s with one); no Infestations errors
  • Local tests: passed at 1abb0c0 (mvn verify, 253 tests, 100% line coverage gate)

Why

Main's ambient sea creatures come from MythicMobs' LEGACY random-spawn generator (randomspawns/OceanAnimals.yml). A spark allocation profile on 2026-11-22 showed it makes about 90% of all heap allocation on Main (about 1 GB/s), with 2 players as with 34, and it keeps G1 running back-to-back marking cycles all day. Decompiled (MythicMobs 5.13.1): every tick, for every player, it copies the player's whole chunk (100 sections) on every try until its point quotas are met, and its Air quota can never be met, so it always runs to MaxGenerationTime. On Dev with one bot: 0.95 GB/s with the generator, 0.03 GB/s without. Tuning it does not help (MaxGenerationTime 5 → 1 saved about 13%). Vanilla mob spawning is off (doMobSpawning false), so the creatures, including the vanilla fish, exist only through this generator.

Changes

  • New wildlife module (WildlifeService, WildlifeConfig, WildlifeRule) with its own wildlife.yml, independent of infestations, provinces and rewards.
  • Every 10 s each player in survival or adventure gets one try. It samples up to 12 random columns in a 24–64 block ring, only in loaded chunks. Each sample uses two height maps (world surface and ocean floor), one block read and one biome read. A column whose top block is water picks a fitting rule (biome, height band, water depth) and spawns one creature 2 blocks under the surface (1 block above the floor in shallower water).
  • Rules mirror OceanAnimals.yml: the six MythicMobs mobs and the five vanilla fish, with the same biomes, the Y 50–64 band, a 30 s server-wide cooldown per kind and the same "at most N within R blocks" limits. A player cap (6 within 64 blocks) keeps the total down. chance per rule allows thinning them out.
  • No leaks. Creatures are tagged (infestations:wildlife = rule id), marked non-persistent (never saved with their chunk), and removed when no player is within 96 blocks (checked every 10 s, only over the creatures this service spawned). Plugin disable removes them too.
  • Everything is tunable in wildlife.yml: interval, ring, attempts, caps, despawn distance, sweep-seconds, and per rule the creature, biomes, height band, depth, below-surface, chance, cooldown, nearby limit and MythicMobs level. Loading logs Wildlife on: N rules, worlds [...].
  • A wildlife.yml that fails to load turns wildlife off; broken rules are skipped with a warning (reload reports config errors).
  • README: feature line.

Deployment (not part of this PR; needs its own go)

On Main, with this jar: set MythicMobs config-spawning.yml Generator: NONE and remove the ADD entries from randomspawns/OceanAnimals.yml, so the old generator never runs alongside this. Tutorial does not run Infestations and does not need ocean wildlife.

Left alone from review

  • wildlife.yml ships enabled: true: on purpose, the Main deployment sets MythicMobs Generator: NONE in the same restart, and Tutorial does not run Infestations.

  • MythicMobs child entities or persistent despawn: checked, the six mobs are Persistent: false, Despawn: true and summon nothing.

  • Vanilla fish can still be despawned by vanilla when far from the player (its own despawn ranges), using up that kind's cooldown: same 64-block spawn radius as the old MythicMobs spawns, so no change.

  • Spawns in loaded but not entity-ticking chunks: Main's simulation distance is 6 chunks (96 blocks), beyond the 64-block ring.

  • sweep-seconds overflow and non-numeric level: only with absurd or malformed values.

Tests

  • WildlifeConfigTest: rule parsing, defaults, clamps, rejected rules, bundled defaults, malformed file.
  • WildlifeServiceTest: start/stop, eligibility, per-player interval, skipped columns (unloaded, dry, too shallow, wrong biome), player cap, cooldown, per-kind limit, chance, MythicMobs and vanilla spawns (including unknown and failed spawns), sweep removal.
  • Lifecycle test checks the new bundled file.

🤖 Generated with Claude Code

…pawns

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Explain Change →

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e1049626-b325-4c97-9f1c-c7a1ef35ba51
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions github-actions Bot added the size:L 100-499 effective changed lines (tests excluded in mixed PRs). label Nov 22, 2026
XxFran10xX and others added 2 commits November 22, 2026 13:58
…he world, skip unknown Mythic mobs until reload

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ife.yml; log the wildlife settings on load

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@XxFran10xX
XxFran10xX marked this pull request as ready for review November 22, 2026 13:30
@XxFran10xX

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Action not completed

Head commit changed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

XxFran10xX and others added 2 commits November 22, 2026 14:32
… the default depth

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@XxFran10xX
XxFran10xX merged commit e9ebfe5 into main Nov 22, 2026
3 checks passed
@XxFran10xX
XxFran10xX deleted the feat/ocean-wildlife branch November 22, 2026 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 effective changed lines (tests excluded in mixed PRs).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant