Skip to content

feat: Update NPC visibility logic to filter out non-viewers and incre… - #47

Merged
ammodev merged 1 commit into
version/26.1from
feat/set-shadow-for-nametag-if-transparent-background
Oct 11, 2026
Merged

ammodev merged 1 commit into
version/26.1from
feat/set-shadow-for-nametag-if-transparent-background

Conversation

@TheBjoRedCraft

Copy link
Copy Markdown
Contributor

…ment Kotlin version to 1.6.11

@TheBjoRedCraft TheBjoRedCraft self-assigned this Oct 11, 2026
Copilot AI balanced review requested due to automatic review settings October 11, 2026 08:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The filtering logic is correct, but the PR description mislabels the project version bump as a "Kotlin version" change, which should be corrected.

1 open finding
What changed in this PR

This PR adds per-viewer visibility filtering to two NPC refresh listeners so that NPCs restricted to a specific set of viewers are no longer refreshed for players who are not viewers. It also bumps the project version. The visibility semantics match the existing ConnectionListener (a null viewers set means the NPC is global/visible to all, while a non-null set restricts visibility), so the new filter it.viewers?.contains(player.uniqueId) == false correctly skips only NPCs whose non-null viewer set excludes the player.

Changes:

  • Skip refreshing NPCs for players not in an NPC's viewer set on world change (WorldChangeListener) and on async post-teleport (FoliaAdditionsListener).
  • Bump the project version from 1.6.10 to 1.6.11 in gradle.properties.
File Description
surf-npc-paper/​src/​main/​kotlin/​dev/​slne/​surf/​npc/​paper/​listener/​WorldChangeListener.kt Adds viewer filter so non-viewers don't trigger a refresh on world change.
surf-npc-paper/​src/​main/​kotlin/​dev/​slne/​surf/​npc/​paper/​listener/​FoliaAdditionsListener.kt Adds the same viewer filter on async post-teleport.
gradle.properties Increments project version 1.6.10 → 1.6.11.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread gradle.properties
kotlin.stdlib.default.dependency=false
org.gradle.parallel=true
version=1.6.10
version=1.6.11
@ammodev
ammodev merged commit 4fe2694 into version/26.1 Oct 11, 2026
1 check passed
@ammodev
ammodev deleted the feat/set-shadow-for-nametag-if-transparent-background branch October 11, 2026 13:04
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.

3 participants