本文整理汇总了Java中ch.njol.skript.lang.Effect类的典型用法代码示例。如果您正苦于以下问题:Java Effect类的具体用法?Java Effect怎么用?Java Effect使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Effect类属于ch.njol.skript.lang包,在下文中一共展示了Effect类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import ch.njol.skript.lang.Effect; //导入依赖的package包/类
@SuppressWarnings("deprecation")
@Override
protected void execute(Event evt) {
int id = 0;
String core = type.getSingle(evt);
if (core.toUpperCase().replace(" ", "_").contains("BLOCK_CRACK")
|| core.toUpperCase().replace(" ", "_").contains("BLOCK_DUST")) {
int index = type.getSingle(evt).lastIndexOf("_");
try {
id = Integer.parseInt(type.getSingle(evt).substring(index + 1));
} catch (Exception exception) {
Skript.error("Could not parse datavalue!");
id = 0;
}
core = core.substring(0, index);
}
player.getSingle(evt).playEffect(location.getSingle(evt), org.bukkit.Effect.getByName(core),
Material.getMaterial(id));
}
示例2: registerEffect
import ch.njol.skript.lang.Effect; //导入依赖的package包/类
public void registerEffect(Class<? extends Effect> effect){
if (!effect.isAnnotationPresent(Documentation.class)){
throw new RegistrationException("Effect class: " + effect.getCanonicalName()
+ " does not have a Documentation annotation");
}
Documentation documentation = effect.getDeclaredAnnotation(Documentation.class);
Skript.registerEffect(effect, addAddonPrefix(documentation.syntax()));
}
示例3: registerEffect
import ch.njol.skript.lang.Effect; //导入依赖的package包/类
/**
* Registers an {@link Effect}.
*
* @param effect The effect's class
* @param patterns Skript patterns to match this effect
*/
@SuppressWarnings("null")
public static <E extends Effect> void registerEffect(final Class<E> effect, final String... patterns) throws IllegalArgumentException {
checkAcceptRegistrations();
Pair<Boolean, String[]> pair = FeatureConfig.contains(effect.getSimpleName(), patterns);
if(pair.getFirst())
return;
final SyntaxElementInfo<E> info = new SyntaxElementInfo<E>(pair.getSecond(), effect);
effects.add(info);
statements.add(info);
}
示例4: registerEffect
import ch.njol.skript.lang.Effect; //导入依赖的package包/类
/**
* Registers an {@link Effect}.
*
* @param effect The effect's class
* @param patterns Skript patterns to match this effect
*/
public static <E extends Effect> void registerEffect(final Class<E> effect, final String... patterns) throws IllegalArgumentException {
checkAcceptRegistrations();
final SyntaxElementInfo<E> info = new SyntaxElementInfo<E>(patterns, effect);
effects.add(info);
statements.add(info);
}
示例5: getEffects
import ch.njol.skript.lang.Effect; //导入依赖的package包/类
public static Collection<SyntaxElementInfo<? extends Effect>> getEffects() {
return effects;
}