Open
Conversation
8a8f036 to
a3940e4
Compare
a3940e4 to
59c4224
Compare
Drayz64
commented
Apr 21, 2025
| import org.bukkit.event.Event; | ||
| import org.bukkit.event.HandlerList; | ||
|
|
||
| public class GuidebookSendEvent extends Event implements Cancellable { |
Author
There was a problem hiding this comment.
I'm thinking this should be GuidebookEnterEvent instead
| } | ||
|
|
||
| private boolean getMatchingSegments(String input, String searchTerm) { | ||
| private boolean matchesAnySegment(String input, String searchTerm) { |
Author
There was a problem hiding this comment.
The current name was misleading
| InfoArea area = PluginData.getInfoAreas().get(key); | ||
| if (area.isInside(playerLocation) && !area.isInformed(player) | ||
| && area.isEnable() && !PluginData.isExcluded(player)) { | ||
| getServer().getScheduler().scheduleSyncRepeatingTask(this, () -> { |
Author
There was a problem hiding this comment.
Minor optimisations
- Storing the filtered info areas before the Player loop
- Only doing the isNear check if the player is known to be inside the area
Other than that the main change is moving PluginData.isExcluded(player) to be inside onRegionEnter
| private List<String> description = new ArrayList<>(); | ||
|
|
||
| protected InfoArea() { | ||
| protected InfoArea(String areaName) { |
Author
There was a problem hiding this comment.
Since the GuidebookSendEvent is called inside InfoArea the area needed to know its own name - I've then been able to use the areaName in a few unrelated places
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.