mirror of
https://github.com/sekwah41/Advanced-Portals.git
synced 2024-06-26 14:45:01 +02:00
trying out material auto complete
This commit is contained in:
parent
fbbd104881
commit
9ec4c3b78a
2
pom.xml
2
pom.xml
|
@ -29,7 +29,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bukkit</groupId>
|
<groupId>org.bukkit</groupId>
|
||||||
<artifactId>bukkit</artifactId>
|
<artifactId>bukkit</artifactId>
|
||||||
<version>1.12-pre2-SNAPSHOT</version>
|
<version>1.12.1-R0.1-SNAPSHOT</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!--<dependency>
|
<!--<dependency>
|
||||||
|
|
|
@ -23,6 +23,7 @@ import java.util.*;
|
||||||
|
|
||||||
public class AdvancedPortalsCommand implements CommandExecutor, TabCompleter {
|
public class AdvancedPortalsCommand implements CommandExecutor, TabCompleter {
|
||||||
|
|
||||||
|
private final ArrayList<String> blockMaterialList = new ArrayList<>();
|
||||||
private AdvancedPortalsPlugin plugin;
|
private AdvancedPortalsPlugin plugin;
|
||||||
|
|
||||||
private int portalArgsStringLength = 0;
|
private int portalArgsStringLength = 0;
|
||||||
|
@ -34,12 +35,17 @@ public class AdvancedPortalsCommand implements CommandExecutor, TabCompleter {
|
||||||
public AdvancedPortalsCommand(AdvancedPortalsPlugin plugin) {
|
public AdvancedPortalsCommand(AdvancedPortalsPlugin plugin) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
|
|
||||||
|
|
||||||
|
for(Material material : Material.values()) {
|
||||||
|
this.blockMaterialList.add("triggerblock:" + material.name());
|
||||||
|
}
|
||||||
plugin.getCommand("advancedportals").setExecutor(this);
|
plugin.getCommand("advancedportals").setExecutor(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
@Override
|
@Override
|
||||||
public boolean onCommand(CommandSender sender, Command cmd, String command, String[] args) {
|
public boolean onCommand(CommandSender sender, Command cmd, String command, String[] args) {
|
||||||
|
System.out.printf("%s %s %s %s%n", sender, cmd, command, args );
|
||||||
ConfigAccessor config = new ConfigAccessor(plugin, "config.yml");
|
ConfigAccessor config = new ConfigAccessor(plugin, "config.yml");
|
||||||
ConfigAccessor portalConfig = new ConfigAccessor(plugin, "portals.yml");
|
ConfigAccessor portalConfig = new ConfigAccessor(plugin, "portals.yml");
|
||||||
if(!(sender instanceof Player)) {
|
if(!(sender instanceof Player)) {
|
||||||
|
@ -272,7 +278,7 @@ public class AdvancedPortalsCommand implements CommandExecutor, TabCompleter {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "variables" :
|
case "variables" :
|
||||||
sender.sendMessage(PluginMessages.customPrefix + " \u00A77Variables \u00A7c: \u00A7aname, triggerBlock, destination");
|
sender.sendMessage(PluginMessages.customPrefix + " \u00A77Variables \u00A7c: \u00A7aname, triggerBlock, desti, destination, bungee, permission, command");
|
||||||
sender.sendMessage("");
|
sender.sendMessage("");
|
||||||
sender.sendMessage("\u00A7aExample command: \u00A7e/portal create name:test triggerId:portal");
|
sender.sendMessage("\u00A7aExample command: \u00A7e/portal create name:test triggerId:portal");
|
||||||
break;
|
break;
|
||||||
|
@ -679,6 +685,7 @@ public class AdvancedPortalsCommand implements CommandExecutor, TabCompleter {
|
||||||
}
|
}
|
||||||
if (!hasTriggerBlock) {
|
if (!hasTriggerBlock) {
|
||||||
autoComplete.add("triggerblock:");
|
autoComplete.add("triggerblock:");
|
||||||
|
autoComplete.addAll(this.blockMaterialList);
|
||||||
}
|
}
|
||||||
if (!hasDestination) {
|
if (!hasDestination) {
|
||||||
autoComplete.add("destination:");
|
autoComplete.add("destination:");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user