TabCompleter pour la commande /region
Création d'une classe d'auto completion pour la commande /region de worldguard Elle permet exclusivement de simplifier l'écriture des identifiants des cubos, qui sont bien trop long à taper
This commit is contained in:
parent
3487eb598c
commit
6e7594ed87
@ -49,7 +49,7 @@ public abstract class AbstractCommandExecutor implements CommandExecutor, TabCom
|
||||
* @param allProposal
|
||||
* @return
|
||||
*/
|
||||
public List<String> getTabProposalFromToken(String token, List<String> allProposal) {
|
||||
public static List<String> getTabProposalFromToken(String token, List<String> allProposal) {
|
||||
List<String> ret = new ArrayList<String>();
|
||||
|
||||
for (String s : allProposal)
|
||||
|
@ -2,6 +2,8 @@ package net.mc_pandacraft.java.plugin.pandacraftutils.commands;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import net.mc_pandacraft.java.plugin.pandacraftutils.PandacraftUtils;
|
||||
|
||||
/**
|
||||
* Initialise et stoque toutes les instances des classes exécutant les commandes Minecraft, géré par le plugin
|
||||
*/
|
||||
@ -61,6 +63,9 @@ public class PandacraftUtilsCommandsManager {
|
||||
add(new CommandMail());
|
||||
add(new CommandReply());
|
||||
|
||||
// complétion des commandes des autres plugins
|
||||
PandacraftUtils.getInstance().getServer().getPluginCommand("region").setTabCompleter(new TabCompleterWorldGuardRegion());
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -0,0 +1,19 @@
|
||||
package net.mc_pandacraft.java.plugin.pandacraftutils.commands;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabCompleter;
|
||||
|
||||
public class TabCompleterWorldGuardRegion implements TabCompleter {
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender paramCommandSender,
|
||||
Command paramCommand, String paramString,
|
||||
String[] paramArrayOfString) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user