Implement WorldGuard region search#1
Conversation
|
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. |
|
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
|
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 :) |
Adds a basic WorldGuard region search. Changed things:
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.