-
Notifications
You must be signed in to change notification settings - Fork 96
Dynamic filters! #914
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Dynamic filters! #914
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
3443a3a
Add dynamic filter support to FilterMatchModule
Pugzy 493b30c
Update portal logic and use dynamic filters
Pugzy c8d9296
Make MatchPlayer implement Filterable instead of the PlayerQuery
KingOfSquares 4c73f80
Add some documentation
KingOfSquares 371d6a2
Actually follow Filterable implementation spec
Pugzy 1fafac8
Ch-Ch-Ch-Changes
Pugzy 1ef46d1
Formatting and extra portal XML exception
Pugzy a8a11f3
Throw error when a non-dynamic filter is registered as a dynamic one
KingOfSquares 1e43136
Actually, dont re-introduce that bug
KingOfSquares d78047b
Some cleanup
KingOfSquares 563d329
default Query#getEvent to null
KingOfSquares 459a882
Suppress some casting warnings
KingOfSquares 76ddc11
Revert changes to MultiFilterFunction
Pugzy d3d41a3
Resolve issue with empty internalSetParty
Pugzy 416454c
Ensure filter event listeners are registered after everything else is…
KingOfSquares ea23d04
Use MethodHandles to optimize how Filterables are extracted from arbi…
KingOfSquares 250fbda
Scope MethodHandle creating to Entityy instead of PLayer
KingOfSquares 1a4697a
Add handler parent check and caching and start testing
Pugzy df5e8b9
Continue fixing
Pugzy 5ea0ad9
Add handlers directly to goal event classes
Pugzy 126e487
Fix getHandle cache exception message and comment
Pugzy b4c4e57
Remove class as a dynamic filter
Pugzy 4d1b56d
Remove redundant inheritdoc javadoc tags
KingOfSquares c618a30
Change SingetonImmutableList to native singleton Collection
KingOfSquares bf3b180
Replace optionals with @Nullable and streams with Collection
KingOfSquares d64d242
Use PlayerItemTransferEvent in holding and carrying filter
KingOfSquares 8109456
Prefix filterable interface methods with get
Pugzy 73eaffb
Move handler management to MethodHandleUtils
Pugzy 598c197
Change access point of MethodHandleUtils
KingOfSquares File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,33 @@ | ||
package tc.oc.pgm.api.filter.query; | ||
|
||
import javax.annotation.Nullable; | ||
import org.bukkit.Location; | ||
import org.bukkit.event.Event; | ||
import org.bukkit.event.entity.CreatureSpawnEvent; | ||
import tc.oc.pgm.api.filter.Filter; | ||
import tc.oc.pgm.api.match.Match; | ||
import tc.oc.pgm.api.party.Party; | ||
import tc.oc.pgm.api.player.MatchPlayer; | ||
import tc.oc.pgm.goals.Goal; | ||
|
||
/** | ||
* A query can be thought of as context to a question which can be asked to a {@link Filter}. The | ||
* context can include different information like a {@link Match}, a {@link Goal}, a {@link | ||
* MatchPlayer} or a {@link CreatureSpawnEvent.SpawnReason}. | ||
* | ||
* @implSpec a {@link Query} interface should only add <b>one</b> piece of information to the | ||
* context. To increase the amount of information retrievable from the query it can extend other | ||
* queries. | ||
* <p>A {@link PlayerQuery} adds a {@link MatchPlayer} to the context, but can also provide info | ||
* found in other queries like a {@link Party} or a {@link Location}, therefore it extends those | ||
* queries({@link PartyQuery}, {@link LocationQuery}) instead of adding more methods to its own | ||
* interface. | ||
* @see Filter | ||
*/ | ||
public interface Query { | ||
/** The event providing the query information, if any */ | ||
@Nullable | ||
Event getEvent(); | ||
default Event getEvent() { | ||
return null; | ||
} | ||
} |
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.