-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Overhaul annotations, fix a ton of bad code, attempt fixing root scre…
…en order, fail spectacularly
- Loading branch information
1 parent
5830d44
commit 20bb974
Showing
57 changed files
with
606 additions
and
538 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
...ig-api-v3/src/main/java/net/modificationstation/stationapi/api/config/CharacterUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 0 additions & 8 deletions
8
glass-config-api-v3/src/main/java/net/modificationstation/stationapi/api/config/Comment.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
...onfig-api-v3/src/main/java/net/modificationstation/stationapi/api/config/ConfigEntry.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package net.modificationstation.stationapi.api.config; | ||
|
||
import java.lang.annotation.*; | ||
|
||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target(ElementType.FIELD) | ||
@Documented | ||
public @interface ConfigEntry { | ||
|
||
/** | ||
* This should be the visible name that you want users to see in the config GUI. | ||
* @return a string, supports colour codes. | ||
*/ | ||
String name(); | ||
|
||
/** | ||
* The description shown to users in the scroll menu. ~30 chars max is recommended. | ||
* @return a string, supports colour codes. | ||
*/ | ||
String description() default ""; | ||
|
||
/** | ||
* The comment shown inside config files. Can be as long as you want, and supports newlines. Does NOT support colour codes. | ||
* If blank, description is shown instead. | ||
*/ | ||
String comment() default ""; | ||
|
||
/** | ||
* Unimplemented. Will be attached to a "?" button for users to show a fullscreen and scrollable description. | ||
*/ | ||
String longDescription() default ""; | ||
|
||
/** | ||
* Syncs the config entry with the server upon join, and server config change. | ||
* Will also be able to be edited by ops in-game. | ||
*/ | ||
boolean multiplayerSynced() default false; | ||
|
||
/** | ||
* The maximum length of this value. | ||
* Default 32. | ||
* Numeric values: the actual number value. | ||
* Strings: how many characters. | ||
* Applies to the contents of arrays, not the arrays themselves. See max and minArrayLength. | ||
*/ | ||
long maxLength() default 32; | ||
|
||
/** | ||
* The minimum length of this value. | ||
* Default 0. | ||
* Numeric values: the actual number value. | ||
* Strings: how many characters. | ||
* Applies to the contents of arrays, not the arrays themselves. See max and minArrayLength. | ||
*/ | ||
long minLength() default 0; | ||
|
||
long maxArrayLength() default Short.MAX_VALUE; | ||
long minArrayLength() default 0; | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 0 additions & 15 deletions
15
...config-api-v3/src/main/java/net/modificationstation/stationapi/api/config/ConfigName.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
...v3/src/main/java/net/modificationstation/stationapi/api/config/FieldModifiedListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package net.modificationstation.stationapi.api.config; | ||
|
||
import net.modificationstation.stationapi.impl.config.GlassYamlWrapper; | ||
|
||
import java.lang.reflect.*; | ||
|
||
/** | ||
* Implement in custom types. This listener does not support java builtins because I value what little remains of my sanity. | ||
*/ | ||
public interface FieldModifiedListener { | ||
|
||
/** | ||
* @param field The field. Use the field name as the yaml key if setting values in there. | ||
* @param glassYamlWrapper The config file at the level the field is at. | ||
* @param eventSource {@link net.modificationstation.stationapi.impl.config.EventStorage.EventSource} | ||
*/ | ||
void fieldModified(Field field, GlassYamlWrapper glassYamlWrapper, int eventSource); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 0 additions & 17 deletions
17
...g-api-v3/src/main/java/net/modificationstation/stationapi/api/config/LongDescription.java
This file was deleted.
Oops, something went wrong.
29 changes: 0 additions & 29 deletions
29
...-config-api-v3/src/main/java/net/modificationstation/stationapi/api/config/MaxLength.java
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
...api-v3/src/main/java/net/modificationstation/stationapi/api/config/MultiplayerSynced.java
This file was deleted.
Oops, something went wrong.
7 changes: 4 additions & 3 deletions
7
...-api-v3/src/main/java/net/modificationstation/stationapi/impl/config/ConfigFactories.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
...-api-v3/src/main/java/net/modificationstation/stationapi/impl/config/ConfigRootEntry.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package net.modificationstation.stationapi.impl.config; | ||
|
||
import net.fabricmc.loader.api.ModContainer; | ||
import net.modificationstation.stationapi.api.config.ConfigRoot; | ||
import net.modificationstation.stationapi.impl.config.object.ConfigCategoryHandler; | ||
|
||
public record ConfigRootEntry( | ||
ModContainer modContainer, | ||
ConfigRoot configRoot, | ||
Object configObject, | ||
ConfigCategoryHandler configCategoryHandler | ||
) {} |
Oops, something went wrong.