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


Java Skript.checkAcceptRegistrations方法代码示例

本文整理汇总了Java中ch.njol.skript.Skript.checkAcceptRegistrations方法的典型用法代码示例。如果您正苦于以下问题:Java Skript.checkAcceptRegistrations方法的具体用法?Java Skript.checkAcceptRegistrations怎么用?Java Skript.checkAcceptRegistrations使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ch.njol.skript.Skript的用法示例。


在下文中一共展示了Skript.checkAcceptRegistrations方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: registerEventValue

import ch.njol.skript.Skript; //导入方法依赖的package包/类
/**
 * Same as {@link #registerEventValue(Class, Class, Getter, int)}
 * 
 * @param e
 * @param c
 * @param g
 * @param time
 * @param excludes Subclasses of the event for which this event value should not be registered for
 */
public static <T, E extends Event> void registerEventValue(final Class<E> e, final Class<T> c, final Getter<T, E> g, final int time, final @Nullable String excludeErrorMessage, final @Nullable Class<? extends E>... excludes) {
	Skript.checkAcceptRegistrations();
	final List<EventValueInfo<?, ?>> eventValues = getEventValuesList(time);
	for (int i = 0; i < eventValues.size(); i++) {
		final EventValueInfo<?, ?> info = eventValues.get(i);
		if (info.event != e ? info.event.isAssignableFrom(e) : info.c.isAssignableFrom(c)) {
			eventValues.add(i, new EventValueInfo<E, T>(e, c, g, excludeErrorMessage, excludes));
			return;
		}
	}
	eventValues.add(new EventValueInfo<E, T>(e, c, g, excludeErrorMessage, excludes));
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:22,代码来源:EventValues.java

示例2: registerConverter

import ch.njol.skript.Skript; //导入方法依赖的package包/类
public static <F, T> void registerConverter(final Class<F> from, final Class<T> to, final Converter<F, T> converter, final int options) {
	Skript.checkAcceptRegistrations();
	final ConverterInfo<F, T> info = new ConverterInfo<F, T>(from, to, converter, options);
	for (int i = 0; i < converters.size(); i++) {
		final ConverterInfo<?, ?> info2 = converters.get(i);
		if (info2.from.isAssignableFrom(from) && to.isAssignableFrom(info2.to)) {
			converters.add(i, info);
			return;
		}
	}
	converters.add(info);
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:13,代码来源:Converters.java

示例3: registerClass

import ch.njol.skript.Skript; //导入方法依赖的package包/类
/**
 * @param info info about the class to register
 */
public static <T> void registerClass(final ClassInfo<T> info) {
	Skript.checkAcceptRegistrations();
	if (classInfosByCodeName.containsKey(info.getCodeName()))
		throw new IllegalArgumentException("Can't register " + info.getC().getName() + " with the code name " + info.getCodeName() + " because that name is already used by " + classInfosByCodeName.get(info.getCodeName()));
	if (exactClassInfos.containsKey(info.getC()))
		throw new IllegalArgumentException("Can't register the class info " + info.getCodeName() + " because the class " + info.getC().getName() + " is already registered");
	if (info.getCodeName().length() > DatabaseStorage.MAX_CLASS_CODENAME_LENGTH)
		throw new IllegalArgumentException("The codename '" + info.getCodeName() + "' is too long to be saved in a database, the maximum length allowed is " + DatabaseStorage.MAX_CLASS_CODENAME_LENGTH);
	exactClassInfos.put(info.getC(), info);
	classInfosByCodeName.put(info.getCodeName(), info);
	tempClassInfos.add(info);
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:16,代码来源:Classes.java

示例4: registerFunction

import ch.njol.skript.Skript; //导入方法依赖的package包/类
/**
 * @param function
 * @return The passed function
 */
public final static JavaFunction<?> registerFunction(final JavaFunction<?> function) {
	Skript.checkAcceptRegistrations();
	if (!function.name.matches(functionNamePattern))
		throw new SkriptAPIException("Invalid function name '" + function.name + "'");
	if (functions.containsKey(function.name))
		throw new SkriptAPIException("Duplicate function " + function.name);
	functions.put(function.name, new FunctionData(function));
	javaFunctions.put(function.name, function);
	return function;
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:15,代码来源:Functions.java

示例5: registerComparator

import ch.njol.skript.Skript; //导入方法依赖的package包/类
/**
 * Registers a {@link Comparator}.
 * 
 * @param t1
 * @param t2
 * @param c
 * @throws IllegalArgumentException if any given class is equal to <code>Object.class</code>
 */
public static <T1, T2> void registerComparator(final Class<T1> t1, final Class<T2> t2, final Comparator<T1, T2> c) {
	Skript.checkAcceptRegistrations();
	if (t1 == Object.class && t2 == Object.class)
		throw new IllegalArgumentException("You must not add a comparator for Objects");
	comparators.add(new ComparatorInfo<T1, T2>(t1, t2, c));
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:15,代码来源:Comparators.java


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