java @literal_Java Literal類代碼示例
本文整理匯總了Java中ch.njol.skript.lang.Literal類的典型用法代碼示例。如果您正苦於以下問題:Java Literal類的具體用法?Java Literal怎麽用?Java Literal使用的例子?那麽恭喜您, 這裏精選的類代碼示例或許可以為您提供幫助。
Literal類屬於ch.njol.skript.lang包,在下文中一共展示了Literal類的40個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於我們的係統推薦出更棒的Java代碼示例。
示例1: init
點讚 3
import ch.njol.skript.lang.Literal; //導入依賴的package包/類
@SuppressWarnings("unchecked")
@Override
public boolean init(Literal>[] args, int matchedPattern,
SkriptParser.ParseResult parseResult) {
isChanger = (parseResult.mark & 1) == 1;
String what = parseResult.regexes.get(0).group();
switch (matchedPattern) {
case 0:
whiches.add(createSyntaxInfo(what, (parseResult.mark & 2) == 2, false));
break;
case 1:
String fromType = ((Literal) args[0]).getSingle().getCodeName();
whiches.add(createSyntaxInfo("[the] " + what + " of %$" + fromType + "s%", false, true));
whiches.add(createSyntaxInfo("%$" + fromType + "s%'[s] " + what, false, false));
break;
}
return true;
}
開發者ID:btk5h,項目名稱:skript-mirror,代碼行數:21,
示例2: init
點讚 3
import ch.njol.skript.lang.Literal; //導入依賴的package包/類
@SuppressWarnings("unchecked")
@Override
public boolean init(Literal>[] args, int matchedPattern,
SkriptParser.ParseResult parseResult) {
String c = parseResult.regexes.get(0).group();
switch (matchedPattern) {
case 0:
whiches.add(createSyntaxInfo(c, false));
break;
case 1:
String type = ((Literal) args[0]).getSingle().getCodeName();
whiches.add(createSyntaxInfo("%" + type + "% (is|are) " + c, false));
whiches.add(createSyntaxInfo("%" + type + "% (isn't|is not|aren't|are not) " + c, true));
break;
}
return true;
}
開發者ID:btk5h,項目名稱:skript-mirror,代碼行數:19,
示例3: init
點讚 3
import ch.njol.skript.lang.Literal; //導入依賴的package包/類
@SuppressWarnings({"unchecked", "null"})
@Override
public boolean init(final Expression>[] vars, final int matchedPattern, final Kleenean isDelayed, final ParseResult parser) {
invis = (Expression) vars[0];
items = (Expression) vars[1];
if (items instanceof Literal) {
for (ItemType t : ((Literal) items).getAll()) {
t = t.getItem();
if (!(t.isAll() || (t.getTypes().size() == 1 && !t.getTypes().get(0).hasDataRange() && t.getTypes().get(0).getId() != -1))) {
Skript.error("The condition 'can hold' can currently only be used with aliases that start with 'every' or 'all', or only represent one item and one data value.", ErrorQuality.SEMANTIC_ERROR);
return false;
}
}
}
setNegated(matchedPattern == 1);
return true;
}
開發者ID:nfell2009,項目名稱:Skript,代碼行數:18,
示例4: init
點讚 3
import ch.njol.skript.lang.Literal; //導入依賴的package包/類
@Override
public boolean init(final Expression>[] exprs, final int matchedPattern, final Kleenean isDelayed, final ParseResult parseResult) {
final Object type = exprs[0] == null ? null : ((Literal>) exprs[0]).getSingle();
if (type instanceof EntityData) {
entityType = (EntityData>) type;
if (!ScriptLoader.isCurrentEvent(PlayerInteractEntityEvent.class)) {
Skript.error("The expression 'clicked entity' can only be used in a click event", ErrorQuality.SEMANTIC_ERROR);
return false;
}
} else {
itemType = (ItemType) type;
if (!ScriptLoader.isCurrentEvent(PlayerInteractEvent.class)) {
Skript.error("The expression 'clicked block' can only be used in a click event", ErrorQuality.SEMANTIC_ERROR);
return false;
}
}
return true;
}
開發者ID:nfell2009,項目名稱:Skript,代碼行數:19,
示例5: init
點讚 3
import ch.njol.skript.lang.Literal; //導入依賴的package包/類
@SuppressWarnings({"unchecked", "null"})
@Override
public boolean init(final Expression>[] exprs, final int matchedPattern, final Kleenean isDelayed, final ParseResult parseResult) {
effects = (Expression) exprs[0];
direction = (Expression) exprs[1];
where = exprs[2];
players = (Expression) exprs[3];
if (effects instanceof Literal) {
final VisualEffect[] effs = effects.getAll(null);
boolean hasLocationEffect = false, hasEntityEffect = false;
for (final VisualEffect e : effs) {
if (e.isEntityEffect())
hasEntityEffect = true;
else
hasLocationEffect = true;
}
if (!hasLocationEffect && players != null)
Skript.warning("Entity effects are visible to all players");
if (!hasLocationEffect && !direction.isDefault())
Skript.warning("Entity effects are always played on an entity");
if (hasEntityEffect && !Entity.class.isAssignableFrom(where.getReturnType()))
Skript.warning("Entity effects can only be played on entities");
}
return true;
}
開發者ID:nfell2009,項目名稱:Skript,代碼行數:26,
示例6: init
點讚 2
import ch.njol.skript.lang.Literal; //導入依賴的package包/類
@Override
public boolean init(final Literal>[] args, final int matchedPattern, final SkriptParser.ParseResult parser) {
prefix = ((Literal) args[0]).getSingle();
if ("".equals(prefix)) {
Skript.error(prefix + " is not a valid placeholder", ErrorQuality.SEMANTIC_ERROR);
return false;
}
new PlaceholderAPIListener(Main.getInstance(), prefix).hook();
return true;
}
開發者ID:Pikachu920,項目名稱:Ersatz,代碼行數:11,
示例7: defendExpression
點讚 2
import ch.njol.skript.lang.Literal; //導入依賴的package包/類
@SuppressWarnings("unchecked")
public static Expression defendExpression(Expression> expr) {
if (expr instanceof UnparsedLiteral) {
Literal> parsed = ((UnparsedLiteral) expr).getConvertedExpression(Object.class);
return (Expression) (parsed == null ? expr : parsed);
} else if (expr instanceof ExpressionList) {
Expression[] exprs = ((ExpressionList) expr).getExpressions();
for (int i = 0; i < exprs.length; i++) {
exprs[i] = defendExpression(exprs[i]);
}
}
return (Expression) expr;
}
開發者ID:btk5h,項目名稱:skript-mirror,代碼行數:14,
示例8: init
點讚 2
import ch.njol.skript.lang.Literal; //導入依賴的package包/類
@SuppressWarnings("unchecked")
@Override
public boolean init(Literal>[] lit, int arg1, ParseResult arg2) {
String[] strings = ((Literal) lit[0]).getAll();
for (int i = 0; i < strings.length; i ++) {
ids.add(strings[i].toLowerCase());
}
return true;
}
開發者ID:MundoSK,項目名稱:MundoSK,代碼行數:10,
示例9: init
點讚 2
import ch.njol.skript.lang.Literal; //導入依賴的package包/類
@Override
public boolean init(Expression>[] expressions, int i, Kleenean kleenean, SkriptParser.ParseResult parseResult) {
String string;
isSingle = i == 0;
if (expressions[0] == null) {
string = getConverterNameByIndex(parseResult.mark, isSingle);
} else if (expressions[0] instanceof Literal>) {
string = ((Literal) expressions[0]).getSingle();
} else if (expressions[0] instanceof VariableString) {
String fullstring = ((VariableString) expressions[0]).toString();
string = fullstring.substring(1, fullstring.length() - 1);
} else {
Skript.error("The string '" + expressions[0] + "' is not a literal string! Only literal strings can be used in the pjson expression!");
return false;
}
Logging.debug(this, "String == " + string + " isSingle == " + isSingle);
index = (Expression) expressions[1];
packetContainerExpression = (Expression) expressions[2];
singleConverter = getSingleConverter(string.toLowerCase());
pluralConverter = getPluralConverter(string.toLowerCase());
Logging.debug(this, "Converters == " + singleConverter + " , " + pluralConverter);
if (isSingle ? singleConverter == null : pluralConverter == null) {
Skript.error("The string " + string + " is not a valid packetinfo!");
return false;
}
return true;
}
開發者ID:MundoSK,項目名稱:MundoSK,代碼行數:28,
示例10: init
點讚 2
import ch.njol.skript.lang.Literal; //導入依賴的package包/類
@Override
public boolean init(Literal>[] literals, int i, SkriptParser.ParseResult parseResult) {
packetType = ((Literal) literals[0]).getSingle();
SectionNode topNode = (SectionNode) SkriptLogger.getNode();
try {
List aliases = new ArrayList<>();
for (Node node : topNode) {
SkriptLogger.setNode(node);
if (node instanceof SectionNode) {
Skript.error("Packet info aliases should not be sections!");
return false;
}
int separatorIndex = node.getKey().indexOf(SEPARATOR);
if (separatorIndex == -1) {
Skript.error("Packet info aliases should be in the format ' " + SEPARATOR + " '");
return false;
}
String syntax = node.getKey().substring(0, separatorIndex).trim();
Optional validatedSyntax = validateAliasSyntax(syntax);
if (!validatedSyntax.isPresent()) {
return false;
}
String original = node.getKey().substring(separatorIndex + 1).trim();
Optional aliasOptional = PacketInfoAlias.create(packetType, validatedSyntax.get(), original);
if (!aliasOptional.isPresent()) {
Skript.error("Invalid target syntax in the packet info alias!");
return false;
}
aliases.add(aliasOptional.get());
}
key = ExprPacketInfoAlias.registerAliases(aliases);
return true;
} finally {
ScopeUtil.removeSubNodes(topNode);
}
}
開發者ID:MundoSK,項目名稱:MundoSK,代碼行數:37,
示例11: init
點讚 2
import ch.njol.skript.lang.Literal; //導入依賴的package包/類
@Override
public boolean init(Literal>[] literals, int i, SkriptParser.ParseResult parseResult) {
PacketType[] packetTypeArray = ((Literal) literals[0]).getAll();
packetTypesToString = literals[0].toString();
MundoPacketEvent.addListener(packetTypeArray);
packetTypes = Arrays.asList(packetTypeArray);
return true;
}
開發者ID:MundoSK,項目名稱:MundoSK,代碼行數:9,
示例12: init
點讚 2
import ch.njol.skript.lang.Literal; //導入依賴的package包/類
@Override
public boolean init(Expression>[] expressions, int i, Kleenean kleenean, SkriptParser.ParseResult parseResult) {
int index = parseResult.mark;
char ch = chars[index];
Number preValue = ((Literal) expressions[0]).getSingle();
value = getValue(preValue, ch);
toString = preValue + "" + ch;
return true;
}
開發者ID:MundoSK,項目名稱:MundoSK,代碼行數:10,
示例13: init
點讚 2
import ch.njol.skript.lang.Literal; //導入依賴的package包/類
@Override
protected boolean init(final Literal>[] exprs, final int matchedPattern, final ParseResult parseResult) {
variant = Variant.values()[matchedPattern];
//if (variant == Variant.HORSE) {
TODO color and style // rem: toString
//}
return true;
}
開發者ID:nfell2009,項目名稱:Skript,代碼行數:9,
示例14: init
點讚 2
import ch.njol.skript.lang.Literal; //導入依賴的package包/類
@SuppressWarnings("unchecked")
@Override
protected boolean init(final Literal>[] exprs, final int matchedPattern, final ParseResult parseResult) {
if (exprs[0] != null)
hand = ((Literal) exprs[0]).getAll();
return true;
}
開發者ID:nfell2009,項目名稱:Skript,代碼行數:8,
示例15: init
點讚 2
import ch.njol.skript.lang.Literal; //導入依賴的package包/類
@Override
protected boolean init(final Literal>[] exprs, final int matchedPattern, final ParseResult parseResult) {
if (matchedPattern <= 2)
angry = matchedPattern - 1;
else
tamed = matchedPattern == 3 ? -1 : 1;
return true;
}
開發者ID:nfell2009,項目名稱:Skript,代碼行數:9,
示例16: init
點讚 2
import ch.njol.skript.lang.Literal; //導入依賴的package包/類
@SuppressWarnings("unchecked")
@Override
protected boolean init(final Literal>[] exprs, final int matchedPattern, final ParseResult parseResult) {
if (exprs.length > 0 && exprs[0] != null) {
if ((types = Converters.convert(((Literal) exprs[0]).getAll(), ItemType.class, new Converter() {
@Override
@Nullable
public ItemType convert(ItemType t) {
t = t.getBlock().clone();
final Iterator iter = t.iterator();
while (iter.hasNext()) {
final int id = iter.next().getId();
if (id <= 0 || id > Skript.MAXBLOCKID)
iter.remove();
}
if (t.numTypes() == 0)
return null;
t.setAmount(-1);
t.setAll(false);
t.clearEnchantments();
return t;
}
})).length == 0) {
Skript.error(m_not_a_block_error.toString());
return false;
}
}
return true;
}
開發者ID:nfell2009,項目名稱:Skript,代碼行數:30,
示例17: init
點讚 2
import ch.njol.skript.lang.Literal; //導入依賴的package包/類
@SuppressWarnings("null")
@Override
public final boolean init(final Expression>[] exprs, final int matchedPattern, final Kleenean isDelayed, final ParseResult parseResult) {
this.matchedPattern = matchedPattern;
// plural bits (0x3): 0 = singular, 1 = plural, 2 = unknown
final int pluralBits = parseResult.mark & 0x3;
this.plural = pluralBits == 1 ? Kleenean.TRUE : pluralBits == 0 ? Kleenean.FALSE : Kleenean.UNKNOWN;
// age bits (0xC): 0 = unknown, 4 = baby, 8 = adult
final int ageBits = parseResult.mark & 0xC;
this.baby = ageBits == 4 ? Kleenean.TRUE : ageBits == 8 ? Kleenean.FALSE : Kleenean.UNKNOWN;
return init(Arrays.copyOf(exprs, exprs.length, Literal[].class), matchedPattern, parseResult);
}
開發者ID:nfell2009,項目名稱:Skript,代碼行數:13,
示例18: init
點讚 2
import ch.njol.skript.lang.Literal; //導入依賴的package包/類
@SuppressWarnings("null")
@Override
protected boolean init(final Literal>[] exprs, final int matchedPattern, final ParseResult parseResult) {
info = types.get(matchedPattern);
assert info != null : matchedPattern;
return true;
}
開發者ID:nfell2009,項目名稱:Skript,代碼行數:8,
示例19: init
點讚 2
import ch.njol.skript.lang.Literal; //導入依賴的package包/類
@SuppressWarnings("unchecked")
@Override
protected boolean init(final Literal>[] exprs, final int matchedPattern, final ParseResult parseResult) {
sheared = matchedPattern - 1;
if (exprs[0] != null)
colors = ((Literal) exprs[0]).getAll();
return true;
}
開發者ID:nfell2009,項目名稱:Skript,代碼行數:9,
示例20: init
點讚 2
import ch.njol.skript.lang.Literal; //導入依賴的package包/類
@SuppressWarnings({"unchecked", "null"})
@Override
public boolean init(final Expression>[] exprs, final int matchedPattern, final Kleenean isDelayed, final ParseResult parseResult) {
amount = (Expression) exprs[0];
unit = ((Literal) exprs[1]).getSingle();
return true;
}
開發者ID:nfell2009,項目名稱:Skript,代碼行數:8,
示例21: simplify
點讚 2
import ch.njol.skript.lang.Literal; //導入依賴的package包/類
@SuppressWarnings("null")
@Override
public Expression extends Number> simplify() {
if (first instanceof Literal && second instanceof Literal)
return new SimpleLiteral(getArray(null), Number.class, false);
return this;
}
開發者ID:nfell2009,項目名稱:Skript,代碼行數:8,
示例22: init
點讚 2
import ch.njol.skript.lang.Literal; //導入依賴的package包/類
@SuppressWarnings({"unchecked", "null"})
@Override
public boolean init(final Expression>[] vars, final int matchedPattern, final Kleenean isDelayed, final ParseResult parser) {
setExpr((Expression) vars[0]);
if (parser.mark != 1) {
single = true;
if (!getExpr().isSingle() || (getExpr() instanceof Literal && ((Literal) getExpr()).getSingle().getTypes().size() != 1)) {
Skript.warning("'" + getExpr() + "' has multiple ids");
single = false;
}
}
return true;
}
開發者ID:nfell2009,項目名稱:Skript,代碼行數:14,
示例23: init
點讚 2
import ch.njol.skript.lang.Literal; //導入依賴的package包/類
@SuppressWarnings("unchecked")
@Override
public boolean init(final Expression>[] exprs, final int matchedPattern, final Kleenean isDelayed, final ParseResult parseResult) {
final Expression> expr = exprs[1].getConvertedExpression((((Literal>) exprs[0]).getSingle()).getC());
if (expr == null)
return false;
this.expr = expr;
return true;
}
開發者ID:nfell2009,項目名稱:Skript,代碼行數:10,
示例24: init
點讚 2
import ch.njol.skript.lang.Literal; //導入依賴的package包/類
@SuppressWarnings("unchecked")
@Override
public boolean init(final Expression>[] exprs, final int matchedPattern, final Kleenean isDelayed, final ParseResult parseResult) {
type = ((Literal>) exprs[0]).getSingle();
spawned = parseResult.mark == 0;
return true;
}
開發者ID:nfell2009,項目名稱:Skript,代碼行數:8,
示例25: init
點讚 2
import ch.njol.skript.lang.Literal; //導入依賴的package包/類
@Override
public boolean init(final Expression>[] exprs, final int matchedPattern, final Kleenean isDelayed, final ParseResult parser) {
@SuppressWarnings("unchecked")
final ClassInfo> ci = ((Literal>) exprs[0]).getSingle();
final EventValueExpression> e = new EventValueExpression(ci.getC());
setExpr(e);
return e.init();
}
開發者ID:nfell2009,項目名稱:Skript,代碼行數:9,
示例26: init
點讚 2
import ch.njol.skript.lang.Literal; //導入依賴的package包/類
@SuppressWarnings("null")
@Override
public boolean init(final Expression>[] exprs, final int matchedPattern, final Kleenean isDelayed, final ParseResult parseResult) {
expr = exprs[0];
if (expr instanceof Literal)
return false;
if (expr.isSingle()) {
Skript.error("'" + expr.toString(null, false) + "' can only ever have one value at most, thus the 'amount of ...' expression is useless. Use '... exists' instead to find out whether the expression has a value.");
return false;
}
return true;
}
開發者ID:nfell2009,項目名稱:Skript,代碼行數:13,
示例27: init
點讚 2
import ch.njol.skript.lang.Literal; //導入依賴的package包/類
@SuppressWarnings({"unchecked", "null"})
@Override
public boolean init(final Expression>[] exprs, final int matchedPattern, final Kleenean isDelayed, final ParseResult parseResult) {
this.matchedPattern = matchedPattern;
types = (Expression extends EntityData>>) exprs[0];
if (matchedPattern % 2 == 0) {
for (final EntityData> d : ((Literal>) types).getAll()) {
if (d.isPlural().isFalse() || d.isPlural().isUnknown() && !StringUtils.startsWithIgnoreCase(parseResult.expr, "all"))
return false;
}
}
if (matchedPattern < 2) {
worlds = (Expression) exprs[exprs.length - 1];
} else {
radius = (Expression) exprs[exprs.length - 2];
center = (Expression) exprs[exprs.length - 1];
final BlockingLogHandler log = SkriptLogger.startLogHandler(new BlockingLogHandler());
try {
centerEntity = center.getSource().getConvertedExpression(Entity.class);
} finally {
log.stop();
}
}
if (types instanceof Literal && ((Literal>) types).getAll().length == 1) {
returnType = ((Literal>) types).getSingle().getType();
}
return true;
}
開發者ID:nfell2009,項目名稱:Skript,代碼行數:29,
示例28: init
點讚 2
import ch.njol.skript.lang.Literal; //導入依賴的package包/類
@SuppressWarnings("unchecked")
@Override
public boolean init(final Expression>[] vars, final int matchedPattern, final Kleenean isDelayed, final ParseResult parser) {
if (vars.length > 0)
types = (Expression) vars[0];
blocks = matchedPattern >= 2;
if (types instanceof Literal) {
for (final ItemType t : ((Literal) types).getAll())
t.setAll(true);
}
return true;
}
開發者ID:nfell2009,項目名稱:Skript,代碼行數:13,
示例29: get
點讚 2
import ch.njol.skript.lang.Literal; //導入依賴的package包/類
@SuppressWarnings("null")
@Override
protected ItemStack[] get(final Event e) {
if (buffer != null)
return buffer;
final ArrayList r = new ArrayList();
for (final ItemStack is : new IteratorIterable(iterator(e)))
r.add(is);
if (types instanceof Literal)
return buffer = r.toArray(new ItemStack[r.size()]);
return r.toArray(new ItemStack[r.size()]);
}
開發者ID:nfell2009,項目名稱:Skript,代碼行數:13,
示例30: init
點讚 2
import ch.njol.skript.lang.Literal; //導入依賴的package包/類
@SuppressWarnings({"unchecked", "null"})
@Override
public boolean init(final Expression>[] exprs, final int matchedPattern, final Kleenean isDelayed, final ParseResult parseResult) {
setExpr(exprs[1]);
amount = (Expression) exprs[0];
if (amount instanceof Literal && getExpr() instanceof Literal)// "x of y" is also an ItemType syntax
return false;
return true;
}
開發者ID:nfell2009,項目名稱:Skript,代碼行數:10,
示例31: init
點讚 2
import ch.njol.skript.lang.Literal; //導入依賴的package包/類
@SuppressWarnings("unchecked")
@Override
public boolean init(final Literal>[] args, final int matchedPattern, final ParseResult parseResult) {
enter = parseResult.mark == 0;
regions = args.length == 0 ? null : (Literal) args[0];
return true;
}
開發者ID:nfell2009,項目名稱:Skript,代碼行數:8,
示例32: ConvertedLiteral
點讚 2
import ch.njol.skript.lang.Literal; //導入依賴的package包/類
public ConvertedLiteral(final Literal source, final T[] data, final Class to) {
super(source, to, new Converter() {
@Override
@Nullable
public T convert(final F f) {
assert false;
return Converters.convert(f, to);
}
});
this.data = data;
assert data.length > 0;
}
開發者ID:nfell2009,項目名稱:Skript,代碼行數:13,
示例33: getConvertedExpression
點讚 2
import ch.njol.skript.lang.Literal; //導入依賴的package包/類
@SuppressWarnings("unchecked")
@Override
@Nullable
public Literal extends R> getConvertedExpression(final Class... to) {
if (CollectionUtils.containsSuperclass(to, this.to))
return (Literal extends R>) this;
return ((Literal) source).getConvertedExpression(to);
}
開發者ID:nfell2009,項目名稱:Skript,代碼行數:9,
示例34: getConvertedExpression
點讚 2
import ch.njol.skript.lang.Literal; //導入依賴的package包/類
@SuppressWarnings("unchecked")
@Override
@Nullable
public Literal extends R> getConvertedExpression(final Class... to) {
if (CollectionUtils.containsSuperclass(to, c))
return (Literal extends R>) this;
final R[] parsedData = Converters.convertArray(data, to, (Class) Utils.getSuperType(to));
if (parsedData.length != data.length)
return null;
return new ConvertedLiteral(this, parsedData, (Class) Utils.getSuperType(to));
}
開發者ID:nfell2009,項目名稱:Skript,代碼行數:12,
示例35: init
點讚 2
import ch.njol.skript.lang.Literal; //導入依賴的package包/類
@SuppressWarnings({"unchecked", "null"})
@Override
public boolean init(final Literal>[] args, final int matchedPattern, final ParseResult parser) {
tick = ((Literal) args[0]).getSingle().getTicks();
worlds = args[1] == null ? Bukkit.getWorlds().toArray(new World[0]) : ((Literal) args[1]).getAll();
if (args[1] != null) {
worldNames = new String[worlds.length];
for (int i = 0; i < worlds.length; i++)
worldNames[i] = worlds[i].getName();
}
return true;
}
開發者ID:nfell2009,項目名稱:Skript,代碼行數:13,
示例36: init
點讚 2
import ch.njol.skript.lang.Literal; //導入依賴的package包/類
@SuppressWarnings("unchecked")
@Override
public boolean init(final Literal>[] args, final int matchedPattern, final ParseResult parser) {
period = ((Literal) args[0]).getSingle();
if (args.length > 1 && args[1] != null) {
worlds = ((Literal) args[1]).getArray();
//worldNames = new String[worlds.length];
//for (int i = 0; i < worlds.length; i++)
//worldNames[i] = worlds[i].getName();
}
return true;
}
開發者ID:nfell2009,項目名稱:Skript,代碼行數:13,
示例37: init
點讚 2
import ch.njol.skript.lang.Literal; //導入依賴的package包/類
@SuppressWarnings("null")
@Override
public boolean init(final Literal>[] args, final int matchedPattern, final ParseResult parser) {
if (args[0] != null) {
command = ((Literal) args[0]).getSingle();
if (command.startsWith("/"))
command = command.substring(1);
}
return true;
}
開發者ID:nfell2009,項目名稱:Skript,代碼行數:11,
示例38: init
點讚 2
import ch.njol.skript.lang.Literal; //導入依賴的package包/類
@Override
public boolean init(final Literal>[] args, final int matchedPattern, final ParseResult parser) {
//if (parser.regexes.get(0).group().equalsIgnoreCase("")/* && isValidatingInput*/)
//return true;
//final Matcher m = Pattern.compile("").matcher(parser.regexes.get(0).group());
//if (m.matches()) {
//final Block b = (Block) Skript.deserialize("block", m.group(1));
//if (b == null)
//return false;
//world = b.getWorld();
//x = b.getX();
//y = b.getY();
//z = b.getZ();
//} else {
@SuppressWarnings("unchecked")
final Literal extends ItemType> l = (Literal extends ItemType>) args[0];//SkriptParser.parseLiteral(parser.regexes.get(0).group(), ItemType.class, ParseContext.EVENT);
if (l == null)
return false;
types = l.getAll();
for (final ItemType t : types) {
boolean hasBlock = false;
for (final ItemData d : t) {
if (d.getId() == -1) {
Skript.error("Can't use an 'on walk' event with an alias that matches all blocks");
return false;
}
if (d.getId() <= Skript.MAXBLOCKID && d.getId() != 0) // don't allow air
hasBlock = true;
}
if (!hasBlock) {
Skript.error(t + " is not a block and can thus not be walked on");
return false;
}
}
//}
return true;
}
開發者ID:nfell2009,項目名稱:Skript,代碼行數:38,
示例39: init
點讚 2
import ch.njol.skript.lang.Literal; //導入依賴的package包/類
@Override
public boolean init(final Literal>[] args, final int matchedPattern, final ParseResult parser) {
click = parser.mark == 0 ? ANY : parser.mark;
types = args[matchedPattern];
if (types != null && !ItemType.class.isAssignableFrom(types.getReturnType())) {
if (click == LEFT) {
Skript.error("A leftclick on an entity is an attack and thus not covered by the 'click' event, but the 'damage' event.", ErrorQuality.SEMANTIC_ERROR);
return false;
} else if (click == ANY) {
Skript.warning("A leftclick on an entity is an attack and thus not covered by the 'click' event, but the 'damage' event. Change this event to a rightclick to disable this warning message.");
}
}
tools = (Literal) args[1 - matchedPattern];
return true;
}
開發者ID:nfell2009,項目名稱:Skript,代碼行數:16,
示例40: init
點讚 2
import ch.njol.skript.lang.Literal; //導入依賴的package包/類
@Override
public boolean init(final Literal>[] args, final int matchedPattern, final ParseResult parser) {
isStart = matchedPattern == 0;
if (parser.mark == 0) {
Skript.warning("Server start/stop events are actually called when Skript is started or stopped. It is thus recommended to use 'on Skript start/stop' instead.");
}
return true;
}
開發者ID:nfell2009,項目名稱:Skript,代碼行數:9,
注:本文中的ch.njol.skript.lang.Literal類示例整理自Github/MSDocs等源碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。
java @literal_Java Literal類代碼示例相关推荐
- java uiautomation_Java UiAutomation類代碼示例
本文整理匯總了Java中android.app.UiAutomation類的典型用法代碼示例.如果您正苦於以下問題:Java UiAutomation類的具體用法?Java UiAutomation怎 ...
- java nifty_Java NiftyDialogBuilder類代碼示例
本文整理匯總了Java中com.gitonway.lee.niftymodaldialogeffects.NiftyDialogBuilder類的典型用法代碼示例.如果您正苦於以下問題:Java Ni ...
- java intfunction_Java IntFunction類代碼示例
本文整理匯總了Java中java.util.function.IntFunction類的典型用法代碼示例.如果您正苦於以下問題:Java IntFunction類的具體用法?Java IntFunct ...
- java sentence_Java Sentence類代碼示例
本文整理匯總了Java中aima.core.logic.propositional.parsing.ast.Sentence類的典型用法代碼示例.如果您正苦於以下問題:Java Sentence類的具 ...
- java scene_Java Scene類代碼示例
本文整理匯總了Java中com.sun.j3d.loaders.Scene類的典型用法代碼示例.如果您正苦於以下問題:Java Scene類的具體用法?Java Scene怎麽用?Java Scene ...
- java notifier_Java Notifier類代碼示例
本文整理匯總了Java中org.apache.maven.model.Notifier類的典型用法代碼示例.如果您正苦於以下問題:Java Notifier類的具體用法?Java Notifier怎麽 ...
- java bidi_Java Bidi類代碼示例
本文整理匯總了Java中java.text.Bidi類的典型用法代碼示例.如果您正苦於以下問題:Java Bidi類的具體用法?Java Bidi怎麽用?Java Bidi使用的例子?那麽恭喜您, 這 ...
- java linest_Java STLineSpacingRule類代碼示例
本文整理匯總了Java中org.docx4j.wml.STLineSpacingRule類的典型用法代碼示例.如果您正苦於以下問題:Java STLineSpacingRule類的具體用法?Java ...
- java datarow_Java DataRow類代碼示例
本文整理匯總了Java中org.apache.cayenne.DataRow類的典型用法代碼示例.如果您正苦於以下問題:Java DataRow類的具體用法?Java DataRow怎麽用?Java ...
最新文章
- 用敏捷开发工具可视化的进行Sprint规划
- redis哨兵机制在集群中的应用
- 关于synchronize与lock的区别
- scrcpy设置快捷键_电脑端scrcpy控制Android手机
- SQL 盲注GET /POST、布尔型,延时型Python脚本
- 数据库设计注意事项和原则
- TensorFlow HOWTO 4.1 多层感知机(分类)
- 客运售票员_「我做一天春运人」体验通村客车售票员兼安全员 温馨慢车上我背着太阳奔跑...
- 全面详解c语言使用cJSON解析JSON字符
- BT601、BT656和BT.709、BT1120
- Elasticsearch 集成 SpringBoot并进行CRUD操作
- VUE+ECHARTS结合使用制作一个图标页面
- 利用selenium在虎牙直播发送弹幕
- 女生从猫猫身上学到的.........||精品||
- MonoRail学习笔记三:使用方便功能强大的routing功能
- Error: Assignments can only be reset if the group ‘group‘ is inactive, but the current state is Stab
- 七段显示器显示整数C语言答案,C语言程序设计试卷(含答案)(7页)-原创力文档...
- Unity中fps游戏的枪准心的动态调整
- UDK – Projectiles
- tab weui 页面切换_tab · WeUI.JS 中文文档 · 看云