Remove getVersion method from API since it won't work in Standalone mode

This commit is contained in:
GeorgH93 2019-06-04 20:29:05 +02:00
parent 060128b9d6
commit 6886b4be8e
No known key found for this signature in database
GPG Key ID: D1630D37F9E4B3C8

View File

@ -17,8 +17,6 @@
package at.pcgamingfreaks.Minepacks.Bukkit.API;
import at.pcgamingfreaks.Version;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import org.bukkit.entity.Player;
@ -41,22 +39,6 @@ public interface MinepacksPlugin
return (plugin instanceof MinepacksPlugin && plugin.isEnabled()) ? (MinepacksPlugin) plugin : null;
}
/**
* Gets the currently running {@link Version} of the plugin.
* Version 0.0 if plugin is not loaded or enabled.
*
* @return The currently running version of the plugin.
*/
static @NotNull Version getVersion()
{
Plugin plugin = Bukkit.getServer().getPluginManager().getPlugin("Minepacks");
if(plugin instanceof MinepacksPlugin && plugin.isEnabled())
{
return new Version(plugin.getDescription().getVersion());
}
return new Version("0.0");
}
/**
* Checks if the plugin is running in standalone mode. Some features and API functions are not available in standalone mode!
*
@ -134,9 +116,9 @@ public interface MinepacksPlugin
/**
* Gets the command manager of the Minepacks plugin.
*
* @return The command manager instance.
* @return The command manager instance. null if the plugin is running in standalone mode
*/
MinepacksCommandManager getCommandManager();
@Nullable MinepacksCommandManager getCommandManager();
/**
* Checks if the player is allowed to open a backpack based on is permissions and current game-mode.