MCPcopy Create free account
hub / github.com/DGVPSH/SlackOpen / parseTime

Method parseTime

src/main/java/net/optifine/CustomSkyLayer.java:110–151  ·  view source on GitHub ↗
(String str)

Source from the content-addressed store, hash-verified

108 }
109
110 private int parseTime(String str)
111 {
112 if (str == null)
113 {
114 return -1;
115 }
116 else
117 {
118 String[] astring = Config.tokenize(str, ":");
119
120 if (astring.length != 2)
121 {
122 Config.warn("Invalid time: " + str);
123 return -1;
124 }
125 else
126 {
127 String s = astring[0];
128 String s1 = astring[1];
129 int i = Config.parseInt(s, -1);
130 int j = Config.parseInt(s1, -1);
131
132 if (i >= 0 && i <= 23 && j >= 0 && j <= 59)
133 {
134 i = i - 6;
135
136 if (i < 0)
137 {
138 i += 24;
139 }
140
141 int k = i * 1000 + (int)((double)j / 60.0D * 1000.0D);
142 return k;
143 }
144 else
145 {
146 Config.warn("Invalid time: " + str);
147 return -1;
148 }
149 }
150 }
151 }
152
153 private boolean parseBoolean(String str, boolean defVal)
154 {

Callers 1

CustomSkyLayerMethod · 0.95

Calls 3

tokenizeMethod · 0.95
warnMethod · 0.95
parseIntMethod · 0.95

Tested by

no test coverage detected