1.1.2 | Bugfix

TabComplete Aller Commands was affected by T2C alias and partially disabled completely. This has been fixed.
This commit is contained in:
JaTiTV 2022-07-19 22:55:25 +02:00
parent 6586ac4ee9
commit dbe5f82030
5 changed files with 5 additions and 8 deletions

View File

@ -6,7 +6,7 @@
<groupId>net.t2code</groupId> <groupId>net.t2code</groupId>
<artifactId>Alias</artifactId> <artifactId>Alias</artifactId>
<version>1.1.1</version> <version>1.1.2</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>T2C-Alias</name> <name>T2C-Alias</name>

View File

@ -6,7 +6,6 @@ import net.t2code.lib.Spigot.Lib.commands.Tab;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
import org.bukkit.event.server.TabCompleteEvent; import org.bukkit.event.server.TabCompleteEvent;
import org.bukkit.plugin.Plugin;
import java.util.*; import java.util.*;
@ -17,11 +16,10 @@ public class TabEvent implements Listener {
public void onTab(TabCompleteEvent e) { public void onTab(TabCompleteEvent e) {
String buffer = e.getBuffer(); String buffer = e.getBuffer();
String[] imp = buffer.replace("/", "").split(" "); String[] imp = buffer.replace("/", "").split(" ");
List<String> list = new ArrayList<>(Collections.emptyList());
if (!Main.allAliases.contains(imp[0]) || !Main.allForSubAliases.contains(imp[0])){ if (!Main.allAliases.contains(imp[0]) || !Main.allForSubAliases.contains(imp[0])){
e.setCompletions(list);
return; return;
} }
List<String> list = new ArrayList<>(Collections.emptyList());
arg1.clear(); arg1.clear();
for (String sals : Main.allSubAliases) { for (String sals : Main.allSubAliases) {

View File

@ -99,9 +99,9 @@ public class SelectAlias {
for (String al : aliasList) { for (String al : aliasList) {
Main.aliasHashMap.put(al, alias); Main.aliasHashMap.put(al, alias);
} }
}
send.console(Prefix + " §aAlias file §e" + config_gui.getName() + " §awas loaded"); send.console(Prefix + " §aAlias file §e" + config_gui.getName() + " §awas loaded");
} }
}
AliasRegister.onRegister(); AliasRegister.onRegister();
} }

View File

@ -51,7 +51,7 @@ public class SelectSubAlias {
if (subAliasFor != null) { if (subAliasFor != null) {
String[] imp = subAliasFor.split(" "); String[] imp = subAliasFor.split(" ");
if (!Main.allAliases.contains(imp[0])) { if (!Main.allAliases.contains(imp[0])) {
send.error(Main.getPlugin(), "Den Alias " + imp[0] + " in der Datei " + config_gui.getName() + " existiert nicht!"); send.error(Main.getPlugin(), "The alias " + imp[0] + " in the file " + config_gui.getName() + " does not exist!");
} }
String[] args = subAliasFor.split(" "); String[] args = subAliasFor.split(" ");
subAliasArg = args.length - 1; subAliasArg = args.length - 1;

View File

@ -10,8 +10,7 @@ SubAlias:
# For example: # For example:
# - aliasexample1 -> aliasexample1 <this SubAlias> # - aliasexample1 -> aliasexample1 <this SubAlias>
# - aliasexample2 test -> aliasexample2 test <this SubAlias> # - aliasexample2 test -> aliasexample2 test <this SubAlias>
SubAliasFor: SubAliasFor: aliasexample1
- aliasexample1
Permission: Permission:
# Here you can say if a permission is needed to use the alias# # Here you can say if a permission is needed to use the alias#
Necessary: true Necessary: true