Package org.bukkit.plugin

Examples of org.bukkit.plugin.PluginDescriptionFile


        if (listener != null) {
            ChestShop.registerListener(listener);
        }

        PluginDescriptionFile description = plugin.getDescription();
        ChestShop.getBukkitLogger().info(description.getName() + " version " + description.getVersion() + " loaded.");
    }
View Full Code Here


          customConfig = YamlConfiguration.loadConfiguration(configFile);
        } else {
            log.severe("[NuxFlags] File not found : plugins/NuxFlags/config.yml");
        }

        PluginDescriptionFile pdfFile = this.getDescription();
        log.info("[NuxFlags] " + pdfFile.getName() + " version " + pdfFile.getVersion() + " is enabled!");
       
    }
View Full Code Here

    public void onEnable() {
        try {
            configuration = new Configuration(new File(getDataFolder().getPath() + "/config.yml"));
            configuration.load();
            PluginDescriptionFile desc = this.getDescription();
            VERSION = desc.getVersion();
            server = this.getServer();
          
            Field cfield = CraftServer.class.getDeclaredField("console");
            cfield.setAccessible(true);
            console = (MinecraftServer) cfield.get((CraftServer)getServer());
View Full Code Here

  /**
   * Generic method that posts a plugin to the metrics website
   */
  void postPlugin(final boolean isPing) throws IOException {
    // Server software specific section
    final PluginDescriptionFile description = plugin.getDescription();
    final String pluginName = description.getName();
    final boolean onlineMode = Bukkit.getServer().getOnlineMode(); // TRUE if online mode is enabled
    final String pluginVersion = description.getVersion();
    final String serverVersion = Bukkit.getVersion();
    final 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 {
        // The plugin's description file containg all of the plugin data such as name, version, author, etc
        final PluginDescriptionFile description = plugin.getDescription();

        // Construct the post data
        final StringBuilder data = new StringBuilder();
        data.append(encode("guid")).append('=').append(encode(guid));
        encodeDataPair(data, "version", description.getVersion());
        encodeDataPair(data, "server", Bukkit.getVersion());
        encodeDataPair(data, "players", Integer.toString(Bukkit.getServer().getOnlinePlayers().length));
        encodeDataPair(data, "revision", String.valueOf(REVISION));

        // If we're pinging, append it
View Full Code Here

    final Skript skript = (Skript) ObjenesisHelper.newInstance(Skript.class); // bypass the class loader check
    final Field instance = Skript.class.getDeclaredField("instance");
    instance.setAccessible(true);
    instance.set(null, skript);
   
    final PluginDescriptionFile pdf = new PluginDescriptionFile(new FileInputStream(new File(dataDir, "plugin.yml")));
   
//      final void init(PluginLoader loader, Server server, PluginDescriptionFile description, File dataFolder, File file, ClassLoader classLoader) {
    final Method init = JavaPlugin.class.getDeclaredMethod("init", PluginLoader.class, Server.class, PluginDescriptionFile.class, File.class, File.class, ClassLoader.class);
    init.setAccessible(true);
    init.invoke(skript, new JavaPluginLoader(s), s, pdf, dataDir, jar, getClass().getClassLoader());
View Full Code Here

            return true;
        } else if (subcommand.equals("about")) {
            if (!checkPerm(sender, "about")) return true;

            // plugin information
            PluginDescriptionFile desc = plugin.getDescription();
            sender.sendMessage(ChatColor.GOLD + desc.getName() + ChatColor.GREEN + " version " + ChatColor.GOLD + desc.getVersion());
            String auth = desc.getAuthors().get(0);
            for (int i = 1; i < desc.getAuthors().size(); ++i) {
                auth += ChatColor.GREEN + ", " + ChatColor.WHITE + desc.getAuthors().get(i);
            }
            sender.sendMessage(ChatColor.GREEN + "By " + ChatColor.WHITE + auth);
            sender.sendMessage(ChatColor.GREEN + "Website: " + ChatColor.WHITE + desc.getWebsite());

            // stats
            if (!plugin.getMetrics().enabled) {
                sender.sendMessage(ChatColor.GOLD + "Metrics are disabled.");
                return true;
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.