File tree Expand file tree Collapse file tree 4 files changed +27
-6
lines changed
src/main/java/com/burchard36/api Expand file tree Collapse file tree 4 files changed +27
-6
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ public class ApiSettings {
2626 protected final List <Class <? extends DataStore >> dataStoreAutoRegisterBlacklist ;
2727
2828 private final DataStoreSettings dataStoreSettings ;
29+ private final CommandSettings commandSettings ;
2930
3031 protected ApiSettings () {
3132 this .papiSupport = true ;
@@ -34,7 +35,8 @@ protected ApiSettings() {
3435 this .useInventoryModule = true ;
3536 this .commandAutoRegisterBlacklist = new ArrayList <>();
3637 this .dataStoreAutoRegisterBlacklist = new ArrayList <>();
37- this .dataStoreSettings = new DataStoreSettings ();
38+ this .dataStoreSettings = new DataStoreSettings (this );
39+ this .commandSettings = new CommandSettings (this );
3840 }
3941
4042 /**
Original file line number Diff line number Diff line change @@ -33,8 +33,6 @@ public abstract class BurchAPI extends JavaPlugin implements Api {
3333
3434 @ Getter
3535 protected final ApiSettings apiSettings = new ApiSettings ();
36- @ Getter
37- protected final CommandSettings commandSettings = new CommandSettings ();
3836
3937 @ Override
4038 public void onEnable () {
Original file line number Diff line number Diff line change 66public class CommandSettings {
77
88 private boolean useStrictSubArgumentChecking ;
9+ private final ApiSettings settings ;
910
10- protected CommandSettings () {
11+ protected CommandSettings (final ApiSettings settings ) {
1112 this .useStrictSubArgumentChecking = true ;
13+ this .settings = settings ;
1214 }
1315
1416 /**
@@ -24,4 +26,13 @@ public CommandSettings setStrictSubArgumentChecking(boolean value) {
2426 return this ;
2527 }
2628
29+ /**
30+ * Joins back to {@link ApiSettings} for easier chaining.
31+ * @return Instance of {@link ApiSettings} for chaining
32+ * @since 2.1.8
33+ */
34+ public ApiSettings join () {
35+ return this .settings ;
36+ }
37+
2738}
Original file line number Diff line number Diff line change @@ -9,14 +9,24 @@ public class DataStoreSettings {
99 * Sets the auto save time in seconds
1010 */
1111 protected int playerDataAutoSave ;
12+ protected final ApiSettings settings ;
1213
13- protected DataStoreSettings () {
14-
14+ protected DataStoreSettings (final ApiSettings settings ) {
15+ this . settings = settings ;
1516 }
1617
1718 public DataStoreSettings setPlayerDataAutoSave (int minutes ) {
1819 this .playerDataAutoSave = minutes ;
1920 return this ;
2021 }
2122
23+ /**
24+ * Joins back to {@link ApiSettings} for easier chaining
25+ * @return Instance of {@link ApiSettings} for easier chaining
26+ * @since 2.1.8
27+ */
28+ public ApiSettings join () {
29+ return this .settings ;
30+ }
31+
2232}
You can’t perform that action at this time.
0 commit comments