Regex pattern support for world names in NPCs and holograms. #138
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
Added regex pattern support for world names in NPCs and holograms.
This allows creating a single NPC/hologram that will automatically appear in multiple worlds matching a pattern (e.g.,
instance_*forinstance_1,instance_2, etc.).✅ Checklist
Fixes #issue_numberorCloses #issue_numbermainbranch🔍 Changes
Please provide a brief summary of the changes made in this PR.
FancyNPCs:
worldfield in NPC configuration*,?,[,{)npcId_worldName)FancyHolograms:
worldPatternfield toHologramDatamatchesWorld()method for dynamic world validationModified files:
plugins/fancynpcs/src/main/java/de/oliver/fancynpcs/NpcManagerImpl.javaplugins/fancyholograms-v2/api/src/main/java/de/oliver/fancyholograms/api/data/HologramData.javaplugins/fancyholograms-v2/api/src/main/java/de/oliver/fancyholograms/api/hologram/Hologram.javaplugins/fancyholograms-v2/src/main/java/de/oliver/fancyholograms/hologram/version/HologramImpl.java🧪 How to Test
Please describe how to manually test the changes made in this PR.
For NPCs:
instance_1,instance_2,instance_3)npcs.yml, configure an NPC withlocation.world: "instance_*"/npc reloadinstance_*worlds at the same coordinatesFor Holograms:
holograms.yml, configure a hologram withlocation.world: "instance_*"instance_*world and verify the hologram appearsSupported patterns:
instance_*→ matchesinstance_1,instance_2, etc.world_?→ matchesworld_1,world_a, etc. (single character)lobby*→ matcheslobby,lobby1,lobby_pvp, etc.