本文整理匯總了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;
}