Hi! How i can cast a "File" to a "Plugin" ? Because the loadPlugin method use a file, but the disablePlugin method a Plugin...
Am I mistaken in thinking this is because loadPlugin returns a plugin from the plugin's file, and when said plugin is loaded, it can be disabled using disablePlugin? I don't see why you'd need to cast at all.
loadPlugin wants a File cause you want to load a plugin that bukkit doesn't know yet, so you have to tell it where to find the jar. But it returns a Plugin object to use, for example with disablePlugin. If you want a already loaded plugin try: Bukkit.getPluginManager().getPlugin("PluginName"); which returns a Plugin object (or null), too.