本文整理匯總了Java中org.bukkit.plugin.java.JavaPlugin.getName方法的典型用法代碼示例。如果您正苦於以下問題:Java JavaPlugin.getName方法的具體用法?Java JavaPlugin.getName怎麽用?Java JavaPlugin.getName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.bukkit.plugin.java.JavaPlugin
的用法示例。
在下文中一共展示了JavaPlugin.getName方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getLibraryResolver
import org.bukkit.plugin.java.JavaPlugin; //導入方法依賴的package包/類
@Override
public LibraryResolver getLibraryResolver(Object realm) {
if (!(realm instanceof JavaPlugin))
throw new IllegalArgumentException("Only realms of type " + JavaPlugin.class.getName() + " are supported");
JavaPlugin plugin = (JavaPlugin) realm;
ClassLoader classLoader = plugin.getClass().getClassLoader();
if (!(classLoader instanceof URLClassLoader))
throw new UnsupportedOperationException("Plugin " + plugin.getName() + " was not loaded by a URLClassLoader");
return libraryResolvers.computeIfAbsent(plugin.getName(), name -> new ClassLoaderLibraryResolver(
repositorySystem,
createSession(),
remoteRepositorySupplier,
(URLClassLoader) classLoader,
plugin.getLogger()
));
}
示例2: Updater
import org.bukkit.plugin.java.JavaPlugin; //導入方法依賴的package包/類
public Updater(JavaPlugin pluginToUpdate, int spigotID, String jarName) {
this.pluginToUpdate = pluginToUpdate;
this.dataFolder = pluginToUpdate.getDataFolder().getAbsolutePath();
this.currentVersion = pluginToUpdate.getDescription().getVersion();
this.updateURL = "https://api.spiget.org/v2/resources/" + spigotID;
this.pluginName = pluginToUpdate.getName();
this.jarName = jarName;
}
示例3: toInternalName
import org.bukkit.plugin.java.JavaPlugin; //導入方法依賴的package包/類
/**
* Convert (plugin, timerName) pair to internal timer name string
*/
static String toInternalName(JavaPlugin plugin, String timerName) {
return plugin.getName() + "!" + timerName;
}