mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-07-01 04:26:42 +00:00
Lots of fixes and cool shit
- Fixes bug that caused login messages to not show properly - Fixes bug that caused names to now show properly in tab - Adds the ability for commands to be ignored if plugins that they require aren't present - Fixes bug that caused the admin list to fail to load properly - Fixes bug that caused tags to not show properly - Login messages now use MiniMessage
This commit is contained in:
@ -63,10 +63,25 @@ public class CommandLoader extends FreedomService
|
||||
|
||||
Set<Class<? extends FreedomCommand>> commandClasses = commandDir.getSubTypesOf(FreedomCommand.class);
|
||||
|
||||
commandLoading:
|
||||
for (Class<? extends FreedomCommand> commandClass : commandClasses)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (commandClass.isAnnotationPresent(CommandDependencies.class))
|
||||
{
|
||||
String[] dependencies = commandClass.getAnnotation(CommandDependencies.class).value();
|
||||
|
||||
for (String plugin : dependencies)
|
||||
{
|
||||
if (!server.getPluginManager().isPluginEnabled(plugin))
|
||||
{
|
||||
FLog.warning("Not loading command due to missing dependency (" + plugin + "): /" + commandClass.getSimpleName().replace("Command_", ""));
|
||||
continue commandLoading;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
add(commandClass.newInstance());
|
||||
}
|
||||
catch (InstantiationException | IllegalAccessException | ExceptionInInitializerError ex)
|
||||
|
Reference in New Issue
Block a user