Skip to content

Compass fixes#339

Merged
Combustible merged 8 commits intomasterfrom
xernial-compass-fixes
Apr 9, 2026
Merged

Compass fixes#339
Combustible merged 8 commits intomasterfrom
xernial-compass-fixes

Conversation

@xerniale
Copy link
Copy Markdown
Collaborator

@xerniale xerniale commented Mar 14, 2026

  • Quest entries now use world names as a prerequisite, instead of appending a warning message if you're on the wrong world. Quests entries without world names specified will still display on any world
  • Fixed Quest Compasses never actually pointing to the correct location on other worlds
  • Fixed a Quest Compass log error

@xerniale xerniale added the ready label Mar 14, 2026
public boolean prerequisiteMet(Player player) {
return mPrerequisites == null || mPrerequisites.prerequisiteMet(new QuestContext(Plugin.getInstance(), player, null));
return (mPrerequisites == null || mPrerequisites.prerequisiteMet(new QuestContext(Plugin.getInstance(), player, null)))
&& player.getWorld().getName().matches(mWorldRegex);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I set up something for zones that checks if world names match regex from a list as they load so that they don't need to be checked more than once; regex checks are slow.

@xerniale xerniale removed the ready label Mar 25, 2026
return false;
}
WorldRegexMatcher matcher = QuestCompassManager.getInstance().getWorldRegexMatcher();
if (matcher != null && matcher.isKnownRegex(mWorldRegex)) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

In theory isKnownRegex shouldn't be required, so this fallback should never be used. Not a bad idea to keep it, but might be worth logging when this happens so we can look into it.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I agree this shouldn't be required, but I couldn't convince myself that it definitely wasn't. Hence the comment on the next line - I didn't want to fall into the matcher if somehow this got tested against an object that wasn't registered. Right now the matcher logic for the variant that takes a world directly just returns false if the regex wasn't registered, rather than falling back to trying to look it up directly. Not sure if I should just change that... or this weird guard that does a 2nd lookup... hmmm...

Copy link
Copy Markdown
Collaborator

@NickNackGus NickNackGus left a comment

Choose a reason for hiding this comment

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

My only remaining concern is if the QuestLocation interface's other implementation needs to be handled as well.

@Combustible
Copy link
Copy Markdown
Collaborator

The other implementer is DeathLocation - it doesn't have a prereq check though... I think if we wanted to expand that it'd be a separate PR, since we'd have to add prereq usage there to filter out deaths on the wrong world. I think we may need to do that later when we have multi-world-dungeon-host support, but today I can't think of a way this would happen

Signed-off-by: Byron Marohn <Combustible@live.com>
@Combustible Combustible merged commit 79e7839 into master Apr 9, 2026
1 check passed
@Combustible Combustible deleted the xernial-compass-fixes branch April 9, 2026 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants