-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from jaron780/master
Command Tab Autocomplete
- Loading branch information
Showing
5 changed files
with
63 additions
and
7 deletions.
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package org.vivecraft.command; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import org.bukkit.command.Command; | ||
import org.bukkit.command.CommandSender; | ||
import org.bukkit.command.TabCompleter; | ||
import org.bukkit.entity.Player; | ||
|
||
public class ConstructTabCompleter implements TabCompleter { | ||
|
||
@Override | ||
public List<String> onTabComplete(CommandSender arg0, Command arg1, String arg2, String[] arg3) { | ||
List<String> list = new ArrayList<String>(); | ||
if(arg0 instanceof Player){ | ||
if(arg3.length >= 1){ | ||
for(Cmd cmd: ViveCommand.getCommands()){ | ||
if(cmd.getCommand().startsWith(arg3[0])) | ||
list.add(cmd.getCommand()); | ||
} | ||
return list; | ||
} | ||
} | ||
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
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#this file is used to check for updates | ||
1.11-r3: VSE has a new update download at https://github.com/jrbudda/Vivecraft_Spigot_Extensions/releases | ||
1.11-r4: VSE is up to date! | ||
1.11-r4: VSE is up to date! | ||
1.11-r5: VSE is up to date! |