当前位置: 首页>>代码示例>>Java>>正文


Java AuthorNagException类代码示例

本文整理汇总了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"));
}
 
开发者ID:CyberdyneCC,项目名称:Thermos-Bukkit,代码行数:12,代码来源:JavaPlugin.java

示例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


注:本文中的org.bukkit.plugin.AuthorNagException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。