File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
main/java/com/sovdee/oopsk/elements/structures Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change 11package com .sovdee .oopsk .elements .structures ;
22
3+ import ch .njol .skript .ScriptLoader ;
34import ch .njol .skript .Skript ;
45import ch .njol .skript .classes .ClassInfo ;
56import ch .njol .skript .config .Node ;
@@ -121,7 +122,7 @@ private List<Field<?>> getFields(@NotNull SectionNode node) {
121122 for (Node child : node ) {
122123 if (child instanceof SimpleNode simpleNode ) {
123124 // match the field pattern
124- String key = simpleNode .getKey ();
125+ String key = ScriptLoader . replaceOptions ( simpleNode .getKey () );
125126 Matcher matcher ;
126127 if (key == null || !(matcher = fieldPattern .matcher (key )).matches ()) {
127128 Skript .error ("invalid field: " + key );
Original file line number Diff line number Diff line change 1+ options:
2+ a: 17
3+
14struct basic:
25 a: int
36 b: strings
47 c: entitytype = cow
8+ d{@a}: number = {@a}
59
610test "basic struct behavior":
711 set {_struct} to a basic struct
812 assert {_struct}->a is not set with "struct field a was somehow set"
913 assert {_struct}->b is not set with "struct field b was somehow set"
1014 assert {_struct}->c is a cow with "struct field c was not set to cow"
15+ assert {_struct}->d{@a} is {@a} with "struct field {@a} was not set to {@a}"
1116
1217 set {_struct}->a to 1
1318 assert {_struct}->a is 1 with "struct field a was not set to 1"
You can’t perform that action at this time.
0 commit comments