Cleanup build a bit

This commit is contained in:
GeorgH93 2019-06-01 00:16:24 +02:00
parent c09f518342
commit dac38c3b36
No known key found for this signature in database
GPG Key ID: D1630D37F9E4B3C8
6 changed files with 21 additions and 13 deletions

View File

@ -186,7 +186,10 @@
<pattern>at.pcgamingfreaks</pattern>
<shadedPattern>at.pcgamingfreaks.MinepacksStandalone.libs.at.pcgamingfreaks</shadedPattern>
<excludes>
<exclude>at.pcgamingfreaks.Minepacks.Bukkit.API.*</exclude>
<exclude>at.pcgamingfreaks.Minepacks.Bukkit.API.Backpack</exclude>
<exclude>at.pcgamingfreaks.Minepacks.Bukkit.API.Callback</exclude>
<exclude>at.pcgamingfreaks.Minepacks.Bukkit.API.MinepacksPlugin</exclude>
<exclude>at.pcgamingfreaks.Minepacks.Bukkit.API.MinepacksCommandManager</exclude>
</excludes>
</relocation>
</relocations>

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2018 GeorgH93
* Copyright (C) 2019 GeorgH93
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -35,7 +35,7 @@
import java.util.Collection;
import java.util.List;
public class CommandManager extends CommandExecutorWithSubCommandsGeneric<MinepacksCommand> implements MinepacksCommandManager
public class CommandManager extends CommandExecutorWithSubCommandsGeneric<MinepacksCommand> /*if_not[STANDALONE]*/ implements MinepacksCommandManager /*end[STANDALONE]*/
{
private final Minepacks plugin;
private final RegisterablePluginCommand backpackCommand;
@ -77,7 +77,7 @@ public CommandManager(Minepacks plugin)
registerSubCommand(new RestoreCommand(plugin));
registerSubCommand(new MigrateCommand(plugin));
registerSubCommand(new VersionCommand(plugin));
registerSubCommand(new HelpCommand(plugin, commands));
registerSubCommand(new HelpCommand(plugin, commands, this));
}
@Override

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2018 GeorgH93
* Copyright (C) 2019 GeorgH93
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -31,13 +31,15 @@
public class HelpCommand extends MinepacksCommand
{
private Collection<MinepacksCommand> commands;
private Message messageHeader, messageFooter;
private final Collection<MinepacksCommand> commands;
private final Message messageHeader, messageFooter;
private final CommandManager commandManager;
public HelpCommand(Minepacks plugin, Collection<MinepacksCommand> commands)
public HelpCommand(Minepacks plugin, Collection<MinepacksCommand> commands, CommandManager commandManager)
{
super(plugin, "help", plugin.getLanguage().getTranslated("Commands.Description.Help"), plugin.getLanguage().getCommandAliases("Help"));
this.commands = commands;
this.commandManager = commandManager;
messageHeader = plugin.getLanguage().getMessage("Ingame.Help.Header");
messageFooter = plugin.getLanguage().getMessage("Ingame.Help.Footer");
@ -53,7 +55,7 @@ public void execute(@NotNull CommandSender sender, @NotNull String mainCommandAl
temp = cmd.doGetHelp(sender);
if(temp != null) help.addAll(temp);
}
((CommandManager) getMinepacksPlugin().getCommandManager()).sendHelp(sender, mainCommandAlias, help);
commandManager.sendHelp(sender, mainCommandAlias, help);
messageFooter.send(sender);
//TODO: pages
}

View File

@ -45,8 +45,7 @@ public UpdateCommand(Minepacks plugin)
public void execute(@NotNull final CommandSender sender, @NotNull String mainCommandAlias, @NotNull String alias, @NotNull String[] args)
{
messageCheckingForUpdates.send(sender);
/*if[STANDALONE]
else[STANDALONE]*/
/*if_not[STANDALONE]*/
((at.pcgamingfreaks.PluginLib.Bukkit.PluginLib) at.pcgamingfreaks.PluginLib.Bukkit.PluginLib.getInstance()).update(null); // Make the PluginLib check for updates too
/*end[STANDALONE]*/
((Minepacks) plugin).update(result -> {

View File

@ -37,8 +37,7 @@ public void execute(@NotNull CommandSender sender, @NotNull String mainCommandAl
{
sender.sendMessage("##### Start Minepacks version info #####");
sender.sendMessage("Marriage Master: " + plugin.getDescription().getVersion());
/*if[STANDALONE]
else[STANDALONE]*/
/*if_not[STANDALONE]*/
sender.sendMessage("PCGF PluginLib: " + at.pcgamingfreaks.PluginLib.Bukkit.PluginLib.getInstance().getVersion());
/*end[STANDALONE]*/
sender.sendMessage("Server: " + plugin.getServer().getVersion());

View File

@ -94,6 +94,7 @@ public void onEnable()
{
// Check if running as standalone edition
/*if[STANDALONE]
getLogger().info("Starting Minepacks in standalone mode!");
if(getServer().getPluginManager().isPluginEnabled("PCGF_PluginLib"))
{
getLogger().info("You do have the PCGF_PluginLib installed. You may consider switching to the default version of the plugin to reduce memory load and unlock additional features.");
@ -309,7 +310,11 @@ public void getBackpack(@NotNull final OfflinePlayer owner, @NotNull final Callb
@Override
public MinepacksCommandManager getCommandManager()
{
/*if[STANDALONE]
return null;
else[STANDALONE]*/
return commandManager;
/*end[STANDALONE]*/
}
public int getBackpackPermSize(Player player)