Package org.bukkit.plugin

Examples of org.bukkit.plugin.PluginDescriptionFile


    /**
     * Generic method that posts a plugin to the metrics website
     */
    private void postPlugin(final boolean isPing) throws IOException {
        // Server software specific section
        PluginDescriptionFile description = plugin.getDescription();
        String pluginName = description.getName();
        boolean onlineMode = Bukkit.getServer().getOnlineMode(); // TRUE if online mode is enabled
        String pluginVersion = description.getVersion();
        String serverVersion = Bukkit.getVersion();
        int playersOnline = Bukkit.getServer().getOnlinePlayers().length;

        // END server software specific section -- all code below does not use any code outside of this class / Java

View Full Code Here


    /**
     * Generic method that posts a plugin to the metrics website
     */
    private void postPlugin(final boolean isPing) throws IOException {
        // Server software specific section
        PluginDescriptionFile description = plugin.getDescription();
        String pluginName = description.getName();
        boolean onlineMode = Bukkit.getServer().getOnlineMode(); // TRUE if online mode is enabled
        String pluginVersion = description.getVersion();
        String serverVersion = Bukkit.getVersion();
        int playersOnline = Bukkit.getServer().getOnlinePlayers().length;
        // END server software specific section -- all code below does not use any code outside of this class / Java
View Full Code Here

        // Tell the server administrator the we finished unloading NoCheatPlus.
        if (verbose) {
            LogUtil.logInfo("[NoCheatPlus] All cleanup done.");
        }
        final PluginDescriptionFile pdfFile = getDescription();
        LogUtil.logInfo("[NoCheatPlus] Version " + pdfFile.getVersion() + " is disabled.");
    }
View Full Code Here

    /**
     * Generic method that posts a plugin to the metrics website
     */
    private void postPlugin(final boolean isPing) throws IOException {
        // Server software specific section
        PluginDescriptionFile description = plugin.getDescription();
        String pluginName = description.getName();
        boolean onlineMode = Bukkit.getServer().getOnlineMode(); // TRUE if online mode is enabled
        String pluginVersion = description.getVersion();
        String serverVersion = Bukkit.getVersion();
        int playersOnline = Bukkit.getServer().getOnlinePlayers().length;

        // END server software specific section -- all code below does not use any code outside of this class / Java

View Full Code Here

  }

  @Override
  public boolean onCommand(CommandSender sender, Command command, String commandLabel, String[] args) {
    try {
      PluginDescriptionFile pdf = this.getDescription();
      if (args.length > 0) {
        return this.commandsManager.execute(sender, command, args);
      } else {
        if (sender instanceof Player) {
          sender.sendMessage("[" + ChatColor.RED + "PermissionsEx" + ChatColor.WHITE + "] version [" + ChatColor.BLUE + pdf.getVersion() + ChatColor.WHITE + "]");

          return this.permissionsManager == null || !this.permissionsManager.has((Player) sender, "permissions.manage");
        } else {
          sender.sendMessage("[PermissionsEx] version [" + pdf.getVersion() + "]");

          return false;
        }
      }
    } catch (Throwable t) {
View Full Code Here

    return mockPlugin(server, name, PluginLoadOrder.POSTWORLD, depend);
  }
 
  private Plugin mockPlugin(Server server, String name, PluginLoadOrder order, String... depend) {
    Plugin plugin = mock(Plugin.class);
    PluginDescriptionFile file = mock(PluginDescriptionFile.class);
   
    when(plugin.getServer()).thenReturn(server);
    when(plugin.getName()).thenReturn(name);
    when(plugin.toString()).thenReturn(name);
    when(plugin.getDescription()).thenReturn(file);
 
    // This is the difficult part
    when(file.getLoad()).thenReturn(order);
    when(file.getDepend()).thenReturn(Arrays.asList(depend));
    when(file.getSoftDepend()).thenReturn(null);
    return plugin;
  }
View Full Code Here

   * @param fakePluginName - the fake plugin name.
   * @return The plugin.
   */
  private static Plugin createPlugin(String fakePluginName) {
    Plugin plugin = mock(Plugin.class);
    PluginDescriptionFile description = mock(PluginDescriptionFile.class);
   
    when(description.getDepend()).thenReturn(Lists.newArrayList("ProtocolLib"));
    when(description.getSoftDepend()).thenReturn(Collections.<String>emptyList());
    when(description.getLoadBefore()).thenReturn(Collections.<String>emptyList());
    when(description.getLoad()).thenReturn(PluginLoadOrder.POSTWORLD);
   
    when(plugin.getName()).thenReturn(fakePluginName);
    when(plugin.getServer()).thenReturn(Bukkit.getServer());
    when(plugin.isEnabled()).thenReturn(true);
    when(plugin.getDescription()).thenReturn(description);
View Full Code Here

    /**
     * Generic method that posts a plugin to the metrics website
     */
    private void postPlugin(boolean isPing) throws IOException {
        // Server software specific section
        PluginDescriptionFile description = plugin.getDescription();
        String pluginName = description.getName();
        boolean onlineMode = Bukkit.getServer().getOnlineMode(); // TRUE if online mode is enabled
        String pluginVersion = description.getVersion();
        String serverVersion = Bukkit.getVersion();
        int playersOnline = Bukkit.getServer().getOnlinePlayers().size(); // DENIZEN - correct player count system for .17.10

        // END server software specific section -- all code below does not use any code outside of this class / Java

View Full Code Here

        // Register our commands
        getCommand("pos").setExecutor(new SamplePosCommand());
        getCommand("debug").setExecutor(new SampleDebugCommand(this));

        // EXAMPLE: Custom code, here we just output some info so we can check all is well
        PluginDescriptionFile pdfFile = this.getDescription();
        getLogger().info( pdfFile.getName() + " version " + pdfFile.getVersion() + " is enabled!" );
    }
View Full Code Here

    /**
     * Generic method that posts a plugin to the metrics website
     */
    private void postPlugin(boolean isPing) throws IOException {
        // Server software specific section
        PluginDescriptionFile description = plugin.getDescription();
        String pluginName = description.getName();
        boolean onlineMode = Bukkit.getServer().getOnlineMode(); // TRUE if online mode is enabled
        String pluginVersion = description.getVersion();
        String serverVersion = Bukkit.getVersion();
        int playersOnline = Bukkit.getServer().getOnlinePlayers().length;

        // END server software specific section -- all code below does not use any code outside of this class / Java

View Full Code Here

TOP

Related Classes of org.bukkit.plugin.PluginDescriptionFile

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.