本文整理汇总了Java中org.bukkit.plugin.AuthorNagException类的典型用法代码示例。如果您正苦于以下问题:Java AuthorNagException类的具体用法?Java AuthorNagException怎么用?Java AuthorNagException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AuthorNagException类属于org.bukkit.plugin包,在下文中一共展示了AuthorNagException类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initialize
import org.bukkit.plugin.AuthorNagException; //导入依赖的package包/类
/**
* @deprecated This method is legacy and will be removed - it must be
* replaced by the specially provided constructor(s).
*/
@Deprecated
protected final void initialize(PluginLoader loader, Server server, PluginDescriptionFile description, File dataFolder, File file, ClassLoader classLoader) {
if (server.getWarningState() == WarningState.OFF) {
return;
}
getLogger().log(Level.WARNING, getClass().getName() + " is already initialized", server.getWarningState() == WarningState.DEFAULT ? null : new AuthorNagException("Explicit initialization"));
}
示例2: addRegistration
import org.bukkit.plugin.AuthorNagException; //导入依赖的package包/类
/**
* Registers a new {@link IRangeGroupType}, with the given name.
*
* @param id
* The ID to register under.
* @param rangeGroupType
* The {@link IRangeGroupType} to register.
* @throws IllegalArgumentException
* If there already is a registration for the given ID
* @throws IllegalArgumentException
* If either id or rangeProducer are null.
*/
public void addRegistration(String id, IRangeGroupType<?> rangeGroupType)
throws IllegalArgumentException {
if (finished) {
// Well, I'm not 100% sure if this is what AuthorNagException is for
// but I think this will do. It doesn't seem to be thrown anywhere
// else (EVER), but it looks like bukkit uses it to write a log
// message to go "nag" at the author of the plugin (with their name
// as found in plugin.yml). Seems perfect for something that should
// not happen unless someone is TRYING to break WDLCompanion.
throw new AuthorNagException(
"Group type registrations have already finished! Did you "
+ "grab on to this event to try and add new "
+ "registrations later on? Please don't do "
+ "that, thanks. The config has already been "
+ "parsed and your new type would be ignored. "
+ "(Attempted to add a IRangeGroupType, "
+ rangeGroupType + ", with an ID of " + id
+ ", to WDLCompanion's rangeGroup map in a "
+ "RangeGroupTypeRegistrationEvent)");
}
if (id == null) {
throw new IllegalArgumentException("id must not be null!");
}
if (rangeGroupType == null) {
throw new IllegalArgumentException("rangeProducer must not be null!");
}
if (plugin.registeredRangeGroupTypes.containsKey(id)) {
throw new IllegalArgumentException(
"RangeProducer already registered for id '" + id
+ "'; tried to register " + rangeGroupType
+ " over it (currently registered: "
+ plugin.registeredRangeGroupTypes.get(id) + ")");
}
plugin.registeredRangeGroupTypes.put(id, rangeGroupType);
plugin.getLogger().fine(
"Registered IRangeProducer " + rangeGroupType + " under '" + id
+ "'.");
}
开发者ID:Pokechu22,项目名称:WorldDownloader-Serverside-Companion,代码行数:51,代码来源:RangeGroupTypeRegistrationEvent.java