Skip to content

Commit

Permalink
Fix expression parsing order (#3942)
Browse files Browse the repository at this point in the history
  • Loading branch information
TPGamesNL authored May 3, 2021
1 parent c717b2f commit 9884fb1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/ch/njol/skript/Skript.java
Original file line number Diff line number Diff line change
Expand Up @@ -1303,10 +1303,10 @@ public static <E extends Expression<T>, T> void registerExpression(final Class<E
throw new IllegalArgumentException("returnType must be a normal type");
String originClassPath = Thread.currentThread().getStackTrace()[2].getClassName();
final ExpressionInfo<E, T> info = new ExpressionInfo<>(patterns, returnType, c, originClassPath, type);
for (int i = type.ordinal() + 1; i < ExpressionType.values().length; i++) {
expressions.add(expressionTypesStartIndices[type.ordinal()], info);
for (int i = type.ordinal(); i < ExpressionType.values().length; i++) {
expressionTypesStartIndices[i]++;
}
expressions.add(expressionTypesStartIndices[type.ordinal()], info);
}

@SuppressWarnings("null")
Expand Down

0 comments on commit 9884fb1

Please sign in to comment.