|
17 | 17 | import org.bukkit.event.Event; |
18 | 18 | import org.jetbrains.annotations.NotNull; |
19 | 19 | import org.jetbrains.annotations.Nullable; |
| 20 | +import org.skriptlang.skript.docs.Origin; |
20 | 21 | import org.skriptlang.skript.lang.comparator.Comparators; |
21 | 22 | import org.skriptlang.skript.lang.comparator.Relation; |
22 | 23 | import org.skriptlang.skript.lang.converter.Converters; |
23 | 24 | import org.skriptlang.skript.lang.properties.Property; |
24 | 25 | import org.skriptlang.skript.lang.properties.PropertyBaseSyntax; |
25 | 26 | import org.skriptlang.skript.lang.properties.PropertyMap; |
26 | 27 | import org.skriptlang.skript.lang.properties.handlers.ContainsHandler; |
| 28 | +import org.skriptlang.skript.registration.SyntaxInfo; |
| 29 | +import org.skriptlang.skript.registration.SyntaxRegistry; |
27 | 30 |
|
28 | 31 | import java.util.Arrays; |
29 | 32 | import java.util.Map; |
|
45 | 48 | @RelatedProperty("contains") |
46 | 49 | public class PropCondContains extends Condition implements PropertyBaseSyntax<ContainsHandler<?,?>>, VerboseAssert { |
47 | 50 |
|
48 | | - static { |
49 | | - Skript.registerCondition(PropCondContains.class, |
50 | | - "%objects% contain[1:s] %objects%", |
51 | | - "%objects% (1:doesn't|1:does not|do not|don't) contain %objects%", |
52 | | - "contents of %objects% contain %objects%", |
53 | | - "contents of %objects% (do not|don't) contain %objects%", |
54 | | - "%inventories% (has|have) %itemtypes% [in [(the[ir]|his|her|its)] inventory]", |
55 | | - "%inventories% (doesn't|does not|do not|don't) have %itemtypes% [in [(the[ir]|his|her|its)] inventory]"); |
| 51 | + public static void register(SyntaxRegistry registry, Origin origin) { |
| 52 | + registry.register(SyntaxRegistry.CONDITION, SyntaxInfo.builder(PropCondContains.class) |
| 53 | + .origin(origin) |
| 54 | + .addPatterns( |
| 55 | + "%objects% contain[1:s] %objects%", |
| 56 | + "%objects% (1:doesn't|1:does not|do not|don't) contain %objects%", |
| 57 | + "contents of %objects% contain %objects%", |
| 58 | + "contents of %objects% (do not|don't) contain %objects%", |
| 59 | + "%inventories% (has|have) %itemtypes% [in [(the[ir]|his|her|its)] inventory]", |
| 60 | + "%inventories% (doesn't|does not|do not|don't) have %itemtypes% [in [(the[ir]|his|her|its)] inventory]" |
| 61 | + ) |
| 62 | + .supplier(PropCondContains::new) |
| 63 | + .build()); |
56 | 64 | } |
57 | 65 |
|
58 | 66 | /* |
|
0 commit comments