@@ -28,7 +28,7 @@ protected void set(CommandSender sender, Arguments arguments) {
2828 String action = arguments .matchesAny (0 , "list operation" , ADD , REMOVE , REPLACE );
2929
3030 if (action .equals (ADD )) {
31- get ().add (verify (getType () .parse (sender , arguments .subArguments (1 ), null )));
31+ get ().add (verify (propertyType .parse (sender , arguments .subArguments (1 ), null )));
3232 callback .accept (get ());
3333 } else {
3434 int index = arguments .find (1 , "position" , input -> Integer .parseInt (input .replace ("@" , "" )));
@@ -38,7 +38,7 @@ protected void set(CommandSender sender, Arguments arguments) {
3838 }
3939
4040 if (action .equals (REPLACE )) {
41- get ().set (index , verify (getType () .parse (sender , arguments .subArguments (2 ), null )));
41+ get ().set (index , verify (propertyType .parse (sender , arguments .subArguments (2 ), null )));
4242 callback .accept (get ());
4343 } else {
4444 get ().remove (index );
@@ -56,15 +56,15 @@ public List<String> onComplete(CommandSender sender, Arguments arguments) {
5656 } else if (arguments .is (0 , ADD ) || arguments .is (0 , REPLACE )) {
5757 // avoid suggesting more than necessary
5858 Arguments data = arguments .subArguments (arguments .is (0 , ADD ) ? 0 : 1 );
59- List <String > suggestion = getType () .complete (sender , data , null );
59+ List <String > suggestion = propertyType .complete (sender , data , null );
6060 return arguments .size () -1 <= suggestion .size () ? suggestion : List .of ();
6161 }
6262 return List .of ();
6363 }
6464
6565 @ Override
6666 public void serialize (@ Nonnull ConfigurationSection configuration ) {
67- Optional .ofNullable (get ()).ifPresent (value -> configuration .set (getName (), value .stream ().map (getType () ::serialize ).toList ()));
67+ Optional .ofNullable (get ()).ifPresent (value -> configuration .set (getName (), value .stream ().map (propertyType ::serialize ).toList ()));
6868 }
6969
7070 @ SuppressWarnings ("unchecked" )
@@ -73,7 +73,7 @@ public void deserialize(@Nonnull ConfigurationSection configuration) {
7373 List <Object > objects = (List <Object >) configuration .getList (getName ());
7474
7575 if (objects != null ) {
76- set (objects .stream ().map (object -> getType (). deserialize ( object ) ).collect (Collectors .toList ()));
76+ set (objects .stream ().map (propertyType :: deserialize ).collect (Collectors .toList ()));
7777 } else {
7878 set (new ArrayList <>(getDefault ()));
7979 }
@@ -82,14 +82,14 @@ public void deserialize(@Nonnull ConfigurationSection configuration) {
8282 @ Override
8383 public boolean equals (Object object ) {
8484 if (object instanceof ListProperty <?> property ) {
85- return property .name .equals (name ) && property .type .getType ().equals (type .getType ());
85+ return property .name .equals (name ) && property .propertyType .getType ().equals (propertyType .getType ());
8686 }
8787 return super .equals (object );
8888 }
8989
9090 @ Override
9191 public String toString () {
92- return isSet () ? get ().stream ().map (getType () ::print ).collect (Collectors .joining (", " )) : "<empty>" ;
92+ return isSet () ? get ().stream ().map (propertyType ::print ).collect (Collectors .joining (", " )) : "<empty>" ;
9393 }
9494
9595 public static <T > Builder <T > create (PropertyType <T > type , String name , Supplier <List <T >> defaultValue ) {
0 commit comments