MCPcopy Index your code
hub / github.com/BombusMod/BombusMod / loadInt

Method loadInt

src/main/java/Colors/ColorTheme.java:313–340  ·  view source on GitHub ↗
(String key, int defaultColor)

Source from the content-addressed store, hash-verified

311 }
312
313 private static int loadInt(String key, int defaultColor) {
314 if (skin==null) {
315 switch (resourceType) {
316//#if FILE_IO
317 case 0: // from fs
318 FileIO f = FileIO.createConnection(skinFile);
319 String skinData = f.fileReadUtf();
320 if (!skinData.equals("")) {
321 skin = new StringLoader().hashtableLoaderFromString(skinData);
322 } else
323 return defaultColor;
324 break;
325//#endif
326 case 1: // from jar
327 skin=new StringLoader().hashtableLoader(skinFile);
328 break;
329 case 2: // from message
330 skin=new StringLoader().hashtableLoaderFromString(skinFile);
331 }
332 }
333 try {
334 String value=(String)skin.get(key);
335 return getColorInt(value);
336 } catch (Exception e) {
337 //StaticData.getInstance().roster.errorLog(e.toString());
338 return defaultColor;
339 }
340 }
341
342 public static int getColorInt(int color, int pos) {
343 String ncolor = getColorString(color);

Callers 1

loadSkinMethod · 0.95

Calls 6

createConnectionMethod · 0.95
fileReadUtfMethod · 0.95
getColorIntMethod · 0.95
hashtableLoaderMethod · 0.80
equalsMethod · 0.45

Tested by

no test coverage detected