本文整理汇总了Java中org.bukkit.plugin.Plugin.getName方法的典型用法代码示例。如果您正苦于以下问题:Java Plugin.getName方法的具体用法?Java Plugin.getName怎么用?Java Plugin.getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bukkit.plugin.Plugin
的用法示例。
在下文中一共展示了Plugin.getName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: UpdateChecker
import org.bukkit.plugin.Plugin; //导入方法依赖的package包/类
public UpdateChecker(Plugin plugin, String spigotFullId) {
this.plugin = plugin;
this.spigotId = spigotFullId;
try {
this.spigotUrl = new URL("https://www.spigotmc.org/resources/" + spigotId + "/");
} catch (MalformedURLException e) {
throw new IllegalArgumentException("Invalid spigot id: " + spigotId);
}
this.logger = plugin.getLogger();
permission = new Permission(plugin.getName() + ".update");
permission.setDefault(PermissionDefault.OP);
Bukkit.getPluginManager().addPermission(permission);
setInterval(20*60*30);//30 minutes
message = buildMessage();
}
示例2: build
import org.bukkit.plugin.Plugin; //导入方法依赖的package包/类
public void build(Plugin pl){
String plugin = !pl.getName().equalsIgnoreCase("DogTags") ? pl.getName() : null;
DogTags.getTags().add(this);
if(plugin != null){
LogUtil.outputMsg(pl.getName() + " has registered the '"+id+"' tag.");
}
}
示例3: setPermsSystem
import org.bukkit.plugin.Plugin; //导入方法依赖的package包/类
public void setPermsSystem() {
PluginManager pm = Bukkit.getServer().getPluginManager();
for(Plugin pl : pm.getPlugins()){
if(pl.isEnabled()){
String plName = pl.getName();
if(app.contains(plName)){
permsPlugin = pm.getPlugin(plName);
}
}
}
}
示例4: getPeachAPI
import org.bukkit.plugin.Plugin; //导入方法依赖的package包/类
/**
* Provides an instance of the {@link PeachAPI}.
*
* @throws RuntimeException if Peach has not initialised. If this occurs then make
* sure you add Peach to your plugin.yml 'depends' list.
*
* @param plugin the plugin requesting the API.
* @return the one and only instance of the Peach API.
*/
public static PeachAPI getPeachAPI(Plugin plugin) {
if (api == null) {
throw new RuntimeException(plugin.getName() + " tried to access the Peach API while it has not been initialised.");
}
return api;
}