You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* This program is free software: you can redistribute it and/or modify
5
+
* it under the terms of the GNU General Public License as published by
6
+
* the Free Software Foundation, either version 3 of the License, or
7
+
* (at your option) any later version.
8
+
*
9
+
* This program is distributed in the hope that it will be useful,
10
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+
* GNU General Public License for more details.
13
+
*
14
+
* You should have received a copy of the GNU General Public License
15
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
+
*/
17
+
18
+
packagecom.lambda.config.groups
19
+
20
+
importcom.lambda.util.Describable
21
+
importcom.lambda.util.NamedEnum
22
+
importjava.time.format.DateTimeFormatter
23
+
importjava.util.Locale
24
+
25
+
interfaceFormatterConfig {
26
+
val locale:Locale
27
+
val separator:String
28
+
val prefix:String
29
+
val postfix:String
30
+
val precision:Int
31
+
val format:DateTimeFormatter
32
+
33
+
enumclassLocales(
34
+
overridevaldisplayName:String,
35
+
overridevaldescription:String,
36
+
vallocale:Locale,
37
+
) : NamedEnum, Describable {
38
+
France("France", "Numbers are formatted using a space as the thousands separator and a comma as the decimal separator", Locale.FRANCE),
39
+
Germany("Germany", "Numbers are formatted using a dot as the thousands separator and a comma as the decimal separator", Locale.GERMANY),
40
+
Italy("Italy", "Numbers are formatted using a comma as the thousands separator and a comma as the decimal separator", Locale.ITALY),
41
+
Japan("Japan", "Numbers are formatted using a comma as the thousands separator and a dot as the decimal separator", Locale.JAPAN),
42
+
Korea("Korea", "Numbers are formatted using a comma as the thousands separator and a dot as the decimal separator", Locale.KOREA),
43
+
UK("United Kingdom", "Numbers are formatted using a comma as the thousands separator and a dot as the decimal separator", Locale.UK),
44
+
US("United States", "Numbers are formatted using a comma as the thousands separator and a dot as the decimal separator", Locale.US),
45
+
Canada("Canada", "Numbers are formatted using a comma as the thousands separator and a dot as the decimal separator", Locale.CANADA),
46
+
Quebec("Québec", "Numbers are formatted using a space as the thousands separator and a comma as the decimal separator", Locale.CANADA_FRENCH); // this the best one :3
47
+
}
48
+
49
+
enumclassTime(
50
+
overridevaldisplayName:String,
51
+
overridevaldescription:String,
52
+
valformat:DateTimeFormatter,
53
+
) : NamedEnum, Describable {
54
+
IsoLocalDate("ISO-8601 Extended", "The ISO date formatter that formats or parses a date without an offset, such as '2011-12-03'", DateTimeFormatter.ISO_LOCAL_DATE),
55
+
IsoOffsetDate("ISO-8601 Offset", "The ISO date formatter that formats or parses a date with an offset, such as '2011-12-03+01:00'", DateTimeFormatter.ISO_OFFSET_DATE),
56
+
IsoDate("ISO-8601 Date", "The ISO date formatter that formats or parses a date with the offset if available, such as '2011-12-03' or '2011-12-03+01:00'", DateTimeFormatter.ISO_DATE),
57
+
IsoLocalTime("ISO-8601 Local Time", "The ISO time formatter that formats or parses a time without an offset, such as '10:15' or '10:15:30'", DateTimeFormatter.ISO_LOCAL_TIME),
58
+
IsoOffsetTime("ISO-8601 Offset Time", "The ISO time formatter that formats or parses a time with an offset, such as '10:15+01:00' or '10:15:30+01:00'", DateTimeFormatter.ISO_OFFSET_TIME),
59
+
IsoTime("ISO-8601 Time", "The ISO time formatter that formats or parses a time, with the offset if available, such as '10:15', '10:15:30' or '10:15:30+01:00'", DateTimeFormatter.ISO_TIME),
60
+
IsoLocalDateTime("ISO-8601 Local Date Time", "The ISO date-time formatter that formats or parses a date-time without an offset, such as '2011-12-03T10:15:30'", DateTimeFormatter.ISO_LOCAL_DATE_TIME),
61
+
IsoOffsetDateTime("ISO-8601 Offset Date Time", "The ISO date-time formatter that formats or parses a date-time with an offset, such as '2011-12-03T10:15:30+01:00'", DateTimeFormatter.ISO_OFFSET_DATE_TIME),
62
+
IsoZonedDateTime("ISO-8601 Zoned Date Time", "The ISO-like date-time formatter that formats or parses a date-time with offset and zone, such as '2011-12-03T10:15:30+01:00[Europe/Paris]'", DateTimeFormatter.ISO_ZONED_DATE_TIME),
63
+
IsoDateTime("ISO-8601 Date Time", "The ISO-like date-time formatter that formats or parses a date-time with the offset and zone if available, such as '2011-12-03T10:15:30', '2011-12-03T10:15:30+01:00' or '2011-12-03T10:15:30+01:00[Europe/Paris]'", DateTimeFormatter.ISO_DATE_TIME),
64
+
IsoOrdinalDate("ISO-8601 Ordinal Date", "The ISO date formatter that formats or parses the ordinal date without an offset, such as '2012-337'", DateTimeFormatter.ISO_ORDINAL_DATE),
65
+
IsoWeekDate("ISO-8601 Week Date", "The ISO date formatter that formats or parses the week-based date without an offset, such as '2012-W48-6'", DateTimeFormatter.ISO_WEEK_DATE),
66
+
IsoInstant("ISO-8601 Instant", "The ISO instant formatter that formats or parses an instant in UTC, such as '2011-12-03T10:15:30Z'", DateTimeFormatter.ISO_INSTANT),
67
+
BasicIsoDate("ISO 8601", "The ISO date formatter that formats or parses a date without an offset, such as '20111203'", DateTimeFormatter.BASIC_ISO_DATE),
68
+
Rfc1123("RFC 1123", "The RFC-1123 date-time formatter, such as 'Tue, 3 Jun 2008 11:05:30 GMT'", DateTimeFormatter.RFC_1123_DATE_TIME);
69
+
}
70
+
71
+
// For context, a tuple is an ordered list of identical value types such as a vec3d which is a tuple of doubles
* This program is free software: you can redistribute it and/or modify
5
+
* it under the terms of the GNU General Public License as published by
6
+
* the Free Software Foundation, either version 3 of the License, or
7
+
* (at your option) any later version.
8
+
*
9
+
* This program is distributed in the hope that it will be useful,
10
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+
* GNU General Public License for more details.
13
+
*
14
+
* You should have received a copy of the GNU General Public License
15
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
+
*/
17
+
18
+
packagecom.lambda.config.groups
19
+
20
+
importcom.lambda.config.Configurable
21
+
importcom.lambda.util.NamedEnum
22
+
importcom.lambda.util.math.Vec2d
23
+
importnet.minecraft.util.math.Vec2f
24
+
importnet.minecraft.util.math.Vec3d
25
+
importnet.minecraft.util.math.Vec3i
26
+
importorg.joml.Vector3f
27
+
importorg.joml.Vector4f
28
+
importjava.time.LocalDate
29
+
importjava.time.LocalDateTime
30
+
importjava.time.ZonedDateTime
31
+
32
+
classFormatterSettings(
33
+
owner:Configurable,
34
+
varargbaseGroup:NamedEnum,
35
+
vis: () ->Boolean = { true }
36
+
) : FormatterConfig, SettingGroup(owner) {
37
+
val localeEnum by owner.setting("Locale", FormatterConfig.Locales.US, "The regional formatting used for numbers", vis).group(*baseGroup)
38
+
overrideval locale get() = localeEnum.locale
39
+
40
+
val sep by owner.setting("Separator", FormatterConfig.TupleSeparator.Comma, "Separator for string serialization of tuple data structures", vis).group(*baseGroup)
41
+
val customSep by owner.setting("Custom Separator", "") { vis() && sep ==FormatterConfig.TupleSeparator.Custom }.group(*baseGroup)
0 commit comments