Fix a bug where using the command help causes an error in standalone mode

This commit is contained in:
GeorgH93 2020-09-07 22:30:36 +02:00
parent f316bdd66e
commit 75d0efc044
No known key found for this signature in database
GPG Key ID: D1630D37F9E4B3C8
3 changed files with 5 additions and 9 deletions

View File

@ -19,7 +19,7 @@
import at.pcgamingfreaks.Minepacks.Bukkit.API.MinepacksPlugin;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.NotNull;
public interface MinepacksPluginExtended extends MinepacksPlugin
{
@ -28,5 +28,5 @@ public interface MinepacksPluginExtended extends MinepacksPlugin
*
* @return The command manager instance. null if the plugin is running in standalone mode
*/
@Nullable MinepacksCommandManager getCommandManager();
@NotNull MinepacksCommandManager getCommandManager();
}

View File

@ -38,7 +38,7 @@
import java.util.List;
import java.util.Locale;
public class CommandManager extends CommandExecutorWithSubCommandsGeneric<MinepacksCommand> /*if_not[STANDALONE]*/ implements MinepacksCommandManager /*end[STANDALONE]*/
public class CommandManager extends CommandExecutorWithSubCommandsGeneric<MinepacksCommand> implements MinepacksCommandManager
{
private final Minepacks plugin;
private final RegisterablePluginCommand backpackCommand;
@ -53,7 +53,7 @@ public CommandManager(@NotNull Minepacks plugin)
backpackCommand.setExecutor(this);
backpackCommand.setTabCompleter(this);
helpFormat = plugin.getLanguage().getMessage("Commands.HelpFormat").replaceAll("\\{MainCommand\\}", "%1\\$s").replaceAll("\\{SubCommand\\}", "%2\\$s").replaceAll("\\{Parameters\\}", "%3\\$s").replaceAll("\\{Description\\}", "%4\\$s").replaceAll("suggest_command", "%5\\$s");
helpFormat = plugin.getLanguage().getMessage("Commands.HelpFormat").replaceAll("\\{MainCommand}", "%1\\$s").replaceAll("\\{SubCommand}", "%2\\$s").replaceAll("\\{Parameters}", "%3\\$s").replaceAll("\\{Description}", "%4\\$s").replaceAll("suggest_command", "%5\\$s");
// Setting the help format for the marry commands as well as the no permissions and not from console message
try

View File

@ -345,13 +345,9 @@ public void getBackpack(final @NotNull OfflinePlayer owner, final @NotNull Callb
}
@Override
public MinepacksCommandManager getCommandManager()
public @NotNull MinepacksCommandManager getCommandManager()
{
/*if[STANDALONE]
return null;
else[STANDALONE]*/
return commandManager;
/*end[STANDALONE]*/
}
public int getBackpackPermSize(final @NotNull Player player)