Skip to content

Claude/farm zone management system m t hw3#26

Merged
Sharkblack3D merged 3 commits into
mainfrom
claude/farm-zone-management-system-mTHw3
Apr 18, 2026
Merged

Claude/farm zone management system m t hw3#26
Sharkblack3D merged 3 commits into
mainfrom
claude/farm-zone-management-system-mTHw3

Conversation

@Sharkblack3D
Copy link
Copy Markdown
Collaborator

No description provided.

claude added 3 commits April 17, 2026 21:53
Leaves and cobwebs have no collision box (isPassable() = true) but are
visually opaque. Mobs spawned at those Y positions appeared stuck inside
blocks. isPassable() now explicitly rejects them so findSafeLocation()
only picks positions with truly clear air for feet and head.

https://claude.ai/code/session_01QRahgKn43HbgkmDkQZCq9Z
Persistence: entity.setPersistent(true) is called immediately after each
MythicMobs spawn, preventing Minecraft from auto-despawning zone mobs
regardless of player proximity or chunk load state.

Containment: every scheduler tick, all loaded tracked mobs are checked
against their region via region.contains(). Any mob that has wandered
outside is teleported to a random safe position inside the region.
Unloaded mobs are skipped (they cannot have moved while unloaded).

zoneRegions (Map<String, ProtectedRegion>) is kept in sync with the
cache each tick so containment lookups need no cache re-query.

https://claude.ai/code/session_01QRahgKn43HbgkmDkQZCq9Z
1. findSafeLocation: use world.getHighestBlockYAt(MOTION_BLOCKING_NO_LEAVES)
   to start the Y-scan at the actual terrain surface instead of max.y()-1,
   eliminating scans through hundreds of empty air blocks in tall regions.

2. checkContainment: run every 4 scheduler fires (~4 s) instead of every
   tick, reducing getEntity() UUID lookups by 4x at no meaningful cost to
   containment responsiveness (mobs move ~8 blocks max between checks).

3. Escape teleport caching: containment teleports reuse the zone's last
   known safe spawn location instead of calling findSafeLocation() again
   for every escaping mob in the same cycle. Refreshed on each spawn.

4. zoneRegions lazy registration: replace put() every tick with
   computeIfAbsent() — only writes when the key is first seen, eliminating
   redundant HashMap puts on every scheduler fire.

5. Remove countMobsInRegion() dead code: the method was never called since
   UUID tracking replaced spatial entity queries. Removed from MythicAdapter
   interface, MythicV5Adapter, and MythicNoopAdapter along with all
   now-unused imports (BlockVector3, World, Entity, Collection, Set).

6. Minor: remove unused `spawned` counter variable from spawnBatch().

https://claude.ai/code/session_01QRahgKn43HbgkmDkQZCq9Z
@Sharkblack3D Sharkblack3D merged commit af959c9 into main Apr 18, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants