generated from KessokuTeaTime/Example-Mod
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
44 additions
and
67 deletions.
There are no files selected for viewing
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
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
28 changes: 24 additions & 4 deletions
28
src/main/java/band/kessokuteatime/ivespoken/config/IveSpokenConfig.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 |
---|---|---|
@@ -1,16 +1,36 @@ | ||
package band.kessokuteatime.ivespoken.config; | ||
|
||
import com.electronwill.nightconfig.core.serde.annotations.SerdeComment; | ||
import com.electronwill.nightconfig.core.serde.annotations.SerdeDefault; | ||
import me.shedaniel.autoconfig.ConfigData; | ||
import me.shedaniel.autoconfig.annotation.Config; | ||
import me.shedaniel.autoconfig.annotation.ConfigEntry; | ||
|
||
import java.util.function.Supplier; | ||
|
||
@Config(name = "ivespoken") | ||
public class IveSpokenConfig implements ConfigData { | ||
public boolean enabled = true; | ||
@ConfigEntry.Gui.Excluded | ||
private transient final Supplier<Boolean> enabledProvider = () -> true; | ||
|
||
@SerdeDefault(provider = "enabledSupplier") | ||
public boolean enabled = enabledProvider.get(); | ||
|
||
@ConfigEntry.Gui.Excluded | ||
private transient final Supplier<Long> lastingTimerProvider = () -> 1000L * 5; | ||
|
||
@SerdeDefault(provider = "enabledSupplier") | ||
@SerdeComment(" The time in milliseconds that the message will be displayed on the screen.") | ||
@SerdeComment(" Max value: 60000 milliseconds (1 minute)") | ||
@ConfigEntry.BoundedDiscrete(max = 1000 * 60) | ||
public long lastingTime = 1000 * 5; | ||
public long lastingTime = lastingTimerProvider.get(); | ||
|
||
@ConfigEntry.Gui.Excluded | ||
private transient final Supplier<Integer> maxWidthProvider = () -> 180; | ||
|
||
@ConfigEntry.BoundedDiscrete(max = 1000) | ||
public int maxWidth = 180; | ||
@SerdeComment(" The maximum width of the message on the screen in pixel.") | ||
@SerdeComment(" Min value: 100 pixels") | ||
@SerdeComment(" Max value: 1000 pixels") | ||
@ConfigEntry.BoundedDiscrete(min = 100,max = 1000) | ||
public int maxWidth = maxWidthProvider.get(); | ||
} |
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
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