1.1.6 | New alias for commands & alias registration for plugin reload
Changes: - For commands the placeholder '[alias]' has been added. - If you add a new alias, it will now be registred on reload of the plugin, so no restart is needed anymore (If a command is renamed / removed, the old one will still be registred, but will not work. I am looking for a solution in the next update).
This commit is contained in:
@@ -2,6 +2,8 @@ package net.t2code.alias.Spigot;
|
||||
|
||||
import net.t2code.alias.Spigot.objects.AliasObject;
|
||||
import net.t2code.alias.Spigot.objects.SubAliasObject;
|
||||
import net.t2code.alias.Spigot.system.BukkitCommandWrap;
|
||||
import net.t2code.alias.Spigot.system.BukkitCommandWrap_Useless;
|
||||
import net.t2code.alias.Spigot.system.Load;
|
||||
import net.t2code.alias.Util;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Ctemplate;
|
||||
@@ -23,6 +25,7 @@ public final class Main extends JavaPlugin {
|
||||
private static List<String> autor;
|
||||
private static Main plugin;
|
||||
public static HashMap<String, AliasObject> aliasHashMap = new HashMap<>();
|
||||
public static HashMap<String, Boolean> loadAliasHashMap = new HashMap<>();
|
||||
public static HashMap<String, SubAliasObject> subAliasHashMap = new HashMap<>();
|
||||
public static ArrayList<String> allAliases = new ArrayList<>();
|
||||
public static ArrayList<String> allSubAliases = new ArrayList<>();
|
||||
@@ -35,6 +38,12 @@ public final class Main extends JavaPlugin {
|
||||
autor = plugin.getDescription().getAuthors();
|
||||
version = plugin.getDescription().getVersion();
|
||||
if (pluginNotFound("T2CodeLib", 96388, Util.getRequiredT2CodeLibVersion())) return;
|
||||
try {
|
||||
Class.forName("com.mojang.brigadier.CommandDispatcher");
|
||||
this.bukkitCommandWrap = new BukkitCommandWrap();
|
||||
} catch (ClassNotFoundException | NoClassDefFoundError e) {
|
||||
this.bukkitCommandWrap = new BukkitCommandWrap_Useless();
|
||||
}
|
||||
Load.onLoad(Util.getPrefix(), autor, version, Util.getSpigot(), Util.getDiscord(), Util.getBstatsID());
|
||||
}
|
||||
|
||||
@@ -91,4 +100,10 @@ public final class Main extends JavaPlugin {
|
||||
public static List<String> getAutor() {
|
||||
return autor;
|
||||
}
|
||||
|
||||
private BukkitCommandWrap bukkitCommandWrap = null;
|
||||
|
||||
public BukkitCommandWrap getBukkitCommandWrap() {
|
||||
return this.bukkitCommandWrap;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user