Skip to content

Implement WorldGuard region search#1

Merged
Phoenix616 merged 3 commits intoMinebench:masterfrom
Joo200:master
May 24, 2020
Merged

Implement WorldGuard region search#1
Phoenix616 merged 3 commits intoMinebench:masterfrom
Joo200:master

Conversation

@Joo200
Copy link
Copy Markdown
Contributor

@Joo200 Joo200 commented May 24, 2020

Adds a basic WorldGuard region search. Changed things:

  • WorldGuard is now a softdepend
  • Region search with /detect search --regions

I changed some internals to Generics, it should be easy to add more keys for search, not only ChunkLocation and World+ProtectedRegions.
Feel free to improve the display format for ProtectedRegions in the search field.

@Phoenix616
Copy link
Copy Markdown
Member

Phoenix616 commented May 24, 2020

Looks good overall, not too sure about the wildcard generic for the SearchResultEntries though. Wouldn't it be better to have an interface/class that both the ChunkLocation and ProtectedRegionEntry implementso that we can be sure that the SearchResults are of the correct type? The teleport method could then also specify that so that we don't potentially get a wrong entry type and don't have to cast that. (I realize that this shouldn't be possible with the current implementation, jsut thinking ahead/about plugins that might mess with this)

Edit: Actually I think simply using the T of the SearchResult for the SearchResultEntry too instead of '?' should fix that.

@Joo200
Copy link
Copy Markdown
Contributor Author

Joo200 commented May 24, 2020

I agree, that solution was a little bit dump.

Changed it.

- Don't keep World reference around when world gets unloaded
- Rename entry's getChunk to more general getLocation
- Add dependency scopes
@Phoenix616 Phoenix616 merged commit 52b6179 into Minebench:master May 24, 2020
@Phoenix616
Copy link
Copy Markdown
Member

Thank you for this pull request! Gonna make sure to add you to the contributors list on Spigot once I'll manage to update it there :)

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.

2 participants