File tree 1 file changed +7
-14
lines changed
json-data-utils/src/main/java/net/minecraftforge/util/data
1 file changed +7
-14
lines changed Original file line number Diff line number Diff line change @@ -34,47 +34,39 @@ public enum OS {
34
34
/** The operating system that this tool is being run on. */
35
35
public static final OS CURRENT = getCurrent ();
36
36
37
- private final String key ;
37
+ /** The primary name, and enum key, of the operating system. */
38
+ public final String key ;
38
39
private final String [] names ;
39
40
40
41
OS (String ... names ) {
41
42
this .key = names [0 ];
42
43
this .names = names ;
43
44
}
44
45
45
- /**
46
- * The primary name, and enum key, of the operating system.
47
- *
48
- * @return The primary name
49
- */
50
- public String key () {
51
- return this .key ;
52
- }
53
-
54
46
/**
55
47
* Returns the OS enum for the given key.
56
48
*
57
49
* @param key The key to search for
58
50
* @return The OS enum, or null if not found
59
51
*/
60
- public static @ Nullable OS byKey (String key ) {
52
+ public static OS byKey (@ Nullable String key ) {
61
53
for (OS value : $values ) {
62
54
if (value .key .equals (key ))
63
55
return value ;
64
56
}
65
57
66
- return null ;
58
+ return UNKNOWN ;
67
59
}
68
60
69
- public static @ Nullable OS byName (String name ) {
61
+ public static OS byName (@ Nullable String name ) {
70
62
for (OS value : $values ) {
71
63
for (String n : value .names ) {
72
64
if (n .equals (name ))
73
65
return value ;
74
66
}
75
67
}
76
68
77
- return null ;
69
+ return UNKNOWN ;
78
70
}
79
71
80
72
/**
@@ -95,6 +87,7 @@ private static OS getCurrent() {
95
87
return os == LINUX ? getCurrentLinux () : os ;
96
88
}
97
89
}
90
+
98
91
return UNKNOWN ;
99
92
}
100
93
You can’t perform that action at this time.
0 commit comments