Skip to content

Fix setPersistent(true) not applying when Bukkit registry lags behind…#27

Merged
Sharkblack3D merged 1 commit into
mainfrom
claude/farm-zone-management-system-mTHw3
Apr 20, 2026
Merged

Fix setPersistent(true) not applying when Bukkit registry lags behind…#27
Sharkblack3D merged 1 commit into
mainfrom
claude/farm-zone-management-system-mTHw3

Conversation

@Sharkblack3D
Copy link
Copy Markdown
Collaborator

… spawn

The previous code called getServer().getEntity(uuid) immediately after MythicMobs returned the UUID. At that point the entity may not yet be registered in Bukkit's entity registry, so getEntity() could return null and the setPersistent(true) call was silently skipped.

Fix: call BukkitAdapter.adapt(active.getEntity()) inside spawnMob() while the ActiveMob reference is still live, then set persistent before returning the UUID. The entity is always accessible at that point.

The redundant getServer().getEntity() + setPersistent() in spawnBatch() is removed since persistence is now guaranteed by the adapter.

https://claude.ai/code/session_01QRahgKn43HbgkmDkQZCq9Z

… spawn

The previous code called getServer().getEntity(uuid) immediately after
MythicMobs returned the UUID. At that point the entity may not yet be
registered in Bukkit's entity registry, so getEntity() could return null
and the setPersistent(true) call was silently skipped.

Fix: call BukkitAdapter.adapt(active.getEntity()) inside spawnMob() while
the ActiveMob reference is still live, then set persistent before returning
the UUID. The entity is always accessible at that point.

The redundant getServer().getEntity() + setPersistent() in spawnBatch()
is removed since persistence is now guaranteed by the adapter.

https://claude.ai/code/session_01QRahgKn43HbgkmDkQZCq9Z
@Sharkblack3D Sharkblack3D merged commit 2ceee13 into main Apr 20, 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