-
-
Notifications
You must be signed in to change notification settings - Fork 147
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
Feature/command selectors #298
Draft
DarkEyeDragon
wants to merge
5
commits into
aikar:master
Choose a base branch
from
DarkEyeDragon:feature/command-selectors
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
5f9bb7b
Add Dutch translation
DarkEyeDragon 8aaf607
Add acf-minecraft_nl.properties
DarkEyeDragon d2620ec
Merge remote-tracking branch 'upstream/master'
DarkEyeDragon 0764211
Add command selectors to BukkitCommandContexts#getOnlinePlayer
DarkEyeDragon 75ac779
Only use selectors when starts with @
DarkEyeDragon 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 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 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 |
---|---|---|
|
@@ -241,6 +241,20 @@ OnlinePlayer getOnlinePlayer(BukkitCommandIssuer issuer, String lookup, boolean | |
Player player = ACFBukkitUtil.findPlayerSmart(issuer, lookup); | ||
//noinspection Duplicates | ||
if (player == null) { | ||
if (issuer.getManager() instanceof BukkitCommandManager) { | ||
BukkitCommandManager manager = (BukkitCommandManager) issuer.getManager(); | ||
//Check if mc version is higher than 1.13.1 (added in 1.13.2) | ||
if ((manager.mcMinorVersion > 13) || (manager.mcMinorVersion == 13 && manager.mcPatchVersion > 1)) { | ||
try { | ||
Entity entity = Bukkit.selectEntities(issuer.getIssuer(), lookup).get(0); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. rather than blind look up 0 relying on errors, iterate and return on first player match instead, and lack of finding should fall through to the lines below. And we can only run this selectEntities if the input starts with @ |
||
if (entity instanceof Player) { | ||
return new OnlinePlayer((Player) entity); | ||
} | ||
} catch (IllegalArgumentException e) { | ||
throw new InvalidCommandArgument(false); | ||
} | ||
} | ||
} | ||
if (allowMissing) { | ||
return null; | ||
} | ||
|
This file contains 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 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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# | ||
# Copyright (c) 2016-2020 Daniel Ennis (Aikar) - MIT License | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining | ||
# a copy of this software and associated documentation files (the | ||
# "Software"), to deal in the Software without restriction, including | ||
# without limitation the rights to use, copy, modify, merge, publish, | ||
# distribute, sublicense, and/or sell copies of the Software, and to | ||
# permit persons to whom the Software is furnished to do so, subject to | ||
# the following conditions: | ||
# | ||
# The above copyright notice and this permission notice shall be | ||
# included in all copies or substantial portions of the Software. | ||
# | ||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
# | ||
acf-core.permission_denied=Het spijt me, maar je hebt geen toegang om dit commando uit te voeren. | ||
acf-core.permission_denied_parameter=Het spijt me, maar je hebt geen toegang om dit commando uit te voeren. | ||
acf-core.error_generic_logged=Er is een fout opgetreden. Dit probleem is geregistreerd. Excuses voor het ongemak. | ||
acf-core.unknown_command=Onbekend Commando, typ <c2>/help</c2> | ||
acf-core.invalid_syntax=Gebruik: <c2>{command}</c2> <c3>{syntax}</c3> | ||
acf-core.error_prefix=Fout: {message} | ||
acf-core.error_performing_command=Het spijt me, maar er is een fout opgetreden bij het uitvoeren van dit commando. | ||
acf-core.info_message={message} | ||
acf-core.please_specify_one_of=Fout: Specificeer ��n van (<c2>{valid}</c2>). | ||
acf-core.must_be_a_number=Fout: {num} moet een getal zijn. | ||
acf-core.must_be_min_length=Fout: Moet minimaal {min} tekens lang zijn. | ||
acf-core.must_be_max_length=Fout: Mag maximaal {max} tekens lang zijn. | ||
acf-core.please_specify_at_most=Fout: Geef een waarde op van maximaal {max}. | ||
acf-core.please_specify_at_least=Fout: Geef een waarde op van minstens {min}. | ||
acf-core.not_allowed_on_console=Fout: De console kan deze opdracht niet uitvoeren. | ||
acf-core.could_not_find_player=Fout: Kon geen speler vinden met de naam: <c2>{search}</c2> | ||
acf-core.no_command_matched_search=Geen commando komt overeen met <c2>{zoeken}</c2> | ||
acf-core.help_page_information=- Pagina <c2>{page}</c2> van <c2>{totalpages}</c2> (<c3>{results}</c3> resultaten) wordt weergegeven. | ||
acf-core.help_no_results=Fout: Geen resultaten meer. | ||
acf-core.help_format=<c1>{command}</c1> <c2>{parameters}</c2> <c3>{separator} {description}</c3> | ||
acf-core.help_detailed_header=<c3>===</c3> <c1> Gedetailleerde hulp weergeven voor </c1><c2>{commandprefix}{command}</c2> <c3> ===</c3> | ||
acf-core.help_detailed_command_format=<c1>{command}</c1> <c2>{parameters}</c2> <c3>{separator} {description}</c3> | ||
acf-core.help_detailed_parameter_format=<c2>{syntaxorname}</c2>: <c3>{description}</c3> | ||
acf-core.help_search_header=<c3>=== </c3><c1>Zoekresultaten voor</c1> <c2>{commandprefix} {command} {search}</c2><c3> ===</c3> | ||
acf-core.help_header=<c3>=== </c3><c1>Hulp voor</c1> <c2>{commandprefix}{command}</c2><c3> ===</c3> |
This file contains 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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# | ||
# Copyright (c) 2016-2020 Daniel Ennis (Aikar) - MIT License | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining | ||
# a copy of this software and associated documentation files (the | ||
# "Software"), to deal in the Software without restriction, including | ||
# without limitation the rights to use, copy, modify, merge, publish, | ||
# distribute, sublicense, and/or sell copies of the Software, and to | ||
# permit persons to whom the Software is furnished to do so, subject to | ||
# the following conditions: | ||
# | ||
# The above copyright notice and this permission notice shall be | ||
# included in all copies or substantial portions of the Software. | ||
# | ||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
# | ||
acf-minecraft.invalid_world=Fout: Deze wereld bestaat niet. | ||
acf-minecraft.you_must_be_holding_item=Fout: U moet een item in uw primaire hand hebben. | ||
acf-minecraft.player_is_vanished_confirm=\ | ||
Waarschuwing: <c2>{vanished}</c2> is verdwenen. Onthul hun dekking niet! \n\ | ||
Om uw actie te bevestigen, voegt u <c2>:confirm</c2> toe aan het einde van hun naam. \n\ | ||
Vb: <c2>{verdwenen}: bevestigen</c2> | ||
acf-minecraft.username_too_short=Fout: Gebruikersnaam te kort, moet minimaal drie tekens bevatten. | ||
acf-minecraft.is_not_a_valid_name=Fout: <c2>{name}</c2> is geen geldige gebruikersnaam. | ||
acf-minecraft.multiple_players_match=Fout: Meerdere spelers kwamen overeen met <c2>{search}</c2><c3>({all})</c3>, wees specifieker. | ||
acf-minecraft.no_player_found_server=Geen speler die overeenkomt met <c2>{search}</c2> is online. | ||
acf-minecraft.no_player_found_offline=Er is geen speler gevonden die overeenkomt met <c2>{search}</c2>. | ||
acf-minecraft.no_player_found=Er is geen speler gevonden die overeenkomt met <c2>{search}</c2>. | ||
acf-minecraft.location_please_specify_world=Fout: specificeer wereld. Voorbeeld: <c2>wereld:x,y,z</c2>. | ||
acf-minecraft.location_please_specify_xyz=Fout: Specificeer de co�rdinaten x, y en z. Voorbeeld: <c2>wereld:x,y,z</c2>. | ||
acf-minecraft.location_console_not_relative=Fout: De console mag geen relatieve co�rdinaten voor de locatie gebruiken. |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is already a bukkit context, this isn't really needed.
this.manager should already exists.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this.manager returns a
CommandManager
which does not have the version fields, however, i should probably be able to cast that safely right?