Feature: Add ForceHidden boolean for Players for Npcs #158
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📋 Description
Currently it is not possible to continiously hide a Npc from the core Registry to a player.
Even when setting the visibility through the existent map it is only an indicator if the Npc should be re-spawned on the next iteration of the core loop.
That means even when cancelling the NpcSpawn event the whole check logic will be done first, resulting first in unnecessary "work" (which can be ignored when it is async anyways) but more important is annoying to achieve.
I don't exactly know if it will resolved but with the method of hiding through cancelling the NpcSpawn event I get that issue: BetonQuest/BetonQuest#3540
✅ Checklist
Fixes #issue_numberorCloses #issue_numbermainbranch🔍 Changes
I've added the map to just skip the spawn process in the abstract Npc.
I also removed the setting of default values on Player join and replaced the re-setting to default on log out.
I doubt it will make a performance difference but it is "just better".
🧪 How to Test
Please describe how to manually test the changes made in this PR.