33import carpet .api .settings .CarpetRule ;
44import carpet .api .settings .Validator ;
55import com .google .common .collect .ImmutableSet ;
6- import net .minecraft .server . command . ServerCommandSource ;
6+ import net .minecraft .commands . CommandSourceStack ;
77import org .jetbrains .annotations .Nullable ;
88
99import java .util .Arrays ;
@@ -14,9 +14,7 @@ public static class PlantTransform extends Validator<String> {
1414 private static final Set <String > OPTIONS = Set .of ("enable" , "grasses" , "dripleaf" , "flowers" , "disable" );
1515
1616 @ Override
17- public String validate (
18- @ Nullable ServerCommandSource serverCommandSource , CarpetRule <String > carpetRule , String newValue , String userInput
19- ) {
17+ public String validate (@ Nullable CommandSourceStack source , CarpetRule <String > carpetRule , String newValue , String userInput ) {
2018 String [] options = newValue .trim ().split ("," );
2119 return !OPTIONS .containsAll (Arrays .stream (options ).toList ()) ? null : newValue ;
2220 }
@@ -29,9 +27,7 @@ public String description() {
2927
3028 public static class TooExpensiveLevel extends Validator <Integer > {
3129 @ Override
32- public Integer validate (
33- @ Nullable ServerCommandSource serverCommandSource , CarpetRule <Integer > carpetRule , Integer newValue , String userInput
34- ) {
30+ public Integer validate (@ Nullable CommandSourceStack source , CarpetRule <Integer > carpetRule , Integer newValue , String userInput ) {
3531 return newValue < -1 ? 39 : newValue ;
3632 }
3733
@@ -45,9 +41,7 @@ public static class LimitationSources extends Validator<String> {
4541 private static final Set <String > OPTIONS = Set .of ("disabled" , "itemFrame" , "customName" );
4642
4743 @ Override
48- public String validate (
49- @ Nullable ServerCommandSource serverCommandSource , CarpetRule <String > carpetRule , String newValue , String userInput
50- ) {
44+ public String validate (@ Nullable CommandSourceStack source , CarpetRule <String > carpetRule , String newValue , String userInput ) {
5145 String [] options = newValue .trim ().split ("," );
5246 return !OPTIONS .containsAll (Arrays .stream (options ).toList ()) ? null : newValue ;
5347 }
@@ -66,9 +60,7 @@ public static class BeaconIncreaseInteractionRangeMode extends Validator<String>
6660 );
6761
6862 @ Override
69- public String validate (
70- @ Nullable ServerCommandSource serverCommandSource , CarpetRule <String > carpetRule , String newValue , String userInput
71- ) {
63+ public String validate (@ Nullable CommandSourceStack source , CarpetRule <String > carpetRule , String newValue , String userInput ) {
7264 return !MODES .contains (newValue ) ? null : newValue ;
7365 }
7466
@@ -80,10 +72,7 @@ public String description() {
8072
8173 public static class BeaconIncreaseInteractionRangeValue extends Validator <Double > {
8274 @ Override
83- public Double validate (
84- @ Nullable ServerCommandSource serverCommandSource , CarpetRule <Double > carpetRule ,
85- Double newValue , String userInput
86- ) {
75+ public Double validate (@ Nullable CommandSourceStack source , CarpetRule <Double > carpetRule , Double newValue , String userInput ) {
8776 return (QcaSettings .beaconIncreaseIsEnabled () && newValue < 0 ) ? 0 : newValue ;
8877 }
8978
@@ -92,4 +81,4 @@ public String description() {
9281 return "This value represents the addend or multiplier will be used in calculate increase value. Rule beaconIncreaseInteractionRange must be enabled. Value must be positive." ;
9382 }
9483 }
95- }
84+ }
0 commit comments