本文整理汇总了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;
}