Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c742acf

Browse files
authoredFeb 1, 2025
Removes no-keyword pattern from ExprNewBannerPattern (SkriptLang#7546)
1 parent e537836 commit c742acf

File tree

1 file changed

+5
-16
lines changed

1 file changed

+5
-16
lines changed
 

‎src/main/java/ch/njol/skript/expressions/ExprNewBannerPattern.java

+5-16
Original file line numberDiff line numberDiff line change
@@ -24,34 +24,23 @@
2424
"remove {_pattern} from banner patterns of {_banneritem}",
2525
"set the 1st banner pattern of block at location(0,0,0) to {_pattern}",
2626
"clear the 1st banner pattern of block at location(0,0,0)",
27-
"",
28-
"set {_pattern} to a red mojang banner pattern"
2927
})
3028
@Since("2.10")
3129
public class ExprNewBannerPattern extends SimpleExpression<Pattern> {
3230

3331
static {
34-
Skript.registerExpression(ExprNewBannerPattern.class, Pattern.class, ExpressionType.PATTERN_MATCHES_EVERYTHING,
35-
"[a] %bannerpatterntype% colo[u]red %color%",
36-
"[a] %*color% %bannerpatterntype%");
32+
Skript.registerExpression(ExprNewBannerPattern.class, Pattern.class, ExpressionType.COMBINED,
33+
"[a] %bannerpatterntype% colo[u]red %color%");
3734
}
3835

3936
private Expression<PatternType> selectedPattern;
4037
private Expression<Color> selectedColor;
4138

4239
@Override
40+
@SuppressWarnings("unchecked")
4341
public boolean init(Expression<?>[] exprs, int matchedPattern, Kleenean isDelayed, ParseResult parseResult) {
44-
if (matchedPattern == 0) {
45-
//noinspection unchecked
46-
selectedPattern = (Expression<PatternType>) exprs[0];
47-
//noinspection unchecked
48-
selectedColor = (Expression<Color>) exprs[1];
49-
} else {
50-
//noinspection unchecked
51-
selectedPattern = (Expression<PatternType>) exprs[1];
52-
//noinspection unchecked
53-
selectedColor = (Expression<Color>) exprs[0];
54-
}
42+
selectedPattern = (Expression<PatternType>) exprs[0];
43+
selectedColor = (Expression<Color>) exprs[1];
5544
return true;
5645
}
5746

0 commit comments

Comments
 (0)
Please sign in to comment.